Commit 8f43363a7cdd3a23dd24a6a6d412f6c3c7f7e87d
1 parent
7734388f
生日有礼代码调整
Showing
3 changed files
with
9 additions
and
44 deletions
pages/giftpack/birthdaygift/birthdaygift.js
| ... | ... | @@ -35,21 +35,21 @@ Page({ |
| 35 | 35 | getApp().request.promiseGet(url, { |
| 36 | 36 | data: { |
| 37 | 37 | "actId": th.data.getActId, //活动id |
| 38 | - "actType": th.data.getActType, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | |
| 38 | + "actType":4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销 | |
| 39 | 39 | "giftBagId": th.data.giftID, //礼包ID |
| 40 | 40 | "storeId": a.stoid, //商家ID |
| 41 | 41 | "userId": d.user_id //用户ID |
| 42 | 42 | } |
| 43 | 43 | }).then(res => { |
| 44 | 44 | if (res.data.code == 0) { |
| 45 | - if (res.data.data.lbCoupons != null) { | |
| 45 | + if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons!=null) { | |
| 46 | 46 | //礼包内容--礼券 |
| 47 | 47 | th.setData({ |
| 48 | 48 | cardShow: true, |
| 49 | 49 | cards: res.data.data.lbCoupons |
| 50 | 50 | }) |
| 51 | 51 | } |
| 52 | - if (res.data.data.lbSM != null) { | |
| 52 | + if (res.data.data.lbSM.length > 0 && res.data.data.lbSM!=nll) { | |
| 53 | 53 | //礼包内容--服务项目 |
| 54 | 54 | th.setData({ |
| 55 | 55 | itemShow: true, |
| ... | ... | @@ -109,46 +109,11 @@ Page({ |
| 109 | 109 | } |
| 110 | 110 | }) |
| 111 | 111 | }, |
| 112 | - //判断中间的连接线是否显示 | |
| 113 | - itemShows: function () { | |
| 114 | - if (this.itemShow) { | |
| 115 | - if (this.cardShow) { | |
| 116 | - return true; | |
| 117 | - } else { | |
| 118 | - return false; | |
| 119 | - } | |
| 120 | - } else { | |
| 121 | - if (this.cardShow) { | |
| 122 | - return false; | |
| 123 | - } else { | |
| 124 | - return false; | |
| 125 | - } | |
| 126 | - | |
| 127 | - } | |
| 128 | - }, | |
| 129 | - //判断中间的连接线是否显示 | |
| 130 | - cardShows: function () { | |
| 131 | - if (this.cardShow) { | |
| 132 | - if (this.packShow) { | |
| 133 | - return true; | |
| 134 | - } else { | |
| 135 | - return false; | |
| 136 | - } | |
| 137 | - } else { | |
| 138 | - if (this.packShow) { | |
| 139 | - return false; | |
| 140 | - } else { | |
| 141 | - return false; | |
| 142 | - } | |
| 143 | - | |
| 144 | - } | |
| 145 | - }, | |
| 146 | 112 | |
| 147 | 113 | onLoad: function onLoad(options) { |
| 148 | 114 | var th = this; |
| 149 | 115 | th.setData({ |
| 150 | 116 | getActId: options.actId, |
| 151 | - getActType: options.actType, | |
| 152 | 117 | giftID: options.giftBagId |
| 153 | 118 | }) |
| 154 | 119 | th.GetList(); |
| ... | ... | @@ -173,8 +138,8 @@ Page({ |
| 173 | 138 | |
| 174 | 139 | var json = { |
| 175 | 140 | "actId": th.data.getActId, //活动Id |
| 176 | - "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 177 | - "lbId": th.data.giftID, //礼包Id | |
| 141 | + "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 142 | + "giftBagId": th.data.giftID, //礼包Id | |
| 178 | 143 | "storeId": a.stoid, //商家Id |
| 179 | 144 | "userId": d.user_id //用户ID |
| 180 | 145 | }; | ... | ... |
pages/giftpack/birthdaygift/birthdaygift.wxml
| 1 | 1 | <view> |
| 2 | 2 | <view class="image_box"> |
| 3 | - <image src="{{iurl+'/miniapp/images/giftbag/vip00.png'}}" lazy-load="true"></image> | |
| 3 | + <image src="{{iurl+'/miniapp/images/giftbag/birth00.png'}}" lazy-load="true"></image> | |
| 4 | 4 | </view> |
| 5 | 5 | <block wx:if="{{itemShow}}"> |
| 6 | 6 | <view class="top"> |
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | </block> |
| 50 | 50 | </view> |
| 51 | 51 | </block> |
| 52 | - <block wx:if="{{true}}"> | |
| 52 | + <block wx:if="{{itemShow}}"> | |
| 53 | 53 | <view > |
| 54 | 54 | <image style="width:10px;height:47px;float:left;top:-38px;left:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> |
| 55 | 55 | <image style="width:10px;height:47px;float:right;top:-38px;right:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> |
| ... | ... | @@ -98,7 +98,7 @@ |
| 98 | 98 | </view> |
| 99 | 99 | </view> |
| 100 | 100 | </block> |
| 101 | - <block wx:if="{{true}}"> | |
| 101 | + <block wx:if="{{cardShow}}"> | |
| 102 | 102 | <view> |
| 103 | 103 | <view> |
| 104 | 104 | <image style="width:10px;height:47px;float:left;top:-38px;left:55px;" src="{{iurl+'/miniapp/images/giftbag/vip05.png'}}" lazy-load="true"></image> | ... | ... |
pages/giftpack/birthdaygift/birthdaygift.wxss