Commit adf335734978e118946b52157e01cde6cbdc1c34

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

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

pages/cart/cart/cart.js
... ... @@ -1031,11 +1031,11 @@ Page({
1031 1031 // title: '提示',
1032 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 1039 this.data.up_dating = 0;
1040 1040 }
1041 1041 },
... ... @@ -1729,11 +1729,11 @@ Page({
1729 1729 th.check_down_line(t, pitem, item, wareIds);
1730 1730 } else {
1731 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 1737 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1738 1738 e.setData({
1739 1739 [txt]: store_count
... ... @@ -1790,11 +1790,11 @@ Page({
1790 1790  
1791 1791 // 判断当前预购买的数量是否超过可购买的数量
1792 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 1798 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1799 1799  
1800 1800 //--> by ty
... ... @@ -1827,12 +1827,11 @@ Page({
1827 1827 // title: '提示',
1828 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 1835 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1837 1836 e.setData({
1838 1837 [txt]: store_count
... ... @@ -1852,11 +1851,11 @@ Page({
1852 1851 // title: '提示',
1853 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 1859 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1861 1860 e.setData({
1862 1861 [txt]: false_data.goods_num - false_data.buy_num
... ... @@ -1875,12 +1874,11 @@ Page({
1875 1874 // title: '提示',
1876 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 1882 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1885 1883 e.setData({
1886 1884 [txt]: false_data.redisnum
... ... @@ -1898,12 +1896,11 @@ Page({
1898 1896 // title: '提示',
1899 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 1904 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1908 1905 e.setData({
1909 1906 [txt]: false_data.buy_limit
... ... @@ -1929,12 +1926,11 @@ Page({
1929 1926 // title: '提示',
1930 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 1934 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1939 1935 e.setData({
1940 1936 [txt]: store_count
... ... @@ -1954,12 +1950,11 @@ Page({
1954 1950 // title: '提示',
1955 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 1958 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1964 1959 e.setData({
1965 1960 [txt]: gr_data.goods_num - gr_data.buy_num
... ... @@ -1978,12 +1973,11 @@ Page({
1978 1973 // title: '提示',
1979 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 1981 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
1988 1982 e.setData({
1989 1983 [txt]: gr_data.redisnum
... ... @@ -2001,12 +1995,11 @@ Page({
2001 1995 // title: '提示',
2002 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 2003 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
2011 2004 e.setData({
2012 2005 [txt]: gr_data.buy_limit
... ... @@ -2082,11 +2075,11 @@ Page({
2082 2075  
2083 2076 // 检测库存
2084 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 2083 th.setData({[txt]: redis_num});
2091 2084 t.goods_num = redis_num;
2092 2085 await th.doCheckAll();
... ... @@ -2123,11 +2116,11 @@ Page({
2123 2116 let num = buylimit - gd_buy_num;
2124 2117  
2125 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 2125 if (buylimit > 0) {
2133 2126 if (num > redis_num) {
... ... @@ -2158,11 +2151,11 @@ Page({
2158 2151 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
2159 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 2159 if (num <= 0) num = 1;
2167 2160 th.setData({[txt]: num - cartGoodsNum});
2168 2161 t.goods_num = num - cartGoodsNum;
... ... @@ -2202,21 +2195,21 @@ Page({
2202 2195  
2203 2196 // 检测库存
2204 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 2203 th.setData({[txt]: redis_num});
2211 2204 return false;
2212 2205 };
2213 2206  
2214 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 2213 th.setData({[txt]: redis_num});
2221 2214 return false;
2222 2215 };
... ... @@ -2256,11 +2249,11 @@ Page({
2256 2249 // 如果限购数量<=活动库存数量,增加数量时会先超过限购数量,此时应提示“超出活动限购数量”
2257 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 2257 th.setData({[txt]: buylimit});
2265 2258  
2266 2259 };
... ... @@ -2291,12 +2284,11 @@ Page({
2291 2284 // title: '提示',
2292 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 2292 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
2301 2293 th.setData({
2302 2294 [txt]: ob.CanOutQty
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -5968,9 +5968,9 @@ Page({
5968 5968 func();
5969 5969 return false;
5970 5970 }
5971   - let str = item.pickup_name + '库存不足!';
  5971 + // let str = item.pickup_name + '库存不足!';
5972 5972 wx.showToast({
5973   - title: str,
  5973 + title: item.pickup_name + '库存不足!',
5974 5974 icon: 'none',
5975 5975 });
5976 5976 // getApp().my_warnning(item.pickup_name + "库存不足!", 0, th);
... ...