From 6a2a635584d203d1130dfe34cfa7c942e5fcc802 Mon Sep 17 00:00:00 2001 From: jueweijue Date: Wed, 26 Jun 2024 08:58:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=9C=A8?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E8=8E=B7=E5=8F=96=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/purchased/page.jsx | 43 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/app/purchased/page.jsx b/app/purchased/page.jsx index 0cf7e31..5f5ee39 100644 --- a/app/purchased/page.jsx +++ b/app/purchased/page.jsx @@ -65,7 +65,6 @@ export default function Purchased() { getData(); }, []); - const [currentWechat, setCurrentWechat] = useState(""); const getWechat = async (streamerMid) => { // 获取微信 try { @@ -94,7 +93,7 @@ export default function Purchased() { }); return; } - setCurrentWechat(detailData.data.wechat_contact); + return detailData.data.wechat_contact; } catch (error) { console.error(error); } @@ -103,28 +102,24 @@ export default function Purchased() { const DirectGetWechatItem = ({ item }) => { //点击查看微信 const handleClick = async () => { - await getWechat(item?.account.mid); - setTimeout( - () => - Modal.alert({ - showCloseButton: true, - confirmText: "复制", - onConfirm: () => { - copy(currentWechat); - Toast.show({ - content: "复制成功", - }); - }, - content: ( -
-

- Ta的微信号:{currentWechat} -

-
- ), - }), - 100 - ); + const wechat = await getWechat(item?.account.mid); + Modal.alert({ + showCloseButton: true, + confirmText: "复制", + onConfirm: () => { + copy(wechat); + Toast.show({ + content: "复制成功", + }); + }, + content: ( +
+

+ Ta的微信号:{wechat} +

+
+ ), + }); }; //点击主播