lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
44c1c60562
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      components/uni-cart-fix/uni-cart-fix.vue

+ 10 - 3
components/uni-cart-fix/uni-cart-fix.vue

@@ -18,9 +18,16 @@
 			},
 			methods: {
 				toCart() {
-					uni.navigateTo({
-						url:"/pages/cart/cart"
-					})
+					if(this.count > 0){
+						uni.navigateTo({
+							url:"/pages/cart/cart"
+						})
+					}else{
+						uni.showToast({
+							icon:'none',
+							title:'购物车是空的,请先加入商品'
+						})
+					}
 				}
 			},
 		}