Commit adf335734978e118946b52157e01cde6cbdc1c34

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

商品详情页、购物车页限购提示修改

pages/cart/cart/cart.js
@@ -1031,11 +1031,11 @@ Page({ @@ -1031,11 +1031,11 @@ Page({
1031 // title: '提示', 1031 // title: '提示',
1032 // content: '购买的数量不能超出库存数量', 1032 // content: '购买的数量不能超出库存数量',
1033 // }); 1033 // });
1034 - // wx.showToast({  
1035 - // title: '购买的数量不能超出库存数量',  
1036 - // icon: 'none',  
1037 - // });  
1038 - getApp().my_warnning('购买的数量不能超出库存数量', 0, this); 1034 + wx.showToast({
  1035 + title: '购买的数量不能超出库存数量',
  1036 + icon: 'none',
  1037 + });
  1038 + // getApp().my_warnning('购买的数量不能超出库存数量', 0, this);
1039 this.data.up_dating = 0; 1039 this.data.up_dating = 0;
1040 } 1040 }
1041 }, 1041 },
@@ -1729,11 +1729,11 @@ Page({ @@ -1729,11 +1729,11 @@ Page({
1729 th.check_down_line(t, pitem, item, wareIds); 1729 th.check_down_line(t, pitem, item, wareIds);
1730 } else { 1730 } else {
1731 if (t.goods_num > store_count) { 1731 if (t.goods_num > store_count) {
1732 - // wx.showToast({  
1733 - // title: '购买数量超出商品库存',  
1734 - // icon: 'none',  
1735 - // });  
1736 - getApp().my_warnning('购买数量超出商品库存', 0, th); 1732 + wx.showToast({
  1733 + title: '购买数量超出商品库存',
  1734 + icon: 'none',
  1735 + });
  1736 + // getApp().my_warnning('购买数量超出商品库存', 0, th);
1737 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1737 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1738 e.setData({ 1738 e.setData({
1739 [txt]: store_count 1739 [txt]: store_count
@@ -1790,11 +1790,11 @@ Page({ @@ -1790,11 +1790,11 @@ Page({
1790 1790
1791 // 判断当前预购买的数量是否超过可购买的数量 1791 // 判断当前预购买的数量是否超过可购买的数量
1792 if (buyed_mum2 > (limit - goodsbuynum) && limit > 0) { 1792 if (buyed_mum2 > (limit - goodsbuynum) && limit > 0) {
1793 - // wx.showToast({  
1794 - // title: '购买数量超出商品限购',  
1795 - // icon: 'none',  
1796 - // });  
1797 - getApp().my_warnning('购买数量超出商品限购', 0, th); 1793 + wx.showToast({
  1794 + title: '购买数量超出商品限购',
  1795 + icon: 'none',
  1796 + });
  1797 + //getApp().my_warnning('购买数量超出商品限购', 0, th);
1798 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1798 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1799 1799
1800 //--> by ty 1800 //--> by ty
@@ -1827,12 +1827,11 @@ Page({ @@ -1827,12 +1827,11 @@ Page({
1827 // title: '提示', 1827 // title: '提示',
1828 // content: '购买数量超出商品库存' 1828 // content: '购买数量超出商品库存'
1829 // }); 1829 // });
1830 - // wx.showToast({  
1831 - // title: '购买数量超出商品库存',  
1832 - // icon: 'none',  
1833 - // // content: '购买数量超出商品库存'  
1834 - // });  
1835 - getApp().my_warnning('购买数量超出商品库存', 0, th); 1830 + wx.showToast({
  1831 + title: '购买数量超出商品库存',
  1832 + icon: 'none',
  1833 + });
  1834 + // getApp().my_warnning('购买数量超出商品库存', 0, th);
1836 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1835 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1837 e.setData({ 1836 e.setData({
1838 [txt]: store_count 1837 [txt]: store_count
@@ -1852,11 +1851,11 @@ Page({ @@ -1852,11 +1851,11 @@ Page({
1852 // title: '提示', 1851 // title: '提示',
1853 // content: '购买数量超出活动库存' 1852 // content: '购买数量超出活动库存'
1854 // }); 1853 // });
1855 - // wx.showToast({  
1856 - // title: '购买数量超出活动库存',  
1857 - // icon: 'none',  
1858 - // });  
1859 - getApp().my_warnning('购买数量超出活动库存', 0, th); 1854 + wx.showToast({
  1855 + title: '购买数量超出活动库存',
  1856 + icon: 'none',
  1857 + });
  1858 + // getApp().my_warnning('购买数量超出活动库存', 0, th);
1860 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1859 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1861 e.setData({ 1860 e.setData({
1862 [txt]: false_data.goods_num - false_data.buy_num 1861 [txt]: false_data.goods_num - false_data.buy_num
@@ -1875,12 +1874,11 @@ Page({ @@ -1875,12 +1874,11 @@ Page({
1875 // title: '提示', 1874 // title: '提示',
1876 // content: '购买数量超出商品库存' 1875 // content: '购买数量超出商品库存'
1877 // }); 1876 // });
1878 - // wx.showToast({  
1879 - // title: '购买数量超出商品库存',  
1880 - // icon: 'none',  
1881 - // // content: '购买数量超出商品库存'  
1882 - // });  
1883 - getApp().my_warnning('购买数量超出商品库存', 0, th); 1877 + wx.showToast({
  1878 + title: '购买数量超出商品库存',
  1879 + icon: 'none',
  1880 + });
  1881 + //getApp().my_warnning('购买数量超出商品库存', 0, th);
1884 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1882 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1885 e.setData({ 1883 e.setData({
1886 [txt]: false_data.redisnum 1884 [txt]: false_data.redisnum
@@ -1898,12 +1896,11 @@ Page({ @@ -1898,12 +1896,11 @@ Page({
1898 // title: '提示', 1896 // title: '提示',
1899 // content: '购买数量超出秒杀限购' 1897 // content: '购买数量超出秒杀限购'
1900 // }); 1898 // });
1901 - // wx.showToast({  
1902 - // title: '购买数量超出秒杀限购',  
1903 - // icon: 'none',  
1904 - // // content: '购买数量超出秒杀限购'  
1905 - // });  
1906 - getApp().my_warnning('购买数量超出秒杀限购', 0, th); 1899 + wx.showToast({
  1900 + title: '购买数量超出秒杀限购',
  1901 + icon: 'none',
  1902 + });
  1903 + // getApp().my_warnning('购买数量超出秒杀限购', 0, th);
1907 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1904 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1908 e.setData({ 1905 e.setData({
1909 [txt]: false_data.buy_limit 1906 [txt]: false_data.buy_limit
@@ -1929,12 +1926,11 @@ Page({ @@ -1929,12 +1926,11 @@ Page({
1929 // title: '提示', 1926 // title: '提示',
1930 // content: '购买数量超出商品库存' 1927 // content: '购买数量超出商品库存'
1931 // }); 1928 // });
1932 - // wx.showToast({  
1933 - // title: '购买数量超出商品库存',  
1934 - // icon: 'none',  
1935 - // // content: '购买数量超出商品库存'  
1936 - // });  
1937 - getApp().my_warnning('购买数量超出商品库存', 0, th); 1929 + wx.showToast({
  1930 + title: '购买数量超出商品库存',
  1931 + icon: 'none',
  1932 + });
  1933 + // getApp().my_warnning('购买数量超出商品库存', 0, th);
1938 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1934 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1939 e.setData({ 1935 e.setData({
1940 [txt]: store_count 1936 [txt]: store_count
@@ -1954,12 +1950,11 @@ Page({ @@ -1954,12 +1950,11 @@ Page({
1954 // title: '提示', 1950 // title: '提示',
1955 // content: '购买数量超出活动库存' 1951 // content: '购买数量超出活动库存'
1956 // }); 1952 // });
1957 - // wx.showToast({  
1958 - // title: '购买数量超出活动库存',  
1959 - // icon: 'none',  
1960 - // // content: '购买数量超出活动库存'  
1961 - // });  
1962 - getApp().my_warnning('购买数量超出活动库存', 0, th); 1953 + wx.showToast({
  1954 + title: '购买数量超出活动库存',
  1955 + icon: 'none',
  1956 + });
  1957 + // getApp().my_warnning('购买数量超出活动库存', 0, th);
1963 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1958 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1964 e.setData({ 1959 e.setData({
1965 [txt]: gr_data.goods_num - gr_data.buy_num 1960 [txt]: gr_data.goods_num - gr_data.buy_num
@@ -1978,12 +1973,11 @@ Page({ @@ -1978,12 +1973,11 @@ Page({
1978 // title: '提示', 1973 // title: '提示',
1979 // content: '购买数量超出商品库存' 1974 // content: '购买数量超出商品库存'
1980 // }); 1975 // });
1981 - // wx.showToast({  
1982 - // title: '购买数量超出商品库存',  
1983 - // icon: 'none',  
1984 - // // content: '购买数量超出商品库存'  
1985 - // });  
1986 - getApp().my_warnning('购买数量超出商品库存', 0, th); 1976 + wx.showToast({
  1977 + title: '购买数量超出商品库存',
  1978 + icon: 'none',
  1979 + });
  1980 + // getApp().my_warnning('购买数量超出商品库存', 0, th);
1987 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 1981 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1988 e.setData({ 1982 e.setData({
1989 [txt]: gr_data.redisnum 1983 [txt]: gr_data.redisnum
@@ -2001,12 +1995,11 @@ Page({ @@ -2001,12 +1995,11 @@ Page({
2001 // title: '提示', 1995 // title: '提示',
2002 // content: '购买数量超出团购限购' 1996 // content: '购买数量超出团购限购'
2003 // }); 1997 // });
2004 - // wx.showToast({  
2005 - // title: '购买数量超出团购限购',  
2006 - // icon: 'none',  
2007 - // // content: '购买数量超出团购限购'  
2008 - // });  
2009 - getApp().my_warnning('购买数量超出团购限购', 0, th); 1998 + wx.showToast({
  1999 + title: '购买数量超出团购限购',
  2000 + icon: 'none',
  2001 + });
  2002 + // getApp().my_warnning('购买数量超出团购限购', 0, th);
2010 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 2003 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
2011 e.setData({ 2004 e.setData({
2012 [txt]: gr_data.buy_limit 2005 [txt]: gr_data.buy_limit
@@ -2082,11 +2075,11 @@ Page({ @@ -2082,11 +2075,11 @@ Page({
2082 2075
2083 // 检测库存 2076 // 检测库存
2084 if(redis_num == 0) { 2077 if(redis_num == 0) {
2085 - // wx.showToast({  
2086 - // title: '超出活动库存',  
2087 - // icon: 'none',  
2088 - // });  
2089 - getApp().my_warnning('超出活动库存', 0, th); 2078 + wx.showToast({
  2079 + title: '超出活动库存',
  2080 + icon: 'none',
  2081 + });
  2082 + // getApp().my_warnning('超出活动库存', 0, th);
2090 th.setData({[txt]: redis_num}); 2083 th.setData({[txt]: redis_num});
2091 t.goods_num = redis_num; 2084 t.goods_num = redis_num;
2092 await th.doCheckAll(); 2085 await th.doCheckAll();
@@ -2123,11 +2116,11 @@ Page({ @@ -2123,11 +2116,11 @@ Page({
2123 let num = buylimit - gd_buy_num; 2116 let num = buylimit - gd_buy_num;
2124 2117
2125 if(totalNum > redis_num) { 2118 if(totalNum > redis_num) {
2126 - // wx.showToast({  
2127 - // title: '超出活动库存',  
2128 - // icon: 'none',  
2129 - // });  
2130 - getApp().my_warnning('超出活动库存', 0, th); 2119 + wx.showToast({
  2120 + title: '超出活动库存',
  2121 + icon: 'none',
  2122 + });
  2123 + // getApp().my_warnning('超出活动库存', 0, th);
2131 // 开启限购 2124 // 开启限购
2132 if (buylimit > 0) { 2125 if (buylimit > 0) {
2133 if (num > redis_num) { 2126 if (num > redis_num) {
@@ -2158,11 +2151,11 @@ Page({ @@ -2158,11 +2151,11 @@ Page({
2158 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量” 2151 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
2159 if(totalNum > num) { 2152 if(totalNum > num) {
2160 // 计算还可以购买的数量:库存量 - 已购数 2153 // 计算还可以购买的数量:库存量 - 已购数
2161 - // wx.showToast({  
2162 - // title: '超出活动限购',  
2163 - // icon: 'none',  
2164 - // });  
2165 - getApp().my_warnning('超出活动限购', 0, th); 2154 + wx.showToast({
  2155 + title: '超出活动限购',
  2156 + icon: 'none',
  2157 + });
  2158 + // getApp().my_warnning('超出活动限购', 0, th);
2166 if (num <= 0) num = 1; 2159 if (num <= 0) num = 1;
2167 th.setData({[txt]: num - cartGoodsNum}); 2160 th.setData({[txt]: num - cartGoodsNum});
2168 t.goods_num = num - cartGoodsNum; 2161 t.goods_num = num - cartGoodsNum;
@@ -2202,21 +2195,21 @@ Page({ @@ -2202,21 +2195,21 @@ Page({
2202 2195
2203 // 检测库存 2196 // 检测库存
2204 if(redis_num == 0) { 2197 if(redis_num == 0) {
2205 - // wx.showToast({  
2206 - // title: '超出活动库存',  
2207 - // icon: 'none',  
2208 - // });  
2209 - getApp().my_warnning('超出活动库存', 0, th); 2198 + wx.showToast({
  2199 + title: '超出活动库存',
  2200 + icon: 'none',
  2201 + });
  2202 + // getApp().my_warnning('超出活动库存', 0, th);
2210 th.setData({[txt]: redis_num}); 2203 th.setData({[txt]: redis_num});
2211 return false; 2204 return false;
2212 }; 2205 };
2213 2206
2214 if(t.goods_num > redis_num) { 2207 if(t.goods_num > redis_num) {
2215 - // wx.showToast({  
2216 - // title: '超出活动库存',  
2217 - // icon: 'none',  
2218 - // });  
2219 - getApp().my_warnning('超出活动库存', 0, th); 2208 + wx.showToast({
  2209 + title: '超出活动库存',
  2210 + icon: 'none',
  2211 + });
  2212 + // getApp().my_warnning('超出活动库存', 0, th);
2220 th.setData({[txt]: redis_num}); 2213 th.setData({[txt]: redis_num});
2221 return false; 2214 return false;
2222 }; 2215 };
@@ -2256,11 +2249,11 @@ Page({ @@ -2256,11 +2249,11 @@ Page({
2256 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量” 2249 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
2257 if(t.goods_num + gd_buy_num > buylimit) { 2250 if(t.goods_num + gd_buy_num > buylimit) {
2258 // 计算还可以购买的数量:库存量 - 已购数 2251 // 计算还可以购买的数量:库存量 - 已购数
2259 - // wx.showToast({  
2260 - // title: '超出活动限购',  
2261 - // icon: 'none',  
2262 - // });  
2263 - getApp().my_warnning('超出活动限购', 0, th); 2252 + wx.showToast({
  2253 + title: '超出活动限购',
  2254 + icon: 'none',
  2255 + });
  2256 + // getApp().my_warnning('超出活动限购', 0, th);
2264 th.setData({[txt]: buylimit}); 2257 th.setData({[txt]: buylimit});
2265 2258
2266 }; 2259 };
@@ -2291,12 +2284,11 @@ Page({ @@ -2291,12 +2284,11 @@ Page({
2291 // title: '提示', 2284 // title: '提示',
2292 // content: '购买数量超出商品库存' 2285 // content: '购买数量超出商品库存'
2293 // }); 2286 // });
2294 - // wx.showToast({  
2295 - // title: '购买数量超出商品库存',  
2296 - // icon: 'none',  
2297 - // // content: '购买数量超出商品库存'  
2298 - // });  
2299 - getApp().my_warnning('购买数量超出商品库存', 0, th); 2287 + wx.showToast({
  2288 + title: '购买数量超出商品库存',
  2289 + icon: 'none',
  2290 + });
  2291 + // getApp().my_warnning('购买数量超出商品库存', 0, th);
2300 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; 2292 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
2301 th.setData({ 2293 th.setData({
2302 [txt]: ob.CanOutQty 2294 [txt]: ob.CanOutQty
pages/goods/goodsInfo/goodsInfo.js
@@ -5968,9 +5968,9 @@ Page({ @@ -5968,9 +5968,9 @@ Page({
5968 func(); 5968 func();
5969 return false; 5969 return false;
5970 } 5970 }
5971 - let str = item.pickup_name + '库存不足!'; 5971 + // let str = item.pickup_name + '库存不足!';
5972 wx.showToast({ 5972 wx.showToast({
5973 - title: str, 5973 + title: item.pickup_name + '库存不足!',
5974 icon: 'none', 5974 icon: 'none',
5975 }); 5975 });
5976 // getApp().my_warnning(item.pickup_name + "库存不足!", 0, th); 5976 // getApp().my_warnning(item.pickup_name + "库存不足!", 0, th);