Commit 9708731df1382658b5c16df9ff61f8bf394f2b7d
1 parent
7e492e65
每月礼包1154场景处理
Showing
2 changed files
with
102 additions
and
7 deletions
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
| @@ -78,6 +78,7 @@ Page({ | @@ -78,6 +78,7 @@ Page({ | ||
| 78 | is_receive:0, | 78 | is_receive:0, |
| 79 | screenWidth: 0, | 79 | screenWidth: 0, |
| 80 | monthgiftbag:{}, | 80 | monthgiftbag:{}, |
| 81 | + scene:"", | ||
| 81 | }, | 82 | }, |
| 82 | onLoad: function (options) { | 83 | onLoad: function (options) { |
| 83 | 84 | ||
| @@ -131,7 +132,13 @@ Page({ | @@ -131,7 +132,13 @@ Page({ | ||
| 131 | // sele_g:monthgiftbag, | 132 | // sele_g:monthgiftbag, |
| 132 | // def_pick_store:monthgiftba_defpick | 133 | // def_pick_store:monthgiftba_defpick |
| 133 | // }) | 134 | // }) |
| 134 | - | 135 | + let scene = wx.getLaunchOptionsSync().scene; |
| 136 | + if (scene==1154) { | ||
| 137 | + this.setData({ | ||
| 138 | + scene | ||
| 139 | + }) | ||
| 140 | + this.getList2() | ||
| 141 | + } | ||
| 135 | }, | 142 | }, |
| 136 | init() { | 143 | init() { |
| 137 | let options = this.data?.params; // this.data == null ? undefined:this.data.params | 144 | let options = this.data?.params; // this.data == null ? undefined:this.data.params |
| @@ -262,6 +269,66 @@ Page({ | @@ -262,6 +269,66 @@ Page({ | ||
| 262 | }) | 269 | }) |
| 263 | 270 | ||
| 264 | }, | 271 | }, |
| 272 | + getList2: function (e) { | ||
| 273 | + var th = this; | ||
| 274 | + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', { | ||
| 275 | + isShowLoading: true, | ||
| 276 | + data: { | ||
| 277 | + store_id: a.stoid, //商家ID | ||
| 278 | + // user_id: d.user_id, //用户ID | ||
| 279 | + page: 1, | ||
| 280 | + pageSize: 10, | ||
| 281 | + is_end:0, | ||
| 282 | + timetype:1, | ||
| 283 | + id:th.data.params.id | ||
| 284 | + }, | ||
| 285 | + success: function (res) { | ||
| 286 | + if (res.data.code == 0) { | ||
| 287 | + th.data.curpage++; | ||
| 288 | + // var arr1 = th.data.wareCard; | ||
| 289 | + var arr2 = res.data.data.pageData; | ||
| 290 | + for (let j = 0; j < arr2.length; j++) { | ||
| 291 | + // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000 | ||
| 292 | + arr2[j].starTime1=arr2[j].begindate | ||
| 293 | + arr2[j].starTime=i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss"); | ||
| 294 | + arr2[j].endTime=i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss"); | ||
| 295 | + arr2[j].giftPosPrice=arr2[j].oldPrice | ||
| 296 | + arr2[j].payMoney=arr2[j].lbPrice | ||
| 297 | + arr2[j].payIntegral=arr2[j].exchangeIntegral | ||
| 298 | + arr2[j].giftQty=arr2[j].buynum | ||
| 299 | + arr2[j].cover_img=arr2[j].imageurl | ||
| 300 | + arr2[j].giftTitle=arr2[j].act_name | ||
| 301 | + arr2[j].virtualsales=arr2[j].virtualSales | ||
| 302 | + arr2[j].lbnum=arr2[j].lbNum | ||
| 303 | + } | ||
| 304 | + if(arr2.length>0){ | ||
| 305 | + var monthgiftbag =arr2[0]; | ||
| 306 | + var ismore = 0; | ||
| 307 | + // if (arr3.length == res.data.data.total) ismore = 1 | ||
| 308 | + var isStart=0; | ||
| 309 | + if (monthgiftbag) { | ||
| 310 | + var start = monthgiftbag.begindate; | ||
| 311 | + let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"') | ||
| 312 | + monthgiftbag.remark=remark | ||
| 313 | + var now = ut.gettimestamp(); | ||
| 314 | + if (start < now) isStart = 1; | ||
| 315 | + } | ||
| 316 | + | ||
| 317 | + | ||
| 318 | + th.setData({ | ||
| 319 | + isStart, | ||
| 320 | + monthgiftbag: monthgiftbag, | ||
| 321 | + sele_g: monthgiftbag, | ||
| 322 | + }) | ||
| 323 | + th.init() | ||
| 324 | + } | ||
| 325 | + } else { | ||
| 326 | + getApp().my_warnning("获取活动失败", 0, th); | ||
| 327 | + } | ||
| 328 | + } | ||
| 329 | + }) | ||
| 330 | + | ||
| 331 | + }, | ||
| 265 | 332 | ||
| 266 | onShow: function () { | 333 | onShow: function () { |
| 267 | var th=this; | 334 | var th=this; |
| @@ -296,6 +363,20 @@ Page({ | @@ -296,6 +363,20 @@ Page({ | ||
| 296 | GetBuyPrice: function (e) { | 363 | GetBuyPrice: function (e) { |
| 297 | var that = this.data; | 364 | var that = this.data; |
| 298 | var th = this; | 365 | var th = this; |
| 366 | + | ||
| 367 | + if (!d || !d.user_id ) { | ||
| 368 | + let scene = that.data.scene; | ||
| 369 | + if (scene==1154) { | ||
| 370 | + wx.navigateTo({ | ||
| 371 | + url: '/packageE/pages/togoin/togoin', | ||
| 372 | + }) | ||
| 373 | + return | ||
| 374 | + }else{ | ||
| 375 | + getApp().my_warnning("请先登录", 0, th); | ||
| 376 | + return false; | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + } | ||
| 299 | //如果还没有开始的话 | 380 | //如果还没有开始的话 |
| 300 | if (th.data.isStart != 1) { | 381 | if (th.data.isStart != 1) { |
| 301 | getApp().my_warnning("活动还没有开始", 0, th); | 382 | getApp().my_warnning("活动还没有开始", 0, th); |
| @@ -331,6 +412,20 @@ Page({ | @@ -331,6 +412,20 @@ Page({ | ||
| 331 | GetBuyIntegral: function (e) { | 412 | GetBuyIntegral: function (e) { |
| 332 | var that = this.data; | 413 | var that = this.data; |
| 333 | var th = this; | 414 | var th = this; |
| 415 | + | ||
| 416 | + if (!d || !d.user_id ) { | ||
| 417 | + let scene = that.data.scene; | ||
| 418 | + if (scene==1154) { | ||
| 419 | + wx.navigateTo({ | ||
| 420 | + url: '/packageE/pages/togoin/togoin', | ||
| 421 | + }) | ||
| 422 | + return | ||
| 423 | + }else{ | ||
| 424 | + getApp().my_warnning("请先登录", 0, th); | ||
| 425 | + return false; | ||
| 426 | + } | ||
| 427 | + | ||
| 428 | + } | ||
| 334 | 429 | ||
| 335 | //如果还没有开始的话 | 430 | //如果还没有开始的话 |
| 336 | if (th.data.isStart != 1) { | 431 | if (th.data.isStart != 1) { |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
| @@ -62,8 +62,8 @@ | @@ -62,8 +62,8 @@ | ||
| 62 | 62 | ||
| 63 | 63 | ||
| 64 | </view> | 64 | </view> |
| 65 | - <view class="top_foot data-v-3a5b7e36"> | ||
| 66 | - <view class="top_foot_price data-v-3a5b7e36 no_line_x"> | 65 | + <view class="top_foot data-v-3a5b7e36" wx:if="{{monthgiftbag.oldPrice}}"> |
| 66 | + <view class="top_foot_price data-v-3a5b7e36 no_line_x" > | ||
| 67 | <text class="data-v-3a5b7e36"> {{monthgiftbag.oldPrice?'零售价:':''}}{{monthgiftbag.oldPrice+"元"}}</text> | 67 | <text class="data-v-3a5b7e36"> {{monthgiftbag.oldPrice?'零售价:':''}}{{monthgiftbag.oldPrice+"元"}}</text> |
| 68 | </view> | 68 | </view> |
| 69 | <!-- <view class="top_foot_qty data-v-3a5b7e36"> | 69 | <!-- <view class="top_foot_qty data-v-3a5b7e36"> |
| @@ -154,7 +154,7 @@ | @@ -154,7 +154,7 @@ | ||
| 154 | <block wx:if="{{isStart==1}}"> | 154 | <block wx:if="{{isStart==1}}"> |
| 155 | <view class="foot_button data-v-3a5b7e36"> | 155 | <view class="foot_button data-v-3a5b7e36"> |
| 156 | <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral>0}}"> | 156 | <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral>0}}"> |
| 157 | - <view class="foot_button_left data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | 157 | + <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_left data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> |
| 158 | <text class="data-v-3a5b7e36 ">立即购买</text> | 158 | <text class="data-v-3a5b7e36 ">立即购买</text> |
| 159 | </view> | 159 | </view> |
| 160 | <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> | 160 | <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> |
| @@ -162,12 +162,12 @@ | @@ -162,12 +162,12 @@ | ||
| 162 | </view> | 162 | </view> |
| 163 | </block> | 163 | </block> |
| 164 | <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral<=0}}"> | 164 | <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral<=0}}"> |
| 165 | - <view class="foot_button_buy data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> | 165 | + <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_buy data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> |
| 166 | <text class="data-v-3a5b7e36">立即购买</text> | 166 | <text class="data-v-3a5b7e36">立即购买</text> |
| 167 | </view> | 167 | </view> |
| 168 | </block> | 168 | </block> |
| 169 | <block wx:if="{{monthgiftbag.lbPrice<=0 && monthgiftbag.payIntegral>0}}"> | 169 | <block wx:if="{{monthgiftbag.lbPrice<=0 && monthgiftbag.payIntegral>0}}"> |
| 170 | - <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> | 170 | + <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> |
| 171 | <text class="data-v-3a5b7e36">立即兑换</text> | 171 | <text class="data-v-3a5b7e36">立即兑换</text> |
| 172 | </view> | 172 | </view> |
| 173 | </block> | 173 | </block> |
| @@ -194,7 +194,7 @@ | @@ -194,7 +194,7 @@ | ||
| 194 | <view class="foot_button data-v-3a5b7e36"> | 194 | <view class="foot_button data-v-3a5b7e36"> |
| 195 | <block wx:if="{{is_lb!=1}}"> | 195 | <block wx:if="{{is_lb!=1}}"> |
| 196 | <view class="foot_button_buy data-v-3a5b7e36 overdue"> | 196 | <view class="foot_button_buy data-v-3a5b7e36 overdue"> |
| 197 | - <text class="data-v-3a5b7e36">无核销商品</text> | 197 | + <text class="data-v-3a5b7e36">请先登录</text> |
| 198 | </view> | 198 | </view> |
| 199 | </block> | 199 | </block> |
| 200 | <block wx:else> | 200 | <block wx:else> |