apply patch

This commit is contained in:
林滔
2025-08-15 10:49:43 +08:00
parent 6eeb305e79
commit d26d3b4d11
27 changed files with 877 additions and 522 deletions

View File

@@ -8,47 +8,25 @@ Page({
selectedType: null,
cards: [],
isQuota: false,
show: false,
show: true, // 默认显示,前端判断
isIOS: false, // 是否为 iOS 系统
showQrcodePopup: false, // 新增:二维码弹窗显示状态
},
onLoad: function (e) {
const that = this;
getApp().check_status()
.then(function(res) {
that.setData({
show: res.data.data.show
});
if (!that.data.show) {
wx.showModal({
title: "提示",
content: "iOS 暂时无法使用此功能,请稍后再试。",
showCancel: false,
confirmText: "知道了",
success: () => {
// 可选:用户确认后返回上一级页面
wx.reLaunch({
url: "/pages/index/index",
})
}
});
return; // 停止执行后续逻辑
}
})
.catch(function(err) {
console.error("获取文章信息失败:", err);
})
.finally(function() {
console.log("check_status调用完成");
});
// 使用 wx.getDeviceInfo() 检测系统是否为 iOS
// 前端判断系统类型
const systemInfo = wx.getSystemInfoSync();
const isIOS = systemInfo.system.toLowerCase().indexOf('ios') !== -1;
this.setData({ isIOS });
if (isIOS) {
// iOS弹二维码弹窗
this.setData({ showQrcodePopup: true, show: false });
return;
}
// 非 iOS 系统,继续加载页面逻辑
var t = wx.getStorageSync("cards").filter(function (t) {
return t.is_quota === JSON.parse(e.isQuota || "false");
});
console.log("renderCards", t);
this.setData({
cards: t,
@@ -169,7 +147,7 @@ Page({
// 将秒时间戳转换为毫秒时间戳
var date = new Date(e * 1000);
// 格式化为YYYY年MM月DD日
// 格式化为"YYYY年MM月DD日"
var year = date.getFullYear();
var month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从 0 开始,需要 +1
var day = String(date.getDate()).padStart(2, "0");
@@ -184,4 +162,15 @@ Page({
onPullDownRefresh: function () {},
onReachBottom: function () {},
onShareAppMessage: function () {},
// 关闭二维码弹窗
closeQrcodePopup: function() {
this.setData({ showQrcodePopup: false });
wx.navigateBack(); // 返回上一页
},
// 阻止事件冒泡
preventDefault: function(e) {
// 阻止点击弹窗内容时触发关闭
}
});