Browse Source

2023.11.1

zyx 1 year ago
parent
commit
3c0c73eb43
2 changed files with 26 additions and 4 deletions
  1. 7 1
      components/productWindow/index.vue
  2. 19 3
      pages/goods_details/index.vue

+ 7 - 1
components/productWindow/index.vue

@@ -13,6 +13,7 @@
 					<view class="money font-color">
 						<view class="acea-row row-middle">
 							{{$t(`¥`)}}<text class="num">{{ attr.productSelect.price }}</text>
+							<text class="num" v-if="attr.productSelect.pay_integral*1>0">+{{ attr.productSelect.pay_integral*1 }}积分</text>
 							<text class='vip-money'
 								v-if="is_vip>0 && attr.productSelect.vip_price">{{$t(`¥`)}}{{attr.productSelect.vip_price}}</text>
 							<view class="vipImg" v-if="is_vip>0 && attr.productSelect.vip_price">
@@ -137,11 +138,16 @@
 				default: ''
 			},
 		},
+		// watch: {
+		// 	attr(newValue, oldValue) {
+		// 		console.log(newValue);
+		// 	}
+		// },
 		data() {
 			return {};
 		},
 		mounted() {
-
+			// console.log(this.attr);
 		},
 		methods: {
 			getpreviewImage: function() {

+ 19 - 3
pages/goods_details/index.vue

@@ -46,11 +46,14 @@
 						<productConSwiper ref="proSwiper" :imgUrls="storeInfo.slider_image"
 							:videoline="storeInfo.video_link" @videoPause="videoPause" @showSwiperImg="showSwiperImg">
 						</productConSwiper>
+						<!-- TODO -->
 						<view class="wrapper">
 							<view class="share acea-row row-between row-bottom">
 								<view class="money font-color">
 									{{$t(`¥`)}}
-									<text class="num" v-text="storeInfo.price || 0"></text>
+									<!-- <text class="num" v-text="storeInfo.price || 0"></text> -->
+									<text class="num">{{storeInfo.price*1 || 0 }}</text>
+									<text class="num" v-if="storeInfo.pay_integral*1>0"> + {{storeInfo.pay_integral*1 }}积分</text>
 									<text v-if="storeInfo.spec_type">{{$t(`起`)}}</text>
 									<text class="vip-money" v-if="
                       storeInfo.vip_price &&
@@ -1116,6 +1119,8 @@
 							let obj = res.data.productValue[key];
 							that.skuArr.push(obj);
 						}
+						// console.log(that.skuArr,'obj')
+						// console.log(res.data.productValue,'obj')
 						this.$set(this, "selectSku", that.skuArr[0]);
 						that.$set(
 							that,
@@ -1163,6 +1168,7 @@
 						// #ifndef H5
 						that.downloadFilestoreImage();
 						// #endif
+						// console.log('555');
 						that.DefaultSelect();
 						that.getCartCount();
 						this.showAnimate = true
@@ -1254,6 +1260,7 @@
 
 				let productSelect = this.productValue[value.join(",")];
 				if (productSelect && productAttr.length) {
+					// console.log(productSelect,'c');
 					this.$set(
 						this.attr.productSelect,
 						"store_name",
@@ -1272,6 +1279,7 @@
 					);
 					this.$set(this, "attrTxt", this.$t(`已选择`));
 				} else if (!productSelect && productAttr.length) {
+					// console.log('b');
 					this.$set(
 						this.attr.productSelect,
 						"store_name",
@@ -1290,6 +1298,7 @@
 					this.$set(this, "attrValue", "");
 					this.$set(this, "attrTxt", this.$t(`请选择`));
 				} else if (!productSelect && !productAttr.length) {
+					// console.log(this.storeInfo,'a');
 					this.$set(
 						this.attr.productSelect,
 						"store_name",
@@ -1298,6 +1307,7 @@
 					this.$set(this.attr.productSelect, "image", this.storeInfo.image);
 					this.$set(this.attr.productSelect, "price", this.storeInfo.price);
 					this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
+					this.$set(this.attr.productSelect, "pay_integral", this.storeInfo.pay_integral);
 					this.$set(
 						this.attr.productSelect,
 						"unique",
@@ -1311,6 +1321,8 @@
 					);
 					this.$set(this, "attrValue", "");
 					this.$set(this, "attrTxt", this.$t(`请选择`));
+					
+					// console.log(this.attr.productSelect);
 				}
 			},
 			/**
@@ -1458,8 +1470,12 @@
 					//默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
 					that.attr.cartAttr = !that.isOpen ? true : false;
 				} else {
-					if (that.isOpen) that.attr.cartAttr = true;
-					else that.attr.cartAttr = !that.attr.cartAttr;
+					if (that.isOpen) { 
+						that.attr.cartAttr = true ;
+					}else {
+						that.attr.cartAttr = !that.attr.cartAttr
+					}
+				
 				}
 				//只有关闭属性弹窗时进行加入购物车
 				if (that.attr.cartAttr === true && that.isOpen === false)