From f449806e8367392694214ba19270a3623272dbcb Mon Sep 17 00:00:00 2001 From: taiwan Date: Wed, 30 Mar 2022 17:11:38 +0800 Subject: [PATCH] 服务卡、幸运购、商品详情、购物车超出提示修改为toast方式 --- packageA/pages/goodsInfo/goodsInfo.js | 69 +++++++++++++++++++++++++++++++++++++++------------------------------ packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 82 ++++++++++++++++++++++++++++++++++++++++++++-------------------------------------- pages/cart/cart/cart.js | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------- pages/goods/goodsInfo/goodsInfo.js | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- 4 files changed, 244 insertions(+), 206 deletions(-) diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index 328caf6..07c43dc 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -874,9 +874,10 @@ Page({ th.setData({ prom_r_null: 1, }); - wx.showModal({ - title: '超出活动库存', - }); + // wx.showModal({ + // title: '超出活动库存', + // }); + getApp().my_warnning('超出活动库存', 0, self); return false; } else { // 可购买数量>0 @@ -899,9 +900,10 @@ Page({ if(canBuyNum > res) { if(curNum > res) { // t当前增减的数量 - wx.showModal({ - title: '超出活动库存', - }); + // wx.showModal({ + // title: '超出活动库存', + // }); + getApp().my_warnning('超出活动库存', 0, self); th.setData({ goodsInputNum: res, }); @@ -911,9 +913,10 @@ Page({ if(canBuyNum <= res) { if(curNum > canBuyNum) { - wx.showModal({ - title: '超出限购数量', - }); + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); th.setData({ goodsInputNum: canBuyNum, }); @@ -1017,9 +1020,10 @@ Page({ // 秒杀购物车购买 修正数量 var snum = limitNum - boughtNum; if (snum <= 0) { - wx.showModal({ - title: '超出限购数量', - }); + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); return false; } @@ -1062,9 +1066,10 @@ Page({ if (th.data.prom_type == 1 && !th.data.is_normal) { var snum = limitNum - boughtNum; if (snum <= 0) { - wx.showModal({ - title: '超出限购数量', - }); + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); return false; } if (totalNum >= redisNums){ @@ -1191,7 +1196,7 @@ Page({ // 否则,进一步判断是否超出限购或超出库存 await this.getactLen().then(async function(res) { // res: redis可购买数量 - console.log('当前可以购买的数量:', res); + // console.log('当前可以购买的数量:', res); if(res <= 0) { // 可购买数量<=0, 设置和显示已抢光 th.setData({ @@ -1216,9 +1221,10 @@ Page({ if(limited > res) { if(t > res) { // t当前增减的数量 - wx.showModal({ - title: '超出活动库存', - }); + // wx.showModal({ + // title: '超出活动库存', + // }); + getApp().my_warnning('超出活动库存', 0, self); th.setData({ goodsInputNum: res, }); @@ -1228,9 +1234,10 @@ Page({ if(limited <= res) { if(t>canBuyNum) { - wx.showModal({ - title: '超出限购数量', - }); + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); th.setData({ goodsInputNum: canBuyNum, }); @@ -3730,20 +3737,22 @@ Page({ //---判断商品是否超出限购--- if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { - wx.showModal({ - title: '提示', - content: '超出活动限购数量' - }); + // wx.showModal({ + // title: '提示', + // content: '超出活动限购数量' + // }); + getApp().my_warnning('超出活动限购数量', 0, self); return false; } } //---判断商品是否超出活动限购--- if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) { if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '提示', - content: '超出活动限购数量' - }); + // wx.showModal({ + // title: '提示', + // content: '超出活动限购数量' + // }); + getApp().my_warnning('超出活动限购数量', 0, self); return false; } } diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index b39f883..585a295 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -1315,20 +1315,22 @@ Page({ //---判断商品是否超出限购--- if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { - wx.showModal({ - title: '提示', - content: '超出商品限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品限购' + // }); + getApp().my_warnning('超出商品限购', 0, th); return false; } } //---判断商品是否超出活动限购--- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '提示', - content: '超出商品活动限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品活动限购' + // }); + getApp().my_warnning('超出商品活动限购', 0, th); return false; } } @@ -1417,20 +1419,22 @@ Page({ //---判断商品是否超出限购--- if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { - wx.showModal({ - title: '提示', - content: '超出商品限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品限购' + // }); + getApp().my_warnning('超出商品限购', 0, th); return false; } } //---判断商品是否超出活动限购--- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '提示', - content: '超出商品活动限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品活动限购' + // }); + getApp().my_warnning('超出商品活动限购', 0, th); return false; } } @@ -1877,10 +1881,10 @@ Page({ var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); if (t + gd_buy_num > th.data.sele_g.viplimited) { - wx.showModal({ - title: '超出商品限购', - }); - + // wx.showModal({ + // title: '超出商品限购', + // }); + getApp().my_warnning('超出商品限购', 0, th); var num = th.data.sele_g.viplimited - gd_buy_num; if (num < 0) num = 0; th.setData({ goodsInputNum: num }) @@ -1891,10 +1895,10 @@ Page({ //--判断商品是否超出活动限购-- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) { if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '超出商品活动限购', - }); - + // wx.showModal({ + // title: '超出商品活动限购', + // }); + getApp().my_warnning('超出商品活动限购', 0, th); var num = th.data.prom_buy_limit - th.data.prom_buy_num; if (num < 0) num = 0; th.setData({ goodsInputNum: num }) @@ -1913,9 +1917,10 @@ Page({ }); if (t > redis_num) { - wx.showModal({ - title: '超出商品活动库存', - }); + // wx.showModal({ + // title: '超出商品活动库存', + // }); + getApp().my_warnning('超出商品活动库存', 0, th); th.setData({ goodsInputNum: redis_num }) return false; } @@ -1955,10 +1960,10 @@ Page({ var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); if (t + gd_buy_num > th.data.sele_g.viplimited) { - wx.showModal({ - title: '超出商品限购', - }); - + // wx.showModal({ + // title: '超出商品限购', + // }); + getApp().my_warnning('超出商品限购', 0, th); var num = th.data.sele_g.viplimited - gd_buy_num; if (num < 0) num = 0; th.setData({ goodsInputNum: num }) @@ -1969,10 +1974,10 @@ Page({ //--判断商品是否超出活动限购-- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '超出商品活动限购', - }); - + // wx.showModal({ + // title: '超出商品活动限购', + // }); + getApp().my_warnning('超出商品活动限购', 0, th); var num = th.data.prom_buy_limit - th.data.prom_buy_num; if (num < 0) num = 0; th.setData({ goodsInputNum: num }) @@ -1991,9 +1996,10 @@ Page({ }); if (t > redis_num) { - wx.showModal({ - title: '超出商品活动库存', - }); + // wx.showModal({ + // title: '超出商品活动库存', + // }); + getApp().my_warnning('超出商品活动库存', 0, th); th.setData({ goodsInputNum: redis_num }) return false; } diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index ecbf7aa..71546a4 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -1026,10 +1026,11 @@ Page({ // title: '提示', // content: '购买的数量不能超出库存数量', // }); - wx.showToast({ - title: '购买的数量不能超出库存数量', - icon: 'none', - }); + // wx.showToast({ + // title: '购买的数量不能超出库存数量', + // icon: 'none', + // }); + getApp().my_warnning('购买的数量不能超出库存数量', 0, this); this.data.up_dating = 0; } }, @@ -1723,11 +1724,11 @@ Page({ th.check_down_line(t, pitem, item, wareIds); } else { if (t.goods_num > store_count) { - wx.showToast({ - title: '购买数量超出商品库存', - icon: 'none', - // content: '购买数量超出商品库存' - }); + // wx.showToast({ + // title: '购买数量超出商品库存', + // icon: 'none', + // }); + getApp().my_warnning('购买数量超出商品库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: store_count @@ -1784,10 +1785,11 @@ Page({ // 判断当前预购买的数量是否超过可购买的数量 if (buyed_mum2 > (limit - goodsbuynum) && limit > 0) { - wx.showToast({ - title: '购买数量超出商品限购', - icon: 'none', - }); + // wx.showToast({ + // title: '购买数量超出商品限购', + // icon: 'none', + // }); + getApp().my_warnning('购买数量超出商品限购', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; //--> by ty @@ -1820,11 +1822,12 @@ Page({ // title: '提示', // content: '购买数量超出商品库存' // }); - wx.showToast({ - title: '购买数量超出商品库存', - icon: 'none', - // content: '购买数量超出商品库存' - }); + // wx.showToast({ + // title: '购买数量超出商品库存', + // icon: 'none', + // // content: '购买数量超出商品库存' + // }); + getApp().my_warnning('购买数量超出商品库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: store_count @@ -1844,11 +1847,11 @@ Page({ // title: '提示', // content: '购买数量超出活动库存' // }); - wx.showToast({ - title: '购买数量超出活动库存', - icon: 'none', - // content: '购买数量超出活动库存' - }); + // wx.showToast({ + // title: '购买数量超出活动库存', + // icon: 'none', + // }); + getApp().my_warnning('购买数量超出活动库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: false_data.goods_num - false_data.buy_num @@ -1867,11 +1870,12 @@ Page({ // title: '提示', // content: '购买数量超出商品库存' // }); - wx.showToast({ - title: '购买数量超出商品库存', - icon: 'none', - // content: '购买数量超出商品库存' - }); + // wx.showToast({ + // title: '购买数量超出商品库存', + // icon: 'none', + // // content: '购买数量超出商品库存' + // }); + getApp().my_warnning('购买数量超出商品库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: false_data.redisnum @@ -1889,11 +1893,12 @@ Page({ // title: '提示', // content: '购买数量超出秒杀限购' // }); - wx.showToast({ - title: '购买数量超出秒杀限购', - icon: 'none', - // content: '购买数量超出秒杀限购' - }); + // wx.showToast({ + // title: '购买数量超出秒杀限购', + // icon: 'none', + // // content: '购买数量超出秒杀限购' + // }); + getApp().my_warnning('购买数量超出秒杀限购', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: false_data.buy_limit @@ -1919,11 +1924,12 @@ Page({ // title: '提示', // content: '购买数量超出商品库存' // }); - wx.showToast({ - title: '购买数量超出商品库存', - icon: 'none', - // content: '购买数量超出商品库存' - }); + // wx.showToast({ + // title: '购买数量超出商品库存', + // icon: 'none', + // // content: '购买数量超出商品库存' + // }); + getApp().my_warnning('购买数量超出商品库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: store_count @@ -1943,11 +1949,12 @@ Page({ // title: '提示', // content: '购买数量超出活动库存' // }); - wx.showToast({ - title: '购买数量超出活动库存', - icon: 'none', - // content: '购买数量超出活动库存' - }); + // wx.showToast({ + // title: '购买数量超出活动库存', + // icon: 'none', + // // content: '购买数量超出活动库存' + // }); + getApp().my_warnning('购买数量超出活动库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: gr_data.goods_num - gr_data.buy_num @@ -1966,11 +1973,12 @@ Page({ // title: '提示', // content: '购买数量超出商品库存' // }); - wx.showToast({ - title: '购买数量超出商品库存', - icon: 'none', - // content: '购买数量超出商品库存' - }); + // wx.showToast({ + // title: '购买数量超出商品库存', + // icon: 'none', + // // content: '购买数量超出商品库存' + // }); + getApp().my_warnning('购买数量超出商品库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: gr_data.redisnum @@ -1988,11 +1996,12 @@ Page({ // title: '提示', // content: '购买数量超出团购限购' // }); - wx.showToast({ - title: '购买数量超出团购限购', - icon: 'none', - // content: '购买数量超出团购限购' - }); + // wx.showToast({ + // title: '购买数量超出团购限购', + // icon: 'none', + // // content: '购买数量超出团购限购' + // }); + getApp().my_warnning('购买数量超出团购限购', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; e.setData({ [txt]: gr_data.buy_limit @@ -2068,10 +2077,11 @@ Page({ // 检测库存 if(redis_num == 0) { - wx.showToast({ - title: '超出活动库存', - icon: 'none', - }); + // wx.showToast({ + // title: '超出活动库存', + // icon: 'none', + // }); + getApp().my_warnning('超出活动库存', 0, th); th.setData({[txt]: redis_num}); t.goods_num = redis_num; await th.doCheckAll(); @@ -2108,10 +2118,11 @@ Page({ let num = buylimit - gd_buy_num; if(totalNum > redis_num) { - wx.showToast({ - title: '超出活动库存', - icon: 'none', - }); + // wx.showToast({ + // title: '超出活动库存', + // icon: 'none', + // }); + getApp().my_warnning('超出活动库存', 0, th); // 开启限购 if (buylimit > 0) { if (num > redis_num) { @@ -2142,10 +2153,11 @@ Page({ // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量” if(totalNum > num) { // 计算还可以购买的数量:库存量 - 已购数 - wx.showToast({ - title: '超出活动限购', - icon: 'none', - }); + // wx.showToast({ + // title: '超出活动限购', + // icon: 'none', + // }); + getApp().my_warnning('超出活动限购', 0, th); if (num <= 0) num = 1; th.setData({[txt]: num - cartGoodsNum}); t.goods_num = num - cartGoodsNum; @@ -2185,19 +2197,21 @@ Page({ // 检测库存 if(redis_num == 0) { - wx.showToast({ - title: '超出活动库存', - icon: 'none', - }); + // wx.showToast({ + // title: '超出活动库存', + // icon: 'none', + // }); + getApp().my_warnning('超出活动库存', 0, th); th.setData({[txt]: redis_num}); return false; }; if(t.goods_num > redis_num) { - wx.showToast({ - title: '超出活动库存', - icon: 'none', - }); + // wx.showToast({ + // title: '超出活动库存', + // icon: 'none', + // }); + getApp().my_warnning('超出活动库存', 0, th); th.setData({[txt]: redis_num}); return false; }; @@ -2237,10 +2251,11 @@ Page({ // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量” if(t.goods_num + gd_buy_num > buylimit) { // 计算还可以购买的数量:库存量 - 已购数 - wx.showToast({ - title: '超出活动限购', - icon: 'none', - }); + // wx.showToast({ + // title: '超出活动限购', + // icon: 'none', + // }); + getApp().my_warnning('超出活动限购', 0, th); th.setData({[txt]: buylimit}); }; @@ -2271,11 +2286,12 @@ Page({ // title: '提示', // content: '购买数量超出商品库存' // }); - wx.showToast({ - title: '购买数量超出商品库存', - icon: 'none', - // content: '购买数量超出商品库存' - }); + // wx.showToast({ + // title: '购买数量超出商品库存', + // icon: 'none', + // // content: '购买数量超出商品库存' + // }); + getApp().my_warnning('购买数量超出商品库存', 0, th); var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; th.setData({ [txt]: ob.CanOutQty diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 8995d14..c0e5f0e 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -1193,20 +1193,22 @@ Page({ //---判断商品是否超出限购--- if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { - wx.showModal({ - title: '提示', - content: '超出商品限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品限购' + // }); + s.my_warnning('超出商品限购', 0, th); return false; } } //---判断商品是否超出活动限购--- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '提示', - content: '超出商品活动限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品活动限购' + // }); + s.my_warnning('超出商品活动限购', 0, th); return false; } } @@ -1298,20 +1300,22 @@ Page({ //---判断商品是否超出限购--- if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { - wx.showModal({ - title: '提示', - content: '超出商品限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品限购' + // }); + s.my_warnning('超出商品限购', 0, th); return false; } } //---判断商品是否超出活动限购--- if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) { if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '提示', - content: '超出商品活动限购' - }); + // wx.showModal({ + // title: '提示', + // content: '超出商品活动限购' + // }); + s.my_warnning('超出商品活动限购', 0, th); return false; } } @@ -1864,10 +1868,10 @@ Page({ var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); if (t + gd_buy_num > th.data.sele_g.viplimited) { - wx.showModal({ - title: '超出商品限购', - }); - + // wx.showModal({ + // title: '超出商品限购', + // }); + s.my_warnning('超出商品限购', 0, th); var num = th.data.sele_g.viplimited - gd_buy_num; if (num < 0) num = 0; th.setData({goodsInputNum: num}) @@ -1881,10 +1885,10 @@ Page({ //--判断商品是否超出活动限购-- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) { if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '超出商品活动限购', - }); - + // wx.showModal({ + // title: '超出商品活动限购', + // }); + s.my_warnning('超出商品活动限购', 0, th); var num = th.data.prom_buy_limit - th.data.prom_buy_num; if (num < 0) num = 0; th.setData({goodsInputNum: num}) @@ -1903,9 +1907,10 @@ Page({ }); if (t > redis_num) { - wx.showModal({ - title: '超出商品活动库存', - }); + // wx.showModal({ + // title: '超出商品活动库存', + // }); + s.my_warnning('超出商品活动库存', 0, th); th.setData({goodsInputNum: redis_num}) return false; } @@ -1946,10 +1951,10 @@ Page({ var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); if (t + gd_buy_num > th.data.sele_g.viplimited) { - wx.showModal({ - title: '超出商品限购', - }); - + // wx.showModal({ + // title: '超出商品限购', + // }); + s.my_warnning('超出商品限购', 0, th); var num = th.data.sele_g.viplimited - gd_buy_num; if (num < 0) num = 0; th.setData({goodsInputNum: num}) @@ -1960,10 +1965,10 @@ Page({ //--判断商品是否超出活动限购-- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '超出商品活动限购', - }); - + // wx.showModal({ + // title: '超出商品活动限购', + // }); + s.my_warnning('超出商品活动限购', 0, th); var num = th.data.prom_buy_limit - th.data.prom_buy_num; if (num < 0) num = 0; th.setData({goodsInputNum: num}) @@ -1982,9 +1987,10 @@ Page({ }); if (t > redis_num) { - wx.showModal({ - title: '超出商品活动库存', - }); + // wx.showModal({ + // title: '超出商品活动库存', + // }); + s.my_warnning('超出商品活动库存', 0, th); th.setData({goodsInputNum: redis_num}) return false; } @@ -1995,9 +2001,10 @@ Page({ if (!th.data.is_normal && th.data.prom_type == 4) { var i_canbuy = th.data.prom_act.limitqty - th.data.prom_act.buy_num; if (t > i_canbuy) { - wx.showModal({ - title: '超出商品活动库存', - }); + // wx.showModal({ + // title: '超出商品活动库存', + // }); + s.my_warnning('超出商品活动库存', 0, th); return false; } } @@ -4153,11 +4160,11 @@ Page({ //---判断商品是否超出限购--- if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { - wx.showModal({ - title: '提示', - content: '超出商品限购' - }); - + // wx.showModal({ + // title: '提示', + // content: '超出商品限购' + // }); + s.my_warnning('超出商品限购', 0, th); var num = th.data.prom_buy_limit - th.data.prom_buy_num; if (num < 0) num = 0; th.setData({goodsInputNum: num}) @@ -4167,11 +4174,11 @@ Page({ //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '提示', - content: '超出商品活动限购' - }); - + // wx.showModal({ + // title: '提示', + // content: '超出商品活动限购' + // }); + s.my_warnning('超出商品活动限购', 0, th); var num = th.data.prom_buy_limit - th.data.prom_buy_num; if (num < 0) num = 0; th.setData({goodsInputNum: num}) @@ -4190,11 +4197,11 @@ Page({ }) if (th.data.goodsInputNum > redis_num) { - wx.showModal({ - title: '提示', - content: '超出商品活动库存' - }); - + // wx.showModal({ + // title: '提示', + // content: '超出商品活动库存' + // }); + s.my_warnning('超出商品活动库存', 0, th); th.setData({goodsInputNum: redis_num}) return false; -- libgit2 0.21.4