diff --git a/config/app.js b/config/app.js index 85facca..ab2ac5f 100644 --- a/config/app.js +++ b/config/app.js @@ -1,8 +1,8 @@ let BASE_URL import store from "@/store/user.js" // 环境 -// let env = "dev" -let env = "prod" +let env = "dev" +// let env = "prod" // let env = "liu"; switch (env) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 254ab6f..955ee96 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -247,8 +247,8 @@ import useUserStore from "@/store/user"; const userStore = useUserStore(); const STORE_INFO = reactive({ - id: 23, - store_name: "农(特)产品直营店" + id: '', + store_name: "" }) const getStoreInfoFn = () => { @@ -370,8 +370,7 @@ name: '', order: '', store_name: '', - // store_id: 23 - store_id: 4 + store_id: '' }) const loading = ref(true); @@ -387,8 +386,7 @@ if (class_all) class_id = ""; //只能带其中一个 if (loadmore) where.value.page_no++; else where.value.page_no = 1; - // where.value.store_id = 23 - where.value.store_id = 4 + console.log('where------------', where.value) goodListApi({ ...where.value, class_all: class_all, @@ -397,11 +395,6 @@ }).then(res => { if (loadmore) goodList.value.push(...res.data.lists); else goodList.value = res.data.lists; - // 补充店铺信息 - // if (!STORE_INFO.store_name || !STORE_INFO.detailed_address) { - // STORE_INFO.store_name = res.data.store.name; - // STORE_INFO.value.detailed_address = res.data.store.detailed_address; - // } }) } @@ -423,9 +416,7 @@ page_no: page_no, page_size: 30, level: three, - // store_id: STORE_INFO.id // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 - // store_id: 23 // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 - store_id: 4 // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 + store_id: STORE_INFO.id // 店铺id,用于获取店铺分类列表,如果为空则获取全部分类列表,否则获取店铺分类列表。 }).then(res => { if (pid == 0) { // 加载一级分类时设置全部分类 if (!res.data?.lists?.length) return; @@ -527,10 +518,7 @@ const openGoodPopup = (item) => { // 打开数量/重量弹窗 goodData.value = item; goodRef.value.setData(item); - // goodRef.value.founcsFn(); showGoodPopup.value = true; - - //统计商品的访问记录 productLogApi({ product_id: item.product_id, @@ -609,13 +597,17 @@ getShareInfo() onLoad(async (opt) => { - where.value.store_id = opt.id || STORE_INFO.id; - // 店铺id if (opt.id) { + where.value.store_id = (opt.id == 'undefined' ? STORE_INFO.id : opt.id); + } else { + where.value.store_id = STORE_INFO.id + } + // 店铺id + if (opt.id && opt.id != 'undefined') { + console.log(opt.id, opt.id != 'undefined', "进来了这里") where.value.store_id = opt.id; const info = await shopDetailApi({ - store_id: 4 - // store_id: 23 + store_id: where.value.store_id }); // 分享参数至当前用户参数 if (opt.spread_uid) {