diff --git a/pages/product/shopPage.vue b/pages/product/shopPage.vue index 5669860..7001052 100644 --- a/pages/product/shopPage.vue +++ b/pages/product/shopPage.vue @@ -12,8 +12,8 @@ {{ storeInfo.storeName || ''}}
-
{{ storeInfo.goodsNum || 0 }}关注
-
{{ storeInfo.collectionNum || 0 }}件商品
+
{{ storeInfo.collectionNum || 0 }}关注
+
{{ storeInfo.goodsNum || 0 }}件商品
@@ -59,7 +59,7 @@
暂无商品信息 - +
{{ item.goodsName }}
@@ -140,23 +140,12 @@ export default { // 小程序默认分享 uni.showShareMenu({ withShareTicket: true }); // #endif + this.init(); }, onShow() { - this.goodsList = []; - this.categoryList = []; - this.couponList = []; - this.goodsParams.pageNumber = 1; - if (this.$options.filters.isLogin("auth")) { - this.enableGoodsIsCollect(); + if (this.goodsList.length == 0) { + this.init(); } - // 店铺信息 - this.getStoreData(); - // 商品信息 - this.getGoodsData(); - // 优惠券信息 - this.getCouponsData(); - // 店铺分类 - this.getCategoryData(); }, // 下拉加载 onReachBottom() { @@ -165,6 +154,26 @@ export default { }, methods: { + /** + * 初始化信息 + */ + init() { + this.goodsList = []; + this.categoryList = []; + this.couponList = []; + this.goodsParams.pageNumber = 1; + if (this.$options.filters.isLogin("auth")) { + this.enableGoodsIsCollect(); + } + // 店铺信息 + this.getStoreData(); + // 商品信息 + this.getGoodsData(); + // 优惠券信息 + this.getCouponsData(); + // 店铺分类 + this.getCategoryData(); + }, /** * 联系客服 */ @@ -173,7 +182,6 @@ export default { // #ifdef MP-WEIXIN const params = { - // originalPrice: this.goodsDetail.original || this.goodsDetail.price, uuid: storage.getUuid(), token: storage.getAccessToken(), diff --git a/pages/product/shopPageGoods.vue b/pages/product/shopPageGoods.vue index 558af67..bf95ef5 100644 --- a/pages/product/shopPageGoods.vue +++ b/pages/product/shopPageGoods.vue @@ -5,7 +5,7 @@
暂无商品信息 - +
{{ item.goodsName }}