Ver código fonte

修改商品数据为0时不可下单

ext.liuqiwen3 1 mês atrás
pai
commit
7cb969f7be
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      pages/goods/goods_details/index.vue

+ 7 - 0
pages/goods/goods_details/index.vue

@@ -875,6 +875,13 @@ const handleSubmit = async () => {
       })
       return ;
     }
+    if(attr.value.productSelect.cart_num == 0 ){
+      uni.showToast({
+        title:'商品数量不能为0!',
+        icon:'none',
+      })
+      return ;
+    }
   }
 
   const productSelect = productValue.value[attrValue.value];