Commit 6e76da51b2c55b6ddd3c20bd8a06e5e2d01d68cc
1 parent
dd20e2fe
1. 预售购买要带场景
2. 多赠品的优化
Showing
4 changed files
with
41 additions
and
9 deletions
packageC/pages/presell/cart/cart.js
| ... | ... | @@ -2057,6 +2057,9 @@ Page({ | 
| 2057 | 2057 | } | 
| 2058 | 2058 | dd.order_amount = parseFloat(th.data.order_m).toFixed(2); | 
| 2059 | 2059 | |
| 2060 | + if(getApp().globalData.scene) | |
| 2061 | + dd.scene=getApp().globalData.scene; | |
| 2062 | + | |
| 2060 | 2063 | console.log(JSON.stringify(dd)); | 
| 2061 | 2064 | wx.request({ | 
| 2062 | 2065 | url: oo.url + '/api/weshop/order/pay/payPresellWk', | ... | ... | 
packageC/pages/presell/goodsInfo/goodsInfo.js
| ... | ... | @@ -3957,7 +3957,7 @@ Page({ | 
| 3957 | 3957 | if (end_time < ut.gettimestamp()) { | 
| 3958 | 3958 | wx.showToast({title:err_txt, icon: 'none', duration: 3000}); | 
| 3959 | 3959 | setTimeout(function () { | 
| 3960 | - ut.wx_back(); | |
| 3960 | + getApp().goto("/pages/index/index/index"); | |
| 3961 | 3961 | }, 2000) | 
| 3962 | 3962 | gnext=0; | 
| 3963 | 3963 | return false; | ... | ... | 
pages/cart/cart2/cart2.wxml
| ... | ... | @@ -726,7 +726,7 @@ | 
| 726 | 726 | </view> | 
| 727 | 727 | <!-- top act_name --> | 
| 728 | 728 | <view class="flex gift_top_v ai_c fs30" style="padding-left: 70rpx"> | 
| 729 | - {{gf_pr_name}},可以获赠一下任意{{zp_num}}件商品 | |
| 729 | + {{gf_pr_name}},可任选{{zp_num}}件商品为赠品 | |
| 730 | 730 | </view> | 
| 731 | 731 | <!-- 赠品选择 --> | 
| 732 | 732 | <scroll-view scroll-y="{{true}}" style="height:calc(100% - 300rpx);"> | ... | ... | 
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -801,6 +801,12 @@ Page({ | 
| 801 | 801 | this.wait_for_store_config(); | 
| 802 | 802 | //先检验一下商品的活动情况 | 
| 803 | 803 | this.check_gd_prom_new(function () { | 
| 804 | + | |
| 805 | + if(ee.data.prom_type==8){ | |
| 806 | + getApp().goto("/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+ee.data.gid+"&prom_id="+ee.data.prom_id); | |
| 807 | + return false; | |
| 808 | + } | |
| 809 | + | |
| 804 | 810 | i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, { | 
| 805 | 811 | failRollback: !0, | 
| 806 | 812 | success: function (t) { | 
| ... | ... | @@ -839,6 +845,8 @@ Page({ | 
| 839 | 845 | }); | 
| 840 | 846 | } | 
| 841 | 847 | } | 
| 848 | + | |
| 849 | + | |
| 842 | 850 | //动态获取商品名称 | 
| 843 | 851 | wx.setNavigationBarTitle({ | 
| 844 | 852 | title: t.data.data.goods_name, | 
| ... | ... | @@ -1173,7 +1181,10 @@ Page({ | 
| 1173 | 1181 | if (num < th.data.goodsInputNum) { | 
| 1174 | 1182 | |
| 1175 | 1183 | // getApp().my_warnning("活动库存不足!", 0, th); | 
| 1176 | - wx.showToast({ title: '活动库存不足!', icon: 'none', }); | |
| 1184 | + wx.showToast({ | |
| 1185 | + title: '活动库存不足!', | |
| 1186 | + icon: 'none', | |
| 1187 | + }); | |
| 1177 | 1188 | return false; | 
| 1178 | 1189 | } else { | 
| 1179 | 1190 | th.add_cart_func(t); | 
| ... | ... | @@ -1205,7 +1216,10 @@ Page({ | 
| 1205 | 1216 | //---判断商品是否超出限购--- | 
| 1206 | 1217 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | 
| 1207 | 1218 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | 
| 1208 | - wx.showToast({ title: '超出商品限购', icon: 'none', }); | |
| 1219 | + wx.showToast({ | |
| 1220 | + title: '超出商品限购', | |
| 1221 | + icon: 'none', | |
| 1222 | + }); | |
| 1209 | 1223 | // s.my_warnning('超出商品限购', 0, th); | 
| 1210 | 1224 | return false; | 
| 1211 | 1225 | } | 
| ... | ... | @@ -1428,7 +1442,10 @@ Page({ | 
| 1428 | 1442 | if (res.data.data.pageData.length > 0) { | 
| 1429 | 1443 | var CanOutQty = res.data.data.pageData[0].CanOutQty; | 
| 1430 | 1444 | if (CanOutQty < e.data.goodsInputNum) { | 
| 1431 | - wx.showToast({ title: '库存不足!', icon: 'none', }); | |
| 1445 | + wx.showToast({ | |
| 1446 | + title: '库存不足!', | |
| 1447 | + icon: 'none', | |
| 1448 | + }); | |
| 1432 | 1449 | return false; | 
| 1433 | 1450 | // return s.my_warnning("库存不足!", 0, th); | 
| 1434 | 1451 | } | 
| ... | ... | @@ -2013,7 +2030,10 @@ Page({ | 
| 2013 | 2030 | var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); | 
| 2014 | 2031 | |
| 2015 | 2032 | if (t + gd_buy_num > th.data.sele_g.viplimited) { | 
| 2016 | - wx.showToast({ title: '超出商品限购', icon: 'none', }); | |
| 2033 | + wx.showToast({ | |
| 2034 | + title: '超出商品限购', | |
| 2035 | + icon: 'none', | |
| 2036 | + }); | |
| 2017 | 2037 | // s.my_warnning('超出商品限购', 0, th); | 
| 2018 | 2038 | var num = th.data.sele_g.viplimited - gd_buy_num; | 
| 2019 | 2039 | if (num < 0) num = 0; | 
| ... | ... | @@ -2104,7 +2124,10 @@ Page({ | 
| 2104 | 2124 | var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); | 
| 2105 | 2125 | |
| 2106 | 2126 | if (t + gd_buy_num > th.data.sele_g.viplimited) { | 
| 2107 | - wx.showToast({ title: '超出商品限购', icon: 'none', }); | |
| 2127 | + wx.showToast({ | |
| 2128 | + title: '超出商品限购', | |
| 2129 | + icon: 'none', | |
| 2130 | + }); | |
| 2108 | 2131 | // s.my_warnning('超出商品限购', 0, th); | 
| 2109 | 2132 | var num = th.data.sele_g.viplimited - gd_buy_num; | 
| 2110 | 2133 | if (num < 0) num = 0; | 
| ... | ... | @@ -4321,7 +4344,10 @@ Page({ | 
| 4321 | 4344 | th = e, | 
| 4322 | 4345 | o = this.data.sele_g; | 
| 4323 | 4346 | if (o.store_count <= 0) { | 
| 4324 | - wx.showToast({ title: '库存已为空!', icon: 'none', }); | |
| 4347 | + wx.showToast({ | |
| 4348 | + title: '库存已为空!', | |
| 4349 | + icon: 'none', | |
| 4350 | + }); | |
| 4325 | 4351 | return false; | 
| 4326 | 4352 | // return s.my_warnning("库存已为空!", 0, th); | 
| 4327 | 4353 | }; | 
| ... | ... | @@ -5768,7 +5794,10 @@ Page({ | 
| 5768 | 5794 | |
| 5769 | 5795 | if (!th.data.only_pk && !th.data.def_pickpu_list) { | 
| 5770 | 5796 | // getApp().confirmBox("门店库存不足", null, 25000, !1); | 
| 5771 | - wx.showToast({ title: '门店库存不足', icon: 'none', }); | |
| 5797 | + wx.showToast({ | |
| 5798 | + title: '门店库存不足', | |
| 5799 | + icon: 'none', | |
| 5800 | + }); | |
| 5772 | 5801 | return false; | 
| 5773 | 5802 | } | 
| 5774 | 5803 | ... | ... | 
