web100 %!s(int64=2) %!d(string=hai) anos
pai
achega
2ba6c51ffa
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      pages/tabBar/shoppingCart.vue

+ 7 - 0
pages/tabBar/shoppingCart.vue

@@ -297,11 +297,18 @@ import { registerRuntimeCompiler } from "vue"
 				}
 				this.totalPrice = 0
 				this.totalFreight = 0
+				let num = 0
 				for (let item of data) {
 					this.totalPrice += Number(item.price) * Number(item.goodsNum)
+					num += Number(item.goodsNum)
 					if (Number(item.goodsNum) == 1) {
 						this.totalFreight += 5
 					}
+
+				}
+				console.log('num',num);
+				if(num>1){
+					this.totalFreight = 0
 				}
 				this.totalFreight = this.totalFreight.toFixed(2)
 				this.totalPrice = this.totalPrice.toFixed(2)