Commit be860f857372419468ffcdb33672777cd94c03c7

Authored by yvan.ni
1 parent 4cee9a6e

1. 服务卡项加入购物车的优化

2.  月包列表的优化
packageA/pages/goodsInfo/goodsInfo.js
... ... @@ -1201,7 +1201,7 @@ Page({
1201 1201 }
1202 1202  
1203 1203 // 以下为当前门店同类商品已经加入到购物车
1204   - var totalNum = th.data.goodsInputNum + item.goods_num;
  1204 + var totalNum = th.data.goodsInputNum + (item?item.goods_num:0);
1205 1205  
1206 1206 // 秒杀购物车购买 修正数量
1207 1207 if (th.data.prom_type == 1 && !th.data.is_normal) {
... ... @@ -1225,43 +1225,60 @@ Page({
1225 1225 }
1226 1226 }
1227 1227  
1228   - var updata = {
1229   - id: item.id,
1230   - goods_num: totalNum,
1231   - money: th.data.data.shop_price,
1232   - store_id: os.stoid,
1233   - };
1234   -
1235   - // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
1236   - if(th.data.options.prom_type == 1) {
1237   - // updata['prom_type'] = th.data.options.prom_type;
1238   - // updata['prom_id'] = th.data.options.prom_id;
1239   - if(th.data.openSpecModal_flash_normal) {
1240   - updata['money'] = th.data.data.shop_price;
1241   - updata['is_pd_normal'] = 1;
1242   - } else {
1243   - updata['money'] = th.data.prom_price;
1244   - };
1245   - };
1246   -
1247   - if (getApp().globalData.guide_id) {
1248   - updata['guide_id'] = getApp().globalData.guide_id;
1249   - updata['guide_type'] = 1;
1250   - }
1251   - if(getApp().globalData.groupchat_id){
1252   - updata['groupchat_id'] = getApp().globalData.groupchat_id;
1253   - }
1254   - getApp().request.put("/api/weshop/cartService/update", {
1255   - data: updata,
1256   - success: function(t) {
1257   - getApp().my_warnning('加入购物车成功', 1, th, 450);
1258   - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
1259   - th.setData({
1260   - cartGoodsNum: c_num
1261   - });
1262   - th.closeSpecModal();
1263   - }
1264   - });
  1228 + if(item) {
  1229 + var updata = {
  1230 + id: item.id,
  1231 + goods_num: totalNum,
  1232 + money: th.data.data.shop_price,
  1233 + store_id: os.stoid,
  1234 + };
  1235 +
  1236 + // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
  1237 + if (th.data.options.prom_type == 1) {
  1238 + // updata['prom_type'] = th.data.options.prom_type;
  1239 + // updata['prom_id'] = th.data.options.prom_id;
  1240 + if (th.data.openSpecModal_flash_normal) {
  1241 + updata['money'] = th.data.data.shop_price;
  1242 + updata['is_pd_normal'] = 1;
  1243 + } else {
  1244 + updata['money'] = th.data.prom_price;
  1245 + }
  1246 +
  1247 + }
  1248 +
  1249 +
  1250 + if (getApp().globalData.guide_id) {
  1251 + updata['guide_id'] = getApp().globalData.guide_id;
  1252 + updata['guide_type'] = 1;
  1253 + }
  1254 + if (getApp().globalData.groupchat_id) {
  1255 + updata['groupchat_id'] = getApp().globalData.groupchat_id;
  1256 + }
  1257 + getApp().request.put("/api/weshop/cartService/update", {
  1258 + data: updata,
  1259 + success: function (t) {
  1260 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  1261 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  1262 + th.setData({
  1263 + cartGoodsNum: c_num
  1264 + });
  1265 + th.closeSpecModal();
  1266 + }
  1267 + });
  1268 + }else{
  1269 + getApp().request.post("/api/weshop/cartService/save", {
  1270 + data: newd,
  1271 + success: function(t) {
  1272 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  1273 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  1274 + th.setData({
  1275 + cartGoodsNum: c_num
  1276 + });
  1277 + th.closeSpecModal();
  1278 + }
  1279 + });
  1280 +
  1281 + }
1265 1282 } else {
1266 1283 getApp().request.post("/api/weshop/cartService/save", {
1267 1284 data: newd,
... ...
packageA/pages/goodsInfo/goodsInfo.wxml
... ... @@ -602,7 +602,6 @@
602 602 <view class="shopping-cart cart-ico new_split pdh20">
603 603 <navigator open-type="switchTab" url="/pages/cart/cart/cart" style="text-align: center">
604 604 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
605   - <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>
606 605 <view>购物车</view>
607 606 </navigator>
608 607 </view>
... ...
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
... ... @@ -72,30 +72,30 @@ Page({
72 72 openSpecModal: 0,
73 73  
74 74 sto_sele_name_1: '',
75   - share_goods_img:'', //礼包的分享图
76   - giftImageCover:null,
77   - canvasHidden:true,
78   - is_receive:0,
  75 + share_goods_img: '', //礼包的分享图
  76 + giftImageCover: null,
  77 + canvasHidden: true,
  78 + is_receive: 0,
79 79 screenWidth: 0,
80   - monthgiftbag:{},
81   - scene:"",
82   - keyword:'', //门店搜索
83   - sec_i:-1,//选中分类门店 下标
  80 + monthgiftbag: {},
  81 + scene: "",
  82 + keyword: '', //门店搜索
  83 + sec_i: -1,//选中分类门店 下标
84 84 },
85 85 onLoad: function (options) {
86 86 //定义第一次进入
87   - this.data.fir_in=1;
  87 + this.data.fir_in = 1;
88 88  
89 89 var th = this;
90 90 console.log('分享参数---');
91 91 console.log(options);
92 92 if (options.lbId && !options.id) {
93   - options.id=options.lbId
94   - // options.lbId=options.id
  93 + options.id = options.lbId
  94 + // options.lbId=options.id
95 95 }
96 96 if (options.id) {
97   - options.lbId=options.id
98   - // options.lbId=options.id
  97 + options.lbId = options.id
  98 + // options.lbId=options.id
99 99 }
100 100  
101 101  
... ... @@ -105,18 +105,18 @@ Page({
105 105 getStorageID: a.stoid,
106 106 })
107 107  
108   - if(!options.lbId && options.scene){
  108 + if (!options.lbId && options.scene) {
109 109 var gid_str = decodeURIComponent(options.scene);
110 110 gid_str = gid_str.split("_");
111   - options.lbId=gid_str[0];
112   - options.id=gid_str[0];
113   - options.first_leader=gid_str[1];
114   - options.isBuy=1;
  111 + options.lbId = gid_str[0];
  112 + options.id = gid_str[0];
  113 + options.first_leader = gid_str[1];
  114 + options.isBuy = 1;
115 115 }
116 116  
117 117 this.setData({
118 118 params: options,
119   - getGiftID:options.id
  119 + getGiftID: options.id
120 120 })
121 121  
122 122  
... ... @@ -125,8 +125,8 @@ Page({
125 125 getGiftID: options.lbId,
126 126 orderSn: options.orderSn,
127 127 flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1
128   - record_list_id:options.record_list_id,
129   - is_receive:options.is_receive
  128 + record_list_id: options.record_list_id,
  129 + is_receive: options.is_receive
130 130 })
131 131 if (options.lbId) th.data.lbId = options.lbId;
132 132 //-- 获取分享人的ID --
... ... @@ -141,7 +141,7 @@ Page({
141 141 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
142 142 if (res.data.code == 0) {
143 143 getApp().globalData.guide_id = res.data.data.id;
144   - getApp().globalData.guide_pick_id= res.data.data.pickup_id
  144 + getApp().globalData.guide_pick_id = res.data.data.pickup_id
145 145 }
146 146 })
147 147 }
... ... @@ -150,7 +150,7 @@ Page({
150 150  
151 151  
152 152 getApp().getConfig(function (e) {
153   - th.setData({sto_sele_name_1: e.store_name})
  153 + th.setData({ sto_sele_name_1: e.store_name })
154 154 })
155 155  
156 156 getApp().getConfig2(function (e) {
... ... @@ -171,10 +171,10 @@ Page({
171 171 }
172 172 });
173 173  
174   - let monthgiftbag=wx.getStorageSync('monthgiftbag')
175   - let monthgiftba_defpick=wx.getStorageSync('monthgiftba_defpick')
  174 + let monthgiftbag = wx.getStorageSync('monthgiftbag')
  175 + let monthgiftba_defpick = wx.getStorageSync('monthgiftba_defpick')
176 176 var now = ut.gettimestamp();
177   - var isStart=0;
  177 + var isStart = 0;
178 178 // var str = res.data.data.starTime;
179 179 // if (start < now) isStart = 1;
180 180 // start = start / 1000;
... ... @@ -188,32 +188,32 @@ Page({
188 188 // }
189 189  
190 190 // this.setData({
191   - // isStart,
192   - // monthgiftbag,
193   - // sele_g:monthgiftbag,
194   - // def_pick_store:monthgiftba_defpick
  191 + // isStart,
  192 + // monthgiftbag,
  193 + // sele_g:monthgiftbag,
  194 + // def_pick_store:monthgiftba_defpick
195 195 // })
196   - let scene=wx.getLaunchOptionsSync().scene;
197   - if (scene==1154) {
  196 + let scene = wx.getLaunchOptionsSync().scene;
  197 + if (scene == 1154) {
198 198 this.setData({
199   - scene
  199 + scene
200 200 })
201 201 this.getList2()
202   - }
  202 + }
203 203 },
204 204 init() {
205 205  
206   - var th=this;
  206 + var th = this;
207 207 //-- 检测一下有没有门店 --
208   - th.check_guide(function (){
209   - com.wait_for_store_config(th);
210   - com.set_user_mo_store(th, os, function () {
211   - if (th.data.sele_g.pickup_list && th.data.def_pick_store) {
212   - com.check_def_pk(th);
213   - }
214   - });
215   - com.get_sto(th, os);
216   - })
  208 + th.check_guide(function () {
  209 + com.wait_for_store_config(th);
  210 + com.set_user_mo_store(th, os, function () {
  211 + if (th.data.sele_g.pickup_list && th.data.def_pick_store) {
  212 + com.check_def_pk(th);
  213 + }
  214 + });
  215 + com.get_sto(th, os);
  216 + })
217 217 // this.GetBuyGiftList();
218 218 // if (this.data.flag == 1) {
219 219 // this.getZxlbDetails();
... ... @@ -227,201 +227,210 @@ Page({
227 227 // }
228 228  
229 229 },
230   - logTab(){
231   - wx.navigateTo({
232   - url: '/packageE/pages/togoin/togoin',
233   - })
  230 + logTab() {
  231 + wx.navigateTo({
  232 + url: '/packageE/pages/togoin/togoin',
  233 + })
234 234 },
235 235 getListInfo: function (e) {
236   - var th = this;
237   - getApp().request.get(`/api/weshop/marketing/marketingMonthgiftbagForm/get/${a.stoid}/${th.data.params.id}`, {
238   - isShowLoading: true,
239   - data: {
240   - // store_id: a.stoid, //商家ID
241   - // user_id: d.user_id, //用户ID
242   - // page: 1,
243   - // pageSize: 10,
244   - // is_end:0,
245   - // timetype:1,
246   - // id:th.data.params.id
247   - },
248   - success: function (res) {
249   - if (res.data.code == 0) {
250   - // th.data.curpage++;
251   - // var arr1 = th.data.wareCard;
252   - let obj = res.data.data;
253   - let monthgiftbag={
254   - remark:obj.remark,
255   - cover_img:obj.imageurl,
256   - giftTitle:obj.act_name,
257   - lbPrice:obj.oldPrice
258   - }
259   - let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
260   - monthgiftbag.remark=remark
261   - th.setData({
262   - monthgiftbag: monthgiftbag,
263   - })
264   - }else {
265   - getApp().my_warnning("获取活动失败", 0, th);
  236 + var th = this;
  237 + getApp().request.get(`/api/weshop/marketing/marketingMonthgiftbagForm/get/${a.stoid}/${th.data.params.id}`, {
  238 + isShowLoading: true,
  239 + data: {
  240 + // store_id: a.stoid, //商家ID
  241 + // user_id: d.user_id, //用户ID
  242 + // page: 1,
  243 + // pageSize: 10,
  244 + // is_end:0,
  245 + // timetype:1,
  246 + // id:th.data.params.id
  247 + },
  248 + success: function (res) {
  249 + if (res.data.code == 0) {
  250 + // th.data.curpage++;
  251 + // var arr1 = th.data.wareCard;
  252 + let obj = res.data.data;
  253 + let monthgiftbag = {
  254 + remark: obj.remark,
  255 + cover_img: obj.imageurl,
  256 + giftTitle: obj.act_name,
  257 + lbPrice: obj.oldPrice
  258 + }
  259 + let remark = monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  260 + monthgiftbag.remark = remark
  261 + th.setData({
  262 + monthgiftbag: monthgiftbag,
  263 + })
  264 +
  265 + th.get_lb_list();//获取从表
  266 +
  267 +
  268 + } else {
  269 + getApp().my_warnning("获取活动失败", 0, th);
  270 + }
  271 +
266 272 }
267   -
268   - }
269   - })
270   -
  273 + })
  274 +
271 275 },
  276 +
272 277 getList: function (e) {
273   - var th = this;
274   - if (!d.user_id) {
275   - th.getList2()
276   - return
277   - }
278   - getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {
279   - isShowLoading: true,
280   - data: {
281   - store_id: a.stoid, //商家ID
282   - user_id: d.user_id, //用户ID
283   - page: 1,
284   - pageSize: 10,
285   - is_end:0,
286   - timetype:1,
287   - id:th.data.params.id
288   - },
289   - success: function (res) {
290   - if (res.data.code == 0) {
291   - th.data.curpage++;
292   - // var arr1 = th.data.wareCard;
293   - var arr2 = res.data.data.pageData;
294   - for (let j = 0; j < arr2.length; j++) {
295   - // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000
296   - arr2[j].starTime1=arr2[j].begindate
297   - arr2[j].starTime=i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");
298   - arr2[j].endTime=i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");
299   - arr2[j].giftPosPrice=arr2[j].oldPrice
300   - arr2[j].payMoney=arr2[j].lbPrice
301   - arr2[j].payIntegral=arr2[j].exchangeIntegral
302   - arr2[j].giftQty=arr2[j].buynum
303   - arr2[j].cover_img=arr2[j].imageurl
304   - arr2[j].giftTitle=arr2[j].act_name
305   - arr2[j].virtualsales=arr2[j].virtualSales
306   - arr2[j].lbnum=arr2[j].lbNum
307   -
308   - }
309   - if(arr2.length>0){
310   - var monthgiftbag =arr2[0];
311   - var ismore = 0;
312   - // if (arr3.length == res.data.data.total) ismore = 1
313   - var isStart=0;
314   - if (monthgiftbag) {
315   - var start = monthgiftbag.begindate;
316   - let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
317   - monthgiftbag.remark=remark
318   - var now = ut.gettimestamp();
319   - if (start < now) isStart = 1;
320   - }
321   -
322   -
323   - th.setData({
324   - isStart,
325   - monthgiftbag: monthgiftbag,
326   - sele_g: monthgiftbag,
327   - default_color:monthgiftbag.bg_color
328   - })
329   - th.init()
330   - }else{
331   - wx.showModal({
332   - title: '提示',
333   - content:'会员身份不符,暂时无法参与',
334   - showCancel:false,
335   - success (res) {
336   - if (res.confirm) {
337   - console.log('用户点击确定')
338   - wx.reLaunch({
339   - url: '/pages/index/index/index'
340   - })
341   - } else if (res.cancel) {
342   - console.log('用户点击取消')
343   - }
  278 + var th = this;
  279 + if (!d.user_id) {
  280 + th.getList2()
  281 + return
  282 + }
  283 + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {
  284 + isShowLoading: true,
  285 + data: {
  286 + store_id: a.stoid, //商家ID
  287 + user_id: d.user_id, //用户ID
  288 + page: 1,
  289 + pageSize: 10,
  290 + is_end: 0,
  291 + timetype: 1,
  292 + id: th.data.params.id
  293 + },
  294 + success: function (res) {
  295 + if (res.data.code == 0) {
  296 + th.data.curpage++;
  297 + // var arr1 = th.data.wareCard;
  298 + var arr2 = res.data.data.pageData;
  299 + for (let j = 0; j < arr2.length; j++) {
  300 + // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000
  301 + arr2[j].starTime1 = arr2[j].begindate
  302 + arr2[j].starTime = i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");
  303 + arr2[j].endTime = i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");
  304 + arr2[j].giftPosPrice = arr2[j].oldPrice
  305 + arr2[j].payMoney = arr2[j].lbPrice
  306 + arr2[j].payIntegral = arr2[j].exchangeIntegral
  307 + arr2[j].giftQty = arr2[j].buynum
  308 + arr2[j].cover_img = arr2[j].imageurl
  309 + arr2[j].giftTitle = arr2[j].act_name
  310 + arr2[j].virtualsales = arr2[j].virtualSales
  311 + arr2[j].lbnum = arr2[j].lbNum
  312 +
  313 + }
  314 + if (arr2.length > 0) {
  315 + var monthgiftbag = arr2[0];
  316 + var ismore = 0;
  317 + // if (arr3.length == res.data.data.total) ismore = 1
  318 + var isStart = 0;
  319 + if (monthgiftbag) {
  320 + var start = monthgiftbag.begindate;
  321 + let remark = monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  322 + monthgiftbag.remark = remark
  323 + var now = ut.gettimestamp();
  324 + if (start < now) isStart = 1;
  325 + }
  326 +
  327 +
  328 + th.setData({
  329 + isStart,
  330 + monthgiftbag: monthgiftbag,
  331 + sele_g: monthgiftbag,
  332 + default_color: monthgiftbag.bg_color
  333 + })
  334 + th.init()
  335 +
  336 + th.get_lb_list();//获取从表
  337 +
  338 + } else {
  339 + wx.showModal({
  340 + title: '提示',
  341 + content: '会员身份不符,暂时无法参与',
  342 + showCancel: false,
  343 + success(res) {
  344 + if (res.confirm) {
  345 + console.log('用户点击确定')
  346 + wx.reLaunch({
  347 + url: '/pages/index/index/index'
  348 + })
  349 + } else if (res.cancel) {
  350 + console.log('用户点击取消')
  351 + }
  352 + }
  353 + })
  354 +
  355 + // th.setData({
  356 + // qx_msg:'活动对象未符合,不能参与'
  357 + // })
  358 +
  359 + }
  360 + } else {
  361 + getApp().my_warnning("获取活动失败", 0, th);
344 362 }
345   - })
346   -
347   - // th.setData({
348   - // qx_msg:'活动对象未符合,不能参与'
349   - // })
350 363 }
351   - } else {
352   - getApp().my_warnning("获取活动失败", 0, th);
353   - }
354   - }
355   - })
356   -
  364 + })
  365 +
357 366 },
358 367 getList2: function (e) {
359   - var th = this;
360   - getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {
361   - isShowLoading: true,
362   - data: {
363   - store_id: a.stoid, //商家ID
364   - // user_id: d.user_id, //用户ID
365   - page: 1,
366   - pageSize: 10,
367   - is_end:0,
368   - timetype:1,
369   - id:th.data.params.id
370   - },
371   - success: function (res) {
372   - if (res.data.code == 0) {
373   - th.data.curpage++;
374   - // var arr1 = th.data.wareCard;
375   - var arr2 = res.data.data.pageData;
376   - for (let j = 0; j < arr2.length; j++) {
377   - // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000
378   - arr2[j].starTime1=arr2[j].begindate
379   - arr2[j].starTime=i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");
380   - arr2[j].endTime=i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");
381   - arr2[j].giftPosPrice=arr2[j].oldPrice
382   - arr2[j].payMoney=arr2[j].lbPrice
383   - arr2[j].payIntegral=arr2[j].exchangeIntegral
384   - arr2[j].giftQty=arr2[j].buynum
385   - arr2[j].cover_img=arr2[j].imageurl
386   - arr2[j].giftTitle=arr2[j].act_name
387   - arr2[j].virtualsales=arr2[j].virtualSales
388   - arr2[j].lbnum=arr2[j].lbNum
389   - }
390   - if(arr2.length>0){
391   - var monthgiftbag =arr2[0];
392   - var ismore = 0;
393   - // if (arr3.length == res.data.data.total) ismore = 1
394   - var isStart=0;
395   - if (monthgiftbag) {
396   - var start = monthgiftbag.begindate;
397   - let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
398   - monthgiftbag.remark=remark
399   - var now = ut.gettimestamp();
400   - if (start < now) isStart = 1;
401   - }
402   -
403   -
404   - th.setData({
405   - isStart,
406   - monthgiftbag: monthgiftbag,
407   - sele_g: monthgiftbag,
408   - })
409   - th.init()
  368 + var th = this;
  369 + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {
  370 + isShowLoading: true,
  371 + data: {
  372 + store_id: a.stoid, //商家ID
  373 + // user_id: d.user_id, //用户ID
  374 + page: 1,
  375 + pageSize: 10,
  376 + is_end: 0,
  377 + timetype: 1,
  378 + id: th.data.params.id
  379 + },
  380 + success: function (res) {
  381 + if (res.data.code == 0) {
  382 + th.data.curpage++;
  383 + // var arr1 = th.data.wareCard;
  384 + var arr2 = res.data.data.pageData;
  385 + for (let j = 0; j < arr2.length; j++) {
  386 + // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000
  387 + arr2[j].starTime1 = arr2[j].begindate
  388 + arr2[j].starTime = i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");
  389 + arr2[j].endTime = i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");
  390 + arr2[j].giftPosPrice = arr2[j].oldPrice
  391 + arr2[j].payMoney = arr2[j].lbPrice
  392 + arr2[j].payIntegral = arr2[j].exchangeIntegral
  393 + arr2[j].giftQty = arr2[j].buynum
  394 + arr2[j].cover_img = arr2[j].imageurl
  395 + arr2[j].giftTitle = arr2[j].act_name
  396 + arr2[j].virtualsales = arr2[j].virtualSales
  397 + arr2[j].lbnum = arr2[j].lbNum
  398 + }
  399 + if (arr2.length > 0) {
  400 + var monthgiftbag = arr2[0];
  401 + var ismore = 0;
  402 + // if (arr3.length == res.data.data.total) ismore = 1
  403 + var isStart = 0;
  404 + if (monthgiftbag) {
  405 + var start = monthgiftbag.begindate;
  406 + let remark = monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  407 + monthgiftbag.remark = remark
  408 + var now = ut.gettimestamp();
  409 + if (start < now) isStart = 1;
  410 + }
  411 +
  412 +
  413 + th.setData({
  414 + isStart,
  415 + monthgiftbag: monthgiftbag,
  416 + sele_g: monthgiftbag,
  417 + })
  418 + th.init()
  419 + }
  420 + } else {
  421 + getApp().my_warnning("获取活动失败", 0, th);
  422 + }
410 423 }
411   - } else {
412   - getApp().my_warnning("获取活动失败", 0, th);
413   - }
414   - }
415   - })
416   -
  424 + })
  425 +
417 426 },
418 427  
419 428 onShow: function () {
420   - var th=this;
421   - this.setData({submit:0})
  429 + var th = this;
  430 + this.setData({ submit: 0 })
422 431  
423   - //res = res.data.data.result;
424   - //if (!res) return false;
  432 + //res = res.data.data.result;
  433 + //if (!res) return false;
425 434 this.setData({
426 435 getUserID: d.user_id || 0,
427 436 });
... ... @@ -434,19 +443,19 @@ Page({
434 443 getApp().goto('/packageE/pages/togoin/togoin');
435 444 return false;
436 445 }
437   -
  446 +
438 447 if (th.data.params && th.data.params.is_act) {
439   - this.getListInfo()
440   - }else{
441   - this.getList();
  448 + this.getListInfo()
  449 + } else {
  450 + this.getList();
442 451 }
443 452 })
444 453  
445 454  
446 455 //判断是不是第一次进入
447   - if(this.data.fir_in){
448   - this.data.fir_in=0;
449   - }else {
  456 + if (this.data.fir_in) {
  457 + this.data.fir_in = 0;
  458 + } else {
450 459 com.set_py_fir();
451 460  
452 461 setTimeout(() => {
... ... @@ -463,60 +472,63 @@ Page({
463 472 })
464 473  
465 474  
466   - if(th.data.back_ord){
  475 + if (th.data.back_ord) {
467 476  
468   - var money=th.data.payMoney;
  477 + var money = th.data.payMoney;
469 478 var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord;
470 479 //-- 通联的第三方支付的返回优化 --
471   - ut.is_pay_ok(th.data.back_ord,bk_url,"none",function (){
472   - if(!th.data.back_ord) return false;
  480 + ut.is_pay_ok(th.data.back_ord, bk_url, "none", function () {
  481 + if (!th.data.back_ord) return false;
473 482 getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page",
474   - {data:{store_id:os.stoid,order_sn:th.data.back_ord,user_id:getApp().globalData.user_id}}).then(res=>{
475   -
476   - if(ut.ajax_ok(res)){
477   - var item=res.data.data.pageData[0];
478   - if(item.pay_state==1){
479   - //支付支付,返回首页
480   - ut.m_toast('支付成功');
481   - th.data.back_ord=null;
482   - setTimeout(()=>{
483   - getApp().goto(bk_url);
484   - },1000)
485   -
486   - }else{
487   - //支付支付,返回首页
488   - ut.m_toast('支付失败');
489   - setTimeout(()=>{
490   - getApp().goto("/pages/index/index/index");
491   - },1000)
  483 + { data: { store_id: os.stoid, order_sn: th.data.back_ord, user_id: getApp().globalData.user_id } }).then(res => {
  484 +
  485 + if (ut.ajax_ok(res)) {
  486 + var item = res.data.data.pageData[0];
  487 + if (item.pay_state == 1) {
  488 + //支付支付,返回首页
  489 + ut.m_toast('支付成功');
  490 + th.data.back_ord = null;
  491 + setTimeout(() => {
  492 + getApp().goto(bk_url);
  493 + }, 1000)
  494 +
  495 + } else {
  496 + //支付支付,返回首页
  497 + ut.m_toast('支付失败');
  498 + setTimeout(() => {
  499 + getApp().goto("/pages/index/index/index");
  500 + }, 1000)
  501 + }
492 502 }
493   - }
494   - })
495   - },null,null,1);
  503 + })
  504 + }, null, null, 1);
496 505  
497   - th.data.back_ord=null;
  506 + th.data.back_ord = null;
498 507 }
499 508  
500 509  
501 510 }, 1000)
502 511 }
503 512  
  513 +
  514 +
  515 +
504 516 },
505 517 GetBuyPrice: function (e) {
506 518 var that = this.data;
507 519 var th = this;
508   - let scene=this.data.scene;
509   - if (scene==1154) {
510   - wx.navigateTo({
511   - url: '/packageE/pages/togoin/togoin',
512   - })
513   - return
  520 + let scene = this.data.scene;
  521 + if (scene == 1154) {
  522 + wx.navigateTo({
  523 + url: '/packageE/pages/togoin/togoin',
  524 + })
  525 + return
514 526 }
515 527  
516   - if (!d || !d.user_id ) {
  528 + if (!d || !d.user_id) {
517 529 getApp().my_warnning("请先登录", 0, th);
518 530 return false;
519   -
  531 +
520 532 }
521 533 //如果还没有开始的话
522 534 if (th.data.isStart != 1) {
... ... @@ -525,14 +537,14 @@ Page({
525 537 }
526 538  
527 539 this.data.payMoney = th.data.sele_g.payMoney;
528   - th.setData({buyType: 2})
  540 + th.setData({ buyType: 2 })
529 541 if (th.data.sele_g.is_pickup) {
530 542 th.setData({
531 543 openSpecModal: 1
532 544 })
533 545 } else {
534 546  
535   - if(this.data.submit) return false;
  547 + if (this.data.submit) return false;
536 548 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
537 549 my_confirm.open(
538 550 "是否确定购买该礼包",
... ... @@ -553,17 +565,17 @@ Page({
553 565 GetBuyIntegral: function (e) {
554 566 var that = this.data;
555 567 var th = this;
556   - let scene =this.data.scene;
557   - if (scene==1154) {
558   - wx.navigateTo({
559   - url: '/packageE/pages/togoin/togoin',
560   - })
561   - return
  568 + let scene = this.data.scene;
  569 + if (scene == 1154) {
  570 + wx.navigateTo({
  571 + url: '/packageE/pages/togoin/togoin',
  572 + })
  573 + return
562 574 }
563   - if (!d || !d.user_id ) {
  575 + if (!d || !d.user_id) {
564 576 getApp().my_warnning("请先登录", 0, th);
565 577 return false;
566   -
  578 +
567 579 }
568 580  
569 581 //如果还没有开始的话
... ... @@ -572,7 +584,7 @@ Page({
572 584 return false;
573 585 }
574 586  
575   - th.setData({buyType: 1});
  587 + th.setData({ buyType: 1 });
576 588 if (th.data.sele_g.is_pickup) {
577 589 th.setData({
578 590 openSpecModal: 1
... ... @@ -607,17 +619,17 @@ Page({
607 619 },
608 620 success: function (res) {
609 621 if (res.data.code == 0) {
610   - console.log('商品------++')
611   - console.log(res)
  622 + console.log('商品------++')
  623 + console.log(res)
612 624 th.setData({
613   - giftImage: th.data.iurl + res.data.data.lbUrl,
614   - giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
  625 + giftImage: th.data.iurl + res.data.data.lbUrl,
  626 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img : res.data.data.lbUrl),
615 627 giftTitle: res.data.data.giftTitle,
616 628 default_color: res.data.data.bgcolor
617 629 })
618 630  
619 631 if (res.data.data.iswarelbtype == 1) {
620   - th.setData({iswarelbtype: 1})
  632 + th.setData({ iswarelbtype: 1 })
621 633 }
622 634  
623 635 if (!res.data.data.giftRemark || res.data.data.giftRemark == '') {
... ... @@ -676,7 +688,7 @@ Page({
676 688 getApp().request.get("/api/weshop/pickup/get/" + os.stoid + "/" + res.data.data.pickup_id, {
677 689 success: function (res) {
678 690 if (res.data.code == 0) {
679   - th.setData({pick_up: res.data.data});
  691 + th.setData({ pick_up: res.data.data });
680 692 }
681 693 }
682 694 });
... ... @@ -693,26 +705,26 @@ Page({
693 705  
694 706 },
695 707  
696   - check_guide(func){
697   - var first_leader=this.data.first_leader;
698   - if(!first_leader){
  708 + check_guide(func) {
  709 + var first_leader = this.data.first_leader;
  710 + if (!first_leader) {
699 711 func();
700 712 return false;
701 713 }
702   - if(this.data.is_geted_guide_pick){
  714 + if (this.data.is_geted_guide_pick) {
703 715 func();
704 716 return false;
705 717 }
706   - if(getApp().globalData.guide_pick_id){
  718 + if (getApp().globalData.guide_pick_id) {
707 719 func();
708 720 return false;
709 721 }
710   - var th=this;
  722 + var th = this;
711 723 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
712 724 if (res.data.code == 0) {
713   - getApp().globalData.guide_pick_id= res.data.data.pickup_id;
  725 + getApp().globalData.guide_pick_id = res.data.data.pickup_id;
714 726 }
715   - th.data.is_geted_guide_pick=1;
  727 + th.data.is_geted_guide_pick = 1;
716 728 func();
717 729 })
718 730 },
... ... @@ -730,8 +742,8 @@ Page({
730 742 success: function success(res) {
731 743 if (res.data.code == 0) {
732 744 _this2.setData({
733   - giftImage: th.iurl + res.data.data.lbUrl,
734   - giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img: res.data.data.lbUrl),
  745 + giftImage: th.iurl + res.data.data.lbUrl,
  746 + giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img : res.data.data.lbUrl),
735 747 // giftTitle: res.data.data.giftTitle,
736 748 giftTitle: res.data.data.lbTitle,
737 749 default_color: res.data.data.bgcolor
... ... @@ -774,7 +786,7 @@ Page({
774 786 if (!sele_g.is_pickup) return false;
775 787  
776 788 //-- 检测一下有没有门店 --
777   - _this2.check_guide(function (){
  789 + _this2.check_guide(function () {
778 790 com.wait_for_store_config(_this2);
779 791 com.set_user_mo_store(_this2, os, function () {
780 792 if (sele_g.pickup_list && _this2.data.def_pick_store) {
... ... @@ -807,7 +819,7 @@ Page({
807 819 if (res.data.code == 0) {
808 820 th.setData({
809 821 giftImage: th.data.iurl + res.data.data.lbUrl,
810   - giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
  822 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img : res.data.data.lbUrl),
811 823 giftTitle: res.data.data.lbTitle,
812 824 default_color: res.data.data.bgcolor
813 825 })
... ... @@ -951,7 +963,7 @@ Page({
951 963 onShareAppMessage: function (e) {
952 964 getApp().globalData.no_clear = 1;
953 965  
954   - var ee=this;
  966 + var ee = this;
955 967 var curPage = this;
956 968 var pagePath = curPage.route; //当前页面url
957 969 if (pagePath.indexOf('/') != 0) {
... ... @@ -959,7 +971,7 @@ Page({
959 971 }
960 972  
961 973  
962   - pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
  974 + pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
963 975 console.log('分享路径');
964 976 console.log(pagePath);
965 977 // if (this.data.isBuy == 0) {
... ... @@ -969,7 +981,7 @@ Page({
969 981 // }
970 982 // console.log('pagePath', pagePath);
971 983  
972   - var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
  984 + var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
973 985  
974 986  
975 987 return {
... ... @@ -985,12 +997,12 @@ Page({
985 997 onShareTimeline() {
986 998 getApp().globalData.no_clear = 1;
987 999  
988   - var ee=this;
  1000 + var ee = this;
989 1001 var pagePath = "&isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
990 1002 var user_id = getApp().globalData.user_id;
991 1003 if (!user_id) user_id = 0;
992 1004  
993   - var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
  1005 + var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
994 1006  
995 1007 return {
996 1008 title: "礼包详情",
... ... @@ -1008,7 +1020,7 @@ Page({
1008 1020 getApp().my_warnning("活动还没有开始", 0, th);
1009 1021 return false;
1010 1022 }
1011   - th.setData({buyType: 3});
  1023 + th.setData({ buyType: 3 });
1012 1024 if (th.data.sele_g.is_pickup) {
1013 1025 th.setData({
1014 1026 openSpecModal: 1
... ... @@ -1031,145 +1043,145 @@ Page({
1031 1043  
1032 1044  
1033 1045 },
1034   - //获取搜索门店输入的值
1035   - input_store: function(e) {
1036   - this.setData({
1037   - keyword: e.detail.value
1038   - })
1039   - },
1040   - //搜索门店
1041   - searchfn(){
1042   - let choice_sort_store = this.data.choice_sort_store
1043   - if (choice_sort_store==0) { //全局搜索
1044   - let all_pick_list = this.data.all_pick_list
1045   - let def_pickpu_list = this.data.def_pickpu_list
1046   - let keyword = this.data.keyword
1047   - if (keyword) {
1048   - let arr=all_pick_list.filter( item =>{
1049   - let i = item.pickup_name.indexOf(keyword)
1050   - if (i > -1) {
1051   - return true
1052   - }else{
1053   - return false
1054   - }
1055   - })
1056   - if (arr && arr.length>0) {
1057   - if(this.data.is_show_sto_cat==1){
1058   - this.setData({
1059   - def_pickpu_list:arr
1060   - })
1061   - }else{
1062   - this.setData({
1063   - only_pk:arr
1064   - })
1065   - }
1066   - }else{
1067   - wx.showToast({
1068   - title: '没有搜索到门店',
1069   - icon: 'none',
1070   - duration: 2000
1071   - })
1072   - }
1073   - }else{
1074   - if (this.data.is_show_sto_cat==1) {
1075   - this.setData({
1076   - def_pickpu_list:all_pick_list.slice(0,10)
1077   - })
1078   - }else{
1079   - this.setData({
1080   - only_pk:all_pick_list
1081   - })
1082   - }
1083   -
1084   - }
1085   - }else{ //分类下搜索
1086   - let sec_i=this.data.sec_i
1087   - let all_sto = this.data.all_sto
1088   - let old_all_sto = this.data.old_all_sto
1089   - if (!old_all_sto) {
  1046 + //获取搜索门店输入的值
  1047 + input_store: function (e) {
1090 1048 this.setData({
1091   - old_all_sto:JSON.parse(JSON.stringify(all_sto))
  1049 + keyword: e.detail.value
1092 1050 })
1093   - }
1094   - let sec_sto= this.data.sec_sto
1095   - let sec_arr = this.data.old_all_sto[sec_i].s_arr
1096   - let keyword = this.data.keyword
1097   - let text='sec_sto.s_arr'
1098   - if (keyword) {
1099   - let arr=sec_arr.filter( item =>{
1100   - let i = item.pickup_name.indexOf(keyword)
1101   - if (i > -1) {
1102   - return true
1103   - }else{
1104   - return false
  1051 + },
  1052 + //搜索门店
  1053 + searchfn() {
  1054 + let choice_sort_store = this.data.choice_sort_store
  1055 + if (choice_sort_store == 0) { //全局搜索
  1056 + let all_pick_list = this.data.all_pick_list
  1057 + let def_pickpu_list = this.data.def_pickpu_list
  1058 + let keyword = this.data.keyword
  1059 + if (keyword) {
  1060 + let arr = all_pick_list.filter(item => {
  1061 + let i = item.pickup_name.indexOf(keyword)
  1062 + if (i > -1) {
  1063 + return true
  1064 + } else {
  1065 + return false
  1066 + }
  1067 + })
  1068 + if (arr && arr.length > 0) {
  1069 + if (this.data.is_show_sto_cat == 1) {
  1070 + this.setData({
  1071 + def_pickpu_list: arr
  1072 + })
  1073 + } else {
  1074 + this.setData({
  1075 + only_pk: arr
  1076 + })
  1077 + }
  1078 + } else {
  1079 + wx.showToast({
  1080 + title: '没有搜索到门店',
  1081 + icon: 'none',
  1082 + duration: 2000
  1083 + })
  1084 + }
  1085 + } else {
  1086 + if (this.data.is_show_sto_cat == 1) {
  1087 + this.setData({
  1088 + def_pickpu_list: all_pick_list.slice(0, 10)
  1089 + })
  1090 + } else {
  1091 + this.setData({
  1092 + only_pk: all_pick_list
  1093 + })
  1094 + }
  1095 +
1105 1096 }
1106   - })
1107   - if (arr && arr.length>0) {
1108   - this.setData({
1109   - [text]:arr
1110   - })
1111   - }else{
1112   - wx.showToast({
1113   - title: '没有搜索到门店',
1114   - icon: 'none',
1115   - duration: 2000
1116   - })
1117   - }
1118   - }else{
1119   - if(this.data.old_all_sto){
1120   - this.setData({
1121   - [text]: this.data.old_all_sto[sec_i].s_arr
1122   - })
1123   - }else{
1124   - this.setData({
1125   - [text]: all_sto[sec_i].s_arr
1126   - })
1127   - }
  1097 + } else { //分类下搜索
  1098 + let sec_i = this.data.sec_i
  1099 + let all_sto = this.data.all_sto
  1100 + let old_all_sto = this.data.old_all_sto
  1101 + if (!old_all_sto) {
  1102 + this.setData({
  1103 + old_all_sto: JSON.parse(JSON.stringify(all_sto))
  1104 + })
  1105 + }
  1106 + let sec_sto = this.data.sec_sto
  1107 + let sec_arr = this.data.old_all_sto[sec_i].s_arr
  1108 + let keyword = this.data.keyword
  1109 + let text = 'sec_sto.s_arr'
  1110 + if (keyword) {
  1111 + let arr = sec_arr.filter(item => {
  1112 + let i = item.pickup_name.indexOf(keyword)
  1113 + if (i > -1) {
  1114 + return true
  1115 + } else {
  1116 + return false
  1117 + }
  1118 + })
  1119 + if (arr && arr.length > 0) {
  1120 + this.setData({
  1121 + [text]: arr
  1122 + })
  1123 + } else {
  1124 + wx.showToast({
  1125 + title: '没有搜索到门店',
  1126 + icon: 'none',
  1127 + duration: 2000
  1128 + })
  1129 + }
  1130 + } else {
  1131 + if (this.data.old_all_sto) {
  1132 + this.setData({
  1133 + [text]: this.data.old_all_sto[sec_i].s_arr
  1134 + })
  1135 + } else {
  1136 + this.setData({
  1137 + [text]: all_sto[sec_i].s_arr
  1138 + })
  1139 + }
1128 1140  
1129   - }
  1141 + }
1130 1142  
1131 1143  
1132   - }
1133   - },
1134   -
1135   - getGift(){
1136   - var that=this;
1137   -
1138   - var json = {
1139   - // "actId": '', //活动Id
1140   - // "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
1141   - // "buyType":""+that.data.buyType, //1=积分兑换 2=余额购买
1142   - // "giftBagId": id, //每月礼包主表id
1143   - // "buyFrom": 2,
1144   - "id":that.data.record_list_id,// "记录Id",
1145   - "storeId": that.data.getStorageID, //商家Id
1146   - "userId": that.data.getUserID, //用户ID
1147   - };
  1144 + }
  1145 + },
  1146 +
  1147 + getGift() {
  1148 + var that = this;
  1149 +
  1150 + var json = {
  1151 + // "actId": '', //活动Id
  1152 + // "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  1153 + // "buyType":""+that.data.buyType, //1=积分兑换 2=余额购买
  1154 + // "giftBagId": id, //每月礼包主表id
  1155 + // "buyFrom": 2,
  1156 + "id": that.data.record_list_id,// "记录Id",
  1157 + "storeId": that.data.getStorageID, //商家Id
  1158 + "userId": that.data.getUserID, //用户ID
  1159 + };
1148 1160 // var url ="/api/weshop/marketing/buy/receive/gift/record/insert";
1149 1161 // var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder";
1150   - var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive";
  1162 + var url = "/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive";
1151 1163 getApp().request.json_post(url, json,
1152 1164 function (res) {
1153   - console.log('领取礼包');
1154   - console.log(res);
  1165 + console.log('领取礼包');
  1166 + console.log(res);
1155 1167 if (res.data.code == 0 && res.data.data) {
1156   - that.setData({
1157   - is_receive:1
1158   - })
1159   - getApp().my_warnning("领取成功!", 1, that);
1160   - that.closeSpecModal();
1161   - setTimeout(()=>{
1162   - wx.navigateBack({
1163   - delta: 0,
  1168 + that.setData({
  1169 + is_receive: 1
1164 1170 })
1165   - },500)
  1171 + getApp().my_warnning("领取成功!", 1, that);
  1172 + that.closeSpecModal();
  1173 + setTimeout(() => {
  1174 + wx.navigateBack({
  1175 + delta: 0,
  1176 + })
  1177 + }, 500)
1166 1178 } else {
1167   - that.setData({submit:0})
  1179 + that.setData({ submit: 0 })
1168 1180 getApp().my_warnning(res.data.msg, 0, that);
1169 1181 }
1170 1182 },
1171 1183 function (res) {
1172   - that.setData({submit:0})
  1184 + that.setData({ submit: 0 })
1173 1185 }
1174 1186 )
1175 1187 },
... ... @@ -1189,7 +1201,7 @@ Page({
1189 1201 // 选择门店
1190 1202 choice_store: function (ee) {
1191 1203 this.setData({
1192   - keyword:''
  1204 + keyword: ''
1193 1205 })
1194 1206  
1195 1207 //--先判断会员状态--
... ... @@ -1342,7 +1354,7 @@ Page({
1342 1354 region_name: region_name,
1343 1355 sort_store: 0,
1344 1356 choice_sort_store: 1,
1345   - sec_i:index,
  1357 + sec_i: index,
1346 1358 sec_sto: item,
1347 1359 sec_pick_index: 0
1348 1360 });
... ... @@ -1368,7 +1380,7 @@ Page({
1368 1380 if (th.data.is_show_sto_cat == 1) {
1369 1381 item = th.data.def_pickpu_list[index];
1370 1382 } else {
1371   - item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  1383 + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
1372 1384 }
1373 1385  
1374 1386 } else {
... ... @@ -1376,7 +1388,7 @@ Page({
1376 1388 item = th.data.sec_sto.s_arr[index];
1377 1389 }
1378 1390  
1379   - if(!item) return false;
  1391 + if (!item) return false;
1380 1392  
1381 1393 if (!th.data.sele_g) return false;
1382 1394  
... ... @@ -1412,14 +1424,14 @@ Page({
1412 1424 if (th.data.is_show_sto_cat == 1) {
1413 1425 item = th.data.def_pickpu_list[index];
1414 1426 } else {
1415   - item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  1427 + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
1416 1428 }
1417 1429 } else {
1418 1430 var index = th.data.sec_pick_index;
1419 1431 item = th.data.sec_sto.s_arr[index];
1420 1432 }
1421 1433  
1422   - if(!item) return false;
  1434 + if (!item) return false;
1423 1435  
1424 1436 th.setData({
1425 1437 def_pick_store: item,
... ... @@ -1454,7 +1466,7 @@ Page({
1454 1466  
1455 1467 },
1456 1468 closeSpecModal: function () {
1457   - this.setData({openSpecModal: 0});
  1469 + this.setData({ openSpecModal: 0 });
1458 1470 },
1459 1471  
1460 1472 buy_libao: function () {
... ... @@ -1496,10 +1508,10 @@ Page({
1496 1508 // }
1497 1509  
1498 1510 if (this.data.share_hidden) {
1499   - this.setData({share_hidden: false,});
  1511 + this.setData({ share_hidden: false, });
1500 1512 }
1501 1513  
1502   - wx.showLoading({title: '生成中...',})
  1514 + wx.showLoading({ title: '生成中...', })
1503 1515 var that = this, th = that;
1504 1516 //设置画板显示,才能开始绘图
1505 1517 that.setData({
... ... @@ -1639,29 +1651,29 @@ Page({
1639 1651 context.setFontSize(32 * unit);
1640 1652 context.setFillStyle('#DE1117');
1641 1653  
1642   - var price_txt="";
1643   - if(price || giftIntegral){
1644   - if(price){
1645   - price_txt='¥' + price;
1646   - if(giftIntegral){
1647   - if(this.data.sele_g.money_type>0){
1648   - price_txt+='+';
1649   - }else{
1650   - price_txt+='或';
1651   - }
1652   - }
1653   - }
1654   - if(giftIntegral) price_txt+=giftIntegral+'积分';
1655   - }else{
1656   - price_txt="免费领取";
  1654 + var price_txt = "";
  1655 + if (price || giftIntegral) {
  1656 + if (price) {
  1657 + price_txt = '¥' + price;
  1658 + if (giftIntegral) {
  1659 + if (this.data.sele_g.money_type > 0) {
  1660 + price_txt += '+';
  1661 + } else {
  1662 + price_txt += '或';
  1663 + }
  1664 + }
  1665 + }
  1666 + if (giftIntegral) price_txt += giftIntegral + '积分';
  1667 + } else {
  1668 + price_txt = "免费领取";
1657 1669 }
1658 1670  
1659 1671 context.fillText(price_txt, 54 * unit, 735 * unit);
1660 1672  
1661 1673  
1662   - var wp= 62 * unit;
1663   - var hp=765 * unit
1664   - this.draw_pos_price(context,wp,hp,this.giftPosPrice,unit);
  1674 + var wp = 62 * unit;
  1675 + var hp = 765 * unit
  1676 + this.draw_pos_price(context, wp, hp, this.giftPosPrice, unit);
1665 1677  
1666 1678 // 8.商品标题
1667 1679 context.setFontSize(20 * unit);
... ... @@ -1683,16 +1695,16 @@ Page({
1683 1695  
1684 1696  
1685 1697 //---市场价划掉---
1686   - draw_pos_price(context,w,h,market_price,unit){
  1698 + draw_pos_price(context, w, h, market_price, unit) {
1687 1699  
1688   - if(!this.is_retail_price) return false;
  1700 + if (!this.is_retail_price) return false;
1689 1701  
1690 1702 context.setFillStyle("gray")
1691 1703 context.setFontSize(22 * unit)
1692 1704 var pri0 = "¥" + market_price.toFixed(2);
1693 1705 context.fillText(pri0, w, h);
1694 1706  
1695   - var c_h=h-6;
  1707 + var c_h = h - 6;
1696 1708 context.setStrokeStyle('gray');
1697 1709 context.setLineWidth(1 * unit);
1698 1710 context.moveTo(w - 5, c_h);
... ... @@ -1708,7 +1720,7 @@ Page({
1708 1720 tt();
1709 1721 return false;
1710 1722 }
1711   - var img_url =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
  1723 + var img_url = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
1712 1724  
1713 1725 //获取商品是分享图信息
1714 1726 wx.getImageInfo({
... ... @@ -1721,8 +1733,8 @@ Page({
1721 1733 fail: function (res) {
1722 1734 //获取默认空白图
1723 1735 wx.getImageInfo({
1724   - src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
1725   - success: function(res) {
  1736 + src: ee.data.iurl + '/miniapp/images/default_g_img.gif',
  1737 + success: function (res) {
1726 1738 ee.data.share_goods_img = res.path; //分享的图片不能用网络的
1727 1739 tt();
1728 1740 }
... ... @@ -1742,13 +1754,39 @@ Page({
1742 1754 },
1743 1755 // 预览海报
1744 1756 previewPoster() {
1745   - getApp().globalData.no_clear=1;
  1757 + getApp().globalData.no_clear = 1;
1746 1758 wx.previewImage({
1747 1759 current: this.data.shareImgPath, // 当前显示图片的http链接
1748   - urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
  1760 + urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
1749 1761 });
1750 1762 },
1751 1763  
1752 1764  
  1765 + //-- 获取从表的信息 --
  1766 + get_lb_list() {
  1767 + let th = this;
  1768 + getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagList/page", {
  1769 + data: {
  1770 + store_id:os.stoid,
  1771 + form_id:th.data.params.id,
  1772 + pageSize:50
  1773 + },
  1774 + }).then(res => {
  1775 + if(ut.ajax_ok(res)){
  1776 + th.setData({
  1777 + wareCard:res.data.data.pageData
  1778 + })
  1779 + }
  1780 + })
  1781 + },
  1782 +
  1783 +
  1784 + //不销毁界面跳转
  1785 + navigateTo: function (e) {
  1786 + var url = e.currentTarget.dataset.url;
  1787 + getApp().goto(url);
  1788 + }
  1789 +
  1790 +
1753 1791  
1754 1792 });
1755 1793 \ No newline at end of file
... ...
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
... ... @@ -78,70 +78,41 @@
78 78 </view> -->
79 79 </view>
80 80 </view>
81   - <view class="box_ware data-v-3a5b7e36" wx:if="{{false}}">
  81 + <view class="box_ware data-v-3a5b7e36" >
82 82 <view class="box_ware_title data-v-3a5b7e36">
83 83 <text class="data-v-3a5b7e36">礼包内容</text>
84 84 </view>
85   - <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="Id">
86   - <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36">
87   - <view class="box_ware_img data-v-3a5b7e36">
88   - <block wx:if="{{item.lbType==1}}">
89   - <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
90   - </block>
91   - <block wx:if="{{item.lbType==2}}">
92   - <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
93   - </block>
94   - <block wx:if="{{item.lbType==3}}">
95   - <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
96   - </block>
97   - <block wx:if="{{item.lbType==4}}">
98   - <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
99   - </block>
100   - <block wx:if="{{item.lbType==5}}">
101   - <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
102   - </block>
103   - </view>
104   - <view class="box_ware_item data-v-3a5b7e36">
105   - <view class="box_ware_item_title data-v-3a5b7e36">
106   - <text class="data-v-3a5b7e36">{{item.couponName}}</text>
107   - </view>
108   - <view class="box_ware_item_price data-v-3a5b7e36">
109   - <text class="data-v-3a5b7e36"></text>
110   - </view>
111   - <view class="box_ware_item_qty data-v-3a5b7e36 flex">
112   - <text class="data-v-3a5b7e36 ellipsis-1">
113   - {{"数量:"+item.num}}
114   - </text>
115   - <block wx:if="{{isBuy==0 && !flag && item.lbType==1}}">
116   - <text style="margin-left:10rpx" wx:if="{{item.useState}}">
117   - 已核销
118   - </text>
119   - <text style="margin-left:10rpx" wx:else>
120   - 未核销
121   - </text>
122   - </block>
123   - </view>
124 85  
125   - <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}">
126   - <!-- <block wx:if="{{c_state==0}}"> -->
  86 + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" >
  87 + <view bindtap="navigateTo"
  88 + data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?only_show=1&lbId={{item.giftbagid}}&cover_img={{item.cover_img}}"
  89 + class="box_ware_box data-v-3a5b7e36">
  90 + <view class="box_ware_img data-v-3a5b7e36">
127 91  
128   - <block wx:if="{{isBuy==0&item.lbType==1}}">
129   - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image>
130   - </block>
  92 + <image src="{{item.cover_img==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.cover_img}}" style="height: 150rpx; width: 150rpx;"
  93 + class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2"
  94 + data-errorimg="wareCard[{{index}}].cover_img"></image>
131 95  
132   - <block wx:if="{{isBuy==0&item.lbType==2}}">
133   - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image>
134   - </block>
135   - <block wx:if="{{isBuy==0&item.lbType==3}}">
136   - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image>
137   - </block>
138   - <block wx:if="{{isBuy==0&item.lbType>3}}">
139   - <text class="data-v-3a5b7e36">奖励已发放</text>
140   - </block>
  96 + </view>
  97 + <view class="box_ware_item data-v-3a5b7e36">
  98 + <view class="box_ware_item_title data-v-3a5b7e36">
  99 + <view><text class="data-v-3a5b7e36">{{item.lbtitle}}</text></view>
  100 + </view>
  101 + <view class="box_ware_item_qty data-v-3a5b7e36 flex">
  102 + <text class="data-v-3a5b7e36 ellipsis-1" style="color:#797979">
  103 + {{"零售价:"+item.oldprice}}
  104 + </text>
  105 + </view>
  106 + <view class="box_ware_code data-v-3a5b7e36 fs34" >
  107 + <view class="month_btn flex fs26 ai-center jc-center">
  108 + <text>第{{index+1}}个月 ></text>
  109 + </view>
  110 + </view>
  111 +
  112 + </view>
141 113 </view>
142   - </view>
143   - </view>
144   - </block>
  114 + </block>
  115 +
145 116 </view>
146 117 <view class="foot_box data-v-3a5b7e36">
147 118 <view class="foot_box_title data-v-3a5b7e36">
... ...
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss
... ... @@ -17,10 +17,10 @@
17 17 }
18 18  
19 19 .box_title.data-v-3a5b7e36 {
20   - margin: 10rpx 20rpx 20rpx 20rpx;
  20 + margin: 18rpx 20rpx 20rpx 20rpx;
21 21 padding: 35rpx;
22 22 background-color: #fff;
23   - border-radius: 40rpx;
  23 + border-radius: 15rpx;
24 24 }
25 25  
26 26 .top_title.data-v-3a5b7e36 {
... ... @@ -68,7 +68,7 @@
68 68 margin: 10rpx 20rpx 20rpx 20rpx;
69 69 padding: 35rpx;
70 70 background-color: #fff;
71   - border-radius: 40rpx;
  71 + border-radius: 15rpx;
72 72 }
73 73  
74 74 .box_ware_title.data-v-3a5b7e36 {
... ... @@ -132,7 +132,7 @@
132 132 .box_ware_item_qty.data-v-3a5b7e36 {
133 133 font-size: 22rpx;
134 134 position: absolute;
135   - bottom: 15rpx;
  135 + bottom: 5rpx;
136 136 left: 0;
137 137 }
138 138  
... ... @@ -155,7 +155,7 @@
155 155 margin: 10rpx 20rpx 50rpx 20rpx;
156 156 padding: 35rpx;
157 157 background-color: #fff;
158   - border-radius: 40rpx;
  158 + border-radius: 15rpx;
159 159 }
160 160  
161 161 .foot_box_title.data-v-3a5b7e36 {
... ... @@ -274,3 +274,8 @@ page.data-v-3a5b7e36 {
274 274 padding-left: 30rpx;
275 275 }
276 276  
  277 +.month_btn{
  278 + width: 165rpx;height: 54rpx;
  279 + background-color: #f85c97;
  280 + border-radius: 54rpx; color: #fff;
  281 +}
... ...
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.wxml
... ... @@ -107,7 +107,7 @@
107 107 <text class="data-v-3a5b7e36"></text>
108 108 </view> -->
109 109  
110   - <block wx:if="{{record_list.is_receive==1 && !flag && item.lbType==1}}">
  110 + <block wx:if="{{record_list.is_receive==1 && !flag && item.lbType==1 && !params.only_show}}">
111 111 <view class="sw_state_btn flex jc-center ai-center yhx" wx:if="{{item.useState}}">
112 112 已核销
113 113 </view>
... ... @@ -157,7 +157,7 @@
157 157  
158 158 <view class="foot_empty data-v-3a5b7e36"></view>
159 159  
160   - <block wx:if="{{flag != 1}}">
  160 + <block wx:if="{{flag != 1 && !params.only_show}}">
161 161  
162 162 <!-- 不是当月的礼包 -->
163 163 <block wx:if="{{!is_cur_list}}">
... ...