Commit 3c98ddacdfd1520caf7b3dc2bb95f6ddda7c3ffb

Authored by 后端研发-苏明海
2 parents 694c253b 235ba445

Merge branch 'qa' into 'master'

Qa

See merge request !264
pages/user/assistance/assistance.js
... ... @@ -168,14 +168,15 @@ Page({
168 168  
169 169 // 领取礼包
170 170 get_libao: function(e) {
171   - var help_id = e.currentTarget.dataset.help_id;
  171 + var help_id = e.currentTarget.dataset.help_id;//活动id
172 172 var taskId = e.currentTarget.dataset.taskid;//任务id
173   - getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 1 + "&taskId=" + taskId);
  173 + var id = e.currentTarget.dataset.id;//用于跳到礼包详情一键全部领取用的任务id
  174 + getApp().goto("/pages/user/assistance/giftpacklist?help_id=" + help_id + "&is_libao=" + 1 + "&taskId=" + taskId+"&id="+id);
174 175 },
175 176  
176 177 //查看礼包id
177   - select_libao: function() {
178   - var orderSn = e.currentTarget.dataset.orderSn; //订单号
  178 + select_libao: function(e) {
  179 + var orderSn = e.currentTarget.dataset.ordersn; //订单号
179 180 getApp().goto("/pages/user/assistance/giftpacklist?orderSn=" + orderSn);
180 181 }
181 182  
... ...
pages/user/assistance/assistance.wxml
... ... @@ -51,7 +51,7 @@
51 51  
52 52 <!-- 已完成的颜色nostate -->
53 53 <view class="flex-center width state" wx:if="{{item.status==1}}">
54   - <view class="ellipsis-1" bindtap="get_libao" data-help_id="{{item.helpFormId}}" data-taskId="{{item.helpTaskId}}">领取礼包</view>
  54 + <view class="ellipsis-1" bindtap="get_libao" data-help_id="{{item.helpFormId}}" data-taskId="{{item.helpTaskId}}" data-id="{{item.id}}">领取礼包</view>
55 55 </view>
56 56 <view class="flex-center width state" wx:if="{{item.status==0}}">
57 57 <view class="ellipsis-1">{{item.zlHelpNum}}/{{item.helpNum}}</view>
... ...
pages/user/assistance/giftpacklist.js
... ... @@ -22,7 +22,6 @@ Page({
22 22 actTitle: '',
23 23 getUrl: '',
24 24 wareCard: [],
25   - orderSn: "", //订单编号
26 25 lbId: "",
27 26 code: "", //核销码
28 27 c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
... ... @@ -31,31 +30,33 @@ Page({
31 30 is_sub: 0, //判断是否重复提交
32 31 is_libao: 0, //0轮播查看活动 1领取礼包 2.查看礼包详情
33 32 held_id: "", //活动id
34   - taskId: "", //任务id
  33 + taskId: "", //任务id用于查找礼包详情
35 34 orderSn: "", //订单号
36   - is_type:"",//类型 0.轮播过来的 1.领取礼包过来的 2.查看礼包过来的
37   - is_head:0,//数据是否加载完成
38   - giftBagId:"",//礼包id
  35 + is_type: "", //类型 0.轮播过来的 1.领取礼包过来的 2.查看礼包过来的
  36 + is_head: 0, //数据是否加载完成
  37 + giftBagId: "", //礼包id
  38 + id: "", //一键领取的时候使用
39 39 },
40 40 onLoad: function(options) {
41 41 var th = this;
42 42 if (options.is_libao == 0) {
43 43 th.setData({
44   - held_id: options.help_id,
45   - taskId: options.taskId,
46   - is_type:0
  44 + held_id: options.help_id,
  45 + taskId: options.taskId,
  46 + is_type: 0
47 47 })
48 48 th.help();
49 49 }
50 50 if (options.is_libao == 1) {
51 51 th.setData({
52 52 held_id: options.help_id,
53   - taskId: options.taskId,
54   - is_type: 1
  53 + taskId: options.taskId,
  54 + is_type: 1,
  55 + id: options.id
55 56 })
56 57 th.help();
57 58 }
58   - if (options.order_sn) {
  59 + if (options.orderSn) {
59 60 th.setData({
60 61 orderSn: options.orderSn,
61 62 is_type: 2
... ... @@ -84,16 +85,19 @@ Page({
84 85 th.setData({
85 86 giftImage: th.data.iurl + res.data.data.lbUrl,
86 87 giftTitle: res.data.data.giftTitle,
87   - is_head:1
  88 + is_head: 1
88 89 })
89 90 if (res.data.data.giftRemark == '') {
90 91 th.setData({
91 92 giftRemark: '暂无详情......'
92 93 })
93 94 } else {
94   - th.setData({
95   - giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
96   - })
  95 + if (res.data.data.giftRemark != null && res.data.data.giftRemark != undefined && res.data.data.giftRemark != '') {
  96 + th.setData({
  97 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  98 + })
  99 + }
  100 +
97 101 }
98 102  
99 103 th.setData({
... ... @@ -137,16 +141,18 @@ Page({
137 141 th.setData({
138 142 giftImage: th.data.iurl + res.data.data.lbUrl,
139 143 giftTitle: res.data.data.giftTitle,
140   - is_head:1
  144 + is_head: 1
141 145 })
142 146 if (res.data.data.giftRemark == '') {
143 147 th.setData({
144 148 giftRemark: '暂无详情......'
145 149 })
146 150 } else {
147   - th.setData({
148   - giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
149   - })
  151 + if (res.data.data.giftRemark != null && res.data.data.giftRemark != undefined && res.data.data.giftRemark != '') {
  152 + th.setData({
  153 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  154 + })
  155 + }
150 156 }
151 157  
152 158 //---获取日期的时间戳---
... ... @@ -202,7 +208,7 @@ Page({
202 208 is_sub: 1
203 209 })
204 210 var json = {
205   - "actId": th.data.taskId, //活动Id
  211 + "actId": th.data.id, //活动Id
206 212 "actType": 5, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
207 213 "giftBagId": 1, //礼包Id
208 214 "storeId": a.stoid, //商家Id
... ... @@ -247,7 +253,7 @@ Page({
247 253 _this2.setData({
248 254 giftImage: th.iurl + res.data.data.lbUrl,
249 255 giftTitle: res.data.data.giftTitle,
250   - is_head:1
  256 + is_head: 1
251 257 })
252 258 if (res.data.data.giftRemark == '') {
253 259  
... ...
pages/user/coupons/coupons.js
... ... @@ -185,8 +185,8 @@ Page({
185 185 for(var i in b_arr){
186 186 b_arr[i].isby=1;
187 187 if(b_arr[i].isuse==0){
188   - if(b_arr[i].use_end_time<ut.gettimestamp()){
189   - b_can_arr.push(b_arr[i]);
  188 + if(b_arr[i].use_end_time<=ut.gettimestamp()){
  189 + b_out_arr.push(b_arr[i]);
190 190 }else{
191 191 b_can_arr.push(b_arr[i]);
192 192 }
... ... @@ -311,7 +311,7 @@ Page({
311 311 var big_arr= this.data.details;
312 312 //可用券加入包邮券
313 313 if(big_arr.length==0 && this.data.b_out_arr){
314   - big_arr=this.data.b_can_arr;
  314 + big_arr=this.data.b_out_arr;
315 315 }
316 316 init_num=this.data.b_out_arr.length;
317 317  
... ...