Commit 8af6f7440091ecab65fa46d8c2f022e1d9e54e55
1 parent
e5e06030
预售的优化
Showing
4 changed files
with
28 additions
and
5 deletions
packageC/pages/presell/cart/cart2.js
@@ -408,6 +408,10 @@ Page({ | @@ -408,6 +408,10 @@ Page({ | ||
408 | 408 | ||
409 | t.data.data.original_img = oo.imghost + t.data.data.original_img; | 409 | t.data.data.original_img = oo.imghost + t.data.data.original_img; |
410 | t.data.data['buynum'] = th.data.gg.goods_num; | 410 | t.data.data['buynum'] = th.data.gg.goods_num; |
411 | + t.data.data.prom_id=th.data.gg.prom_id; | ||
412 | + t.data.data.prom_type=8; | ||
413 | + | ||
414 | + | ||
411 | var distr_t = 0, et = 0; | 415 | var distr_t = 0, et = 0; |
412 | 416 | ||
413 | if(t.data.data.is_minishop==1 && getApp().is_sp_hao()){ | 417 | if(t.data.data.is_minishop==1 && getApp().is_sp_hao()){ |
packageC/pages/presell/cart/cart2_pre.js
@@ -187,6 +187,8 @@ Page({ | @@ -187,6 +187,8 @@ Page({ | ||
187 | 187 | ||
188 | t.data.data.original_img = os.imghost + t.data.data.original_img; | 188 | t.data.data.original_img = os.imghost + t.data.data.original_img; |
189 | t.data.data['buynum'] = gg.goods_num; | 189 | t.data.data['buynum'] = gg.goods_num; |
190 | + t.data.data.prom_type=8; | ||
191 | + t.data.data.prom_id=gg.prom_id; | ||
190 | 192 | ||
191 | var distr_t = 0, et = 0; | 193 | var distr_t = 0, et = 0; |
192 | 194 |
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -702,6 +702,9 @@ Page({ | @@ -702,6 +702,9 @@ Page({ | ||
702 | title: t.data.data.goods_name, | 702 | title: t.data.data.goods_name, |
703 | }); | 703 | }); |
704 | 704 | ||
705 | + t.data.data.prom_id= th.data.presell_id; | ||
706 | + t.data.data.prom_type= 8; | ||
707 | + | ||
705 | //-- 把商品的赋值 -- | 708 | //-- 把商品的赋值 -- |
706 | ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); | 709 | ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); |
707 | ee.data.sele_g_id = t.data.data.goods_id; | 710 | ee.data.sele_g_id = t.data.data.goods_id; |
@@ -1082,7 +1085,7 @@ Page({ | @@ -1082,7 +1085,7 @@ Page({ | ||
1082 | newd.goods_price = th.data.prom_price; | 1085 | newd.goods_price = th.data.prom_price; |
1083 | newd.member_goods_price = th.data.prom_price, | 1086 | newd.member_goods_price = th.data.prom_price, |
1084 | newd.prom_type = 8; | 1087 | newd.prom_type = 8; |
1085 | - newd.prom_id = o.prom_id; | 1088 | + newd.prom_id = th.data.presell_id; |
1086 | 1089 | ||
1087 | if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | 1090 | if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); |
1088 | if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); | 1091 | if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); |
@@ -1665,11 +1668,11 @@ Page({ | @@ -1665,11 +1668,11 @@ Page({ | ||
1665 | is_on_sale: 1, | 1668 | is_on_sale: 1, |
1666 | pageSize: 500, | 1669 | pageSize: 500, |
1667 | orderField: 'gg_ordid,goods_spec,sort', | 1670 | orderField: 'gg_ordid,goods_spec,sort', |
1668 | - prom_type: 8, | 1671 | + //prom_type: 8, |
1669 | }; | 1672 | }; |
1670 | 1673 | ||
1671 | if (tt.data.presellForm && tt.data.presellForm.id) { | 1674 | if (tt.data.presellForm && tt.data.presellForm.id) { |
1672 | - rq_data.prom_id = tt.data.presellForm.id; | 1675 | + //rq_data.prom_id = tt.data.presellForm.id; |
1673 | } | 1676 | } |
1674 | 1677 | ||
1675 | await getApp().request.promiseGet("/api/weshop/goods/page", { | 1678 | await getApp().request.promiseGet("/api/weshop/goods/page", { |
@@ -4291,6 +4294,7 @@ Page({ | @@ -4291,6 +4294,7 @@ Page({ | ||
4291 | if (res.data.code == 0 && res.data.data) { | 4294 | if (res.data.code == 0 && res.data.data) { |
4292 | var arr = res.data.data; | 4295 | var arr = res.data.data; |
4293 | presell_id = arr.presell_id; | 4296 | presell_id = arr.presell_id; |
4297 | + th.data.presell_id=presell_id; | ||
4294 | th.setData({ | 4298 | th.setData({ |
4295 | presellList: arr, | 4299 | presellList: arr, |
4296 | }) | 4300 | }) |
@@ -4378,7 +4382,7 @@ Page({ | @@ -4378,7 +4382,7 @@ Page({ | ||
4378 | 4382 | ||
4379 | var userInfo = getApp().globalData.userInfo; | 4383 | var userInfo = getApp().globalData.userInfo; |
4380 | // timetype: 1, | 4384 | // timetype: 1, |
4381 | - var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1, prom_type: 8, prom_id: presell_id, pageSize: 1000 }; | 4385 | + var pre_data = { store_id: os.stoid, is_end: 0, isuse: 1,presell_id: presell_id, pageSize: 1000 }; |
4382 | if (userInfo) { | 4386 | if (userInfo) { |
4383 | pre_data.user_id = userInfo.user_id; | 4387 | pre_data.user_id = userInfo.user_id; |
4384 | } | 4388 | } |
pages/goods/goodsInfo/goodsInfo.js
@@ -7746,7 +7746,20 @@ Page({ | @@ -7746,7 +7746,20 @@ Page({ | ||
7746 | var prom_id = e.currentTarget.dataset.id; | 7746 | var prom_id = e.currentTarget.dataset.id; |
7747 | var prom_type = e.currentTarget.dataset.prom_type; | 7747 | var prom_type = e.currentTarget.dataset.prom_type; |
7748 | var goods_id = this.data.data.goods_id; | 7748 | var goods_id = this.data.data.goods_id; |
7749 | - var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + goods_id + "&prom_id=" + prom_id + "&prom_type="+prom_type; | 7749 | + var url = ""; |
7750 | + | ||
7751 | + switch (parseInt(prom_type)){ | ||
7752 | + case 1: | ||
7753 | + case 2: | ||
7754 | + case 4: | ||
7755 | + case 6: | ||
7756 | + url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + goods_id + "&prom_id=" + prom_id + "&prom_type="+prom_type; | ||
7757 | + break; | ||
7758 | + case 8: | ||
7759 | + url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + goods_id+ "&prom_id=" + prom_id; | ||
7760 | + } | ||
7761 | + | ||
7762 | + | ||
7750 | getApp().goto(url); | 7763 | getApp().goto(url); |
7751 | }, | 7764 | }, |
7752 | 7765 |