From 36e794d948b856f2a542aaadd0e374892635be14 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期三, 25 六月 2025 21:19:17 +0800 Subject: [PATCH] 自定义顶部组件优化 --- pages/health/healthVideo.vue | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/pages/health/healthVideo.vue b/pages/health/healthVideo.vue index 4ac5030..8fef229 100644 --- a/pages/health/healthVideo.vue +++ b/pages/health/healthVideo.vue @@ -1,6 +1,6 @@ <template> <view class="video-container"> - <top-bar selectedTitleIndex="health" @changeTab="topBarChange" class="topBar"></top-bar> + <top-bar selectedTitleIndex="health" textColor="black" @changeTab="topBarChange" class="topBar"></top-bar> <!-- 瑙嗛鍔犺浇 --> <zero-loading v-show="videoLoading" type="circle" color="#0ebd57" text=""></zero-loading> <!-- 瑙嗛鍒楄〃 --> @@ -250,6 +250,7 @@ import { getUserInfo } from "@/api/members"; import storage from "@/utils/storage.js"; export default { + components: {TopBar}, computed: { hasPlayTime() { return this.sliderFormatTime(this.progress > 0 ? this.duration * this.progress / 100 : 0); @@ -381,6 +382,17 @@ } }, methods: { + topBarChange(titleObj) { + if (titleObj.index === 'home') { + uni.switchTab({ + url: titleObj.pagePath + }); + } else { + uni.redirectTo({ + url: titleObj.pagePath + }); + } + }, // 闈欓粯鐧诲綍 wxSilentLogin(callback) { //鑾峰彇code -- Gitblit v1.8.0