Commit 9708731df1382658b5c16df9ff61f8bf394f2b7d

Authored by 前端开发-罗建龙
1 parent 7e492e65

每月礼包1154场景处理

packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
... ... @@ -78,6 +78,7 @@ Page({
78 78 is_receive:0,
79 79 screenWidth: 0,
80 80 monthgiftbag:{},
  81 + scene:"",
81 82 },
82 83 onLoad: function (options) {
83 84  
... ... @@ -131,7 +132,13 @@ Page({
131 132 // sele_g:monthgiftbag,
132 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 143 init() {
137 144 let options = this.data?.params; // this.data == null ? undefined:this.data.params
... ... @@ -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 333 onShow: function () {
267 334 var th=this;
... ... @@ -296,6 +363,20 @@ Page({
296 363 GetBuyPrice: function (e) {
297 364 var that = this.data;
298 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 381 if (th.data.isStart != 1) {
301 382 getApp().my_warnning("活动还没有开始", 0, th);
... ... @@ -331,6 +412,20 @@ Page({
331 412 GetBuyIntegral: function (e) {
332 413 var that = this.data;
333 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 431 if (th.data.isStart != 1) {
... ...
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
... ... @@ -62,8 +62,8 @@
62 62  
63 63  
64 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 67 <text class="data-v-3a5b7e36"> {{monthgiftbag.oldPrice?'零售价:':''}}{{monthgiftbag.oldPrice+"元"}}</text>
68 68 </view>
69 69 <!-- <view class="top_foot_qty data-v-3a5b7e36">
... ... @@ -154,7 +154,7 @@
154 154 <block wx:if="{{isStart==1}}">
155 155 <view class="foot_button data-v-3a5b7e36">
156 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 158 <text class="data-v-3a5b7e36 ">立即购买</text>
159 159 </view>
160 160 <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
... ... @@ -162,12 +162,12 @@
162 162 </view>
163 163 </block>
164 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 166 <text class="data-v-3a5b7e36">立即购买</text>
167 167 </view>
168 168 </block>
169 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 171 <text class="data-v-3a5b7e36">立即兑换</text>
172 172 </view>
173 173 </block>
... ... @@ -194,7 +194,7 @@
194 194 <view class="foot_button data-v-3a5b7e36">
195 195 <block wx:if="{{is_lb!=1}}">
196 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 198 </view>
199 199 </block>
200 200 <block wx:else>
... ...