tj
2025-05-21 7abdb24968bcb88f177851a30e41f282b9189a98
components/footer/customer-footer.vue
@@ -1,7 +1,8 @@
<template>
   <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" :class="flg==index?'cur':''" @click="go(index,item)">
         <!-- <view class="item" :class="flg == index ? 'cur' : ''" @click="go(index, item)"> -->
         <view class="item" :class="currentIndex === index ? 'cur' : ''" @click="go(index, item)">
            <!-- <view v-if="index==0">
               <image src="../../static/images/customer/footer/footer-home-1.png" class="footer-icon"
@@ -56,7 +57,7 @@
               },
               {
                  "text": "行程规划",
            "text": "我的种草",
                  "pagePath": '/sub-pages/customer/shopping/shopping'
               },
               {
@@ -65,7 +66,7 @@
               },
               {
                  "text": "我的",
                  "pagePath": '/pages/user/supplier-user'
            "pagePath": '/sub-pages/mine/index'
               }
            ]
         }
@@ -82,28 +83,28 @@
         }
      },
      created() {},
   computed: {
      currentPath() {
         const pages = getCurrentPages();
         const currentPage = pages[pages.length - 1];
         return '/' + currentPage.route;
      },
      currentIndex() {
         return this.tabBar.findIndex(item => this.normalizePath(item.pagePath) === this.normalizePath(this.currentPath));
      }
   },
      methods: {
      normalizePath(path) {
         return path.replace(/^\/+/, '/');
      },
         go(index, item) {
            debugger;
            uni.navigateTo({
                  url: item.pagePath
               })
            // if (index === 1 || index === 2) {
            //    //交易大厅和购物车,这2个可以用跳转方式
            //    uni.navigateTo({
            //       url: item.pagePath
            //    })
            // } else {
            //    uni.reLaunch({
            //       url: item.pagePath
            //    });
            // }
         uni.reLaunch({
            url: item.pagePath
         })
         },
      }