"use client"; import React, { useState, useEffect, useRef } from "react"; import Empty from "@/components/Empty"; import requireAPI from "@/utils/requireAPI"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft } from "@fortawesome/free-solid-svg-icons"; import { InfiniteScroll, Avatar, Divider } from "antd-mobile"; import { useRouter } from "next/navigation"; import InfiniteScrollContent from "@/components/InfiniteScrollContent"; import AddWeChat from "@/components/AddWeChat"; export default function UnlockedWechat() { const router = useRouter(); //查询数据 const [data, setData] = useState([]); const [offset, setOffset] = useState(0); const [hasMore, setHasMore] = useState(1); const [visible, setVisible] = useState(false); const currentStreamer = useRef({}); useEffect(() => { getData(); }, []); const getData = async (currentOffset) => { if (!hasMore) return; try { //查已解锁微信的主播的mid const temData = await requireAPI("POST", "/api/vas/get_unlock_wechat_list", { body: { offset: currentOffset, limit: 12, }, }); setData([...data, ...temData.data.list]); setOffset(temData.data.offset); setHasMore(temData.data.more); } catch (error) { console.error(error); } }; async function loadMore() { if (!offset) return; const append = await getData(streamerInfo.id, currentKey, offset); if (append) { setData((val) => [...val, ...append]); } } return (
已解锁微信
{item.account.name}
{item.streamer.bio}