同步
This commit is contained in:
@@ -54,7 +54,8 @@ Page({
|
||||
|
||||
// mp_config.mpUi.chaptersPage
|
||||
chaptersBookTitle: '一场SOUL的创业实验场',
|
||||
chaptersBookSubtitle: '来自Soul派对房的真实商业故事'
|
||||
chaptersBookSubtitle: '来自Soul派对房的真实商业故事',
|
||||
chaptersNewBadgeText: 'NEW'
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -71,13 +72,20 @@ Page({
|
||||
|
||||
_applyChaptersMpUi() {
|
||||
const c = app.globalData.configCache?.mpConfig?.mpUi?.chaptersPage || {}
|
||||
const h = app.globalData.configCache?.mpConfig?.mpUi?.homePage || {}
|
||||
const newBadgeText = String(c.newBadgeText || c.sectionNewBadgeText || h.latestSectionTitle || 'NEW').trim() || 'NEW'
|
||||
this.setData({
|
||||
chaptersBookTitle: String(c.bookTitle || '一场SOUL的创业实验场').trim() || '一场SOUL的创业实验场',
|
||||
chaptersBookSubtitle: String(c.bookSubtitle || '来自Soul派对房的真实商业故事').trim() ||
|
||||
'来自Soul派对房的真实商业故事'
|
||||
'来自Soul派对房的真实商业故事',
|
||||
chaptersNewBadgeText: newBadgeText
|
||||
})
|
||||
},
|
||||
|
||||
_normalizeBadgeText(v) {
|
||||
return String(v || '').trim().slice(0, 8)
|
||||
},
|
||||
|
||||
async loadFeatureConfig() {
|
||||
try {
|
||||
if (app.globalData.features && typeof app.globalData.features.searchEnabled === 'boolean') {
|
||||
@@ -122,10 +130,14 @@ Page({
|
||||
let icon = String(p.icon || '').trim()
|
||||
if (icon && !isSafeImageSrc(icon)) icon = ''
|
||||
const iconEmoji = icon ? '' : partEmojiForBodyIndex(idx)
|
||||
const partBadgeText = this._normalizeBadgeText(
|
||||
p.badgeText || p.badge_text || p.partBadgeText || p.part_badge_text
|
||||
)
|
||||
return {
|
||||
id: p.id,
|
||||
icon,
|
||||
iconEmoji,
|
||||
iconText: partBadgeText,
|
||||
title: p.title,
|
||||
subtitle: p.subtitle || '',
|
||||
chapterCount: p.chapterCount || 0,
|
||||
@@ -176,6 +188,9 @@ Page({
|
||||
isFree: r.isFree === true || (r.price !== undefined && r.price === 0),
|
||||
price: r.price ?? 1,
|
||||
isNew: r.isNew === true || r.is_new === true,
|
||||
newBadgeText: this._normalizeBadgeText(
|
||||
r.newBadgeText || r.new_badge_text || r.sectionBadgeText || r.section_badge_text || r.badgeText || r.badge_text
|
||||
),
|
||||
isPremium
|
||||
})
|
||||
})
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
<view class="part-header" bindtap="togglePart" data-id="{{item.id}}">
|
||||
<view class="part-left">
|
||||
<image wx:if="{{item.icon}}" class="part-icon-img" src="{{item.icon}}" mode="aspectFill"/>
|
||||
<view wx:elif="{{item.iconText}}" class="part-icon part-icon-text">{{item.iconText}}</view>
|
||||
<view wx:elif="{{item.iconEmoji}}" class="part-icon part-icon-emoji">{{item.iconEmoji}}</view>
|
||||
<view wx:else class="part-icon">{{item.title[0] || '篇'}}</view>
|
||||
<view class="part-info">
|
||||
@@ -101,7 +102,7 @@
|
||||
<icon wx:else name="lock" size="24" color="rgba(255,255,255,0.3)" customClass="section-lock lock-closed"></icon>
|
||||
</view>
|
||||
<text class="section-title {{section.isFree || isVip || (!section.isPremium && hasFullBook) || purchasedSections.indexOf(section.id) > -1 ? '' : 'text-muted'}}">{{section.id}} {{section.title}}</text>
|
||||
<text wx:if="{{section.isNew}}" class="tag tag-new">NEW</text>
|
||||
<text wx:if="{{section.isNew || section.newBadgeText}}" class="tag tag-new">{{section.newBadgeText || chaptersNewBadgeText}}</text>
|
||||
</view>
|
||||
<view class="section-right">
|
||||
<text wx:if="{{section.isFree}}" class="tag tag-free">免费</text>
|
||||
|
||||
@@ -380,6 +380,13 @@
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.part-icon-text {
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.part-subtitle {
|
||||
font-size: 20rpx;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
|
||||
Reference in New Issue
Block a user