hwq 2 anos atrás
pai
commit
93cf1a8365
1 arquivos alterados com 12 adições e 9 exclusões
  1. 12 9
      pages/product/product.vue

+ 12 - 9
pages/product/product.vue

@@ -35,7 +35,7 @@
 			<text class="title" v-if="goodsType == 1">{{ goodsObjact.title }}</text>
 			<view class="price-box" v-if="goodsType == 0">
 				<text class="price-tip">¥</text>
-				<text class="price">{{ goodsObjact.price }}<text v-if="details.integral" style="padding-left: 8rpx;">+{{details.integral}} 趣豆</text></text>
+				<text class="price">{{ goodsObjact.price }}<text v-if="actionIntegral != 0" style="padding-left: 8rpx;">+{{actionIntegral}} 趣豆</text></text>
 				<text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text>
 				<!-- <text class="coupon-tip">7折</text> -->
 				
@@ -141,7 +141,8 @@
 					<image :src="actionImage"></image>
 					<view class="right">
 						<view class="good-name clamp">{{ goodsObjact.store_name }}</view>
-						<text class="price">¥{{ actionPrice }}</text>
+						<text class="price" v-if="actionIntegral != 0">¥{{ actionPrice }}+{{actionIntegral}}趣豆</text>
+						<text class="price" v-else>¥{{ actionPrice }}</text>
 						<!-- <text class="stock">库存:{{ goodsObjact.stock }}件</text> -->
 						<!-- <view class="selected" v-if="goodsType == 0">
 							已选:
@@ -204,7 +205,7 @@ export default {
 	},
 	data() {
 		return {
-			details: '',
+			actionIntegral: '',
 			reply: '', //评论
 			type: 1, //默认支付方式add为
 			goodsNumber: 1, //购买数量
@@ -322,7 +323,7 @@ export default {
 		goodsDetail() {
 			let obj = this;
 			goodsDetail({}, this.goodsid).then(function({ data }) {
-				obj.details = data;
+				obj.actionIntegral = data.integral;
 				let goods = data.storeInfo;
 				let store_info = data.system_store; // 保存店铺信息
 				console.log(store_info);
@@ -398,7 +399,7 @@ export default {
 			this.type = str;
 		},
 		//选择规格
-		selectSpec(item, arr, ind) {
+		selectSpec(item, arr, ind) {
 			arr.attr_value.forEach(function(e) {
 				e.check = false;
 			});
@@ -406,8 +407,10 @@ export default {
 			this.specSelected[ind] = item.attr;
 			let str = this.specSelected.join(',');
 			this.specSelectedName = this.specSelected.join(' ');
-			if (this.productValue[str]) {
-				let data = this.productValue[str];
+				console.log(this.productValue,str)
+			if (this.productValue[str]) {
+				let data = this.productValue[str];
+				this.actionIntegral = data.integral
 				this.actionPrice = data.price;
 				this.goodsNumberMax = data.stock;
 				this.actionImage = data.image;
@@ -560,7 +563,7 @@ page {
 		font-size: $font-base;
 	}
 	.price {
-		font-size: 45rpx !important;
+		font-size: 40rpx !important;
 		font-weight: bold;
 	}
 	.timeStop {
@@ -917,7 +920,7 @@ page {
 				margin-bottom: 15rpx;
 			}
 			.price {
-				font-size: 60rpx;
+				font-size: 40rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
 				color: #ff6f0f;