From 810be121d0ad95211ad13ebed9fb4e834c0c2f72 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 25 三月 2024 11:08:32 +0800 Subject: [PATCH] 添加资源购买功能页面 --- custom-tab-bar/index.js | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 3783000..b7ed143 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -4,15 +4,20 @@ active: 0, list: TabMenu, }, - + observers: { + 'active': function (newValue) { + console.log('active鍙樺寲', newValue); + } + }, methods: { onChange(event) { - this.setData({ active: event.detail.value }); - console.log(this.data.active); + console.log(event); + this.setData({ active: this.data.list[event.detail.value].id }); + const url = this.data.list[event.detail.value].url.startsWith('/') + ? this.data.list[event.detail.value].url + : `/${this.data.list[event.detail.value].url}` wx.switchTab({ - url: this.data.list[event.detail.value].url.startsWith('/') - ? this.data.list[event.detail.value].url - : `/${this.data.list[event.detail.value].url}`, + url: url }); }, -- Gitblit v1.9.1