From e3599c3afc86b45b95a4188619f26b3d324891bc Mon Sep 17 00:00:00 2001 From: hackrobot Date: Thu, 18 Jul 2024 11:38:07 +0800 Subject: [PATCH] update --- src/pages/index/index.jsx | 57 ++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index e198f24..45cb436 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -361,16 +361,14 @@ const Index = () => { { - if (!!wxid) { - // 修改接口数据 - // 先判断用户字段 - if (!!userInfo?.ebook) { - // 已预约 - Taro.atMessage({ - message: "已预约成功", - type: "warning", - }); - } else { + if (!!userInfo?.ebook) { + // 已预约 + Taro.atMessage({ + message: "已预约成功", + type: "warning", + }); + } else { + if (!!wxid) { // 发起预约 const userUpdateData = { ebook: 1, // 只更新 openid 字段 @@ -402,9 +400,9 @@ const Index = () => { // getUserinfo() }, }); + } else { + setmeetupQR(true); } - } else { - setmeetupQR(true); } }} > @@ -482,23 +480,20 @@ const Index = () => { : null, }} onClick={() => { - if (!!wxid) { - // window.alert(userInfo?.activity_status); - // 修改接口数据 - // 先判断用户字段 - if (userInfo?.activity_status == "1") { - // 已预约 - Taro.atMessage({ - message: "已预约成功", - type: "warning", - }); - } else if (userInfo?.activity_status == "2") { - // 已预约 - Taro.atMessage({ - message: "审核中", - type: "warning", - }); - } else { + if (userInfo?.activity_status == "1") { + // 已预约 + Taro.atMessage({ + message: "已预约成功", + type: "warning", + }); + } else if (userInfo?.activity_status == "2") { + // 已预约 + Taro.atMessage({ + message: "审核中", + type: "warning", + }); + } else { + if (!!wxid) { // 发起预约 const userUpdateData = { activity_status: "2", // 审核中 @@ -526,9 +521,9 @@ const Index = () => { window.location.reload(); }, }); + } else { + setmeetupQR(true); } - } else { - setmeetupQR(true); } }} >