Browse Source

commit -m 商品详细显示

zhengjinyi 3 years ago
parent
commit
b940e67e31
2 changed files with 16 additions and 7 deletions
  1. 0 2
      components/cm-module/pageTemplate/templatePrice.vue
  2. 16 5
      pages/goods/product.vue

+ 0 - 2
components/cm-module/pageTemplate/templatePrice.vue

@@ -160,8 +160,6 @@ export default {
 			this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
 			this.goods = data
 			this.firstClubType = this.clubType
-			console.log('userIdentity',this.userIdentity)
-			console.log('firstClubType',this.firstClubType)
 		},
 		PromotionsFormat(promo) {
 			//促销活动类型数据处理

+ 16 - 5
pages/goods/product.vue

@@ -601,7 +601,7 @@ export default {
 		return {
 			StaticUrl: this.$Static, //静态图片路径
 			clickPath: '/pages/search/search',
-			html: '<div style="text-align: center;color:#333333;">暂无内容</div>',
+			html: '',
 			productNoneImage: 'https://static.caimei365.com/app/img/icon/icon-pnone.png',
 			mode: 'round',
 			iconClass: 'icon-aixin',
@@ -800,10 +800,7 @@ export default {
 						}
 					}
 					this.ladderPriceFlag = this.product.ladderPriceFlag
-					this.html =
-						this.product.productDetail == null
-							? this.html
-							: this.$api.adaptRichTextImg(this.product.productDetail.detailInfo)
+					this.html = this.adaptRichTextImg(this.product)
 					this.stock = this.product.stock
 					this.buyRetailPriceStep = this.product.step
 					this.number = this.product.minBuyNumber
@@ -876,6 +873,20 @@ export default {
 					this.$util.msg(error.msg, 2000)
 				})
 		},
+		adaptRichTextImg(product){// 商品详情
+			let defaulHtml = '<div style="text-align: center;color:#333333;">暂无内容</div>'
+			let html = ''
+			if(product.productDetailChose == 1){// 同资质机构显示商品详情
+				html = product.productDetail ? this.$api.adaptRichTextImg(product.productDetail.detailInfo) : defaulHtml
+			}else{
+				if(this.hasLogin && this.userIdentity !=4){
+					html = product.productDetail ? this.$api.adaptRichTextImg(product.productDetail.detailInfo) : defaulHtml
+				}else{
+					html = product.productDetail ? this.$api.adaptRichTextImg(product.productDetail.commonDetailInfo) : defaulHtml
+				}
+			}
+			return html
+		},
 		getCommodityCombinationList() {
 			// 初始化商品详情配套商品
 			this.ProductService.getCommodityCombinationList({