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) {
// 阻止点击弹窗内容时触发关闭
}
});

View File

@@ -30,3 +30,11 @@
<text>成为会员,享受无限使用功能特权,体验更多专属内容!</text>
</view>
</view>
<view wx:if="{{showQrcodePopup}}" class="qrcode-popup-mask" bindtap="closeQrcodePopup">
<view class="qrcode-popup" catchtap="preventDefault">
<image src="../../images/qrcode_for_gh_e64390b2d04e_258.jpg" class="qrcode-img" show-menu-by-longpress="true"></image>
<view class="qrcode-tip">IOS此功能暂不可用。长按识别二维码前往公众号获取更多额度</view>
<view class="qrcode-close-btn" bindtap="closeQrcodePopup">关闭</view>
</view>
</view>

View File

@@ -130,4 +130,103 @@ page {
.right {
color: #fff;
}
/* 二维码弹窗样式 */
.qrcode-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(4px);
}
.qrcode-popup {
background: linear-gradient(145deg, #2f2f50, #383861);
border-radius: 24px;
box-shadow: 0 12px 36px rgba(0,0,0,0.3);
padding: 36px 28px 24px;
display: flex;
flex-direction: column;
align-items: center;
min-width: 280px;
max-width: 85vw;
animation: popupFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
border: 1px solid rgba(255, 255, 255, 0.1);
}
@keyframes popupFadeIn {
0% {
opacity: 0;
transform: scale(0.95) translateY(10px);
}
100% {
opacity: 1;
transform: scale(1) translateY(0);
}
}
.qrcode-img {
width: 200px;
height: 200px;
border-radius: 16px;
margin-bottom: 24px;
box-shadow: 0 4px 16px rgba(0,0,0,0.15);
background: #fff;
padding: 8px;
transition: transform 0.3s ease;
}
.qrcode-img:active {
transform: scale(0.98);
}
.qrcode-tip {
font-size: 17px;
color: #a790e2;
margin-bottom: 24px;
text-align: center;
font-weight: 500;
line-height: 1.5;
padding: 0 12px;
}
.qrcode-close-btn {
margin-top: 12px;
padding: 12px 36px;
background: linear-gradient(90deg, #8d72d2, #7183f3);
color: #fff;
border: none;
border-radius: 24px;
font-size: 16px;
font-weight: 600;
box-shadow: 0 4px 12px rgba(141, 114, 210, 0.3);
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.qrcode-close-btn:active {
transform: scale(0.96);
background: linear-gradient(90deg, #7183f3, #8d72d2);
box-shadow: 0 2px 8px rgba(141, 114, 210, 0.2);
}
.qrcode-close-btn::after {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
transform: scale(0);
opacity: 0;
transition: transform 0.6s, opacity 0.6s;
}