浏览代码

商品详情样式

zhangdehua 11 月之前
父节点
当前提交
667b88f67f
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      app/index/view/cart/shoppingCart.html

+ 7 - 0
app/index/view/cart/shoppingCart.html

@@ -212,6 +212,7 @@
         const tap = "ontouchstart" in window ? "touchstart" : "click";
 
         var addressId = {$addressId};
+        var cartTotal = {$cartTotal};
         var payByPoints = "{$payByPoints}";
         //console.log(payByPoints, payByPoints)
 
@@ -524,6 +525,12 @@
         //支付
         $(".payPalButton").on(tap, async function () {
             console.log("paypaing")
+            if (cartTotal == 0){
+                showToast('The cart is empty, please add the products first')
+                window.location.replace('/index/index/index.html');
+                return
+            }
+
             // 支付之前先判断是否有默认地址
             if (!addressId) {
                 showToast('No address')