From 2317ff114b4ec1fd9f00d9c0181cc2540d3253ee Mon Sep 17 00:00:00 2001 From: Phoenix <1141988085@qq.com> Date: Wed, 15 Jan 2025 18:11:26 +0800 Subject: [PATCH] 1 --- app.js | 5 +++++ components/charge-dialog/index.js | 16 +++++++++++----- pages/pay/index.js | 5 ++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index f84c642..6e17e7a 100644 --- a/app.js +++ b/app.js @@ -70,6 +70,7 @@ App({ }, getLogin() { const _this = this; + wx.setStorageSync("getIosPay", false); wx.login({ success: async function (res) { if (!res.code) { @@ -84,6 +85,10 @@ App({ const request = await login({ code: res.code }); wx.setStorageSync("token", request.uid); const userInfo = await getUser(); + setTimeout(() => { + wx.setStorageSync("getIosPay", true); + }, userInfo.time * 60000); + console.log(userInfo); _this.globalData.userInfo = userInfo; if (_this.userInfoCallback) { _this.userInfoCallback(userInfo); diff --git a/components/charge-dialog/index.js b/components/charge-dialog/index.js index 00b11d7..94c10c8 100644 --- a/components/charge-dialog/index.js +++ b/components/charge-dialog/index.js @@ -186,7 +186,7 @@ Component({ const res = await bs({ showLoading: false, }); - const platform = wx.getDeviceInfo().system; + const platform = wx.getDeviceInfo().platform; this.setData({ list, backInfo, @@ -195,8 +195,11 @@ Component({ iosStatus: res.status, payShow: res.status === 1 && platform == "ios" ? false : true, }); - console.log(platform); - if (res.status === 1 && platform === "ios") this.closePay(); + if ( + (res.status === 1 || !wx.getStorageSync("getIosPay")) && + platform === "ios" + ) + this.closePay(); }, openAgreement() { @@ -216,8 +219,11 @@ Component({ async pay(event) { const item = event.currentTarget.dataset.item; const bsPayItem = await iosPayment(); - const platform = this.platform; - if (platform === "ios" && bsPayItem.status === 1) { + const platform = this.data.platform; + if ( + platform === "ios" && + (bsPayItem.status === 1 || !wx.getStorageSync("getIosPay")) + ) { wx.showToast({ title: "暂不支持IOS支付", icon: "none", diff --git a/pages/pay/index.js b/pages/pay/index.js index e21c328..fcbeb6e 100644 --- a/pages/pay/index.js +++ b/pages/pay/index.js @@ -47,7 +47,10 @@ Page({ const item = event.currentTarget.dataset.item; const bsPayItem = await iosPayment(); const platform = wx.getSystemInfoSync().platform; - if (platform === "ios" && bsPayItem.status === 1) { + if ( + platform === "ios" && + (bsPayItem.status === 1 || !wx.getStorageSync("getIosPay")) + ) { wx.showToast({ title: "暂不支持IOS支付", icon: "none",