更新小程序 API 基础地址,调整阅读页面逻辑以支持免费内容展示,新增提现审批逻辑的二次校验,确保用户可提现金额准确。优化相关注释以提升代码可读性。
This commit is contained in:
@@ -227,7 +227,7 @@ Page({
|
||||
section.price = sectionPrice
|
||||
}
|
||||
this.setData({ section })
|
||||
|
||||
|
||||
let res = prefetched
|
||||
if (!res) {
|
||||
res = mid
|
||||
@@ -250,6 +250,16 @@ Page({
|
||||
if (accessManager.canAccessFullContent(accessState)) {
|
||||
app.markSectionAsRead(id)
|
||||
}
|
||||
// 0元即免费:接口返回 price 为 0 或 isFree 为 true 时,不展示付费墙
|
||||
const isFreeByPrice = res.price === 0 || res.price === '0' || Number(res.price) === 0
|
||||
const isFreeByFlag = res.isFree === true
|
||||
if (isFreeByPrice || isFreeByFlag) {
|
||||
const section = this.data.section || {}
|
||||
if (res.price !== undefined && res.price !== null) section.price = Number(res.price)
|
||||
if (res.isFree !== undefined) section.isFree = !!res.isFree
|
||||
this.setData({ section, showPaywall: false, canAccess: true, accessState: 'free' })
|
||||
app.markSectionAsRead(id)
|
||||
}
|
||||
setTimeout(() => this.drawShareCard(), 600)
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user