From 1fbb43c848fafba68488998b9899554ecb867327 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com>
Date: Wed, 11 Aug 2021 09:49:09 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=97=E9=93=BA=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E5=BA=97=E9=93=BA=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/product/shopPage.vue | 44 +++++++++++++++++++--------------
pages/product/shopPageGoods.vue | 2 +-
2 files changed, 27 insertions(+), 19 deletions(-)
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 }}