diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 0e7a139..f806017 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -176,6 +176,29 @@ Component({ }) }, + // 跳转到鸡蛋估价页面 + goToEvaluatePage() { + console.log('点击鸡蛋估价按钮,跳转到估价页面'); + wx.switchTab({ + url: '/pages/evaluate/index', + success: (res) => { + console.log('跳转到估价页面成功:', res); + }, + fail: (err) => { + console.error('跳转到估价页面失败,尝试使用reLaunch:', err); + wx.reLaunch({ + url: '/pages/evaluate/index', + success: (res) => { + console.log('reLaunch到估价页面成功:', res); + }, + fail: (err) => { + console.error('reLaunch到估价页面也失败:', err); + } + }); + } + }); + }, + // 从全局数据同步状态的方法 - 增强版