Commit 8b7088558b6749269e9cfad705e499dadf68e0d2

Authored by yvan.ni
1 parent 1df16535

商品详情页面的优化

pages/goods/goodsInfo/goodsInfo.js
@@ -1818,93 +1818,93 @@ Page({ @@ -1818,93 +1818,93 @@ Page({
1818 } 1818 }
1819 th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 1819 th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
1820 1820
1821 - } else if (o.prom_type == 7) {  
1822 -  
1823 - //判断进行中的活动,是不是要判断线下库存  
1824 - th.check_zh_acting(function (ee) {  
1825 - newd.prom_id = 0;  
1826 - newd.prom_type = 0;  
1827 - if (ee && th.data.sele_g.act) {  
1828 - newd.prom_id = th.data.sele_g.act.id;  
1829 - newd.prom_type = 7;  
1830 - if (o.store_count <= 0) {  
1831 - wx.hideLoading();  
1832 - th.data.adding=0;  
1833 - wx.showToast({  
1834 - title: '库存已为空!',  
1835 - icon: 'none',  
1836 - });  
1837 - return false;  
1838 - };  
1839 - if (o.store_count < e.data.goodsInputNum) {  
1840 - wx.hideLoading();  
1841 - th.data.adding=0;  
1842 - wx.showToast({  
1843 - title: '库存不足!',  
1844 - icon: 'none',  
1845 - });  
1846 - return false;  
1847 - //return s.my_warnning("库存不足!", 0, th);  
1848 - };  
1849 - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步  
1850 - return false;  
1851 - } else {  
1852 - //---如果是线下门店销售的时候---  
1853 - if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) {  
1854 - var pick = th.get_pick_from_list(th.data.sto_sele_id)  
1855 -  
1856 - th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) {  
1857 - if (CanOutQty) {  
1858 -  
1859 - if (CanOutQty < e.data.goodsInputNum) {  
1860 - wx.hideLoading();  
1861 - th.data.adding=0;  
1862 - wx.showToast({  
1863 - title: '库存不足!',  
1864 - icon: 'none',  
1865 - });  
1866 - return false;  
1867 - }  
1868 -  
1869 - th.add_cart_next(e, t, a, o, newd, CanOutQty);  
1870 - } else {  
1871 - wx.hideLoading();  
1872 - th.data.adding=0;  
1873 - wx.showToast({  
1874 - title: '库存不足!',  
1875 - icon: 'none',  
1876 - });  
1877 - return false;  
1878 - }  
1879 - })  
1880 -  
1881 - } else {  
1882 - if (o.store_count <= 0) {  
1883 - wx.hideLoading();  
1884 - th.data.adding=0;  
1885 - wx.showToast({  
1886 - title: '库存已为空!',  
1887 - icon: 'none',  
1888 - });  
1889 - return false;  
1890 - //return s.my_warnning("库存已为空!", 0, th);  
1891 - };  
1892 - if (o.store_count < e.data.goodsInputNum) {  
1893 - wx.hideLoading();  
1894 - th.data.adding=0;  
1895 - wx.showToast({  
1896 - title: '库存不足!',  
1897 - icon: 'none',  
1898 - });  
1899 - return false;  
1900 - //return s.my_warnning("库存不足!", 0, th);  
1901 - };  
1902 - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步  
1903 - }  
1904 - }  
1905 - })  
1906 } 1821 }
1907 - 1822 + // else if (o.prom_type == 7) {
  1823 + //
  1824 + // //判断进行中的活动,是不是要判断线下库存
  1825 + // th.check_zh_acting(function (ee) {
  1826 + // newd.prom_id = 0;
  1827 + // newd.prom_type = 0;
  1828 + // if (ee && th.data.sele_g.act) {
  1829 + // newd.prom_id = th.data.sele_g.act.id;
  1830 + // newd.prom_type = 7;
  1831 + // if (o.store_count <= 0) {
  1832 + // wx.hideLoading();
  1833 + // th.data.adding=0;
  1834 + // wx.showToast({
  1835 + // title: '库存已为空!',
  1836 + // icon: 'none',
  1837 + // });
  1838 + // return false;
  1839 + // };
  1840 + // if (o.store_count < e.data.goodsInputNum) {
  1841 + // wx.hideLoading();
  1842 + // th.data.adding=0;
  1843 + // wx.showToast({
  1844 + // title: '库存不足!',
  1845 + // icon: 'none',
  1846 + // });
  1847 + // return false;
  1848 + // //return s.my_warnning("库存不足!", 0, th);
  1849 + // };
  1850 + // th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  1851 + // return false;
  1852 + // } else {
  1853 + // //---如果是线下门店销售的时候---
  1854 + // if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) {
  1855 + // var pick = th.get_pick_from_list(th.data.sto_sele_id)
  1856 + //
  1857 + // th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) {
  1858 + // if (CanOutQty) {
  1859 + //
  1860 + // if (CanOutQty < e.data.goodsInputNum) {
  1861 + // wx.hideLoading();
  1862 + // th.data.adding=0;
  1863 + // wx.showToast({
  1864 + // title: '库存不足!',
  1865 + // icon: 'none',
  1866 + // });
  1867 + // return false;
  1868 + // }
  1869 + //
  1870 + // th.add_cart_next(e, t, a, o, newd, CanOutQty);
  1871 + // } else {
  1872 + // wx.hideLoading();
  1873 + // th.data.adding=0;
  1874 + // wx.showToast({
  1875 + // title: '库存不足!',
  1876 + // icon: 'none',
  1877 + // });
  1878 + // return false;
  1879 + // }
  1880 + // })
  1881 + //
  1882 + // } else {
  1883 + // if (o.store_count <= 0) {
  1884 + // wx.hideLoading();
  1885 + // th.data.adding=0;
  1886 + // wx.showToast({
  1887 + // title: '库存已为空!',
  1888 + // icon: 'none',
  1889 + // });
  1890 + // return false;
  1891 + // //return s.my_warnning("库存已为空!", 0, th);
  1892 + // };
  1893 + // if (o.store_count < e.data.goodsInputNum) {
  1894 + // wx.hideLoading();
  1895 + // th.data.adding=0;
  1896 + // wx.showToast({
  1897 + // title: '库存不足!',
  1898 + // icon: 'none',
  1899 + // });
  1900 + // return false;
  1901 + // //return s.my_warnning("库存不足!", 0, th);
  1902 + // };
  1903 + // th.add_cart_next(e, t, a, o, newd); //加入购物车下一步
  1904 + // }
  1905 + // }
  1906 + // })
  1907 + // }
1908 //要包含积分购的普通购买0 3,5,7,10, is_integral_normal积分普通购买字段 1908 //要包含积分购的普通购买0 3,5,7,10, is_integral_normal积分普通购买字段
1909 else if ([0, 3, 5, 7, 10].indexOf(th.data.prom_type) > -1 || newd.is_integral_normal) { 1909 else if ([0, 3, 5, 7, 10].indexOf(th.data.prom_type) > -1 || newd.is_integral_normal) {
1910 newd.prom_type = 0; 1910 newd.prom_type = 0;