Zory 3 日 前
コミット
1d46a924f1
2 ファイル変更13 行追加5 行削除
  1. 2 1
      pages/goods/detail.vue
  2. 11 4
      pages/index/index.vue

+ 2 - 1
pages/goods/detail.vue

@@ -497,7 +497,8 @@ export default {
 				if (!app.storeData) {
 					app.storeData = res.data.poi;
 					uni.setStorageSync("contact",res.data.poi);
-				}
+				}
+				uni.setStorageSync("poiId",res.data.poi_id);
 				app.goodsData = res.data;
 				app.bannerData = res.data.image_list
 				app.specs = res.data.specs;

+ 11 - 4
pages/index/index.vue

@@ -76,16 +76,23 @@ export default {
 		}
 	},
 	onLoad({store}) {
-		app = this;
-		app.storeId = store?store:"7644106137976965139";
+		app = this;
+		var poiId = uni.getStorageSync("poiId");
+		if (!poiId && !store) {
+			app.storeId = "7644106137976965139";
+		} else {
+			app.storeId = poiId;
+		}
 		app.getData()
 	},
 	methods: {
-		getData(){
+		getData(){
+			if (!app.storeId) return ;
 			Api.data({"store":app.storeId}).then((res)=>{
 				if (res.code !== 1) {
 					return app.$dialog.showSuccess(res.msg)
-				}
+				}
+				uni.setStorageSync("poiId",res.data.store.poi_id);
 				app.storeData = res.data.store;
 				app.goodsData = res.data.goods;
 				uni.setStorageSync("contact",res.data.store);