| | |
| | | <template>
|
| | | <view class="footer flex customer-footer" style="">
|
| | | <view class="footer flex customer-footer flex-wrap-normal" style="">
|
| | | <view v-for="(item,index) in tabBar" :key="index" class="footer-item">
|
| | | <view class="item flex" :class="flg==index?'cur':''" @click="go(index,item)">
|
| | | <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="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/d7/d795bbde55c84f6db0a8f6862ee9988bfooter-home-1.png" class="footer-icon"
|
| | | v-if="flg==0"></image>
|
| | | <image src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/0a/0aed01874f3a42b5a57ade2484fc446efooter-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==0"></image>
|
| | | <image src="../../static/images/customer/footer/footer-trade-0.png" class="footer-icon" v-if="flg!=0"></image>
|
| | | <image src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/7b/7b69a2e18107442ba238e6d681172ff1footer-trade-1.png" class="footer-icon"
|
| | | v-if="flg==1"></image>
|
| | | <image src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/ba/ba971b2a32e645ec9d8d779308c115f2footer-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==0">
|
| | | <image src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/39/39bb3d90aa1d497a8d1574acc4a92e5dfooter-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!=0">
|
| | | <image src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/0b/0ba125ec84834e058efa40389c7622a3footer-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==1"></image>
|
| | | <image src="../../static/images/customer/footer/footer-self-0.png" class="footer-icon" v-if="flg!=1"></image>
|
| | | <image src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/d0/d0b2ffa17da7437493e5bbe67750001cfooter-self-1.png" class="footer-icon"
|
| | | v-if="flg==3"></image>
|
| | | <image src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/d0/d0a386f6648d4890ac35e417db38672cfooter-self-0.png" class="footer-icon"
|
| | | v-if="flg!=3"></image>
|
| | | </view>
|
| | |
|
| | | <view>
|
| | |
| | | return {
|
| | | tabBar: [{
|
| | |
|
| | | "text": "首页"
|
| | | "text": "首页",
|
| | | "pagePath": '/pages/home/home'
|
| | | },
|
| | | {
|
| | |
|
| | | "text": "交易大厅"
|
| | | "text": "交易大厅",
|
| | | "pagePath": '/sub_pages/customer/trade/trade'
|
| | | },
|
| | | {
|
| | |
|
| | | "text": "购物车"
|
| | | "text": "购物车",
|
| | | "pagePath": '/sub_pages/customer/shopping/shopping'
|
| | | },
|
| | | {
|
| | | "text": "我的"
|
| | | "text": "我的",
|
| | | "pagePath": '/pages/user/supplier-user'
|
| | | }
|
| | | ]
|
| | | }
|
| | |
| | | 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
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | | //判断,如果上上上级别,就是要跳转的,改为返回,避免堆栈太多
|
| | | const pages = getCurrentPages();
|
| | | //如果上一层就是购物车,那么就返回,而不是跳转
|
| | | // console.log('toShopping',pages)
|
| | | if (pages && pages.length >= 2) {
|
| | | if ( ('/' + pages[pages.length - 2].route) === item.pagePath) {
|
| | | uni.navigateBack()
|
| | | return
|
| | | }
|
| | | }
|
| | |
|
| | | uni.navigateTo({
|
| | | url: item.pagePath
|
| | | })
|
| | |
|
| | | } else {
|
| | | uni.reLaunch({
|
| | | url: item.pagePath
|
| | |
|
| | | });
|
| | | }
|
| | |
|
| | | },
|
| | | }
|
| | | }
|