Commit a721e7e7373b53b44ed19e1b46c8fa346bc95234
1 parent
e9dd25b7
小程序多赠品测试的bug返回
Showing
6 changed files
with
62 additions
and
15 deletions
components/long_warn/long_warn.wxml
| 1 | 1 | <view class="rim" wx:if="{{is_show}}"> |
| 2 | 2 | <view class="content flex-center"> |
| 3 | 3 | <view class="con_view" style="width:{{width>0?width+'rpx':'auto'}}"> |
| 4 | - <view class="con_view_img"> | |
| 5 | - <image wx:if="{{type}}" src="{{iurl}}/miniapp/images/sucess_g.png"></image><!-- 成功 --> | |
| 6 | - <image wx:else src="{{iurl}}/miniapp/images/gt.png"></image> <!-- 失败 --> | |
| 4 | + <view class="con_view_img flex ai_c jc-center"> | |
| 5 | + <view wx:if="{{type}}" class="circle-box flex ai_c jc-center"> | |
| 6 | + <text class="iconfont icon-dagou"></text> | |
| 7 | + </view><!-- 成功 --> | |
| 8 | + <text wx:else class="iconfont icon-info" style="font-size: 78rpx"></text> <!-- 失败 --> | |
| 7 | 9 | </view> |
| 8 | 10 | <view class="msg">{{val}}</view> |
| 9 | 11 | </view> | ... | ... |
components/long_warn/long_warn.wxss
| 1 | +@import '../../app.wxss'; | |
| 1 | 2 | .cover-layer { |
| 2 | 3 | position: fixed; |
| 3 | 4 | left: 0; |
| ... | ... | @@ -21,8 +22,15 @@ |
| 21 | 22 | .con_view{ |
| 22 | 23 | min-width:180rpx; max-width: 720rpx; width: auto; padding: 40rpx 30rpx; background-color: #000; border-radius:22rpx; text-align: center; |
| 23 | 24 | } |
| 24 | -.con_view .con_view_img{ height: 120rpx;} | |
| 25 | +.con_view .con_view_img{ height: 120rpx; color: #fff} | |
| 25 | 26 | .con_view image{ width: 84rpx; height: 84rpx;} |
| 26 | 27 | .msg{ |
| 27 | 28 | color:#fff; font-size: 32rpx |
| 28 | 29 | } |
| 30 | + | |
| 31 | +.circle-box{ | |
| 32 | + width: 80rpx; | |
| 33 | + height: 80rpx; | |
| 34 | + border: 1rpx solid #fff; | |
| 35 | + border-radius: 50%; | |
| 36 | +} | ... | ... |
pages/cart/cart/cart.js
| ... | ... | @@ -2417,6 +2417,16 @@ Page({ |
| 2417 | 2417 | |
| 2418 | 2418 | //--------------去结算------------ |
| 2419 | 2419 | async checkout() { |
| 2420 | + | |
| 2421 | + if(getApp().is_sp_hao()){ | |
| 2422 | + wx.showToast({ | |
| 2423 | + title: "视频号不支持购物车购买", | |
| 2424 | + icon: 'none', | |
| 2425 | + duration: 2000 | |
| 2426 | + }); | |
| 2427 | + return false; | |
| 2428 | + } | |
| 2429 | + | |
| 2420 | 2430 | if (!this.data.total_num || this.data.total_num <= 0) return false; |
| 2421 | 2431 | if (!this.data.is_load) return false; |
| 2422 | 2432 | if (this.data.up_dating) { | ... | ... |
pages/cart/cart2/cart2.js
| ... | ... | @@ -1234,7 +1234,7 @@ Page({ |
| 1234 | 1234 | if(parseInt(get_data.zp_mode)==1){ |
| 1235 | 1235 | if(!send_gf[pickid]) send_gf[pickid]=[]; |
| 1236 | 1236 | send_gf[pickid].push({ |
| 1237 | - pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num, | |
| 1237 | + pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num*get_data.bs, | |
| 1238 | 1238 | gf_pr_name:item_map.name,prom_id:item_map.prom_id}); |
| 1239 | 1239 | } |
| 1240 | 1240 | } |
| ... | ... | @@ -4048,10 +4048,13 @@ Page({ |
| 4048 | 4048 | arr.s_coupon_id = get_data.coupon_id; |
| 4049 | 4049 | arr.s_coupon_num = get_data.coupon_num; |
| 4050 | 4050 | arr.zp_mode = get_data.zp_mode; |
| 4051 | - arr.zp_num = get_data.zp_num; | |
| 4051 | + arr.zp_num = get_data.zp_num?get_data.zp_num:1; //确保默认一个 | |
| 4052 | 4052 | |
| 4053 | 4053 | //-- 看是不是有赠品 -- |
| 4054 | - if (get_data.gift_id && parseInt(get_data.zp_mode)!=1){ | |
| 4054 | + if (get_data.gift_id && parseInt(get_data.zp_mode)!=1 | |
| 4055 | + && get_data.zp_num* arr.bs<=get_data.limit_num | |
| 4056 | + && get_data.zp_num* arr.bs<=get_data.gift_storecount | |
| 4057 | + ){ | |
| 4055 | 4058 | arr.gift_id = get_data.gift_id; |
| 4056 | 4059 | arr.gift_goods_id = get_data.goods_id; |
| 4057 | 4060 | arr.gift_goods_name = get_data.goods_name; |
| ... | ... | @@ -4078,7 +4081,7 @@ Page({ |
| 4078 | 4081 | if(parseInt(get_data.zp_mode)==1){ |
| 4079 | 4082 | if(!send_gf[pickid]) send_gf[pickid]=[]; |
| 4080 | 4083 | send_gf[pickid].push({ |
| 4081 | - pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num, | |
| 4084 | + pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num*get_data.bs, | |
| 4082 | 4085 | gf_pr_name:prom.name,prom_id:prom.prom_id}); |
| 4083 | 4086 | th.setData({send_gf:send_gf}); |
| 4084 | 4087 | } |
| ... | ... | @@ -4471,6 +4474,25 @@ Page({ |
| 4471 | 4474 | } |
| 4472 | 4475 | }, |
| 4473 | 4476 | |
| 4477 | + | |
| 4478 | + //输入框输入数量的时候 | |
| 4479 | + valueToNum:function (e){ | |
| 4480 | + var th=this; | |
| 4481 | + var idx=e.currentTarget.dataset.item; | |
| 4482 | + var gift_item=this.data.giftsinfo[idx]; | |
| 4483 | + var num=parseInt(e.detail.value); | |
| 4484 | + var txt="giftsinfo["+idx+"].goods_num"; | |
| 4485 | + var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num); | |
| 4486 | + if(!is_true){ | |
| 4487 | + th.setData({[txt]:1}); | |
| 4488 | + return false; | |
| 4489 | + } | |
| 4490 | + th.setData({[txt]:num}); | |
| 4491 | + | |
| 4492 | + }, | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
| 4474 | 4496 | addNum:function (e) { |
| 4475 | 4497 | var th=this; |
| 4476 | 4498 | var idx=e.currentTarget.dataset.item; |
| ... | ... | @@ -4548,7 +4570,7 @@ Page({ |
| 4548 | 4570 | // 这里是保证所有的赠品部会超出 -- |
| 4549 | 4571 | if (discount.gift_storecount < all_num ) { |
| 4550 | 4572 | wx.showToast({ |
| 4551 | - title: "礼包库存不足", | |
| 4573 | + title: "赠品库存不足", | |
| 4552 | 4574 | icon: 'none', |
| 4553 | 4575 | duration: 2000 |
| 4554 | 4576 | }); |
| ... | ... | @@ -4662,10 +4684,13 @@ Page({ |
| 4662 | 4684 | var set_data = this.data.send_gf[gf_pickup_id][this.data.send_gf_index]; |
| 4663 | 4685 | set_data.selected = 1; |
| 4664 | 4686 | var txt9 = "cartlist[" + index + "].goods"; |
| 4665 | - var txt1 = "send_gf[" + gf_pickup_id + "][" + this.data.send_gf_index + "]"; | |
| 4666 | - th.setData({[txt9]: new_pk_list_goods, [txt1]: set_data}); | |
| 4687 | + | |
| 4688 | + th.setData({[txt9]: new_pk_list_goods, send_gf: this.data.send_gf}); | |
| 4667 | 4689 | this.data.old_cartlist[index].goods = new_pk_list_goods; |
| 4668 | 4690 | |
| 4691 | + | |
| 4692 | + console.log(this.data.send_gf,"----"); | |
| 4693 | + | |
| 4669 | 4694 | th.calculatePrice(); |
| 4670 | 4695 | }else{ |
| 4671 | 4696 | var new_pk_list_goods=[]; | ... | ... |
pages/cart/cart2/cart2.wxml
| ... | ... | @@ -202,7 +202,7 @@ |
| 202 | 202 | data-pk="{{item.pickup_id}}" data-index="{{index}}" |
| 203 | 203 | bindtap="show_sele_gift" > |
| 204 | 204 | <view class="flex ai_c"> |
| 205 | - <view class="circle">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
| 205 | + <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
| 206 | 206 | </view> |
| 207 | 207 | |
| 208 | 208 | <view class="flex ai_c" wx:if="{{iter.selected}}"> |
| ... | ... | @@ -391,7 +391,7 @@ |
| 391 | 391 | data-pk="{{bn_pick}}" data-index="{{index}}" |
| 392 | 392 | bindtap="show_sele_gift" > |
| 393 | 393 | <view class="flex ai_c"> |
| 394 | - <view class="circle">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
| 394 | + <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
| 395 | 395 | </view> |
| 396 | 396 | |
| 397 | 397 | <view class="flex ai_c" wx:if="{{iter.selected}}"> |
| ... | ... | @@ -729,6 +729,7 @@ |
| 729 | 729 | {{gf_pr_name}},可以获赠一下任意{{zp_num}}件商品 |
| 730 | 730 | </view> |
| 731 | 731 | <!-- 赠品选择 --> |
| 732 | + <scroll-view scroll-y="{{true}}" style="height:calc(100% - 300rpx);"> | |
| 732 | 733 | <view class="order-item" hidden="{{items.hide_div}}" data-item="{{idx}}" wx:for="{{giftsinfo}}" wx:for-item="items" wx:for-index="idx"> |
| 733 | 734 | |
| 734 | 735 | <view bindtap="check_th_item" class="order-raido flex-vertical " data-check="{{items.selected?items.selected:0}}" data-item="{{idx}}"> |
| ... | ... | @@ -758,13 +759,14 @@ |
| 758 | 759 | <view class="count"> |
| 759 | 760 | <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view> |
| 760 | 761 | <input class="goodadd" bindblur="valueToNum" data-item="{{idx}}" |
| 761 | - bindinput="refresh_input" type="number" value="{{items.goods_num}}"></input> | |
| 762 | + bindinput="refresh_input" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input> | |
| 762 | 763 | <view class="add" bindtap="addNum" data-item="{{idx}}">+</view> |
| 763 | 764 | </view> |
| 764 | 765 | </view> |
| 765 | 766 | |
| 766 | 767 | </view> |
| 767 | 768 | </view> |
| 769 | + </scroll-view> | |
| 768 | 770 | <!-- 确认选择 --> |
| 769 | 771 | <view class="pay-for flex-vertical-between" style="bottom: 0"> |
| 770 | 772 | <view></view> | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -505,7 +505,7 @@ |
| 505 | 505 | <text class="tick lh2 pdr20" wx:if="{{item.past==1}}">包邮</text> |
| 506 | 506 | <text class="tick lh2 pdr20" wx:if="{{item.intValue>0}}">送{{item.intValue}}积分</text> |
| 507 | 507 | <view class="tick lh2 pdr20" wx:if="{{item.couponId>0}}">送{{item.couponMoney}}元优惠券</view> |
| 508 | - <view class="tick ellipsis-1x lh2" wx:if="{{item.gift_id}}">送商品{{tool.repl(item.goods_name)}}</view> | |
| 508 | + <view class="tick ellipsis-1x lh2" wx:if="{{item.gift_id}}">送赠品</view> | |
| 509 | 509 | <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.lb_id>0}}" data-id="{{item.lb_id}}" bindtap="viewLbDetails">送{{item.lbtitle}}</view> |
| 510 | 510 | <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.zxlb_id>0}}" data-id="{{item.zxlb_id}}" data-flag="1" bindtap="viewLbDetails">送{{item.zxlbtitle}}</view> |
| 511 | 511 | </view> | ... | ... |