Browse Source

bug 修复

lilei 4 years ago
parent
commit
44c1c60562
1 changed files with 10 additions and 3 deletions
  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: {
 			methods: {
 				toCart() {
 				toCart() {
-					uni.navigateTo({
-						url:"/pages/cart/cart"
-					})
+					if(this.count > 0){
+						uni.navigateTo({
+							url:"/pages/cart/cart"
+						})
+					}else{
+						uni.showToast({
+							icon:'none',
+							title:'购物车是空的,请先加入商品'
+						})
+					}
 				}
 				}
 			},
 			},
 		}
 		}