From 17bb1250f2120415e5fc9f47fe50b60f72b47a07 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期日, 04 八月 2024 12:50:01 +0800 Subject: [PATCH] update 优化搜索事件 --- components/footer/customer-footer.vue | 56 ++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 40 insertions(+), 16 deletions(-) diff --git a/components/footer/customer-footer.vue b/components/footer/customer-footer.vue index c953cce..3cc049b 100644 --- a/components/footer/customer-footer.vue +++ b/components/footer/customer-footer.vue @@ -4,22 +4,30 @@ <view class="item" :class="flg==index?'cur':''" @click="go(index,item)"> <view v-if="index==0"> - <image src="../../static/images/customer/footer/footer-home-1.png" class="footer-icon" v-if="flg==0"></image> - <image src="../../static/images/customer/footer/footer-home-0.png" class="footer-icon" v-if="flg!=0"></image> + <image src="../../static/images/customer/footer/footer-home-1.png" class="footer-icon" + v-if="flg==0"></image> + <image src="../../static/images/customer/footer/footer-home-0.png" class="footer-icon" + v-if="flg!=0"></image> </view> <view v-if="index==1"> - <image src="../../static/images/customer/footer/footer-trade-1.png" class="footer-icon" v-if="flg==1"></image> - <image src="../../static/images/customer/footer/footer-trade-0.png" class="footer-icon" v-if="flg!=1"></image> + <image src="../../static/images/customer/footer/footer-trade-1.png" class="footer-icon" + v-if="flg==1"></image> + <image src="../../static/images/customer/footer/footer-trade-0.png" class="footer-icon" + v-if="flg!=1"></image> </view> <view v-if="index==2"> - <image src="../../static/images/customer/footer/footer-shopping-1.png" class="footer-icon" v-if="flg==2"> + <image src="../../static/images/customer/footer/footer-shopping-1.png" class="footer-icon" + v-if="flg==2"> </image> - <image src="../../static/images/customer/footer/footer-shopping-0.png" class="footer-icon" v-if="flg!=2"> + <image src="../../static/images/customer/footer/footer-shopping-0.png" class="footer-icon" + v-if="flg!=2"> </image> </view> <view v-if="index==3"> - <image src="../../static/images/customer/footer/footer-self-1.png" class="footer-icon" v-if="flg==3"></image> - <image src="../../static/images/customer/footer/footer-self-0.png" class="footer-icon" v-if="flg!=3"></image> + <image src="../../static/images/customer/footer/footer-self-1.png" class="footer-icon" + v-if="flg==3"></image> + <image src="../../static/images/customer/footer/footer-self-0.png" class="footer-icon" + v-if="flg!=3"></image> </view> <view> @@ -39,21 +47,21 @@ tabBar: [{ "text": "首页", - "pagePath":'/pages/home/home' + "pagePath": '/pages/home/home' }, { "text": "交易大厅", - "pagePath":'/sub_pages/customer/trade/trade' + "pagePath": '/sub_pages/customer/trade/trade' }, { "text": "购物车", - "pagePath":'/sub_pages/customer/shopping/shopping' + "pagePath": '/sub_pages/customer/shopping/shopping' }, { "text": "我的", - "pagePath":'/pages/user/supplier-user' + "pagePath": '/pages/user/supplier-user' } ] } @@ -73,13 +81,29 @@ methods: { go(index, item) { - if (this.flg == ('' + index)) { + if (this.flg == index) { return } - uni.redirectTo({ - url: item.pagePath + if (index === 1 || index === 2) { + //交易大厅和购物车,这2个可以用跳转方式 + if (index === 2) { + if (!this.currentInfo.id) { + this.$message.showToast('请先登录') + return + } - }); + } + uni.navigateTo({ + url: item.pagePath + }) + + } else { + uni.redirectTo({ + url: item.pagePath + + }); + } + }, } } -- Gitblit v1.9.3