又改了一个抖音版本

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> <template>
<view class="app-tab-bar-toutiao"> <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')"> <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> <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 === 1 }">盒柜</text> <text class="tab-text" :class="{ active: selected === 0 }">盒柜</text>
</view> </view>
<view class="tab-bar-item" @tap="switchTab('pages/mine/index')"> <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> <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 === 2 }">我的</text> <text class="tab-text" :class="{ active: selected === 1 }">我的</text>
</view> </view>
</view> </view>
</template> </template>
@ -21,7 +16,7 @@
export default { export default {
data() { data() {
return { return {
selected: 2 // "" selected: 0 // ""
} }
}, },
mounted() { mounted() {
@ -37,9 +32,8 @@ export default {
const currentPage = pages[pages.length - 1] const currentPage = pages[pages.length - 1]
const route = currentPage.route const route = currentPage.route
if (route === 'pages/index/index') this.selected = 0 if (route === 'pages/cabinet/index') this.selected = 0
else if (route === 'pages/cabinet/index') this.selected = 1 else if (route === 'pages/mine/index') this.selected = 1
else if (route === 'pages/mine/index') this.selected = 2
} }
}, },
switchTab(url) { switchTab(url) {

View File

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

View File

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

View File

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