web100 před 2 roky
rodič
revize
2ba6c51ffa
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  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)