又改了一个抖音版本

This commit is contained in:
tsui110 2026-01-10 20:19:14 +08:00
parent 3b0bf07f77
commit 1c62867cd2
4 changed files with 33 additions and 15 deletions

View File

@ -1,18 +1,13 @@
<template>
<view class="app-tab-bar-toutiao">
<view class="tab-bar-item" @tap="switchTab('pages/index/index')">
<image class="tab-icon" :src="selected === 0 ? '/static/tab/home_active.png' : '/static/tab/home.png'" mode="aspectFit"></image>
<text class="tab-text" :class="{ active: selected === 0 }">首页</text>
</view>
<view class="tab-bar-item" @tap="switchTab('pages/cabinet/index')">
<image class="tab-icon" :src="selected === 1 ? '/static/tab/box_active.png' : '/static/tab/box.png'" mode="aspectFit"></image>
<text class="tab-text" :class="{ active: selected === 1 }">盒柜</text>
<image class="tab-icon" :src="selected === 0 ? '/static/tab/box_active.png' : '/static/tab/box.png'" mode="aspectFit"></image>
<text class="tab-text" :class="{ active: selected === 0 }">盒柜</text>
</view>
<view class="tab-bar-item" @tap="switchTab('pages/mine/index')">
<image class="tab-icon" :src="selected === 2 ? '/static/tab/profile_active.png' : '/static/tab/profile.png'" mode="aspectFit"></image>
<text class="tab-text" :class="{ active: selected === 2 }">我的</text>
<image class="tab-icon" :src="selected === 1 ? '/static/tab/profile_active.png' : '/static/tab/profile.png'" mode="aspectFit"></image>
<text class="tab-text" :class="{ active: selected === 1 }">我的</text>
</view>
</view>
</template>
@ -21,7 +16,7 @@
export default {
data() {
return {
selected: 2 // ""
selected: 0 // ""
}
},
mounted() {
@ -37,9 +32,8 @@ export default {
const currentPage = pages[pages.length - 1]
const route = currentPage.route
if (route === 'pages/index/index') this.selected = 0
else if (route === 'pages/cabinet/index') this.selected = 1
else if (route === 'pages/mine/index') this.selected = 2
if (route === 'pages/cabinet/index') this.selected = 0
else if (route === 'pages/mine/index') this.selected = 1
}
},
switchTab(url) {

View File

@ -9,11 +9,13 @@
<!-- #endif -->
<!-- 顶部导航栏 -->
<!-- #ifndef MP-TOUTIAO -->
<view class="navbar">
<view class="navbar-content">
<text class="navbar-title">设置</text>
</view>
</view>
<!-- #endif -->
<!-- 设置内容区域 -->
<view class="settings-content">
@ -106,6 +108,7 @@ export default {
}
/* 导航栏 */
/* #ifndef MP-TOUTIAO */
.navbar {
position: fixed;
top: 0;
@ -131,13 +134,23 @@ export default {
font-weight: 800;
color: $text-main;
}
/* #endif */
/* 设置内容区 */
/* #ifdef MP-TOUTIAO */
.settings-content {
padding-top: $spacing-lg;
padding-left: $spacing-lg;
padding-right: $spacing-lg;
}
/* #endif */
/* #ifndef MP-TOUTIAO */
.settings-content {
padding-top: calc(env(safe-area-inset-top) + 88rpx + $spacing-lg);
padding-left: $spacing-lg;
padding-right: $spacing-lg;
}
/* #endif */
/* 退出登录区域 */
.logout-section {

View File

@ -159,7 +159,10 @@
"path": "settings/index",
"style": {
"navigationBarTitleText": "设置",
"navigationStyle": "custom"
"navigationStyle": "custom",
"mp-toutiao": {
"navigationStyle": "default"
}
}
}
]

View File

@ -204,7 +204,15 @@ export default {
}
},
onLoad() {
//
// #ifdef MP-TOUTIAO
// ,
uni.switchTab({
url: '/pages/cabinet/index'
})
return
// #endif
// ()
if (!checkPhoneBoundSync()) return
// 200ms Token/Session