xuxueyang
2024-08-31 32526e5bddb7b14328b2467cd18783f480b33f3b
components/footer/customer-footer.vue
@@ -84,19 +84,37 @@
            if (this.flg == index) {
               return
            }
            if (index===1||index===2) {
               //交易大厅和购物车,这2个可以用跳转方式
               uni.navigateTo({
                  url:item.pagePath
               })
            }else{
               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
               });
            }
         },
      }
   }