feat: 小程序阅读记录与资料链路、管理端用户规则、API/VIP/推荐与运营脚本
- miniprogram: reading-records、imageUrl/mpNavigate、多页资料与 VIP 展示调整 - soul-admin: Users/Settings/UserDetailModal、dist 构建产物更新 - soul-api: user/vip/referral/ckb/db、MBTI 头像管理、user_rule_completion、迁移 SQL - .cursor: karuo-party 与飞书文档;.gitignore 忽略 .tmp_skill_bundle Made-with: Cursor
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
const app = getApp()
|
||||
const { trackClick } = require('../../utils/trackClick')
|
||||
const { cleanSingleLineField } = require('../../utils/contentParser')
|
||||
const { navigateMpPath } = require('../../utils/mpNavigate.js')
|
||||
|
||||
/** 与首页固定「卡若」获客位重复时从横滑列表剔除(含历史误写「卡路」) */
|
||||
function isKaruoHostDuplicateName(displayName) {
|
||||
@@ -85,7 +86,19 @@ Page({
|
||||
searchEnabled: true,
|
||||
|
||||
// 审核模式:隐藏支付相关入口
|
||||
auditMode: false
|
||||
auditMode: false,
|
||||
|
||||
// mp_config.mpUi.homePage(后台系统设置 mpUi)
|
||||
mpUiLogoTitle: '卡若创业派对',
|
||||
mpUiLogoSubtitle: '来自派对房的真实故事',
|
||||
mpUiLinkKaruoText: '点击链接卡若',
|
||||
mpUiSearchPlaceholder: '搜索章节标题或内容...',
|
||||
mpUiBannerTag: '推荐',
|
||||
mpUiBannerReadMore: '点击阅读',
|
||||
mpUiSuperTitle: '超级个体',
|
||||
mpUiSuperLinkText: '获客入口',
|
||||
mpUiPickTitle: '精选推荐',
|
||||
mpUiLatestTitle: '最新新增'
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -111,6 +124,7 @@ Page({
|
||||
onShow() {
|
||||
console.log('[Index] onShow 触发')
|
||||
this.setData({ auditMode: app.globalData.auditMode || false })
|
||||
this._applyHomeMpUi()
|
||||
|
||||
// 设置TabBar选中状态
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
@@ -305,6 +319,30 @@ Page({
|
||||
wx.switchTab({ url: '/pages/chapters/chapters' })
|
||||
},
|
||||
|
||||
_applyHomeMpUi() {
|
||||
const h = app.globalData.configCache?.mpConfig?.mpUi?.homePage || {}
|
||||
this.setData({
|
||||
mpUiLogoTitle: String(h.logoTitle || '卡若创业派对').trim() || '卡若创业派对',
|
||||
mpUiLogoSubtitle: String(h.logoSubtitle || '来自派对房的真实故事').trim() || '来自派对房的真实故事',
|
||||
mpUiLinkKaruoText: String(h.linkKaruoText || '点击链接卡若').trim() || '点击链接卡若',
|
||||
mpUiSearchPlaceholder: String(h.searchPlaceholder || '搜索章节标题或内容...').trim() || '搜索章节标题或内容...',
|
||||
mpUiBannerTag: String(h.bannerTag || '推荐').trim() || '推荐',
|
||||
mpUiBannerReadMore: String(h.bannerReadMoreText || '点击阅读').trim() || '点击阅读',
|
||||
mpUiSuperTitle: String(h.superSectionTitle || '超级个体').trim() || '超级个体',
|
||||
mpUiSuperLinkText: String(h.superSectionLinkText || '获客入口').trim() || '获客入口',
|
||||
mpUiPickTitle: String(h.pickSectionTitle || '精选推荐').trim() || '精选推荐',
|
||||
mpUiLatestTitle: String(h.latestSectionTitle || '最新新增').trim() || '最新新增'
|
||||
})
|
||||
},
|
||||
|
||||
/** 超级个体右侧文案:默认跳转找伙伴 Tab(路径可由 homePage.superSectionLinkPath 配置) */
|
||||
goSuperSectionLink() {
|
||||
const p = String(
|
||||
app.globalData.configCache?.mpConfig?.mpUi?.homePage?.superSectionLinkPath || '/pages/match/match'
|
||||
).trim()
|
||||
if (p) navigateMpPath(p)
|
||||
},
|
||||
|
||||
async loadFeatureConfig() {
|
||||
try {
|
||||
const hasCachedFeatures = app.globalData.features && typeof app.globalData.features.searchEnabled === 'boolean'
|
||||
@@ -313,6 +351,7 @@ Page({
|
||||
searchEnabled: app.globalData.features.searchEnabled,
|
||||
auditMode: app.globalData.auditMode || false
|
||||
})
|
||||
this._applyHomeMpUi()
|
||||
return
|
||||
}
|
||||
const res = await app.getConfig()
|
||||
@@ -324,8 +363,10 @@ Page({
|
||||
app.globalData.features.searchEnabled = searchEnabled
|
||||
app.globalData.auditMode = auditMode
|
||||
this.setData({ searchEnabled, auditMode })
|
||||
this._applyHomeMpUi()
|
||||
} catch (e) {
|
||||
this.setData({ searchEnabled: true, auditMode: app.globalData.auditMode || false })
|
||||
this._applyHomeMpUi()
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user