This commit is contained in:
Alex-larget
2026-03-24 15:44:08 +08:00
parent 346e8ab057
commit 28ad08da84
62 changed files with 814 additions and 840 deletions

View File

@@ -19,7 +19,7 @@ Page({
},
bookInfo: {
title: '一场Soul的创业实验',
totalChapters: 62,
totalChapters: 0, // 来自 book/stats 或 app.getTotalSections()
parts: [
{ name: '真实的人', chapters: 10 },
{ name: '真实的行业', chapters: 15 },
@@ -34,7 +34,8 @@ Page({
onLoad() {
wx.showShareMenu({ withShareTimeline: true })
this.setData({
statusBarHeight: app.globalData.statusBarHeight
statusBarHeight: app.globalData.statusBarHeight,
'bookInfo.totalChapters': app.getTotalSections()
})
this.loadAuthor()
this.loadBookStats()
@@ -59,7 +60,7 @@ Page({
title: d.title || '',
bio: d.bio || '',
stats: Array.isArray(d.stats) ? d.stats : [
{ label: '商业案例', value: '62' },
{ label: '商业案例', value: String(app.getTotalSections()) },
{ label: '连续直播', value: '365天' },
{ label: '派对分享', value: '1000+' }
],
@@ -81,7 +82,7 @@ Page({
try {
const res = await app.request({ url: '/api/miniprogram/book/stats', silent: true })
if (res?.success && res.data) {
const total = res.data?.totalChapters || 62
const total = res.data?.totalChapters ?? app.getTotalSections()
this.setData({ 'bookInfo.totalChapters': total })
const stats = this.data.author?.stats || []
const idx = stats.findIndex((s) => s && (s.label === '商业案例' || s.label === '章节'))