Commit e76dc5d7cbc148119667b6e4fb2fd42313ac056b
1 parent
7a696005
优惠活动次数限制oa单
Showing
6 changed files
with
236 additions
and
89 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -753,12 +753,28 @@ Page({ |
753 | 753 | item1.is_post_temp=res.data.data.is_post_temp; |
754 | 754 | } |
755 | 755 | }) |
756 | - } | |
757 | - | |
756 | + } | |
757 | + | |
758 | 758 | //要把优惠活动加入,prom_goods_map中,赠品不要运算,代发商品不算优惠 |
759 | 759 | if (item1.prom_type == 3 && item1.is_gift != 1 && !item1.whsle_id) { |
760 | - // th.check_is_youhui(item1.goods_id, item1.pick_id); | |
761 | - await th.add_prom_goods_map(item1); | |
760 | + // th.check_is_youhui(item1.goods_id, item1.pick_id); | |
761 | + //增加优惠活动次数限制 | |
762 | + let limit_num= await th.getprom(item1.prom_id) //活动限制次数 | |
763 | + | |
764 | + if(!limit_num){ | |
765 | + await th.add_prom_goods_map(item1); | |
766 | + item1.prom_id='' | |
767 | + item1.prom_type='' | |
768 | + }else{ | |
769 | + let user_pre_buynum = await th.getUserBuyPromNum_pre(item1.prom_id) //用户已经参与次数 | |
770 | + | |
771 | + if(user_pre_buynum<limit_num){ | |
772 | + await th.add_prom_goods_map(item1); | |
773 | + }else{ | |
774 | + item1.prom_id='' | |
775 | + item1.prom_type='' | |
776 | + } | |
777 | + } | |
762 | 778 | } |
763 | 779 | |
764 | 780 | //要把组合购的东西拿出来算一下 |
... | ... | @@ -5529,50 +5545,93 @@ Page({ |
5529 | 5545 | return !check; |
5530 | 5546 | }, |
5531 | 5547 | //立即购买获取优惠活动的内容 |
5532 | - buy_now_prom_goods: function (prom_id, arr, func) { | |
5548 | + buy_now_prom_goods: async function (prom_id, arr, func) { | |
5533 | 5549 | var th = this; |
5534 | 5550 | var price = arr.shop_price * arr.goods_num; |
5535 | 5551 | var prom = null; |
5536 | 5552 | var gg = to.get_b_now(); |
5537 | - getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + prom_id, {}).then(res => { | |
5553 | + getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + prom_id, {}).then( async res => { | |
5538 | 5554 | |
5539 | 5555 | if (res.data.code == 0) { |
5540 | 5556 | prom = res.data.data; |
5541 | - let min_value = 0 | |
5542 | - if (prom && prom.is_xz_yh) { | |
5543 | - let arr = prom.promGoodsList || [] | |
5544 | - arr.map(item => { | |
5545 | - if (min_value) { | |
5546 | - min_value = item.condition | |
5547 | - } else { | |
5548 | - if (min_value < item.condition) { | |
5549 | - min_value = item.condition | |
5557 | + if(prom && prom.limit_num*1){ | |
5558 | + let user_pre_buynum=await th.getUserBuyPromNum_pre(prom.id) | |
5559 | + if (user_pre_buynum>=prom.limit_num) { | |
5560 | + arr.prom_price=null; | |
5561 | + arr.prom_id=""; | |
5562 | + arr.prom_type=""; | |
5563 | + func(arr); | |
5564 | + }else{ | |
5565 | + let min_value = 0 | |
5566 | + if (prom && prom.is_xz_yh) { | |
5567 | + let arr = prom.promGoodsList || [] | |
5568 | + arr.map(item => { | |
5569 | + if (min_value) { | |
5570 | + min_value = item.condition | |
5571 | + } else { | |
5572 | + if (min_value < item.condition) { | |
5573 | + min_value = item.condition | |
5574 | + } | |
5575 | + } | |
5576 | + }) | |
5577 | + if (arr.length > 0) { | |
5578 | + if (arr[0].prom_type == 0) { | |
5579 | + if (price < min_value) { | |
5580 | + prom.is_xz_yh = 0 | |
5581 | + } | |
5582 | + } else { | |
5583 | + if (arr.goods_num < min_value) { | |
5584 | + prom.is_xz_yh = 0 | |
5585 | + } | |
5586 | + } | |
5550 | 5587 | } |
5551 | 5588 | } |
5552 | - }) | |
5553 | - if (arr.length > 0) { | |
5554 | - if (arr[0].prom_type == 0) { | |
5555 | - if (price < min_value) { | |
5556 | - prom.is_xz_yh = 0 | |
5589 | + return getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | |
5590 | + data: { | |
5591 | + price: parseFloat(price).toFixed(2), | |
5592 | + prom_id: prom_id, | |
5593 | + goods_num: arr.goods_num, | |
5594 | + user_id: getApp().globalData.user_id, | |
5595 | + is_bz: prom.is_bz | |
5557 | 5596 | } |
5558 | - } else { | |
5559 | - if (arr.goods_num < min_value) { | |
5560 | - prom.is_xz_yh = 0 | |
5597 | + }) | |
5598 | + } | |
5599 | + }else{ | |
5600 | + let min_value = 0 | |
5601 | + if (prom && prom.is_xz_yh) { | |
5602 | + let arr = prom.promGoodsList || [] | |
5603 | + arr.map(item => { | |
5604 | + if (min_value) { | |
5605 | + min_value = item.condition | |
5606 | + } else { | |
5607 | + if (min_value < item.condition) { | |
5608 | + min_value = item.condition | |
5609 | + } | |
5610 | + } | |
5611 | + }) | |
5612 | + if (arr.length > 0) { | |
5613 | + if (arr[0].prom_type == 0) { | |
5614 | + if (price < min_value) { | |
5615 | + prom.is_xz_yh = 0 | |
5616 | + } | |
5617 | + } else { | |
5618 | + if (arr.goods_num < min_value) { | |
5619 | + prom.is_xz_yh = 0 | |
5620 | + } | |
5561 | 5621 | } |
5562 | 5622 | } |
5563 | 5623 | } |
5624 | + //------------------- | |
5625 | + return getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | |
5626 | + data: { | |
5627 | + price: parseFloat(price).toFixed(2), | |
5628 | + prom_id: prom_id, | |
5629 | + goods_num: arr.goods_num, | |
5630 | + user_id: getApp().globalData.user_id, | |
5631 | + is_bz: prom.is_bz | |
5632 | + } | |
5633 | + }) | |
5564 | 5634 | } |
5565 | - | |
5566 | - //------------------- | |
5567 | - return getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | |
5568 | - data: { | |
5569 | - price: parseFloat(price).toFixed(2), | |
5570 | - prom_id: prom_id, | |
5571 | - goods_num: arr.goods_num, | |
5572 | - user_id: getApp().globalData.user_id, | |
5573 | - is_bz: prom.is_bz | |
5574 | - } | |
5575 | - }) | |
5576 | 5635 | } else { |
5577 | 5636 | func(arr); |
5578 | 5637 | } |
... | ... | @@ -5644,6 +5703,30 @@ Page({ |
5644 | 5703 | func(arr); |
5645 | 5704 | }) |
5646 | 5705 | }, |
5706 | + //优惠促销用户参与次数 | |
5707 | + async getUserBuyPromNum_pre(prom_id){ | |
5708 | + var userInfo = getApp().globalData.userInfo; | |
5709 | + var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=3&prom_id=${prom_id}`; | |
5710 | + let res = await getApp().request.promiseGet(url, { | |
5711 | + data:{} | |
5712 | + }); | |
5713 | + let user_pre_buynum=0 | |
5714 | + if(res.data.code==0 && res.data.data){ | |
5715 | + user_pre_buynum=res.data.data.userbuynum | |
5716 | + } | |
5717 | + return user_pre_buynum | |
5718 | + }, | |
5719 | + //获取优惠活动 | |
5720 | + async getprom(prom_id){ | |
5721 | + let limit_num=0 | |
5722 | + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => { | |
5723 | + if (res.data.code == 0) { | |
5724 | + let prom = res.data.data; | |
5725 | + limit_num =prom.limit_num | |
5726 | + } | |
5727 | + }) | |
5728 | + return limit_num | |
5729 | + }, | |
5647 | 5730 | //--检查订单优惠-- |
5648 | 5731 | check_is_order_prom: function (condition, func, pick) { |
5649 | 5732 | var th = this; |
... | ... | @@ -5666,7 +5749,7 @@ Page({ |
5666 | 5749 | var pickid = item.pick_id; |
5667 | 5750 | var map = th.data.prom_goods_map; |
5668 | 5751 | var obj = map[pickid]; |
5669 | - | |
5752 | + | |
5670 | 5753 | if (map[pickid]) { |
5671 | 5754 | if (map[pickid][item.prom_id]) { |
5672 | 5755 | |
... | ... | @@ -5685,6 +5768,7 @@ Page({ |
5685 | 5768 | |
5686 | 5769 | } else { |
5687 | 5770 | var prom = null; |
5771 | + | |
5688 | 5772 | await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + item.prom_id, {}).then(res => { |
5689 | 5773 | if (res.data.code == 0) { |
5690 | 5774 | prom = res.data.data; |
... | ... | @@ -5729,6 +5813,7 @@ Page({ |
5729 | 5813 | } else { |
5730 | 5814 | var ob = {}; |
5731 | 5815 | var prom = null; |
5816 | + | |
5732 | 5817 | await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + item.prom_id, {}).then(res => { |
5733 | 5818 | if (res.data.code == 0) { |
5734 | 5819 | prom = res.data.data; | ... | ... |
pages/cart/cart/cart.js
... | ... | @@ -3837,12 +3837,19 @@ Page({ |
3837 | 3837 | if (th.data.promgoods_map[p_item[0]]) { |
3838 | 3838 | prom = th.data.promgoods_map[p_item[0]]; |
3839 | 3839 | } else { |
3840 | + | |
3840 | 3841 | await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + p_item[0], {}).then(res => { |
3841 | 3842 | if (res.data.code == 0) { |
3842 | 3843 | prom = res.data.data; |
3843 | 3844 | } |
3844 | 3845 | }) |
3845 | 3846 | } |
3847 | + let limit_num=0 | |
3848 | + let user_pre_buynum=0 | |
3849 | + if (prom && prom.limit_num) { | |
3850 | + limit_num=prom.limit_num; | |
3851 | + user_pre_buynum = await this.getUserBuyPromNum_pre(prom.id) | |
3852 | + } | |
3846 | 3853 | //如果活动已经结束 |
3847 | 3854 | if (!prom || prom.is_end || prom.end_time < ut.gettimestamp()) { |
3848 | 3855 | for (var ii in list.goods) { |
... | ... | @@ -3856,7 +3863,7 @@ Page({ |
3856 | 3863 | } |
3857 | 3864 | continue; |
3858 | 3865 | } |
3859 | - | |
3866 | + | |
3860 | 3867 | if (!th.data.promgoods_map[p_item[0]]) th.data.promgoods_map[p_item[0]] = prom; |
3861 | 3868 | //---读取打折的详情--- |
3862 | 3869 | var ob = p_item[1]; |
... | ... | @@ -3880,36 +3887,37 @@ Page({ |
3880 | 3887 | if (!promgoods_list) continue; |
3881 | 3888 | th.data.promgoods_list[p_item[0]] = promgoods_list; |
3882 | 3889 | } |
3883 | - | |
3884 | - for (var i in promgoods_list) { | |
3885 | - var item = promgoods_list[i]; | |
3886 | - if (item.prom_type == 0) { | |
3887 | - if (ob.price < item.condition) { | |
3888 | - var elem = { | |
3889 | - prom_id: prom.id, | |
3890 | - diff_type: item.prom_type, | |
3891 | - diff: (item.condition - ob.price).toFixed(2), | |
3892 | - content: JSON.parse(item.preferential_type) | |
3890 | + | |
3891 | + if (!limit_num || user_pre_buynum<limit_num) { | |
3892 | + for (var i in promgoods_list) { | |
3893 | + var item = promgoods_list[i]; | |
3894 | + if (item.prom_type == 0) { | |
3895 | + if (ob.price < item.condition) { | |
3896 | + var elem = { | |
3897 | + prom_id: prom.id, | |
3898 | + diff_type: item.prom_type, | |
3899 | + diff: (item.condition - ob.price).toFixed(2), | |
3900 | + content: JSON.parse(item.preferential_type) | |
3901 | + } | |
3902 | + make_up_arr.push(elem); | |
3903 | + break; | |
3893 | 3904 | } |
3894 | - make_up_arr.push(elem); | |
3895 | - break; | |
3896 | - } | |
3897 | - } else { | |
3898 | - if (ob.num < item.condition) { | |
3899 | - var elem = { | |
3900 | - prom_id: prom.id, | |
3901 | - diff_type: item.prom_type, | |
3902 | - diff: (item.condition - ob.num).toFixed(2), | |
3903 | - content: JSON.parse(item.preferential_type) | |
3905 | + } else { | |
3906 | + if (ob.num < item.condition) { | |
3907 | + var elem = { | |
3908 | + prom_id: prom.id, | |
3909 | + diff_type: item.prom_type, | |
3910 | + diff: (item.condition - ob.num).toFixed(2), | |
3911 | + content: JSON.parse(item.preferential_type) | |
3912 | + } | |
3913 | + make_up_arr.push(elem); | |
3914 | + break; | |
3904 | 3915 | } |
3905 | - make_up_arr.push(elem); | |
3906 | - break; | |
3907 | 3916 | } |
3908 | 3917 | } |
3909 | 3918 | } |
3910 | 3919 | |
3911 | 3920 | |
3912 | - | |
3913 | 3921 | //-- 只有在单赠品的时候,才要进行计算 -- |
3914 | 3922 | await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { |
3915 | 3923 | data: { |
... | ... | @@ -4059,7 +4067,19 @@ Page({ |
4059 | 4067 | } |
4060 | 4068 | |
4061 | 4069 | }, |
4062 | - | |
4070 | + //优惠促销用户参与次数 | |
4071 | + async getUserBuyPromNum_pre(prom_id){ | |
4072 | + var userInfo = getApp().globalData.userInfo; | |
4073 | + var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=3&prom_id=${prom_id}`; | |
4074 | + let res = await getApp().request.promiseGet(url, { | |
4075 | + data:{} | |
4076 | + }); | |
4077 | + let user_pre_buynum=0 | |
4078 | + if(res.data.code==0 && res.data.data){ | |
4079 | + user_pre_buynum=res.data.data.userbuynum | |
4080 | + } | |
4081 | + return user_pre_buynum | |
4082 | + }, | |
4063 | 4083 | async all_check_prom_activity() { |
4064 | 4084 | this.data.duo_zp_num_arr = {}; |
4065 | 4085 | for (var i in this.data.requestData) { |
... | ... | @@ -4146,6 +4166,12 @@ Page({ |
4146 | 4166 | } |
4147 | 4167 | }) |
4148 | 4168 | } |
4169 | + let limit_num=0 | |
4170 | + let user_pre_buynum=0 | |
4171 | + if (prom && prom.limit_num) { | |
4172 | + limit_num=prom.limit_num; | |
4173 | + user_pre_buynum = await this.getUserBuyPromNum_pre(prom.id) | |
4174 | + } | |
4149 | 4175 | //如果活动已经结束 |
4150 | 4176 | if (!prom || prom.is_end || prom.end_time < ut.gettimestamp()) { |
4151 | 4177 | for (var ii in list.goods) { |
... | ... | @@ -4159,7 +4185,7 @@ Page({ |
4159 | 4185 | } |
4160 | 4186 | continue; |
4161 | 4187 | } |
4162 | - | |
4188 | + | |
4163 | 4189 | if (!th.data.promgoods_map[p_item[0]]) th.data.promgoods_map[p_item[0]] = prom; |
4164 | 4190 | //---读取打折的详情--- |
4165 | 4191 | var ob = p_item[1]; |
... | ... | @@ -4183,30 +4209,31 @@ Page({ |
4183 | 4209 | if (!promgoods_list) continue; |
4184 | 4210 | th.data.promgoods_list[p_item[0]] = promgoods_list; |
4185 | 4211 | } |
4186 | - | |
4187 | - for (var i in promgoods_list) { | |
4188 | - var item = promgoods_list[i]; | |
4189 | - if (item.prom_type == 0) { | |
4190 | - if (ob.price < item.condition) { | |
4191 | - var elem = { | |
4192 | - prom_id: prom.id, | |
4193 | - diff_type: item.prom_type, | |
4194 | - diff: (item.condition - ob.price).toFixed(2), | |
4195 | - content: JSON.parse(item.preferential_type) | |
4212 | + if (!limit_num || user_pre_buynum<limit_num) { | |
4213 | + for (var i in promgoods_list) { | |
4214 | + var item = promgoods_list[i]; | |
4215 | + if (item.prom_type == 0) { | |
4216 | + if (ob.price < item.condition) { | |
4217 | + var elem = { | |
4218 | + prom_id: prom.id, | |
4219 | + diff_type: item.prom_type, | |
4220 | + diff: (item.condition - ob.price).toFixed(2), | |
4221 | + content: JSON.parse(item.preferential_type) | |
4222 | + } | |
4223 | + make_up_arr.push(elem); | |
4224 | + break; | |
4196 | 4225 | } |
4197 | - make_up_arr.push(elem); | |
4198 | - break; | |
4199 | - } | |
4200 | - } else { | |
4201 | - if (ob.num < item.condition) { | |
4202 | - var elem = { | |
4203 | - prom_id: prom.id, | |
4204 | - diff_type: item.prom_type, | |
4205 | - diff: (item.condition - ob.num).toFixed(2), | |
4206 | - content: JSON.parse(item.preferential_type) | |
4226 | + } else { | |
4227 | + if (ob.num < item.condition) { | |
4228 | + var elem = { | |
4229 | + prom_id: prom.id, | |
4230 | + diff_type: item.prom_type, | |
4231 | + diff: (item.condition - ob.num).toFixed(2), | |
4232 | + content: JSON.parse(item.preferential_type) | |
4233 | + } | |
4234 | + make_up_arr.push(elem); | |
4235 | + break; | |
4207 | 4236 | } |
4208 | - make_up_arr.push(elem); | |
4209 | - break; | |
4210 | 4237 | } |
4211 | 4238 | } |
4212 | 4239 | } | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -267,6 +267,7 @@ Page({ |
267 | 267 | base_nor_prom_type:0, |
268 | 268 | base_nor_prom_id:0, |
269 | 269 | base_nor_goods_id:0, |
270 | + user_pre_buynum:0, //用户优惠促销参与次数 | |
270 | 271 | }, |
271 | 272 | |
272 | 273 | //------初始化加载---------- |
... | ... | @@ -1532,7 +1533,21 @@ Page({ |
1532 | 1533 | }) |
1533 | 1534 | // return userbuynum |
1534 | 1535 | }, |
1535 | - | |
1536 | + //优惠促销用户参与次数 | |
1537 | + async getUserBuyPromNum_pre(prom_id){ | |
1538 | + var userInfo = getApp().globalData.userInfo; | |
1539 | + var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=3&prom_id=${prom_id}`; | |
1540 | + let res = await getApp().request.promiseGet(url, { | |
1541 | + data:{} | |
1542 | + }); | |
1543 | + let user_pre_buynum=0 | |
1544 | + if(res.data.code==0 && res.data.data){ | |
1545 | + user_pre_buynum=res.data.data.userbuynum | |
1546 | + } | |
1547 | + this.setData({ | |
1548 | + user_pre_buynum | |
1549 | + }) | |
1550 | + }, | |
1536 | 1551 | //-- 加入购物的函数 -- |
1537 | 1552 | add_cart_func: function (t) { |
1538 | 1553 | var i = getApp().request; |
... | ... | @@ -7451,7 +7466,7 @@ Page({ |
7451 | 7466 | getApp().pre_img(this.data.sele_g.original_img); |
7452 | 7467 | }, |
7453 | 7468 | |
7454 | - is_show_more_buy: function () { | |
7469 | + is_show_more_buy: async function () { | |
7455 | 7470 | var prom_goods = this.data.prom_goods; |
7456 | 7471 | var per_price = this.data.sele_g.shop_price |
7457 | 7472 | if (this.data.card_field && this.data.sele_g[this.data.card_field] > 0) { |
... | ... | @@ -7475,7 +7490,10 @@ Page({ |
7475 | 7490 | } |
7476 | 7491 | } |
7477 | 7492 | } |
7478 | - | |
7493 | + //获取用户参与优惠促销的次数 | |
7494 | + if(con && con.prom_id){ | |
7495 | + await this.getUserBuyPromNum_pre(con.prom_id); | |
7496 | + } | |
7479 | 7497 | this.setData({ |
7480 | 7498 | hui_condition: con |
7481 | 7499 | }); | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -507,7 +507,7 @@ |
507 | 507 | <view class="fs28 f1" wx:for="{{prom_goods}}"> |
508 | 508 | <view> |
509 | 509 | <text class="prom_condition"> |
510 | - <text class="fill-box">消费满{{item.condition}}{{item.prom_type==1 ? '件':'元'}}</text>享优惠 | |
510 | + <text class="fill-box">消费满{{item.condition}}{{item.prom_type==1 ? '件':'元'}}</text>享优惠(每人{{item.limit_num ? '限参与'+item.limit_num+'次' : '参与不限次' }}) | |
511 | 511 | </text> |
512 | 512 | </view> |
513 | 513 | |
... | ... | @@ -1344,7 +1344,7 @@ |
1344 | 1344 | </view> |
1345 | 1345 | </view> |
1346 | 1346 | <!-- 提示再买多少优惠 --> |
1347 | - <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}"> | |
1347 | + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2 && (!hui_condition.limit_num || user_pre_buynum<hui_condition.limit_num)}}"> | |
1348 | 1348 | 再买{{hui_condition.need}} |
1349 | 1349 | <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text> |
1350 | 1350 | <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text> | ... | ... |
pages/goods/goodsList/goodsList.js
... | ... | @@ -41,6 +41,7 @@ Page({ |
41 | 41 | fil_nation_state:0, |
42 | 42 | fil_brand_state:0, |
43 | 43 | fil_price_state:0, |
44 | + limit_num:0, | |
44 | 45 | }, |
45 | 46 | |
46 | 47 | onLoad: function(t) { |
... | ... | @@ -125,6 +126,9 @@ Page({ |
125 | 126 | th.set_prom_list(arr); |
126 | 127 | } |
127 | 128 | }) |
129 | + if (t.prom_id) { | |
130 | + this.getprom(t.prom_id) | |
131 | + } | |
128 | 132 | } |
129 | 133 | |
130 | 134 | //--- 阶梯优惠活动的凑单 --- |
... | ... | @@ -236,7 +240,18 @@ Page({ |
236 | 240 | onShow:function () { |
237 | 241 | getApp().check_can_share(); |
238 | 242 | }, |
239 | - | |
243 | + //获取优惠活动 | |
244 | + async getprom(prom_id){ | |
245 | + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => { | |
246 | + if (res.data.code == 0) { | |
247 | + let prom = res.data.data; | |
248 | + let limit_num =prom.limit_num | |
249 | + this.setData({ | |
250 | + limit_num | |
251 | + }) | |
252 | + } | |
253 | + }) | |
254 | + }, | |
240 | 255 | //设置优惠券的 |
241 | 256 | set_prom_list:async function(arr){ |
242 | 257 | var th=this; | ... | ... |
pages/goods/goodsList/goodsList.wxml
1 | 1 | <wxs module="g_filter" src="../search/g_filter.wxs"></wxs> |
2 | 2 | <view class="container" wx:if="{{show_all}}"> |
3 | 3 | <view> |
4 | + | |
4 | 5 | <block wx:for="{{prom_goods_list}}"> |
5 | 6 | <view class="fs30 ellipsis-1" style="padding: 20rpx 30rpx"> |
7 | + <text style="color: red;" wx:if="{{index==0 && limit_num>0}}">每人限参与{{limit_num}}次;</text> | |
6 | 8 | 满{{item.condition}}<text space="{{true}}" wx:if="{{item.prom_type==0}}">元 </text> <text space="{{true}}" wx:else>件 </text> |
7 | 9 | <text space="{{true}}" wx:if="{{item.content.is_money && item.content.is_money!='0'}}">减{{item.content.money}}元 </text> |
8 | 10 | <text space="{{true}}" wx:if="{{item.content.is_sale && item.content.is_sale!='0'}}">打{{item.content.sale}}折 </text> | ... | ... |