更新小程序,新增VIP会员状态管理功能,优化章节解锁逻辑,支持VIP用户访问增值内容。调整用户详情页面,增加VIP相关字段和功能,提升用户体验。更新会议记录,反映最新讨论内容。

This commit is contained in:
Alex-larget
2026-03-10 11:04:34 +08:00
parent 30ebdb5ac7
commit 05ac60dc7e
60 changed files with 8387 additions and 1583 deletions

View File

@@ -742,20 +742,25 @@ Page({
})
},
// VIP状态查询hasFullBook 优先,兼容模拟支付等本地已置 VIP 的情况
// VIP状态查询注意:hasFullBook=9.9 买断,不等同 VIP
async loadVipStatus() {
if (app.globalData.hasFullBook) {
this.setData({ isVip: true, vipExpireDate: this.data.vipExpireDate || '' })
}
const userId = app.globalData.userInfo?.id
if (!userId) return
try {
const res = await app.request({ url: `/api/miniprogram/vip/status?userId=${userId}`, silent: true })
if (res?.success) {
const isVip = !!res.data?.isVip
app.globalData.isVip = isVip
app.globalData.vipExpireDate = res.data?.expireDate || ''
this.setData({
isVip: res.data?.isVip || app.globalData.hasFullBook,
isVip,
vipExpireDate: res.data?.expireDate || this.data.vipExpireDate || ''
})
// 同步到 storage便于其他页面复用注意hasFullBook=买断isVip=会员)
const userInfo = app.globalData.userInfo || {}
userInfo.isVip = isVip
userInfo.vipExpireDate = res.data?.expireDate || ''
wx.setStorageSync('userInfo', userInfo)
}
} catch (e) { console.log('[My] VIP查询失败', e) }
},