This commit is contained in:
张华 2025-01-15 18:11:26 +08:00
parent 6e7fde9ff6
commit 2317ff114b
3 changed files with 20 additions and 6 deletions

5
app.js
View File

@ -70,6 +70,7 @@ App({
}, },
getLogin() { getLogin() {
const _this = this; const _this = this;
wx.setStorageSync("getIosPay", false);
wx.login({ wx.login({
success: async function (res) { success: async function (res) {
if (!res.code) { if (!res.code) {
@ -84,6 +85,10 @@ App({
const request = await login({ code: res.code }); const request = await login({ code: res.code });
wx.setStorageSync("token", request.uid); wx.setStorageSync("token", request.uid);
const userInfo = await getUser(); const userInfo = await getUser();
setTimeout(() => {
wx.setStorageSync("getIosPay", true);
}, userInfo.time * 60000);
console.log(userInfo);
_this.globalData.userInfo = userInfo; _this.globalData.userInfo = userInfo;
if (_this.userInfoCallback) { if (_this.userInfoCallback) {
_this.userInfoCallback(userInfo); _this.userInfoCallback(userInfo);

View File

@ -186,7 +186,7 @@ Component({
const res = await bs({ const res = await bs({
showLoading: false, showLoading: false,
}); });
const platform = wx.getDeviceInfo().system; const platform = wx.getDeviceInfo().platform;
this.setData({ this.setData({
list, list,
backInfo, backInfo,
@ -195,8 +195,11 @@ Component({
iosStatus: res.status, iosStatus: res.status,
payShow: res.status === 1 && platform == "ios" ? false : true, payShow: res.status === 1 && platform == "ios" ? false : true,
}); });
console.log(platform); if (
if (res.status === 1 && platform === "ios") this.closePay(); (res.status === 1 || !wx.getStorageSync("getIosPay")) &&
platform === "ios"
)
this.closePay();
}, },
openAgreement() { openAgreement() {
@ -216,8 +219,11 @@ Component({
async pay(event) { async pay(event) {
const item = event.currentTarget.dataset.item; const item = event.currentTarget.dataset.item;
const bsPayItem = await iosPayment(); const bsPayItem = await iosPayment();
const platform = this.platform; const platform = this.data.platform;
if (platform === "ios" && bsPayItem.status === 1) { if (
platform === "ios" &&
(bsPayItem.status === 1 || !wx.getStorageSync("getIosPay"))
) {
wx.showToast({ wx.showToast({
title: "暂不支持IOS支付", title: "暂不支持IOS支付",
icon: "none", icon: "none",

View File

@ -47,7 +47,10 @@ Page({
const item = event.currentTarget.dataset.item; const item = event.currentTarget.dataset.item;
const bsPayItem = await iosPayment(); const bsPayItem = await iosPayment();
const platform = wx.getSystemInfoSync().platform; const platform = wx.getSystemInfoSync().platform;
if (platform === "ios" && bsPayItem.status === 1) { if (
platform === "ios" &&
(bsPayItem.status === 1 || !wx.getStorageSync("getIosPay"))
) {
wx.showToast({ wx.showToast({
title: "暂不支持IOS支付", title: "暂不支持IOS支付",
icon: "none", icon: "none",