Explorar el Código

购物车超过库存报错

Mike hace 7 años
padre
commit
c163eaa04c
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      wechat/pages/goods/goods.js

+ 10 - 1
wechat/pages/goods/goods.js

xqd
@@ -320,10 +320,19 @@ Page({
                     num: page.data.form.number,
                 },
                 success: function (res) {
+                  // console.log();
+                  if (res.code == 1){
                     wx.showToast({
-                        title: res.msg,
+                      title: res.msg,
+                      image: "/images/icon-warning.png",
                         duration: 1500
                     });
+                  }else{
+                    wx.showToast({
+                      title: res.msg,
+                      duration: 1500
+                    });
+                  }
                     page.getGoods();
                     wx.hideLoading();
                     page.setData({