Ver código fonte

Merge branch 'master' into zhongqi-ghsLimitBuyUpdate

shish 2 semanas atrás
pai
commit
a55d99cb01
1 arquivos alterados com 8 adições e 4 exclusões
  1. 8 4
      hdApp/src/pagesPurchase/ghsProduct.vue

+ 8 - 4
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -478,8 +478,8 @@ export default {
 		syncHeaderNoticeClass() {
 			this.myClass = this.ghsNoticeList.length > 0 ? 'fadeIn' : 'fadeInSmall'
 		},
-		fetchGhsNoticeList() {
-			ghsCommonInfo({ghsId:this.ghsId}).then(res => {
+		fetchGhsNoticeList(ghsId) {
+			ghsCommonInfo({ghsId:ghsId}).then(res => {
 				const allList = (res.data && res.data.ghsNoticeList) ? res.data.ghsNoticeList : []
 				// 分类菜单:positions 含 1
 				this.ghsNoticeList = allList.filter(item => (item.positions || []).includes(1))
@@ -623,7 +623,6 @@ export default {
 					this.ghsId = id
 					this.shopId = this.option.shopId
 					this.option.id = res.data.id;
-					this.fetchGhsNoticeList()
 					// 扫码/分享进入时,在解析出真实 ghsId 后立即恢复对应购物车,防止异步加载延迟
 					if (id > 0) {
 						let currentInfo = uni.getStorageSync('selectList' + this.pageType + '_ghs_' + id);
@@ -636,6 +635,8 @@ export default {
 					if(id>0){
 						this.visitMall(id)
 						this.initGhsDataV2(id,shopId,0)
+						//有批发店才请求公告
+						this.fetchGhsNoticeList(id)
 					}
 				}).catch(err => {})
 			} else {
@@ -645,8 +646,11 @@ export default {
 				getGhsDataApi({id: this.option.id}).then(res => {
 					this.setGhsInfo(res.data)
 					this.shopId = res.data.shopId
-					this.fetchGhsNoticeList()
 					this.visitMall(this.option.id)
+					if(Number(this.ghsId)>0){
+						//有批发店才请求公告
+						this.fetchGhsNoticeList(this.ghsId)
+					}
 				}).catch(err => {})
 			}
 		},