"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 clipboard from "copy-to-clipboard"; export default function AlreadyAddWechat({ zid, currentIndex }) { const [offset, setOffset] = useState(0); const [more, setMore] = useState(1); const [data, setData] = useState([]); const [modalVisible, setModalVisible] = useState(false); const getData = async () => { if (zid === undefined || !more || currentIndex != 0) return; try { const body = { tab: 2, 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 copy = (_data) => { // console.log("_data", _data); clipboard(_data); Toast.show({ icon: "success", content: "已复制到剪贴板", position: "top", }); }; //单个成员组件 const RenderItem = ({ item }) => { return (
{item?.account?.name}
{item?.account?.user_id}

请于72小时内添加对方微信

付款时间:{new Date(item?.ct * 1000).toLocaleString()}

{ setModalVisible(!modalVisible); Modal.show({ content: (
setModalVisible(false)} className="flex-1 justify-center items-center bg-[#00000080]" >
{!item.consumer_wechat ? (
{item?.account?.name}
Ta的微信号:
{item?.consumer_wechat}
copy(item?.consumer_wechat)} className="flex items-center" > 复制
添加时请备注:
{item?.consumer_note}
copy(item?.consumer_note)} className="flex items-center" > 复制
) : (
{item?.account?.name}
请确认对方已主动添加您的微信,并您已经通过好友申请。
)}
), closeOnMaskClick: true, bodyStyle: { background: "none", }, }); }} className="bg-[#FFFFFF1A] rounded-full px-4 py-2 text-white h-fit text-[14px] whitespace-nowrap" > {item.order_status === 4 && "已处理"} {item.order_status === 5 && "已完成"} {item.order_status === 6 && "已退款"}
); }; return (
{data.length == 0 && (
)} {data.map((item, index) => ( ))} {null}
); }