Browse Source

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

wangning 5 years ago
parent
commit
0fc9ff141c

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

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

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

@@ -5,8 +5,11 @@
         <view
         <view
           :key="item.shopId"
           :key="item.shopId"
           @click="pageTo({
           @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"
           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) {
 		} else if (item.type == 4) {
 			console.log('switchTab', item.query)
 			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({
 			uni.switchTab({
 				url: item.url
 				url: item.url
 			})
 			})