更新小程序 API 基础地址,调整阅读页面逻辑以支持免费内容展示,新增提现审批逻辑的二次校验,确保用户可提现金额准确。优化相关注释以提升代码可读性。
This commit is contained in:
@@ -8,8 +8,8 @@ const { parseScene } = require('./utils/scene.js')
|
|||||||
App({
|
App({
|
||||||
globalData: {
|
globalData: {
|
||||||
// API基础地址 - 连接真实后端
|
// API基础地址 - 连接真实后端
|
||||||
// baseUrl: 'https://soulapi.quwanzhi.com',
|
baseUrl: 'https://soulapi.quwanzhi.com',
|
||||||
baseUrl: 'https://souldev.quwanzhi.com',
|
// baseUrl: 'https://souldev.quwanzhi.com',
|
||||||
// baseUrl: 'http://localhost:3006',
|
// baseUrl: 'http://localhost:3006',
|
||||||
// baseUrl: 'http://localhost:8080',
|
// baseUrl: 'http://localhost:8080',
|
||||||
|
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ Page({
|
|||||||
section.price = sectionPrice
|
section.price = sectionPrice
|
||||||
}
|
}
|
||||||
this.setData({ section })
|
this.setData({ section })
|
||||||
|
|
||||||
let res = prefetched
|
let res = prefetched
|
||||||
if (!res) {
|
if (!res) {
|
||||||
res = mid
|
res = mid
|
||||||
@@ -250,6 +250,16 @@ Page({
|
|||||||
if (accessManager.canAccessFullContent(accessState)) {
|
if (accessManager.canAccessFullContent(accessState)) {
|
||||||
app.markSectionAsRead(id)
|
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)
|
setTimeout(() => this.drawShareCard(), 600)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -156,6 +156,17 @@ func AdminWithdrawalsAction(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批准前二次校验可提现金额,与申请时口径一致,防止退款/冲正后超额打款
|
||||||
|
available, _, _, _, _ := computeAvailableWithdraw(db, w.UserID)
|
||||||
|
if w.Amount > available {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"success": false,
|
||||||
|
"error": "用户当前可提现不足,无法批准",
|
||||||
|
"message": fmt.Sprintf("用户当前可提现 ¥%.2f,本笔申请 ¥%.2f,可能因退款/冲正导致。请核对后再批或联系用户。", available, w.Amount),
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 调用微信转账接口:按提现手续费扣除后打款,例如申请100元、手续费5%则实际打款95元
|
// 调用微信转账接口:按提现手续费扣除后打款,例如申请100元、手续费5%则实际打款95元
|
||||||
remark := "提现"
|
remark := "提现"
|
||||||
if w.Remark != nil && *w.Remark != "" {
|
if w.Remark != nil && *w.Remark != "" {
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user