shish 3 anni fa
parent
commit
94d0c89f32

+ 7 - 11
hdApp/src/mixins/cgProduct.js

@@ -68,8 +68,8 @@ export default {
 			if (this.selectList) {
 				for (const item of this.selectList) {
 					const itemInfo = this.getSelectItemById(item.id, item.classId);
-					if ( itemInfo && !this.$util.isEmpty(itemInfo.bigPrice)) {
-						price += item.bigCount * Number(itemInfo.bigPrice);
+					if ( itemInfo && !this.$util.isEmpty(itemInfo.price)) {
+						price += item.bigCount * Number(itemInfo.price);
 					}
 				}
 			}
@@ -80,13 +80,8 @@ export default {
 			if (this.selectList) {
 				for (const item of this.selectList) {
 					const itemInfo = this.getSelectItemById(item.id, item.classId);
-					if (
-						itemInfo &&
-						!this.$util.isEmpty(itemInfo.bigPrice) &&
-						!this.$util.isEmpty(itemInfo.smallPrice)
-					) {
-						price += item.bigCount * Number(itemInfo.bigPrice);
-						price += item.smallCount * Number(itemInfo.smallPrice);
+					if ( itemInfo && !this.$util.isEmpty(itemInfo.price)) {
+						price += item.bigCount * Number(itemInfo.price);
 					}
 				}
 			}
@@ -214,11 +209,12 @@ export default {
 		switchGlobalUnitType(){
 			if(this.globalUnitType == 0){
 				this.globalUnitType = 1
-				this.customData.userPrice = parseFloat(this.customData.smallPrice)
+				let smallPrice = this.customData.smallPrice ? this.customData.smallPrice : 0
+				this.customData.userPrice = parseFloat(smallPrice)
 				this.customData.bigCount = null
 			}else{
 				this.globalUnitType = 0
-				this.customData.userPrice = parseFloat(this.customData.bigPrice)
+				this.customData.userPrice = parseFloat(this.customData.price)
 				this.customData.smallCount = null
 			}
 		},

+ 0 - 1
hdApp/src/pagesPurchase/details.vue

@@ -238,7 +238,6 @@ export default {
 		...mapGetters(["getMerchantInfo", "getLoginInfo"]),
 		allPrice() {
 			let price = 0;
-
 			if (this.selectList) {
 				for (const item of this.selectList) {
 					if (item.itemPrice) {

+ 1 - 2
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -128,7 +128,7 @@
 									<text class="item-price">
 										<text class="unit">¥</text>
 										<text class="price">
-											{{ parseFloat(item.bigPrice)||0 }}
+											{{ parseFloat(item.price)||0 }}
 										</text>
 									</text>
 								</view>
@@ -305,7 +305,6 @@ export default {
 
 				this.customData.bigCount = this.xjData.stock
 				this.customData.smallCount = 0
-				this.customData.bigPrice = this.xjData.price
 				this.customData.price = this.xjData.price
 				this.customData.itemPrice = this.xjData.price
 				this.customData.userPrice = (Number(this.xjData.stock) * Number(this.xjData.price)).toFixed(2)