Commit 13178af2dedff0edc16c1e51dbe915ded2a2d5be
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
4 changed files
with
153 additions
and
25 deletions
pages/cart/cart2/cart2.js
... | ... | @@ -124,6 +124,7 @@ Page({ |
124 | 124 | in_zhact_gdmap:{}, //不同门店参与同一活动的限购 |
125 | 125 | hid_inp:1, |
126 | 126 | user_note:{}, |
127 | + zuhe_map_good:{}, | |
127 | 128 | }, |
128 | 129 | onLoad: function (t) { |
129 | 130 | wx.setNavigationBarTitle({title: "填写订单",}) |
... | ... | @@ -453,6 +454,7 @@ Page({ |
453 | 454 | //要把组合购的东西拿出来算一下 |
454 | 455 | if (item1.prom_type == 7) { |
455 | 456 | var isok = 1; |
457 | + var is_flag=1; | |
456 | 458 | //如果有组合购 |
457 | 459 | var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id+'/'+getApp().globalData.userInfo.user_id; |
458 | 460 | await getApp().request.promiseGet(url, {}).then(res => { |
... | ... | @@ -464,25 +466,45 @@ Page({ |
464 | 466 | if (ut.gettimestamp() > res.data.data.end_time) { |
465 | 467 | isok = 0; |
466 | 468 | } |
469 | + item1.act = res.data.data; | |
467 | 470 | } else { |
468 | 471 | //未找到商品的活动 |
469 | - isok = 0; | |
472 | + is_flag = 0; | |
470 | 473 | } |
471 | - item1.act = res.data.data; | |
472 | 474 | }) |
473 | - | |
474 | 475 | if (!isok) { |
475 | 476 | getApp().my_warnning("组合购的活动已经过期", 0, th); |
476 | 477 | return false; |
477 | 478 | } |
478 | - | |
479 | + var url1 = "/api/weshop/prom/zhbuyGoods/page"; | |
480 | + var req_data = { | |
481 | + page: 1, | |
482 | + pageSize: 2000, | |
483 | + store_id: os.stoid, | |
484 | + zh_id: item1.prom_id, | |
485 | + } | |
486 | + await getApp().request.promiseGet(url1, { | |
487 | + data: req_data | |
488 | + }).then(res => { | |
489 | + if (ut.ajax_ok(res)) { | |
490 | + var gdlist = res.data.data.pageData; | |
491 | + gdlist.forEach(i=>{ | |
492 | + if(item1.goods_id==i.goods_id&&!is_flag){ | |
493 | + item1.prom_type=0; | |
494 | + item1.prom_type1=0; | |
495 | + item1.prom_id=0; | |
496 | + item1.prom_id1=0 | |
497 | + } | |
498 | + }) | |
499 | + th.data.zuhe_map_good[item1.prom_id]=gdlist; | |
500 | + } | |
501 | + }) | |
479 | 502 | } |
480 | 503 | } |
481 | 504 | |
482 | 505 | //在分组的时候,就不要再调用接口,await |
483 | 506 | for (var i = 0; i < carr.length; i++) { |
484 | 507 | var item = carr[i]; |
485 | - | |
486 | 508 | //-- 如果是等级会员注册返回 -- |
487 | 509 | if (is_card_back) { |
488 | 510 | th.data.card_name = th.data.userinfo.card_field; |
... | ... | @@ -666,22 +688,26 @@ Page({ |
666 | 688 | //存储不同活动的商品列表 |
667 | 689 | u_item.zh_prom_goods = {}; |
668 | 690 | for (let var1 in obj) { |
669 | - var h_item = obj[var1]; | |
670 | - var gdlist = null; | |
671 | - var url1 = "/api/weshop/prom/zhbuyGoods/page"; | |
672 | - var req_data = { | |
673 | - page: 1, | |
674 | - pageSize: 2000, | |
675 | - store_id: os.stoid, | |
676 | - zh_id: h_item.prom_id, | |
677 | - } | |
678 | - await getApp().request.promiseGet(url1, { | |
679 | - data: req_data | |
680 | - }).then(res => { | |
681 | - if (ut.ajax_ok(res)) { | |
682 | - gdlist = res.data.data.pageData; | |
683 | - } | |
684 | - }) | |
691 | + var h_item=obj[var1]; | |
692 | + var gdlist= th.data.zuhe_map_good[h_item.prom_id]; | |
693 | + //获取活动需要的商品列表 | |
694 | + // u_item.zh_prom_goods[h_item.prom_id]=gdlist; | |
695 | + // var h_item = obj[var1]; | |
696 | + // var gdlist = null; | |
697 | + // var url1 = "/api/weshop/prom/zhbuyGoods/page"; | |
698 | + // var req_data = { | |
699 | + // page: 1, | |
700 | + // pageSize: 2000, | |
701 | + // store_id: os.stoid, | |
702 | + // zh_id: h_item.prom_id, | |
703 | + // } | |
704 | + // await getApp().request.promiseGet(url1, { | |
705 | + // data: req_data | |
706 | + // }).then(res => { | |
707 | + // if (ut.ajax_ok(res)) { | |
708 | + // gdlist = res.data.data.pageData; | |
709 | + // } | |
710 | + // }) | |
685 | 711 | //获取活动需要的商品列表 |
686 | 712 | u_item.zh_prom_goods[h_item.prom_id] = {gdlist: gdlist, act: h_item.act}; |
687 | 713 | } | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -4261,9 +4261,12 @@ Page({ |
4261 | 4261 | context.setTextAlign('left'); |
4262 | 4262 | context.fillText('强烈推荐', 64*unit, 672*unit); |
4263 | 4263 | // 7.商品价格 |
4264 | + let price = '¥' + this.data.data.shop_price; | |
4265 | + // if (th.data.prom_act) | |
4266 | + // pri0 = th.data.prom_act.price; | |
4264 | 4267 | context.setFontSize(32*unit); |
4265 | 4268 | context.setFillStyle('#DE1117'); |
4266 | - context.fillText('¥59.00', 54*unit, 730*unit); | |
4269 | + context.fillText(price, 54*unit, 730*unit); | |
4267 | 4270 | // 8.商品标题 |
4268 | 4271 | context.setFontSize(20*unit); |
4269 | 4272 | context.setFillStyle('#898989'); | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -87,7 +87,8 @@ |
87 | 87 | 零售价¥{{filters.toFix(data.market_price,2)}} |
88 | 88 | </view> |
89 | 89 | </view> |
90 | - <view class="abs white xc-nanber"> | |
90 | + | |
91 | + <!-- <view class="abs white xc-nanber"> | |
91 | 92 | <text class="fs22">已拼{{prom_act.buy_num}}件</text> |
92 | 93 | <view class="flex" style='margin-top:-34rpx'> |
93 | 94 | <view class="xc-people-img"> |
... | ... | @@ -95,7 +96,19 @@ |
95 | 96 | </view> |
96 | 97 | <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人拼</view> |
97 | 98 | </view> |
98 | - </view> | |
99 | + </view> --> | |
100 | + | |
101 | + <!-- 幸运购 --> | |
102 | + <view class="abs white xc-nanber" wx:if="{{false}}"> | |
103 | + <text class="fs22">已成团{{prom_act.buy_num}}期</text> | |
104 | + <view class="flex" style='margin-top:-34rpx'> | |
105 | + <view class="xc-people-img"> | |
106 | + <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image> | |
107 | + </view> | |
108 | + <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人团</view> | |
109 | + </view> | |
110 | + </view> | |
111 | + | |
99 | 112 | <view class="hy-stop word-color fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view> |
100 | 113 | <view class="hy-stop word-color-lan fs26 abs" wx:if="{{prom_st==0}}">距活动开始还有</view> |
101 | 114 | <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;"> |
... | ... | @@ -204,6 +217,72 @@ |
204 | 217 | </view> |
205 | 218 | </view> |
206 | 219 | </view> |
220 | + | |
221 | + <!-- 幸运购 --> | |
222 | + <view class="pt_fir se2 bdt16" wx:if="{{teamgroup}}" hidden="{{true}}"> | |
223 | + <view class="xc-partner-frame"> | |
224 | + <view class="zzk-1 flex jc_sb" bindtap="go_t_more"> | |
225 | + <view class="pdl10">已参团4人,还差<text class="c-red">1</text>人成团</view> | |
226 | + <view class="ckgd flex ai_c"> | |
227 | + 查看奖励 | |
228 | + <view class="bg_right arrow-one"></view> | |
229 | + </view> | |
230 | + </view> | |
231 | + </view> | |
232 | + <view class='group'> | |
233 | + <view class='group-list luck' bindtap="go_cj_team" data-ind="{{t_ind}}"> | |
234 | + <!-- <view class="flex ai_c"> --> | |
235 | + <!-- //选项框头像 --> | |
236 | + <view class='gtou' wx:for="{{teamgroup}}" wx:for-index="t_ind" wx:key="teamgroup"> | |
237 | + <image src='{{item.user.head_pic}}'></image> | |
238 | + </view> | |
239 | + <view class='gtou more'> | |
240 | + <text class="iconfont icon-sandian"></text> | |
241 | + </view> | |
242 | + <!-- <view class='gtou'> | |
243 | + <image src='{{item.user.head_pic}}'></image> | |
244 | + </view> --> | |
245 | + <!-- //等你来拼 --> | |
246 | + <!-- <view class='gdn ellipsis-1'>{{item.user.nickname}}</view> --> | |
247 | + <!-- </view> --> | |
248 | + <!-- //还差几人,剩余时间 --> | |
249 | + <!-- <view class="rel"> | |
250 | + <view class='ghaicha ellipsis-2'> | |
251 | + <text class='gred' wx:if="{{prom_act.max_ct_num >0}}"> | |
252 | + <text class="flex" wx:if="{{prom_act.max_ct_num - item.open_num>0}}"> | |
253 | + 还差 | |
254 | + <text class="word-color">{{prom_act.max_ct_num - item.open_num}}</text> | |
255 | + 人享最低优惠 | |
256 | + </text> | |
257 | + <text wx:else>您已经享最低优惠</text> | |
258 | + </text> | |
259 | + <text class='gred' wx:else> | |
260 | + 还差 | |
261 | + <text style='color:#ff2753'>{{prom_act.ct_num - item.open_num}}</text> | |
262 | + 人成团 | |
263 | + </text> | |
264 | + <view class="t_show"> | |
265 | + 剩余 | |
266 | + <text wx:if="{{timer[t_ind].day}}">{{timer[t_ind].day}}天:</text> | |
267 | + <text>{{timer[t_ind].hou}}</text> | |
268 | + : | |
269 | + <text>{{timer[t_ind].min}}</text> | |
270 | + : | |
271 | + <text>{{timer[t_ind].sec}}</text> | |
272 | + </view> | |
273 | + </view> | |
274 | + </view> --> | |
275 | + <!-- //参加团 --> | |
276 | + <!-- <view class='cjt t-c'>去参团</view> --> | |
277 | + <!-- <view class="clear"></view> --> | |
278 | + </view> | |
279 | + | |
280 | + <view class="fs24 pdh20 pdt20">*<text class="c-red">5</text>人成团,<text class="c-red">5</text>人得商品,<text class="c-red">5</text>人全额退款并获得<text class="c-red">惊喜礼品</text>!</view> | |
281 | + </view> | |
282 | + </view> | |
283 | + | |
284 | + | |
285 | + | |
207 | 286 | </view> |
208 | 287 | <!-- 积分购 --> |
209 | 288 | <view wx:if="{{prom_type==4}}"> |
... | ... | @@ -491,6 +570,9 @@ |
491 | 570 | </view> |
492 | 571 | </view> |
493 | 572 | </block> |
573 | + | |
574 | + | |
575 | + | |
494 | 576 | <!-- 要判断是不是有订单优惠 --> |
495 | 577 | <block wx:if="{{order_prom}}"> |
496 | 578 | <view class="cx-frame flex" style="position: relative; height: auto"> | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxss
... | ... | @@ -2858,4 +2858,21 @@ button.custom-service::after{ |
2858 | 2858 | color: #fff; |
2859 | 2859 | } |
2860 | 2860 | |
2861 | -.mt20{ margin-top: 20rpx} | |
2862 | 2861 | \ No newline at end of file |
2862 | +.mt20{ margin-top: 20rpx} | |
2863 | + | |
2864 | +.group .group-list.luck { | |
2865 | + padding: 0 20rpx; | |
2866 | + justify-content: flex-start; | |
2867 | +} | |
2868 | + | |
2869 | +.group-list.luck .gtou ~ .gtou { | |
2870 | + margin-left: -16rpx; | |
2871 | +} | |
2872 | + | |
2873 | +.gtou.more { | |
2874 | + background-color: #ddd; | |
2875 | + text-align: center; | |
2876 | + line-height: 70rpx; | |
2877 | + border-radius: 50%; | |
2878 | + color: #aaa; | |
2879 | +} | |
2863 | 2880 | \ No newline at end of file | ... | ... |