Commit f449806e8367392694214ba19270a3623272dbcb

Authored by 后端研发-苏泰源
1 parent fb827e92

服务卡、幸运购、商品详情、购物车超出提示修改为toast方式

packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -874,9 +874,10 @@ Page({
874 874 th.setData({
875 875 prom_r_null: 1,
876 876 });
877   - wx.showModal({
878   - title: '超出活动库存',
879   - });
  877 + // wx.showModal({
  878 + // title: '超出活动库存',
  879 + // });
  880 + getApp().my_warnning('超出活动库存', 0, self);
880 881 return false;
881 882 } else {
882 883 // 可购买数量>0
... ... @@ -899,9 +900,10 @@ Page({
899 900  
900 901 if(canBuyNum > res) {
901 902 if(curNum > res) { // t当前增减的数量
902   - wx.showModal({
903   - title: '超出活动库存',
904   - });
  903 + // wx.showModal({
  904 + // title: '超出活动库存',
  905 + // });
  906 + getApp().my_warnning('超出活动库存', 0, self);
905 907 th.setData({
906 908 goodsInputNum: res,
907 909 });
... ... @@ -911,9 +913,10 @@ Page({
911 913  
912 914 if(canBuyNum <= res) {
913 915 if(curNum > canBuyNum) {
914   - wx.showModal({
915   - title: '超出限购数量',
916   - });
  916 + // wx.showModal({
  917 + // title: '超出限购数量',
  918 + // });
  919 + getApp().my_warnning('超出限购数量', 0, self);
917 920 th.setData({
918 921 goodsInputNum: canBuyNum,
919 922 });
... ... @@ -1017,9 +1020,10 @@ Page({
1017 1020 // 秒杀购物车购买 修正数量
1018 1021 var snum = limitNum - boughtNum;
1019 1022 if (snum <= 0) {
1020   - wx.showModal({
1021   - title: '超出限购数量',
1022   - });
  1023 + // wx.showModal({
  1024 + // title: '超出限购数量',
  1025 + // });
  1026 + getApp().my_warnning('超出限购数量', 0, self);
1023 1027 return false;
1024 1028 }
1025 1029  
... ... @@ -1062,9 +1066,10 @@ Page({
1062 1066 if (th.data.prom_type == 1 && !th.data.is_normal) {
1063 1067 var snum = limitNum - boughtNum;
1064 1068 if (snum <= 0) {
1065   - wx.showModal({
1066   - title: '超出限购数量',
1067   - });
  1069 + // wx.showModal({
  1070 + // title: '超出限购数量',
  1071 + // });
  1072 + getApp().my_warnning('超出限购数量', 0, self);
1068 1073 return false;
1069 1074 }
1070 1075 if (totalNum >= redisNums){
... ... @@ -1191,7 +1196,7 @@ Page({
1191 1196 // 否则,进一步判断是否超出限购或超出库存
1192 1197 await this.getactLen().then(async function(res) {
1193 1198 // res: redis可购买数量
1194   - console.log('当前可以购买的数量:', res);
  1199 + // console.log('当前可以购买的数量:', res);
1195 1200 if(res <= 0) {
1196 1201 // 可购买数量<=0, 设置和显示已抢光
1197 1202 th.setData({
... ... @@ -1216,9 +1221,10 @@ Page({
1216 1221  
1217 1222 if(limited > res) {
1218 1223 if(t > res) { // t当前增减的数量
1219   - wx.showModal({
1220   - title: '超出活动库存',
1221   - });
  1224 + // wx.showModal({
  1225 + // title: '超出活动库存',
  1226 + // });
  1227 + getApp().my_warnning('超出活动库存', 0, self);
1222 1228 th.setData({
1223 1229 goodsInputNum: res,
1224 1230 });
... ... @@ -1228,9 +1234,10 @@ Page({
1228 1234  
1229 1235 if(limited <= res) {
1230 1236 if(t>canBuyNum) {
1231   - wx.showModal({
1232   - title: '超出限购数量',
1233   - });
  1237 + // wx.showModal({
  1238 + // title: '超出限购数量',
  1239 + // });
  1240 + getApp().my_warnning('超出限购数量', 0, self);
1234 1241 th.setData({
1235 1242 goodsInputNum: canBuyNum,
1236 1243 });
... ... @@ -3730,20 +3737,22 @@ Page({
3730 3737 //---判断商品是否超出限购---
3731 3738 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
3732 3739 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
3733   - wx.showModal({
3734   - title: '提示',
3735   - content: '超出活动限购数量'
3736   - });
  3740 + // wx.showModal({
  3741 + // title: '提示',
  3742 + // content: '超出活动限购数量'
  3743 + // });
  3744 + getApp().my_warnning('超出活动限购数量', 0, self);
3737 3745 return false;
3738 3746 }
3739 3747 }
3740 3748 //---判断商品是否超出活动限购---
3741 3749 if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) {
3742 3750 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
3743   - wx.showModal({
3744   - title: '提示',
3745   - content: '超出活动限购数量'
3746   - });
  3751 + // wx.showModal({
  3752 + // title: '提示',
  3753 + // content: '超出活动限购数量'
  3754 + // });
  3755 + getApp().my_warnning('超出活动限购数量', 0, self);
3747 3756 return false;
3748 3757 }
3749 3758 }
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... ... @@ -1315,20 +1315,22 @@ Page({
1315 1315 //---判断商品是否超出限购---
1316 1316 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
1317 1317 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
1318   - wx.showModal({
1319   - title: '提示',
1320   - content: '超出商品限购'
1321   - });
  1318 + // wx.showModal({
  1319 + // title: '提示',
  1320 + // content: '超出商品限购'
  1321 + // });
  1322 + getApp().my_warnning('超出商品限购', 0, th);
1322 1323 return false;
1323 1324 }
1324 1325 }
1325 1326 //---判断商品是否超出活动限购---
1326 1327 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
1327 1328 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
1328   - wx.showModal({
1329   - title: '提示',
1330   - content: '超出商品活动限购'
1331   - });
  1329 + // wx.showModal({
  1330 + // title: '提示',
  1331 + // content: '超出商品活动限购'
  1332 + // });
  1333 + getApp().my_warnning('超出商品活动限购', 0, th);
1332 1334 return false;
1333 1335 }
1334 1336 }
... ... @@ -1417,20 +1419,22 @@ Page({
1417 1419 //---判断商品是否超出限购---
1418 1420 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
1419 1421 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
1420   - wx.showModal({
1421   - title: '提示',
1422   - content: '超出商品限购'
1423   - });
  1422 + // wx.showModal({
  1423 + // title: '提示',
  1424 + // content: '超出商品限购'
  1425 + // });
  1426 + getApp().my_warnning('超出商品限购', 0, th);
1424 1427 return false;
1425 1428 }
1426 1429 }
1427 1430 //---判断商品是否超出活动限购---
1428 1431 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
1429 1432 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
1430   - wx.showModal({
1431   - title: '提示',
1432   - content: '超出商品活动限购'
1433   - });
  1433 + // wx.showModal({
  1434 + // title: '提示',
  1435 + // content: '超出商品活动限购'
  1436 + // });
  1437 + getApp().my_warnning('超出商品活动限购', 0, th);
1434 1438 return false;
1435 1439 }
1436 1440 }
... ... @@ -1877,10 +1881,10 @@ Page({
1877 1881 var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id);
1878 1882  
1879 1883 if (t + gd_buy_num > th.data.sele_g.viplimited) {
1880   - wx.showModal({
1881   - title: '超出商品限购',
1882   - });
1883   -
  1884 + // wx.showModal({
  1885 + // title: '超出商品限购',
  1886 + // });
  1887 + getApp().my_warnning('超出商品限购', 0, th);
1884 1888 var num = th.data.sele_g.viplimited - gd_buy_num;
1885 1889 if (num < 0) num = 0;
1886 1890 th.setData({ goodsInputNum: num })
... ... @@ -1891,10 +1895,10 @@ Page({
1891 1895 //--判断商品是否超出活动限购--
1892 1896 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) {
1893 1897 if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
1894   - wx.showModal({
1895   - title: '超出商品活动限购',
1896   - });
1897   -
  1898 + // wx.showModal({
  1899 + // title: '超出商品活动限购',
  1900 + // });
  1901 + getApp().my_warnning('超出商品活动限购', 0, th);
1898 1902 var num = th.data.prom_buy_limit - th.data.prom_buy_num;
1899 1903 if (num < 0) num = 0;
1900 1904 th.setData({ goodsInputNum: num })
... ... @@ -1913,9 +1917,10 @@ Page({
1913 1917 });
1914 1918  
1915 1919 if (t > redis_num) {
1916   - wx.showModal({
1917   - title: '超出商品活动库存',
1918   - });
  1920 + // wx.showModal({
  1921 + // title: '超出商品活动库存',
  1922 + // });
  1923 + getApp().my_warnning('超出商品活动库存', 0, th);
1919 1924 th.setData({ goodsInputNum: redis_num })
1920 1925 return false;
1921 1926 }
... ... @@ -1955,10 +1960,10 @@ Page({
1955 1960 var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id);
1956 1961  
1957 1962 if (t + gd_buy_num > th.data.sele_g.viplimited) {
1958   - wx.showModal({
1959   - title: '超出商品限购',
1960   - });
1961   -
  1963 + // wx.showModal({
  1964 + // title: '超出商品限购',
  1965 + // });
  1966 + getApp().my_warnning('超出商品限购', 0, th);
1962 1967 var num = th.data.sele_g.viplimited - gd_buy_num;
1963 1968 if (num < 0) num = 0;
1964 1969 th.setData({ goodsInputNum: num })
... ... @@ -1969,10 +1974,10 @@ Page({
1969 1974 //--判断商品是否超出活动限购--
1970 1975 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
1971 1976 if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
1972   - wx.showModal({
1973   - title: '超出商品活动限购',
1974   - });
1975   -
  1977 + // wx.showModal({
  1978 + // title: '超出商品活动限购',
  1979 + // });
  1980 + getApp().my_warnning('超出商品活动限购', 0, th);
1976 1981 var num = th.data.prom_buy_limit - th.data.prom_buy_num;
1977 1982 if (num < 0) num = 0;
1978 1983 th.setData({ goodsInputNum: num })
... ... @@ -1991,9 +1996,10 @@ Page({
1991 1996 });
1992 1997  
1993 1998 if (t > redis_num) {
1994   - wx.showModal({
1995   - title: '超出商品活动库存',
1996   - });
  1999 + // wx.showModal({
  2000 + // title: '超出商品活动库存',
  2001 + // });
  2002 + getApp().my_warnning('超出商品活动库存', 0, th);
1997 2003 th.setData({ goodsInputNum: redis_num })
1998 2004 return false;
1999 2005 }
... ...
pages/cart/cart/cart.js
... ... @@ -1026,10 +1026,11 @@ Page({
1026 1026 // title: '提示',
1027 1027 // content: '购买的数量不能超出库存数量',
1028 1028 // });
1029   - wx.showToast({
1030   - title: '购买的数量不能超出库存数量',
1031   - icon: 'none',
1032   - });
  1029 + // wx.showToast({
  1030 + // title: '购买的数量不能超出库存数量',
  1031 + // icon: 'none',
  1032 + // });
  1033 + getApp().my_warnning('购买的数量不能超出库存数量', 0, this);
1033 1034 this.data.up_dating = 0;
1034 1035 }
1035 1036 },
... ... @@ -1723,11 +1724,11 @@ Page({
1723 1724 th.check_down_line(t, pitem, item, wareIds);
1724 1725 } else {
1725 1726 if (t.goods_num > store_count) {
1726   - wx.showToast({
1727   - title: '购买数量超出商品库存',
1728   - icon: 'none',
1729   - // content: '购买数量超出商品库存'
1730   - });
  1727 + // wx.showToast({
  1728 + // title: '购买数量超出商品库存',
  1729 + // icon: 'none',
  1730 + // });
  1731 + getApp().my_warnning('购买数量超出商品库存', 0, th);
1731 1732 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1732 1733 e.setData({
1733 1734 [txt]: store_count
... ... @@ -1784,10 +1785,11 @@ Page({
1784 1785  
1785 1786 // 判断当前预购买的数量是否超过可购买的数量
1786 1787 if (buyed_mum2 > (limit - goodsbuynum) && limit > 0) {
1787   - wx.showToast({
1788   - title: '购买数量超出商品限购',
1789   - icon: 'none',
1790   - });
  1788 + // wx.showToast({
  1789 + // title: '购买数量超出商品限购',
  1790 + // icon: 'none',
  1791 + // });
  1792 + getApp().my_warnning('购买数量超出商品限购', 0, th);
1791 1793 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1792 1794  
1793 1795 //--> by ty
... ... @@ -1820,11 +1822,12 @@ Page({
1820 1822 // title: '提示',
1821 1823 // content: '购买数量超出商品库存'
1822 1824 // });
1823   - wx.showToast({
1824   - title: '购买数量超出商品库存',
1825   - icon: 'none',
1826   - // content: '购买数量超出商品库存'
1827   - });
  1825 + // wx.showToast({
  1826 + // title: '购买数量超出商品库存',
  1827 + // icon: 'none',
  1828 + // // content: '购买数量超出商品库存'
  1829 + // });
  1830 + getApp().my_warnning('购买数量超出商品库存', 0, th);
1828 1831 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1829 1832 e.setData({
1830 1833 [txt]: store_count
... ... @@ -1844,11 +1847,11 @@ Page({
1844 1847 // title: '提示',
1845 1848 // content: '购买数量超出活动库存'
1846 1849 // });
1847   - wx.showToast({
1848   - title: '购买数量超出活动库存',
1849   - icon: 'none',
1850   - // content: '购买数量超出活动库存'
1851   - });
  1850 + // wx.showToast({
  1851 + // title: '购买数量超出活动库存',
  1852 + // icon: 'none',
  1853 + // });
  1854 + getApp().my_warnning('购买数量超出活动库存', 0, th);
1852 1855 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1853 1856 e.setData({
1854 1857 [txt]: false_data.goods_num - false_data.buy_num
... ... @@ -1867,11 +1870,12 @@ Page({
1867 1870 // title: '提示',
1868 1871 // content: '购买数量超出商品库存'
1869 1872 // });
1870   - wx.showToast({
1871   - title: '购买数量超出商品库存',
1872   - icon: 'none',
1873   - // content: '购买数量超出商品库存'
1874   - });
  1873 + // wx.showToast({
  1874 + // title: '购买数量超出商品库存',
  1875 + // icon: 'none',
  1876 + // // content: '购买数量超出商品库存'
  1877 + // });
  1878 + getApp().my_warnning('购买数量超出商品库存', 0, th);
1875 1879 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1876 1880 e.setData({
1877 1881 [txt]: false_data.redisnum
... ... @@ -1889,11 +1893,12 @@ Page({
1889 1893 // title: '提示',
1890 1894 // content: '购买数量超出秒杀限购'
1891 1895 // });
1892   - wx.showToast({
1893   - title: '购买数量超出秒杀限购',
1894   - icon: 'none',
1895   - // content: '购买数量超出秒杀限购'
1896   - });
  1896 + // wx.showToast({
  1897 + // title: '购买数量超出秒杀限购',
  1898 + // icon: 'none',
  1899 + // // content: '购买数量超出秒杀限购'
  1900 + // });
  1901 + getApp().my_warnning('购买数量超出秒杀限购', 0, th);
1897 1902 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1898 1903 e.setData({
1899 1904 [txt]: false_data.buy_limit
... ... @@ -1919,11 +1924,12 @@ Page({
1919 1924 // title: '提示',
1920 1925 // content: '购买数量超出商品库存'
1921 1926 // });
1922   - wx.showToast({
1923   - title: '购买数量超出商品库存',
1924   - icon: 'none',
1925   - // content: '购买数量超出商品库存'
1926   - });
  1927 + // wx.showToast({
  1928 + // title: '购买数量超出商品库存',
  1929 + // icon: 'none',
  1930 + // // content: '购买数量超出商品库存'
  1931 + // });
  1932 + getApp().my_warnning('购买数量超出商品库存', 0, th);
1927 1933 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1928 1934 e.setData({
1929 1935 [txt]: store_count
... ... @@ -1943,11 +1949,12 @@ Page({
1943 1949 // title: '提示',
1944 1950 // content: '购买数量超出活动库存'
1945 1951 // });
1946   - wx.showToast({
1947   - title: '购买数量超出活动库存',
1948   - icon: 'none',
1949   - // content: '购买数量超出活动库存'
1950   - });
  1952 + // wx.showToast({
  1953 + // title: '购买数量超出活动库存',
  1954 + // icon: 'none',
  1955 + // // content: '购买数量超出活动库存'
  1956 + // });
  1957 + getApp().my_warnning('购买数量超出活动库存', 0, th);
1951 1958 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1952 1959 e.setData({
1953 1960 [txt]: gr_data.goods_num - gr_data.buy_num
... ... @@ -1966,11 +1973,12 @@ Page({
1966 1973 // title: '提示',
1967 1974 // content: '购买数量超出商品库存'
1968 1975 // });
1969   - wx.showToast({
1970   - title: '购买数量超出商品库存',
1971   - icon: 'none',
1972   - // content: '购买数量超出商品库存'
1973   - });
  1976 + // wx.showToast({
  1977 + // title: '购买数量超出商品库存',
  1978 + // icon: 'none',
  1979 + // // content: '购买数量超出商品库存'
  1980 + // });
  1981 + getApp().my_warnning('购买数量超出商品库存', 0, th);
1974 1982 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1975 1983 e.setData({
1976 1984 [txt]: gr_data.redisnum
... ... @@ -1988,11 +1996,12 @@ Page({
1988 1996 // title: '提示',
1989 1997 // content: '购买数量超出团购限购'
1990 1998 // });
1991   - wx.showToast({
1992   - title: '购买数量超出团购限购',
1993   - icon: 'none',
1994   - // content: '购买数量超出团购限购'
1995   - });
  1999 + // wx.showToast({
  2000 + // title: '购买数量超出团购限购',
  2001 + // icon: 'none',
  2002 + // // content: '购买数量超出团购限购'
  2003 + // });
  2004 + getApp().my_warnning('购买数量超出团购限购', 0, th);
1996 2005 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1997 2006 e.setData({
1998 2007 [txt]: gr_data.buy_limit
... ... @@ -2068,10 +2077,11 @@ Page({
2068 2077  
2069 2078 // 检测库存
2070 2079 if(redis_num == 0) {
2071   - wx.showToast({
2072   - title: '超出活动库存',
2073   - icon: 'none',
2074   - });
  2080 + // wx.showToast({
  2081 + // title: '超出活动库存',
  2082 + // icon: 'none',
  2083 + // });
  2084 + getApp().my_warnning('超出活动库存', 0, th);
2075 2085 th.setData({[txt]: redis_num});
2076 2086 t.goods_num = redis_num;
2077 2087 await th.doCheckAll();
... ... @@ -2108,10 +2118,11 @@ Page({
2108 2118 let num = buylimit - gd_buy_num;
2109 2119  
2110 2120 if(totalNum > redis_num) {
2111   - wx.showToast({
2112   - title: '超出活动库存',
2113   - icon: 'none',
2114   - });
  2121 + // wx.showToast({
  2122 + // title: '超出活动库存',
  2123 + // icon: 'none',
  2124 + // });
  2125 + getApp().my_warnning('超出活动库存', 0, th);
2115 2126 // 开启限购
2116 2127 if (buylimit > 0) {
2117 2128 if (num > redis_num) {
... ... @@ -2142,10 +2153,11 @@ Page({
2142 2153 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
2143 2154 if(totalNum > num) {
2144 2155 // 计算还可以购买的数量:库存量 - 已购数
2145   - wx.showToast({
2146   - title: '超出活动限购',
2147   - icon: 'none',
2148   - });
  2156 + // wx.showToast({
  2157 + // title: '超出活动限购',
  2158 + // icon: 'none',
  2159 + // });
  2160 + getApp().my_warnning('超出活动限购', 0, th);
2149 2161 if (num <= 0) num = 1;
2150 2162 th.setData({[txt]: num - cartGoodsNum});
2151 2163 t.goods_num = num - cartGoodsNum;
... ... @@ -2185,19 +2197,21 @@ Page({
2185 2197  
2186 2198 // 检测库存
2187 2199 if(redis_num == 0) {
2188   - wx.showToast({
2189   - title: '超出活动库存',
2190   - icon: 'none',
2191   - });
  2200 + // wx.showToast({
  2201 + // title: '超出活动库存',
  2202 + // icon: 'none',
  2203 + // });
  2204 + getApp().my_warnning('超出活动库存', 0, th);
2192 2205 th.setData({[txt]: redis_num});
2193 2206 return false;
2194 2207 };
2195 2208  
2196 2209 if(t.goods_num > redis_num) {
2197   - wx.showToast({
2198   - title: '超出活动库存',
2199   - icon: 'none',
2200   - });
  2210 + // wx.showToast({
  2211 + // title: '超出活动库存',
  2212 + // icon: 'none',
  2213 + // });
  2214 + getApp().my_warnning('超出活动库存', 0, th);
2201 2215 th.setData({[txt]: redis_num});
2202 2216 return false;
2203 2217 };
... ... @@ -2237,10 +2251,11 @@ Page({
2237 2251 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
2238 2252 if(t.goods_num + gd_buy_num > buylimit) {
2239 2253 // 计算还可以购买的数量:库存量 - 已购数
2240   - wx.showToast({
2241   - title: '超出活动限购',
2242   - icon: 'none',
2243   - });
  2254 + // wx.showToast({
  2255 + // title: '超出活动限购',
  2256 + // icon: 'none',
  2257 + // });
  2258 + getApp().my_warnning('超出活动限购', 0, th);
2244 2259 th.setData({[txt]: buylimit});
2245 2260  
2246 2261 };
... ... @@ -2271,11 +2286,12 @@ Page({
2271 2286 // title: '提示',
2272 2287 // content: '购买数量超出商品库存'
2273 2288 // });
2274   - wx.showToast({
2275   - title: '购买数量超出商品库存',
2276   - icon: 'none',
2277   - // content: '购买数量超出商品库存'
2278   - });
  2289 + // wx.showToast({
  2290 + // title: '购买数量超出商品库存',
  2291 + // icon: 'none',
  2292 + // // content: '购买数量超出商品库存'
  2293 + // });
  2294 + getApp().my_warnning('购买数量超出商品库存', 0, th);
2279 2295 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
2280 2296 th.setData({
2281 2297 [txt]: ob.CanOutQty
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -1193,20 +1193,22 @@ Page({
1193 1193 //---判断商品是否超出限购---
1194 1194 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
1195 1195 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
1196   - wx.showModal({
1197   - title: '提示',
1198   - content: '超出商品限购'
1199   - });
  1196 + // wx.showModal({
  1197 + // title: '提示',
  1198 + // content: '超出商品限购'
  1199 + // });
  1200 + s.my_warnning('超出商品限购', 0, th);
1200 1201 return false;
1201 1202 }
1202 1203 }
1203 1204 //---判断商品是否超出活动限购---
1204 1205 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
1205 1206 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
1206   - wx.showModal({
1207   - title: '提示',
1208   - content: '超出商品活动限购'
1209   - });
  1207 + // wx.showModal({
  1208 + // title: '提示',
  1209 + // content: '超出商品活动限购'
  1210 + // });
  1211 + s.my_warnning('超出商品活动限购', 0, th);
1210 1212 return false;
1211 1213 }
1212 1214 }
... ... @@ -1298,20 +1300,22 @@ Page({
1298 1300 //---判断商品是否超出限购---
1299 1301 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
1300 1302 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
1301   - wx.showModal({
1302   - title: '提示',
1303   - content: '超出商品限购'
1304   - });
  1303 + // wx.showModal({
  1304 + // title: '提示',
  1305 + // content: '超出商品限购'
  1306 + // });
  1307 + s.my_warnning('超出商品限购', 0, th);
1305 1308 return false;
1306 1309 }
1307 1310 }
1308 1311 //---判断商品是否超出活动限购---
1309 1312 if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) {
1310 1313 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
1311   - wx.showModal({
1312   - title: '提示',
1313   - content: '超出商品活动限购'
1314   - });
  1314 + // wx.showModal({
  1315 + // title: '提示',
  1316 + // content: '超出商品活动限购'
  1317 + // });
  1318 + s.my_warnning('超出商品活动限购', 0, th);
1315 1319 return false;
1316 1320 }
1317 1321 }
... ... @@ -1864,10 +1868,10 @@ Page({
1864 1868 var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id);
1865 1869  
1866 1870 if (t + gd_buy_num > th.data.sele_g.viplimited) {
1867   - wx.showModal({
1868   - title: '超出商品限购',
1869   - });
1870   -
  1871 + // wx.showModal({
  1872 + // title: '超出商品限购',
  1873 + // });
  1874 + s.my_warnning('超出商品限购', 0, th);
1871 1875 var num = th.data.sele_g.viplimited - gd_buy_num;
1872 1876 if (num < 0) num = 0;
1873 1877 th.setData({goodsInputNum: num})
... ... @@ -1881,10 +1885,10 @@ Page({
1881 1885 //--判断商品是否超出活动限购--
1882 1886 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) {
1883 1887 if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
1884   - wx.showModal({
1885   - title: '超出商品活动限购',
1886   - });
1887   -
  1888 + // wx.showModal({
  1889 + // title: '超出商品活动限购',
  1890 + // });
  1891 + s.my_warnning('超出商品活动限购', 0, th);
1888 1892 var num = th.data.prom_buy_limit - th.data.prom_buy_num;
1889 1893 if (num < 0) num = 0;
1890 1894 th.setData({goodsInputNum: num})
... ... @@ -1903,9 +1907,10 @@ Page({
1903 1907 });
1904 1908  
1905 1909 if (t > redis_num) {
1906   - wx.showModal({
1907   - title: '超出商品活动库存',
1908   - });
  1910 + // wx.showModal({
  1911 + // title: '超出商品活动库存',
  1912 + // });
  1913 + s.my_warnning('超出商品活动库存', 0, th);
1909 1914 th.setData({goodsInputNum: redis_num})
1910 1915 return false;
1911 1916 }
... ... @@ -1946,10 +1951,10 @@ Page({
1946 1951 var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id);
1947 1952  
1948 1953 if (t + gd_buy_num > th.data.sele_g.viplimited) {
1949   - wx.showModal({
1950   - title: '超出商品限购',
1951   - });
1952   -
  1954 + // wx.showModal({
  1955 + // title: '超出商品限购',
  1956 + // });
  1957 + s.my_warnning('超出商品限购', 0, th);
1953 1958 var num = th.data.sele_g.viplimited - gd_buy_num;
1954 1959 if (num < 0) num = 0;
1955 1960 th.setData({goodsInputNum: num})
... ... @@ -1960,10 +1965,10 @@ Page({
1960 1965 //--判断商品是否超出活动限购--
1961 1966 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
1962 1967 if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
1963   - wx.showModal({
1964   - title: '超出商品活动限购',
1965   - });
1966   -
  1968 + // wx.showModal({
  1969 + // title: '超出商品活动限购',
  1970 + // });
  1971 + s.my_warnning('超出商品活动限购', 0, th);
1967 1972 var num = th.data.prom_buy_limit - th.data.prom_buy_num;
1968 1973 if (num < 0) num = 0;
1969 1974 th.setData({goodsInputNum: num})
... ... @@ -1982,9 +1987,10 @@ Page({
1982 1987 });
1983 1988  
1984 1989 if (t > redis_num) {
1985   - wx.showModal({
1986   - title: '超出商品活动库存',
1987   - });
  1990 + // wx.showModal({
  1991 + // title: '超出商品活动库存',
  1992 + // });
  1993 + s.my_warnning('超出商品活动库存', 0, th);
1988 1994 th.setData({goodsInputNum: redis_num})
1989 1995 return false;
1990 1996 }
... ... @@ -1995,9 +2001,10 @@ Page({
1995 2001 if (!th.data.is_normal && th.data.prom_type == 4) {
1996 2002 var i_canbuy = th.data.prom_act.limitqty - th.data.prom_act.buy_num;
1997 2003 if (t > i_canbuy) {
1998   - wx.showModal({
1999   - title: '超出商品活动库存',
2000   - });
  2004 + // wx.showModal({
  2005 + // title: '超出商品活动库存',
  2006 + // });
  2007 + s.my_warnning('超出商品活动库存', 0, th);
2001 2008 return false;
2002 2009 }
2003 2010 }
... ... @@ -4153,11 +4160,11 @@ Page({
4153 4160 //---判断商品是否超出限购---
4154 4161 if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
4155 4162 if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
4156   - wx.showModal({
4157   - title: '提示',
4158   - content: '超出商品限购'
4159   - });
4160   -
  4163 + // wx.showModal({
  4164 + // title: '提示',
  4165 + // content: '超出商品限购'
  4166 + // });
  4167 + s.my_warnning('超出商品限购', 0, th);
4161 4168 var num = th.data.prom_buy_limit - th.data.prom_buy_num;
4162 4169 if (num < 0) num = 0;
4163 4170 th.setData({goodsInputNum: num})
... ... @@ -4167,11 +4174,11 @@ Page({
4167 4174 //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---
4168 4175 if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) {
4169 4176 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
4170   - wx.showModal({
4171   - title: '提示',
4172   - content: '超出商品活动限购'
4173   - });
4174   -
  4177 + // wx.showModal({
  4178 + // title: '提示',
  4179 + // content: '超出商品活动限购'
  4180 + // });
  4181 + s.my_warnning('超出商品活动限购', 0, th);
4175 4182 var num = th.data.prom_buy_limit - th.data.prom_buy_num;
4176 4183 if (num < 0) num = 0;
4177 4184 th.setData({goodsInputNum: num})
... ... @@ -4190,11 +4197,11 @@ Page({
4190 4197 })
4191 4198  
4192 4199 if (th.data.goodsInputNum > redis_num) {
4193   - wx.showModal({
4194   - title: '提示',
4195   - content: '超出商品活动库存'
4196   - });
4197   -
  4200 + // wx.showModal({
  4201 + // title: '提示',
  4202 + // content: '超出商品活动库存'
  4203 + // });
  4204 + s.my_warnning('超出商品活动库存', 0, th);
4198 4205 th.setData({goodsInputNum: redis_num})
4199 4206  
4200 4207 return false;
... ...