"use client"; import React, { useState } from "react"; import { Image, InfiniteScroll, List, Toast, Modal } from "antd-mobile"; import Empty from "@/components/Empty"; import requireAPI from "@/utils/requireAPI"; import { useRouter } from "next/navigation"; import clipboard from "copy-to-clipboard"; export default function HaveNotAddWechat({ zid, currentIndex }) { const [offset, setOffset] = useState(0); const [more, setMore] = useState(1); const [data, setData] = useState([]); const router = useRouter(); const getData = async (refresh) => { if (zid === undefined || !more || currentIndex != 0) return; try { const body = { tab: 1, offset: refresh ? 0 : offset, //如果是下拉刷新则更新最新数据 limit: 20, }; const _data = await requireAPI("POST", "/api/vas/get_add_wechat_list", { body, }); if (_data.ret === -1) { Toast.show({ icon: "fail", content: _data.msg, position: "top", }); return; } setData((old) => [...old, ..._data.data.list]); setOffset(_data.data.offset); setMore(_data.data.more); } catch (error) { console.error(error); } }; const handleConfirm = async (item, modal) => { try { const _data = await requireAPI("POST", "/api/vas/confirm_add_wechat", { body: { order_id: item.order_id }, }); if (_data.ret === -1) { Toast.show({ icon: "fail", content: _data.msg, position: "top", }); return; } modal.close(); router.refresh(); } catch (error) { console.error(error); } }; //保存内容到剪贴板 const copy = (_data) => { // console.log("_data", _data); clipboard(_data); Toast.show({ icon: "success", content: "已复制到剪贴板", position: "top", }); }; //单个成员组件 const RenderItem = ({ item }) => { return (
{item?.account?.name}
请于72小时内添加对方微信
付款时间:{new Date(item?.ct * 1000).toLocaleString()}
请确认对方已主动添加您的微信,并您已经通过好友申请。