diff --git a/pages/index/index.vue b/pages/index/index.vue index ff0b328..a88241f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -192,7 +192,9 @@ } // 用户选择的门店信息 - const storeInfo = JSON.parse(uni.getStorageSync('STORE_INFO')) + let STORE_INFO = uni.getStorageSync('STORE_INFO'); + if (STORE_INFO) + STORE_INFO = JSON.parse(STORE_INFO) /*商品列表滚动隐藏头部导航 */ const instance = getCurrentInstance(); // 获取组件实例 @@ -269,7 +271,7 @@ page_size: 25, name: '', order: '', - store_id: storeInfo.id + store_id: STORE_INFO.id || '' }) // console.log(JSON.parse(uni.getStorageSync('STORE_INFO'))) @@ -421,9 +423,8 @@ productLogApi({ product_id: item.product_id, cate_id: item.cate_id, - store_id: uni.getStorageSync('STORE_INFO').id || '' + store_id: STORE_INFO.id || '' }); - }; const changeGood = (data) => { // 确定选择商品重量 showGoodPopup.value = false;