删除不再使用的文件,包括.gitignore、多个启动和配置指南文档,以及小程序相关的脚本和文档,简化项目结构以提高可维护性。
This commit is contained in:
@@ -23,21 +23,52 @@ Component({
|
||||
pagePath: '/pages/match/match',
|
||||
text: '找伙伴',
|
||||
iconType: 'match',
|
||||
isSpecial: true
|
||||
isSpecial: true,
|
||||
hidden: true // 默认隐藏,等配置加载后根据后台设置显示
|
||||
},
|
||||
{
|
||||
pagePath: '/pages/my/my',
|
||||
text: '我的',
|
||||
iconType: 'user'
|
||||
}
|
||||
]
|
||||
],
|
||||
matchEnabled: false // 找伙伴功能开关(默认隐藏,等待后台配置加载)
|
||||
},
|
||||
|
||||
attached() {
|
||||
// 初始化时获取当前页面
|
||||
this.loadFeatureConfig()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 加载功能配置
|
||||
async loadFeatureConfig() {
|
||||
try {
|
||||
const app = getApp()
|
||||
const res = await app.request('/api/db/config')
|
||||
|
||||
if (res.success && res.features) {
|
||||
const matchEnabled = res.features.matchEnabled === true
|
||||
this.setData({ matchEnabled })
|
||||
|
||||
// 更新list,隐藏或显示找伙伴
|
||||
const list = this.data.list.map(item => {
|
||||
if (item.iconType === 'match') {
|
||||
return { ...item, hidden: !matchEnabled }
|
||||
}
|
||||
return item
|
||||
})
|
||||
this.setData({ list })
|
||||
|
||||
console.log('[TabBar] 功能配置加载成功,找伙伴功能:', matchEnabled ? '开启' : '关闭')
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[TabBar] 加载功能配置失败:', e)
|
||||
// 失败时默认隐藏找伙伴(与Web版保持一致)
|
||||
this.setData({ matchEnabled: false })
|
||||
}
|
||||
},
|
||||
|
||||
switchTab(e) {
|
||||
const data = e.currentTarget.dataset
|
||||
const url = data.path
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<view class="tab-bar-text" style="color: {{selected === 1 ? selectedColor : color}}">{{list[1].text}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 找伙伴 - 中间突出按钮 -->
|
||||
<view class="tab-bar-item special-item" data-path="{{list[2].pagePath}}" data-index="2" bindtap="switchTab">
|
||||
<!-- 找伙伴 - 中间突出按钮(可通过后台隐藏) -->
|
||||
<view wx:if="{{matchEnabled}}" class="tab-bar-item special-item" data-path="{{list[2].pagePath}}" data-index="2" bindtap="switchTab">
|
||||
<view class="special-button {{selected === 2 ? 'special-active' : ''}}">
|
||||
<view class="icon-users">
|
||||
<view class="user-circle user-1"></view>
|
||||
|
||||
Reference in New Issue
Block a user