Просмотр исходного кода

解决 商城 - 最近访问 点击跳转时要带 account=xxx 参数值取上面图片时原shopId

wangning 5 лет назад
Родитель
Сommit
0fc9ff141c
3 измененных файлов с 17 добавлено и 5 удалено
  1. 8 2
      mallApp/src/pages/home/index.vue
  2. 5 2
      mallApp/src/pages/home/recent.vue
  3. 4 1
      mallApp/src/utils/util.js

+ 8 - 2
mallApp/src/pages/home/index.vue

@@ -55,14 +55,20 @@ export default {
       ad: [],
       category: [],
       columnStyle: null,
-      currentTabIndex: 0
+      currentTabIndex: 0,
+      account: ''
     };
   },
   computed: {
     ...mapGetters({ orderShop: "getOrderShop" })
   },
-  onLoad (option) { },
+  onLoad (option) {
+    console.log('onload===>', option)
+  },
   mounted () { },
+  onShow () {
+    uni.hideTabBar()
+  },
   methods: {
     init () {
       getOrderShop().then(res => {

+ 5 - 2
mallApp/src/pages/home/recent.vue

@@ -5,8 +5,11 @@
         <view
           :key="item.shopId"
           @click="pageTo({
-              url: '/pages/home/index?account='+item.shopId,
-              type:4
+              url: '/pages/home/index',
+              type:4,
+              query: {
+                account: '15680'
+              }
             })"
           v-for="item in list"
         >

+ 4 - 1
mallApp/src/utils/util.js

@@ -208,7 +208,10 @@ export const pageTo = (item) => {
 			})
 		} else if (item.type == 4) {
 			console.log('switchTab', item.query)
-			uni.setStorageSync('switchTabQuery', item.query)
+      uni.setStorageSync('switchTabQuery', item.query)
+      if (item.query.account) {
+        uni.setStorageSync('account', item.query.account)
+      }
 			uni.switchTab({
 				url: item.url
 			})