Commit 1e32e7430f52f299bc0500d9b1f604fb973033e5
1 parent
32d833de
app.json修改
Showing
9 changed files
with
1402 additions
and
39 deletions
app.json
@@ -91,44 +91,45 @@ | @@ -91,44 +91,45 @@ | ||
91 | "pages/quan_pro/quan_pro", | 91 | "pages/quan_pro/quan_pro", |
92 | "pages/liveStream/liveStream", | 92 | "pages/liveStream/liveStream", |
93 | "pages/liveStreamDetails/liveStreamDetails", | 93 | "pages/liveStreamDetails/liveStreamDetails", |
94 | - "pages/addCustomer/addCustomer", | ||
95 | - "pages/goods_share/goods_share", | ||
96 | - "pages/activity_share/activity_share", | ||
97 | - "pages/live_share/live_share", | ||
98 | - "pages/quan/quan", | ||
99 | - "pages/chongzhi/chongzhi", | ||
100 | - "pages/chongzhiDetails/chongzhiDetails", | ||
101 | - "pages/jfbuy/jfbuy", | ||
102 | - "pages/hongBao/hongBao", | ||
103 | - "pages/hongBaoDetails/hongBaoDetails", | ||
104 | - "pages/service_record/service_record", | ||
105 | - "pages/checkin/checkin", | ||
106 | - "pages/distribution/myteam/myteam", | ||
107 | - "pages/distribution/order/order", | ||
108 | - "pages/distribution/commision/commision", | ||
109 | - "pages/distribution/rank/rank", | ||
110 | - "pages/distribution/card/card", | ||
111 | - "pages/distribution/goods/goods", | ||
112 | - "pages/distribution/shop/shop", | ||
113 | - "pages/distribution/rookie/rookie", | ||
114 | - "pages/service_share/service_share", | ||
115 | - "pages/cardList/cardList", | ||
116 | - "pages/goodsInfo/goodsInfo", | ||
117 | - "pages/my_service/appment_main", | ||
118 | - "pages/my_service/i_service", | ||
119 | - "pages/my_service/cosmetology_list", | ||
120 | - "pages/my_service/hist_service", | ||
121 | - "pages/my_service/tment_details", | ||
122 | - "pages/my_service/tment_eval", | ||
123 | - "pages/my_service/tment_order_list", | ||
124 | - "pages/my_service/beauty_deta", | ||
125 | - "pages/my_service2/appment_main", | ||
126 | - "pages/profile/profile", | ||
127 | - "pages/parseHtml/parseHtml", | ||
128 | - "pages/myGift/myGift", | ||
129 | - "pages/myGiftDetails/myGiftDetails", | ||
130 | - "pages/cart2_ser/cart2_ser", | ||
131 | - "pages/libao_payment/payment" | 94 | + "pages/addCustomer/addCustomer", |
95 | + "pages/goods_share/goods_share", | ||
96 | + "pages/activity_share/activity_share", | ||
97 | + "pages/live_share/live_share", | ||
98 | + "pages/quan/quan", | ||
99 | + "pages/chongzhi/chongzhi", | ||
100 | + "pages/chongzhiDetails/chongzhiDetails", | ||
101 | + "pages/jfbuy/jfbuy", | ||
102 | + "pages/hongBao/hongBao", | ||
103 | + "pages/hongBaoDetails/hongBaoDetails", | ||
104 | + "pages/service_record/service_record", | ||
105 | + "pages/checkin/checkin", | ||
106 | + "pages/distribution/myteam/myteam", | ||
107 | + "pages/distribution/order/order", | ||
108 | + "pages/distribution/commision/commision", | ||
109 | + "pages/distribution/rank/rank", | ||
110 | + "pages/distribution/card/card", | ||
111 | + "pages/distribution/goods/goods", | ||
112 | + "pages/distribution/shop/shop", | ||
113 | + "pages/distribution/rookie/rookie", | ||
114 | + "pages/service_share/service_share", | ||
115 | + "pages/cardList/cardList", | ||
116 | + "pages/goodsInfo/goodsInfo", | ||
117 | + "pages/my_service/appment_main", | ||
118 | + "pages/my_service/i_service", | ||
119 | + "pages/my_service/cosmetology_list", | ||
120 | + "pages/my_service/hist_service", | ||
121 | + "pages/my_service/tment_details", | ||
122 | + "pages/my_service/tment_eval", | ||
123 | + "pages/my_service/tment_order_list", | ||
124 | + "pages/my_service/beauty_deta", | ||
125 | + "pages/my_service2/appment_main", | ||
126 | + "pages/profile/profile", | ||
127 | + "pages/parseHtml/parseHtml", | ||
128 | + "pages/myGift/myGift", | ||
129 | + "pages/myGiftDetails/myGiftDetails", | ||
130 | + "pages/cart2_ser/cart2_ser", | ||
131 | + "pages/libao_payment/payment", | ||
132 | + "pages/details_serviceCard/details_serviceCard" | ||
132 | ] | 133 | ] |
133 | 134 | ||
134 | }, | 135 | }, |
@@ -151,7 +152,9 @@ | @@ -151,7 +152,9 @@ | ||
151 | "pages/zuhegou/list/list", | 152 | "pages/zuhegou/list/list", |
152 | "pages/user/binding_info/binding_info", | 153 | "pages/user/binding_info/binding_info", |
153 | "pages/user/choice_guide/choice_guide", | 154 | "pages/user/choice_guide/choice_guide", |
154 | - "pages/video/index" | 155 | + "pages/video/index", |
156 | + "pages/boxes-list/boxes-list", | ||
157 | + "pages/boxes-details/boxes-details" | ||
155 | ] | 158 | ] |
156 | }, | 159 | }, |
157 | { | 160 | { |
packageB/pages/boxes-details/boxes-details.js
0 → 100644
1 | +// packageA/pages/details_serviceCard/details_serviceCard.js | ||
2 | +const app = getApp(); | ||
3 | +const os = app.globalData.setting; | ||
4 | +let self = null; | ||
5 | + | ||
6 | +Page({ | ||
7 | + | ||
8 | + /** | ||
9 | + * 页面的初始数据 | ||
10 | + */ | ||
11 | + data: { | ||
12 | + is_summit_ing: 0, | ||
13 | + | ||
14 | + showQr: false, | ||
15 | + }, | ||
16 | + | ||
17 | + /** | ||
18 | + * 生命周期函数--监听页面加载 | ||
19 | + */ | ||
20 | + onLoad: function(options) { | ||
21 | + self = this; | ||
22 | + this.data.options = options; | ||
23 | + app.isLogin().then(function(data) { | ||
24 | + self.setData({ | ||
25 | + userInfo: data, | ||
26 | + }); | ||
27 | + self.getConfig(); | ||
28 | + }); | ||
29 | + }, | ||
30 | + | ||
31 | + /** | ||
32 | + * 生命周期函数--监听页面初次渲染完成 | ||
33 | + */ | ||
34 | + onReady: function() { | ||
35 | + | ||
36 | + }, | ||
37 | + | ||
38 | + /** | ||
39 | + * 生命周期函数--监听页面显示 | ||
40 | + */ | ||
41 | + onShow: function() { | ||
42 | + if (app.globalData.userInfo) { | ||
43 | + if (!this.data.isLogin) { | ||
44 | + this.setData({ | ||
45 | + userInfo: app.globalData.userInfo, | ||
46 | + imghost: app.globalData.setting.imghost, | ||
47 | + isLogin: true, | ||
48 | + }); | ||
49 | + | ||
50 | + let url = '/api/weshop/recharge/user/page' | ||
51 | + let data = { | ||
52 | + store_id: app.globalData.setting.stoid, | ||
53 | + user_id: this.data.userInfo.user_id, | ||
54 | + order_id: this.data.options.order_id, | ||
55 | + }; | ||
56 | + | ||
57 | + // 请求数据 | ||
58 | + app.promiseGet(url, { | ||
59 | + data: data, | ||
60 | + }).then(res => { | ||
61 | + if (res.data.code == 0) { | ||
62 | + console.log('请求成功', res); | ||
63 | + this.setData({ | ||
64 | + details: res.data.data.pageData[0], | ||
65 | + }); | ||
66 | + } else { | ||
67 | + throw (res); | ||
68 | + }; | ||
69 | + }).catch(err => { | ||
70 | + wx.showToast({ | ||
71 | + title: err.data.data, | ||
72 | + icon: 'error', | ||
73 | + }); | ||
74 | + }); | ||
75 | + | ||
76 | + }; | ||
77 | + }; | ||
78 | + }, | ||
79 | + | ||
80 | + /** | ||
81 | + * 生命周期函数--监听页面隐藏 | ||
82 | + */ | ||
83 | + onHide: function() { | ||
84 | + | ||
85 | + }, | ||
86 | + | ||
87 | + /** | ||
88 | + * 生命周期函数--监听页面卸载 | ||
89 | + */ | ||
90 | + onUnload: function() { | ||
91 | + | ||
92 | + }, | ||
93 | + | ||
94 | + /** | ||
95 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
96 | + */ | ||
97 | + onPullDownRefresh: function() { | ||
98 | + | ||
99 | + }, | ||
100 | + | ||
101 | + /** | ||
102 | + * 页面上拉触底事件的处理函数 | ||
103 | + */ | ||
104 | + onReachBottom: function() { | ||
105 | + | ||
106 | + }, | ||
107 | + | ||
108 | + /** | ||
109 | + * 用户点击右上角分享 | ||
110 | + */ | ||
111 | + onShareAppMessage: function() { | ||
112 | + | ||
113 | + }, | ||
114 | + | ||
115 | + | ||
116 | + // 内容复制到剪贴板 | ||
117 | + copy() { | ||
118 | + console.log('点击了复制按钮'); | ||
119 | + wx.setClipboardData({ | ||
120 | + data: this.data.details.order_sn, | ||
121 | + success(res) { | ||
122 | + wx.getClipboardData({ | ||
123 | + success(res) { | ||
124 | + console.log(res.data); | ||
125 | + } | ||
126 | + }) | ||
127 | + } | ||
128 | + }) | ||
129 | + }, | ||
130 | + | ||
131 | + | ||
132 | + // 图片异常时加载默认图片 | ||
133 | + bind_bnerr(e) { | ||
134 | + var errImg = e.currentTarget.dataset.errorimg; | ||
135 | + var errObj = {}; | ||
136 | + errObj[errImg] = 'public/images/default_goods_image_240.gif'; | ||
137 | + this.setData(errObj); // this.setData({ details.list[0].img_url}); | ||
138 | + }, | ||
139 | + | ||
140 | + | ||
141 | + // 查看商品详情 | ||
142 | + viewDetails(e) { | ||
143 | + let goods_id = e.currentTarget.dataset.gid; | ||
144 | + let url = '/packageA/pages/goodsInfo/goodsInfo?goods_id=' + goods_id; | ||
145 | + app.goto(url); | ||
146 | + }, | ||
147 | + | ||
148 | + // 获取系统参数 | ||
149 | + getConfig() { | ||
150 | + app.getConfig2(function(e) { | ||
151 | + // console.log('101',e); | ||
152 | + let json_d = JSON.parse(e.switch_list); | ||
153 | + self.setData({ | ||
154 | + sys_switch: json_d, | ||
155 | + // weapp_customertype: json_d.weapp_customertype, | ||
156 | + }); | ||
157 | + }, 1); | ||
158 | + }, | ||
159 | + | ||
160 | + | ||
161 | + // 联系微信客服 | ||
162 | + contact_wx() { | ||
163 | + var url = this.data.sys_switch.weapp_customertype_url; | ||
164 | + var id = this.data.sys_switch.weapp_customertype_appid; | ||
165 | + wx.openCustomerServiceChat({ | ||
166 | + extInfo: { | ||
167 | + url: url | ||
168 | + }, | ||
169 | + corpId: id, | ||
170 | + success(res) {} | ||
171 | + }) | ||
172 | + }, | ||
173 | + | ||
174 | + | ||
175 | + // 联系电话客服 | ||
176 | + contactService() { | ||
177 | + app.getConfig(function(t) { | ||
178 | + if (t.store_tel == undefined) { | ||
179 | + app.request.get('/api/weshop/store/get/' + os.stoid, { | ||
180 | + isShowLoading: 1, | ||
181 | + data: {}, | ||
182 | + success: function(rs) { | ||
183 | + app.globalData.config = rs.data.data; | ||
184 | + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { | ||
185 | + app.my_warnning('商家未设置电话', 0, self); | ||
186 | + return false; | ||
187 | + } | ||
188 | + app.confirmBox('请联系客服:' + rs.data.data.store_tel); | ||
189 | + } | ||
190 | + }) | ||
191 | + } else { | ||
192 | + app.confirmBox('请联系客服:' + t.store_tel); | ||
193 | + } | ||
194 | + }); | ||
195 | + }, | ||
196 | + | ||
197 | + | ||
198 | + // 评价商品 | ||
199 | + access() { | ||
200 | + let listLength = this.data.details.list.length; | ||
201 | + let order_id = this.data.details.order_id; | ||
202 | + let url = ''; | ||
203 | + | ||
204 | + // 卡项订单跳转到评论页要多加个参数card=1 | ||
205 | + // 卡项订单goods_id要带card_id | ||
206 | + if (listLength == 1) { | ||
207 | + let price = this.data.details.list[0].price; | ||
208 | + let card_id = this.data.details.list[0].card_id; | ||
209 | + url = | ||
210 | + `/packageB/pages/user/add_comment/add_comment?card=1&goods_id=${card_id}&order_id=${order_id}&price=${price}` | ||
211 | + }; | ||
212 | + if (listLength > 1) { | ||
213 | + url = `/packageB/pages/user/comment/comment?card=1&status=0&order_id=${order_id}`; | ||
214 | + }; | ||
215 | + f | ||
216 | + // console.log('url', url); | ||
217 | + app.goto(url); | ||
218 | + }, | ||
219 | + | ||
220 | + | ||
221 | + // 查看评论 | ||
222 | + viewComment() { | ||
223 | + let order_id = this.data.details.order_id; | ||
224 | + let card_id = this.data.details.list[0].card_id; | ||
225 | + let listLength = this.data.details.list.length; | ||
226 | + let url = ''; | ||
227 | + | ||
228 | + // 卡项订单单个商品 | ||
229 | + if (listLength == 1) { | ||
230 | + url = `/packageB/pages/user/view_comment/view_comment?card=1&goods_id=${card_id}&order_id=${order_id}`; | ||
231 | + }; | ||
232 | + // 卡项订单多个商品 | ||
233 | + if (listLength > 1) { | ||
234 | + // status控制评论列表页的activeStatus | ||
235 | + url = `/packageB/pages/user/comment/comment?card=1&status=1&order_id=${order_id}`; | ||
236 | + }; | ||
237 | + | ||
238 | + app.goto(url); | ||
239 | + }, | ||
240 | + | ||
241 | + | ||
242 | + // 再来一单 | ||
243 | + buy2(t) { | ||
244 | + let details = this.data.details; | ||
245 | + var th = this; | ||
246 | + var ind = 1; // 1:加入购物车 | ||
247 | + // var ind = t.currentTarget.dataset.openSpecModal_ind; | ||
248 | + // var action= t.currentTarget.dataset.action; | ||
249 | + var action = 'add'; // | ||
250 | + // if(!ind) ind = t.currentTarget.dataset.openspecmodal_ind; | ||
251 | + | ||
252 | + th.setData({ | ||
253 | + open_ind_store: ind | ||
254 | + }); | ||
255 | + | ||
256 | + // if(!th.data.sto_sele_name){ | ||
257 | + // getApp().my_warnning('请选择门店', 1, th, 450); | ||
258 | + // return false; | ||
259 | + // } | ||
260 | + | ||
261 | + | ||
262 | + if (action == "buy") { | ||
263 | + //--------------此时操作的数据------------ | ||
264 | + // var newd = { | ||
265 | + // id: th.data.data.id, | ||
266 | + // goods_num: th.data.goodsInputNum, | ||
267 | + // pick_id: th.data.sto_sele_id, | ||
268 | + // keyid: th.data.sto_sele_keyid, | ||
269 | + // }; | ||
270 | + // newd['pick_name'] = th.data.sto_sele_name; | ||
271 | + // newd['guide_id'] = getApp().globalData.guide_id; | ||
272 | + // newd['guide_type']=0; | ||
273 | + // th.buyNow(newd); | ||
274 | + } else { | ||
275 | + | ||
276 | + var newd = { | ||
277 | + // service_id: th.data.data.id, | ||
278 | + // service_sn:th.data.data.service_sn, | ||
279 | + // service_name:th.data.data.goods_name, | ||
280 | + // goods_num: th.data.goodsInputNum, | ||
281 | + // pick_id: th.data.sto_sele_id, | ||
282 | + // user_id:oo.user_id, | ||
283 | + // store_id:os.stoid, | ||
284 | + // money:th.data.data.shop_price, | ||
285 | + | ||
286 | + service_id: details.list[0].card_id, | ||
287 | + service_sn: details.list[0].service_sn, | ||
288 | + service_name: details.list[0].service_name, | ||
289 | + goods_num: details.list[0].qty, | ||
290 | + pick_id: details.list[0].pickup_id, | ||
291 | + user_id: this.data.userInfo.user_id, | ||
292 | + store_id: app.globalData.setting.stoid, | ||
293 | + money: details.list[0].price, | ||
294 | + }; | ||
295 | + if (getApp().globalData.guide_id) { | ||
296 | + newd['guide_id'] = getApp().globalData.guide_id; | ||
297 | + newd['guide_type'] = 0; | ||
298 | + } | ||
299 | + | ||
300 | + //----先看会员在购物车中是否加入了该商品----- | ||
301 | + app.request.get("/api/weshop/cartService/page", { | ||
302 | + data: { | ||
303 | + store_id: app.globalData.setting.stoid, | ||
304 | + user_id: this.data.userInfo.user_id, | ||
305 | + service_id: details.list[0].card_id, | ||
306 | + pick_id: details.list[0].pickup_id, | ||
307 | + }, | ||
308 | + success: function(re) { | ||
309 | + | ||
310 | + //-------如果购物车中有相关的数据--------- | ||
311 | + if (re.data.data.total > 0) { | ||
312 | + var item = re.data.data.pageData[0]; | ||
313 | + var updata = { | ||
314 | + id: item.id, | ||
315 | + goods_num: details.list[0].qty + item.goods_num, | ||
316 | + money: details.list[0].price, | ||
317 | + store_id: app.globalData.setting.stoid, | ||
318 | + }; | ||
319 | + | ||
320 | + if (getApp().globalData.guide_id) { | ||
321 | + updata['guide_id'] = getApp().globalData.guide_id; | ||
322 | + updata['guide_type'] = 1; | ||
323 | + } | ||
324 | + getApp().request.put("/api/weshop/cartService/update", { | ||
325 | + data: updata, | ||
326 | + success: function(t) { | ||
327 | + // getApp().my_warnning('加入购物车成功', 1, th, 450); | ||
328 | + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; | ||
329 | + th.setData({ | ||
330 | + cartGoodsNum: c_num | ||
331 | + }); | ||
332 | + app.goto('/pages/cart/cart/cart'); | ||
333 | + // th.closeSpecModal(); | ||
334 | + } | ||
335 | + }); | ||
336 | + } else { | ||
337 | + | ||
338 | + getApp().request.post("/api/weshop/cartService/save", { | ||
339 | + data: newd, | ||
340 | + success: function(t) { | ||
341 | + // getApp().my_warnning('加入购物车成功', 1, th, 450); | ||
342 | + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; | ||
343 | + th.setData({ | ||
344 | + cartGoodsNum: c_num | ||
345 | + }); | ||
346 | + app.goto('/pages/cart/cart/cart'); | ||
347 | + // th.closeSpecModal(); | ||
348 | + } | ||
349 | + }); | ||
350 | + } | ||
351 | + } | ||
352 | + }); | ||
353 | + | ||
354 | + } | ||
355 | + }, | ||
356 | + | ||
357 | + | ||
358 | + // 取消订单 | ||
359 | + // api/weshop/recharge/update?store_id=&order_id=&order_status=3 | ||
360 | + cancle() { | ||
361 | + wx.showModal({ | ||
362 | + title: '提示', | ||
363 | + content: '确定取消订单吗?', | ||
364 | + success(res) { | ||
365 | + if (res.confirm) { | ||
366 | + console.log('用户点击确定'); | ||
367 | + let order_id = self.data.details.order_id; | ||
368 | + let order_sn = self.data.details.order_sn; | ||
369 | + app.request.put('/api/weshop/recharge/update', { | ||
370 | + data: { | ||
371 | + store_id: os.stoid, | ||
372 | + order_id: order_id, | ||
373 | + order_sn: order_sn, | ||
374 | + order_status: 3, | ||
375 | + }, | ||
376 | + success: function(res) { | ||
377 | + | ||
378 | + //取消成功刷新订单 | ||
379 | + let url = '/api/weshop/recharge/user/page' | ||
380 | + let data = { | ||
381 | + store_id: app.globalData.setting.stoid, | ||
382 | + user_id: self.data.userInfo.user_id, | ||
383 | + order_id: self.data.options.order_id, | ||
384 | + }; | ||
385 | + | ||
386 | + // 请求数据 | ||
387 | + app.promiseGet(url, { | ||
388 | + data: data, | ||
389 | + }).then(res => { | ||
390 | + if (res.data.code == 0) { | ||
391 | + console.log('请求成功', res); | ||
392 | + wx.showToast({ | ||
393 | + title: '取消成功', | ||
394 | + }); | ||
395 | + self.setData({ | ||
396 | + details: res.data.data.pageData[0], | ||
397 | + }); | ||
398 | + } else { | ||
399 | + throw (res); | ||
400 | + }; | ||
401 | + }).catch(err => { | ||
402 | + wx.showToast({ | ||
403 | + title: err.data.data, | ||
404 | + icon: 'error', | ||
405 | + }); | ||
406 | + }); | ||
407 | + | ||
408 | + }, | ||
409 | + }) | ||
410 | + } else if (res.cancel) { | ||
411 | + console.log('用户点击取消'); | ||
412 | + } | ||
413 | + } | ||
414 | + }); | ||
415 | + }, | ||
416 | + | ||
417 | + | ||
418 | + // 立即支付 | ||
419 | + pay() { | ||
420 | + let order_sn = this.data.details.order_sn; | ||
421 | + let store_id = app.globalData.setting.stoid; | ||
422 | + | ||
423 | + app.request.post('/api/weshop/order/pay/createRechargeOrder', { | ||
424 | + data: { | ||
425 | + parentSn: order_sn, | ||
426 | + store_id: store_id, | ||
427 | + }, | ||
428 | + | ||
429 | + success: function(res) { | ||
430 | + var n = res.data.data; | ||
431 | + self.weixinPay(n, function() { | ||
432 | + app.showWarning('支付成功'); | ||
433 | + // setTimeout(function() { | ||
434 | + // wx.reLaunch({ | ||
435 | + // url: '/pages/user/my_service/i_service', | ||
436 | + // }) | ||
437 | + // }, 1000) | ||
438 | + }, function() { | ||
439 | + app.showWarning('支付失败'); | ||
440 | + // setTimeout(function() { | ||
441 | + // wx.reLaunch({ | ||
442 | + // url: '/packageA/pages/cardList/cardList', | ||
443 | + // }) | ||
444 | + // }, 1000) | ||
445 | + }); | ||
446 | + } | ||
447 | + }) | ||
448 | + }, | ||
449 | + | ||
450 | + | ||
451 | + //------调起支付框-------- | ||
452 | + weixinPay: function(n, success, fail) { | ||
453 | + if (!n) return false; | ||
454 | + wx.requestPayment({ | ||
455 | + timeStamp: String(n.timeStamp), | ||
456 | + nonceStr: n.nonceStr, | ||
457 | + package: n.packageValue, | ||
458 | + signType: n.signType, | ||
459 | + paySign: n.paySign, | ||
460 | + success: function(n) { | ||
461 | + console.log(n), getApp().showSuccess("支付成功!"); | ||
462 | + "function" == typeof success && success(); | ||
463 | + wx.redirectTo({ | ||
464 | + url: "../deposit/deposit" | ||
465 | + }); | ||
466 | + }, | ||
467 | + fail: function(n) { | ||
468 | + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") : | ||
469 | + "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n | ||
470 | + .errMsg.substr("requestPayment:fail ".length)), | ||
471 | + "function" == typeof fail && fail(); | ||
472 | + } | ||
473 | + }); | ||
474 | + }, | ||
475 | + | ||
476 | + | ||
477 | + | ||
478 | + | ||
479 | + | ||
480 | + | ||
481 | + | ||
482 | + | ||
483 | + showQr() { | ||
484 | + this.setData({ | ||
485 | + showQr: true, | ||
486 | + }); | ||
487 | + }, | ||
488 | + | ||
489 | + closeQr() { | ||
490 | + this.setData({ | ||
491 | + showQr: false, | ||
492 | + }); | ||
493 | + }, | ||
494 | + | ||
495 | + touchMove() {} | ||
496 | + | ||
497 | + | ||
498 | + | ||
499 | + | ||
500 | + | ||
501 | + | ||
502 | + | ||
503 | + | ||
504 | +}) |
packageB/pages/boxes-details/boxes-details.json
0 → 100644
packageB/pages/boxes-details/boxes-details.wxml
0 → 100644
1 | +<wxs module="filter" src="../../../utils/filter.wxs"></wxs> | ||
2 | + | ||
3 | +<view class="main"> | ||
4 | + <view class="bg-white pdh20 bdr12"> | ||
5 | + <block> | ||
6 | + <!-- 门店名称栏 --> | ||
7 | + <!-- <view class="flex jc_sb ai_c pdv20"> | ||
8 | + <view class="ellipsis-1 pdr40 fs30"><text class="iconfont icon-shop c-red pdr10"></text>{{item.pickup_name}}</view> | ||
9 | + <block> | ||
10 | + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 0}}">待支付</text> | ||
11 | + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 1}}">待评价</text> | ||
12 | + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 2}}">已评价</text> | ||
13 | + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 3}}">已取消</text> | ||
14 | + <text class="c-red shrink0 fs26" wx:if="{{details.order_status == 5}}">已作废</text> | ||
15 | + </block> | ||
16 | + </view> --> | ||
17 | + | ||
18 | + <!-- 列表栏 --> | ||
19 | + <view> | ||
20 | + <!-- <view class="flex pdv20" wx:for="{{details.list}}" bindtap="viewDetails" data-gid="{{item.card_id}}"> --> | ||
21 | + <view class="flex pdv20" bindtap="viewDetails" data-gid="{{item.card_id}}" wx:for="{{14}}"> | ||
22 | + <view class="pic-box shrink0"> | ||
23 | + <text class="iconfont icon-shangpin fs60 white"></text> | ||
24 | + </view> | ||
25 | + <view class="pdl20 f1"> | ||
26 | + <view class="flex jc_sb ai_c"> | ||
27 | + <view class="title ellipsis-2 pdr40">商品名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称</view> | ||
28 | + <text class="c-6">x1{{item.price}}</text> | ||
29 | + </view> | ||
30 | + <view class="flex ai_c c-9 fs26"> | ||
31 | + <!-- <text>10个/蓝色</text> --> | ||
32 | + <text class="rmb c-red">2{{filters.price(item.group_price)}}</text> | ||
33 | + <view class="fs22 del pdl10 c-c7">零售价<text class="rmb">3{{item.market_price}}</text></view> | ||
34 | + </view> | ||
35 | + </view> | ||
36 | + </view> | ||
37 | + </view> | ||
38 | + </block> | ||
39 | + | ||
40 | + | ||
41 | + <!-- 统计栏 --> | ||
42 | + <!-- <view class="t-r bdt pdv20">共{{filter.count(details.list)}}件商品,合计:<text class="rmb c-red bold fs30">{{details.account}}</text></view> --> | ||
43 | + </view> | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + <!-- 底部按钮栏 --> | ||
49 | + <view class="btn-bar bg-white pd20 t-c"> | ||
50 | + <!-- <text class="btn bg-orange white" bindtap="buy2">再来一单</text> --> | ||
51 | + <text class="btn bg-red white" bindtap="showQr">立即兑换</text> | ||
52 | + </view> | ||
53 | +</view> | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | +<!-- 遮罩层 --> | ||
61 | +<view class="mask" hidden="{{!showQr}}" catchtouchmove="touchMove"></view> | ||
62 | +<!-- 码 --> | ||
63 | +<view class="popup-container" hidden="{{!showQr}}" catchtouchmove="touchMove"> | ||
64 | + <view class="t-r pdb20"><text class="iconfont icon-close fs40" bindtap="closeQr"></text></view> | ||
65 | + <view class="popup"> | ||
66 | + <!-- <view class="popup-title"> | ||
67 | + <block wx:if="{{details[useIndex].isby == 1}}">包邮券</block> | ||
68 | + <block wx:else> | ||
69 | + {{filter.getNum(details[useIndex].Sum)}}元微券 | ||
70 | + </block> | ||
71 | + </view> --> | ||
72 | + <!-- <view class="pdt20 c-fe0000"><text class="rmb fs80" wx:if="{{details[useIndex].isby != 1}}">{{filter.getNum(details[useIndex].Sum)}}</text></view> --> | ||
73 | + <!-- 条形码 --> | ||
74 | + <view class="bar-container"> | ||
75 | + <canvas class="barcode" canvas-id="barcode"/> | ||
76 | + <view class="pdt20 fs26" wx:if="{{details[useIndex].CashRepNo}}">{{details[useIndex].CashRepNo}}</view> | ||
77 | + <view class="pdt20 fs26" wx:else>{{details[useIndex].no}}</view> | ||
78 | + </view> | ||
79 | + <!-- 二维码 --> | ||
80 | + <view class="qr-container"> | ||
81 | + <canvas class="qrcode" canvas-id="qrcode"/> | ||
82 | + </view> | ||
83 | + <view class="pdv20 c-7b fs26 bdt"> | ||
84 | + <text wx:if="{{details[useIndex].ValidDate}}" class="ellipsis-1x">有效期:{{details[useIndex].BeginDate==null ? " " : time.replace_time2(details[useIndex].BeginDate)}} 至 {{time.replace_time2(details[useIndex].ValidDate)}}</text> | ||
85 | + <text wx:elif="{{details[useIndex].use_end_time}}" class="ellipsis-1x">有效期:{{details[useIndex].use_start_time==null ? " " : time.format_time(details[useIndex].use_start_time)}} 至 {{time.format_time(details[useIndex].use_end_time)}}</text> | ||
86 | + <text wx:else>有效期:不限</text> | ||
87 | + </view> | ||
88 | + </view> | ||
89 | +</view> |
packageB/pages/boxes-details/boxes-details.wxss
0 → 100644
1 | +page { | ||
2 | + box-sizing: border-box; | ||
3 | + padding: 20rpx 20rpx 0; | ||
4 | + background-color: #f2f2f2; | ||
5 | + font-size: 28rpx; | ||
6 | +} | ||
7 | + | ||
8 | +.bdr12 { | ||
9 | + border-radius: 12rpx; | ||
10 | +} | ||
11 | + | ||
12 | +.w40 { | ||
13 | + width: 40%; | ||
14 | + box-sizing: border-box; | ||
15 | +} | ||
16 | + | ||
17 | +.btn-border { | ||
18 | + border: 2rpx solid #808080; | ||
19 | +} | ||
20 | + | ||
21 | + | ||
22 | +.bg-red { | ||
23 | + background-image: -webkit-linear-gradient(315deg,#f2140c,#f2270c 70%,#f24d0c); | ||
24 | + background-image: linear-gradient(135deg,#f2140c,#f2270c 70%,#f24d0c); | ||
25 | +} | ||
26 | + | ||
27 | +.bg-orange { | ||
28 | + background-image: -webkit-linear-gradient(315deg,#ffba0d,#ffc30d 69%,#ffcf0d); | ||
29 | + background-image: linear-gradient(135deg,#ffba0d,#ffc30d 69%,#ffcf0d); | ||
30 | +} | ||
31 | + | ||
32 | +.c-orange { | ||
33 | + color: #ff9000; | ||
34 | +} | ||
35 | + | ||
36 | +.main { | ||
37 | + padding-bottom: 134rpx; | ||
38 | +} | ||
39 | + | ||
40 | +.pic-box { | ||
41 | + width: 130rpx; | ||
42 | + height: 130rpx; | ||
43 | + border-radius: 12rpx; | ||
44 | + overflow: hidden; | ||
45 | + display: flex; | ||
46 | + justify-content: center; | ||
47 | + align-items: center; | ||
48 | + background-color: pink; | ||
49 | +} | ||
50 | + | ||
51 | +.rmb::before { | ||
52 | + content: '¥'; | ||
53 | +} | ||
54 | + | ||
55 | +.title { | ||
56 | + height: 88rpx; | ||
57 | +} | ||
58 | + | ||
59 | +.separator { | ||
60 | + position: relative; | ||
61 | +} | ||
62 | + | ||
63 | +.separator::before { | ||
64 | + content: ''; | ||
65 | + position: absolute; | ||
66 | + width: 2rpx; | ||
67 | + height: 30%; | ||
68 | + background-color: #f8f8f8; | ||
69 | + left: 0; | ||
70 | + top: 0; | ||
71 | + bottom: 0; | ||
72 | + margin: auto; | ||
73 | +} | ||
74 | + | ||
75 | +.btn-bar { | ||
76 | + box-sizing: border-box; | ||
77 | + position: fixed; | ||
78 | + left: 0; | ||
79 | + bottom: 0; | ||
80 | + width: 100%; | ||
81 | + font-size: 26rpx; | ||
82 | + border-top: 2rpx solid #f2f2f2; | ||
83 | +} | ||
84 | + | ||
85 | +.btn { | ||
86 | + width: 50%; | ||
87 | + box-sizing: border-box; | ||
88 | + display: inline-block; | ||
89 | + height: 70rpx; | ||
90 | + line-height: 70rpx; | ||
91 | + padding: 0 40rpx; | ||
92 | + border-radius: 100rpx; | ||
93 | +} | ||
94 | + | ||
95 | +.btn-copy { | ||
96 | + display: block; | ||
97 | + color: #666; | ||
98 | + font-size: 22rpx; | ||
99 | + padding: 0 20rpx; | ||
100 | + border-radius: 6rpx; | ||
101 | + background-color: #f0f0f0; | ||
102 | +} | ||
103 | + | ||
104 | +.del { | ||
105 | + text-decoration: line-through; | ||
106 | +} | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | +.mask { | ||
113 | + position: fixed; | ||
114 | + width: 100%; | ||
115 | + height: 100%; | ||
116 | + top: 0; | ||
117 | + left: 0; | ||
118 | + background-color: rgba(0,0,0,.7); | ||
119 | + z-index: 1; | ||
120 | + } | ||
121 | + | ||
122 | + .popup-container { | ||
123 | + position: fixed; | ||
124 | + width: 70%; | ||
125 | + border-radius: 12rpx; | ||
126 | + top: 50%; | ||
127 | + left: 50%; | ||
128 | + transform: translate(-50%, -50%); | ||
129 | + z-index: 3; | ||
130 | + } | ||
131 | + | ||
132 | + .popup { | ||
133 | + text-align: center; | ||
134 | + border-radius: 12rpx; | ||
135 | + background-color: white; | ||
136 | + overflow: hidden; | ||
137 | + /* width: 80%; */ | ||
138 | + } | ||
139 | + | ||
140 | + .popup-container .icon-close { | ||
141 | + color: rgba(255,255,255,.6); | ||
142 | + } | ||
143 | + | ||
144 | + .popup-title { | ||
145 | + padding: 40rpx 0; | ||
146 | + color: #fe0000; | ||
147 | + background-color: #FFD3D6; | ||
148 | + position: relative; | ||
149 | + } | ||
150 | + | ||
151 | + .popup-title::after { | ||
152 | + content: ''; | ||
153 | + position: absolute; | ||
154 | + left: -20rpx; | ||
155 | + bottom: -12rpx; | ||
156 | + width: 130%; | ||
157 | + height: 20rpx; | ||
158 | + background: -webkit-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
159 | + background: -moz-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
160 | + background: -o-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
161 | + background: radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
162 | + background-size: 40rpx 40rpx; | ||
163 | + transform: rotate(180deg); | ||
164 | + -webkit-transform: rotate(180deg); | ||
165 | + } | ||
166 | + | ||
167 | + | ||
168 | + .popup .rmb::before { | ||
169 | + font-size: 40rpx; | ||
170 | + } | ||
171 | + | ||
172 | + .img-qr { | ||
173 | + display: block; | ||
174 | + width: 300rpx; | ||
175 | + height: 300rpx; | ||
176 | + margin: 0 auto; | ||
177 | + background-color: pink; | ||
178 | + } | ||
179 | + | ||
180 | + .qrcode { | ||
181 | + width: 300rpx; | ||
182 | + height: 300rpx; | ||
183 | + margin: 0 auto; | ||
184 | + } | ||
185 | + | ||
186 | + | ||
187 | + .noMore { | ||
188 | + padding: 20rpx; | ||
189 | + color: #bbb; | ||
190 | + text-align: center; | ||
191 | + font-size: 22rpx; | ||
192 | + } | ||
193 | + | ||
194 | + .breakall { | ||
195 | + word-break: break-all; | ||
196 | + } | ||
197 | + | ||
198 | + | ||
199 | + |
packageB/pages/boxes-list/boxes-list.js
0 → 100644
1 | +const app = getApp(); | ||
2 | +let self = null; | ||
3 | + | ||
4 | +Page({ | ||
5 | + data: { | ||
6 | + tabArr: ['待核销','已核销'], | ||
7 | + currentTabIndex: 0, | ||
8 | + | ||
9 | + isLogin: false, | ||
10 | + list: null, | ||
11 | + isLoading: false, // 检测是否已经发送请求,防止重复发送请求 | ||
12 | + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 | ||
13 | + pageNum: 1, // 当前页数 | ||
14 | + | ||
15 | + // showReward: false, | ||
16 | + // prizesArr: [], | ||
17 | + | ||
18 | + // typeArr: [{ | ||
19 | + // key: 'point', | ||
20 | + // name: '积分', | ||
21 | + // },{ | ||
22 | + // key: 'grow', | ||
23 | + // name: '成长值', | ||
24 | + // },{ | ||
25 | + // key: 'point', | ||
26 | + // name: '优惠券', | ||
27 | + // },{ | ||
28 | + // key: 'prestore_name', | ||
29 | + // name: '项目服务', | ||
30 | + // },{ | ||
31 | + // key: 'prestore_money', | ||
32 | + // name: '预存金额', | ||
33 | + // }], | ||
34 | + }, | ||
35 | + | ||
36 | + onLoad: function () { | ||
37 | + self = this; | ||
38 | + app.isLogin().then(function(data) { | ||
39 | + self.setData({ | ||
40 | + userInfo: data, | ||
41 | + }); | ||
42 | + }); | ||
43 | + }, | ||
44 | + | ||
45 | + onShow: function() { | ||
46 | + if(app.globalData.userInfo) { | ||
47 | + if(!this.data.isLogin) { | ||
48 | + this.setData({ | ||
49 | + userInfo: app.globalData.userInfo, | ||
50 | + imghost: app.globalData.setting.imghost, | ||
51 | + isLogin: true, | ||
52 | + }); | ||
53 | + | ||
54 | + let data = { | ||
55 | + store_id: app.globalData.setting.stoid, | ||
56 | + user_id: this.data.userInfo.user_id, | ||
57 | + }; | ||
58 | + | ||
59 | + // 默认获取'全部' | ||
60 | + this.getData(true, '/api/weshop/prom/luckyOrder/page', data) | ||
61 | + .then(()=>{ | ||
62 | + this.setData({ | ||
63 | + currentData: data, | ||
64 | + }); | ||
65 | + }); | ||
66 | + | ||
67 | + }; | ||
68 | + }; | ||
69 | + }, | ||
70 | + | ||
71 | + | ||
72 | + /** | ||
73 | + * 页面上拉触底事件的处理函数 | ||
74 | + */ | ||
75 | + onReachBottom: function () { | ||
76 | + this.scrollToLower('/api/weshop/prom/luckyOrder/page', this.data.currentData); | ||
77 | + }, | ||
78 | + | ||
79 | + | ||
80 | + // 图片异常时加载默认图片 | ||
81 | + bind_bnerr: function (e) { | ||
82 | + var _errImg = e.target.dataset.errorimg; | ||
83 | + var val = e.target.dataset.val; | ||
84 | + if(val!=undefined && val!=null && val!='null' ){ | ||
85 | + var _errObj = {}; | ||
86 | + _errObj[_errImg] = "/public/images/default_goods_image_240.gif"; | ||
87 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
88 | + } | ||
89 | + }, | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + // 点击tab选项卡 | ||
94 | + clickTab(e) { | ||
95 | + this.setData({ | ||
96 | + currentTabIndex: e.target.dataset.index, | ||
97 | + noMore: false, | ||
98 | + pageNum: 1, | ||
99 | + list: null, | ||
100 | + }); | ||
101 | + | ||
102 | + let currentTabIndex = parseInt(this.data.currentTabIndex); | ||
103 | + let currentData = this.data.currentData; | ||
104 | + | ||
105 | + delete currentData.page; | ||
106 | + | ||
107 | + switch(currentTabIndex) { | ||
108 | + case 0: { | ||
109 | + delete currentData.team_status; | ||
110 | + break; | ||
111 | + }; | ||
112 | + case 1: { | ||
113 | + currentData.team_status = 0; | ||
114 | + break; | ||
115 | + }; | ||
116 | + case 2: { | ||
117 | + currentData.team_status = 2; | ||
118 | + break; | ||
119 | + }; | ||
120 | + case 3: { | ||
121 | + currentData.team_status = 1; | ||
122 | + break; | ||
123 | + }; | ||
124 | + }; | ||
125 | + | ||
126 | + // 请求 | ||
127 | + this.getData(true, '/api/weshop/prom/luckyOrder/page', currentData); | ||
128 | + | ||
129 | + }, | ||
130 | + | ||
131 | + | ||
132 | + /** | ||
133 | + * 请求数据 | ||
134 | + */ | ||
135 | + getData: function(isInit, url, data) { | ||
136 | + let p = app.request.promiseGet(url, { | ||
137 | + data: data, | ||
138 | + isShowLoading: true, | ||
139 | + }) | ||
140 | + .then(function(res) { | ||
141 | + if(res.data.code == 0) { | ||
142 | + | ||
143 | + self.setData({ | ||
144 | + isLoading: false | ||
145 | + }); | ||
146 | + | ||
147 | + if(isInit) {// 第一次加载 | ||
148 | + self.setData({ | ||
149 | + list: res.data.data | ||
150 | + }); | ||
151 | + } else { | ||
152 | + self.setData({ | ||
153 | + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData) | ||
154 | + }); | ||
155 | + }; | ||
156 | + | ||
157 | + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) { | ||
158 | + self.setData({ | ||
159 | + noMore: true | ||
160 | + }); | ||
161 | + }; | ||
162 | + | ||
163 | + } else { | ||
164 | + self.setData({ | ||
165 | + 'list.pageData': [] | ||
166 | + }); | ||
167 | + }; | ||
168 | + | ||
169 | + }); | ||
170 | + | ||
171 | + return p; | ||
172 | + }, | ||
173 | + | ||
174 | + | ||
175 | + /** | ||
176 | + * 上拉加载 | ||
177 | + */ | ||
178 | + scrollToLower(url, requestData) { | ||
179 | + // 数据总量 | ||
180 | + let total = this.data.list.total; | ||
181 | + // 单页最大数据量 | ||
182 | + let pageSize = this.data.list.pageSize; | ||
183 | + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’ | ||
184 | + if((total != 0)&&(total <= pageSize)) { | ||
185 | + this.setData({ | ||
186 | + noMore: true | ||
187 | + }); | ||
188 | + }; | ||
189 | + | ||
190 | + if(!this.data.isLoading && !this.data.noMore) { | ||
191 | + this.setData({ | ||
192 | + isLoading: true, | ||
193 | + pageNum: this.data.pageNum + 1 | ||
194 | + }); | ||
195 | + requestData.page = this.data.pageNum; | ||
196 | + this.getData(false, url, requestData); | ||
197 | + }; | ||
198 | + }, | ||
199 | + | ||
200 | + | ||
201 | + //跳转 | ||
202 | + go: function (e) { | ||
203 | + var url = e.currentTarget.dataset.url; | ||
204 | + getApp().goto(url); | ||
205 | + }, | ||
206 | + | ||
207 | + //查看奖励 | ||
208 | + showReward: function(e) { | ||
209 | + this.setData({ | ||
210 | + currentItemIndex: e.target.dataset.index, | ||
211 | + currentItemAid: e.target.dataset.aid, | ||
212 | + }); | ||
213 | + this.getPrizes(this.data.currentItemIndex); | ||
214 | + }, | ||
215 | + | ||
216 | + //关闭奖励 | ||
217 | + closeReward: function() { | ||
218 | + this.setData({ | ||
219 | + showReward: false, | ||
220 | + }); | ||
221 | + }, | ||
222 | + | ||
223 | + | ||
224 | + // 获取优惠券奖励和服务项目奖励 | ||
225 | + getPrizes: function(currentItemIndex) { | ||
226 | + let currentItem = this.data.list.pageData[currentItemIndex]; | ||
227 | + let type = currentItem.type; | ||
228 | + | ||
229 | + // 分割type字符串 | ||
230 | + let typeArr = this.splitStringToArr(type); | ||
231 | + let prizesArr = []; | ||
232 | + let promiseArr = []; | ||
233 | + typeArr.forEach(function(item) { | ||
234 | + | ||
235 | + let obj = {}; | ||
236 | + obj.type = item; | ||
237 | + | ||
238 | + let promise = new Promise((resolve, reject) => { | ||
239 | + switch(item) { | ||
240 | + case 1: { //积分 | ||
241 | + obj.name = '积分'; | ||
242 | + obj.num = 'point'; | ||
243 | + prizesArr.push(obj); | ||
244 | + resolve(); | ||
245 | + break; | ||
246 | + }; | ||
247 | + case 2: { //成长值 | ||
248 | + obj.name = '成长值'; | ||
249 | + obj.num = 'grow'; | ||
250 | + prizesArr.push(obj); | ||
251 | + resolve(); | ||
252 | + break; | ||
253 | + }; | ||
254 | + case 3: { //优惠券 | ||
255 | + app.request.promiseGet('/api/weshop/prom/luckyCoupon/page', { | ||
256 | + data: { | ||
257 | + store_id: app.globalData.setting.stoid, | ||
258 | + aid: self.data.currentItemAid, | ||
259 | + } | ||
260 | + }).then(res => { | ||
261 | + if(res.data.code == 0) { | ||
262 | + obj.couponList = res.data.data.pageData; | ||
263 | + prizesArr.push(obj); | ||
264 | + resolve(); | ||
265 | + }; | ||
266 | + }); | ||
267 | + break; | ||
268 | + }; | ||
269 | + case 4: { //服务项目 | ||
270 | + app.request.promiseGet('/api/weshop/prom/luckyService/page', { | ||
271 | + data: { | ||
272 | + store_id: app.globalData.setting.stoid, | ||
273 | + aid: self.data.currentItemAid, | ||
274 | + } | ||
275 | + }).then(res => { | ||
276 | + if(res.data.code == 0) { | ||
277 | + obj.serviceList = res.data.data.pageData; | ||
278 | + prizesArr.push(obj); | ||
279 | + resolve(); | ||
280 | + }; | ||
281 | + }); | ||
282 | + break; | ||
283 | + }; | ||
284 | + case 5: { //预存金额 | ||
285 | + obj.name = 'prestore_name'; | ||
286 | + obj.num = 'prestore_money'; | ||
287 | + prizesArr.push(obj); | ||
288 | + resolve(); | ||
289 | + break; | ||
290 | + }; | ||
291 | + }; | ||
292 | + }); | ||
293 | + | ||
294 | + promiseArr.push(promise); | ||
295 | + | ||
296 | + | ||
297 | + Promise.all(promiseArr).then(()=> { | ||
298 | + self.setData({ | ||
299 | + prizesArr, | ||
300 | + showReward: true, | ||
301 | + }); | ||
302 | + }); | ||
303 | + | ||
304 | + }); | ||
305 | + }, | ||
306 | + | ||
307 | + // 将type字符串分割成数组 | ||
308 | + splitStringToArr: function(typeStr) { | ||
309 | + var index; | ||
310 | + var newTypeArr = []; | ||
311 | + var typeStrArr = typeStr.split(','); | ||
312 | + typeStrArr.forEach(function(item) { | ||
313 | + index = parseInt(item); | ||
314 | + newTypeArr.push(index); | ||
315 | + }); | ||
316 | + return newTypeArr; | ||
317 | + }, | ||
318 | + | ||
319 | + | ||
320 | + | ||
321 | + | ||
322 | + | ||
323 | + viewDetails() { | ||
324 | + let url = '/packageB/pages/boxes-details/boxes-details'; | ||
325 | + app.goto(url); | ||
326 | + } | ||
327 | + | ||
328 | + | ||
329 | +}) | ||
330 | + |
packageB/pages/boxes-list/boxes-list.json
0 → 100644
packageB/pages/boxes-list/boxes-list.wxml
0 → 100644
1 | +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | ||
2 | + | ||
3 | +<!-- tabbar --> | ||
4 | +<view class="tab-hd" bindtap="clickTab"> | ||
5 | + <view class="tab-hd-item {{currentTabIndex == index ? 'active':''}}" | ||
6 | + wx:for="{{tabArr}}" | ||
7 | + data-index="{{index}}">{{item}}</view> | ||
8 | +</view> | ||
9 | + | ||
10 | +<view class="tab-bd"> | ||
11 | + <view class="list"> | ||
12 | + | ||
13 | + | ||
14 | + <view class="list-item" wx:if="{{currentTabIndex == 0}}" bindtap="viewDetails"> | ||
15 | + <view class="pd20"> | ||
16 | + <view class=""><text class="fs24 c-9">订单编号:</text>191561561565555</view> | ||
17 | + <view class="ellipsis-2 title">卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称</view> | ||
18 | + <view class="flex ai-center"> | ||
19 | + <text class="rmb fs40 c-red">2{{filters.price(item.group_price)}}</text> | ||
20 | + <view class="fs22 del pdl10 c-c7">零售价<text class="rmb">3{{item.market_price}}</text></view> | ||
21 | + </view> | ||
22 | + <view class="fs24 c-red">*兑换截止日期:2022-01-01至2022-12-31</view> | ||
23 | + </view> | ||
24 | + | ||
25 | + <view class="pd20 bdt fs24 t-r"> | ||
26 | + <view class="btn bg-gray white">已过期</view> | ||
27 | + <view class="btn bg-red white">立即兑换</view> | ||
28 | + </view> | ||
29 | + </view> | ||
30 | + | ||
31 | + | ||
32 | + <view class="list-item" wx:if="{{currentTabIndex == 1}}"> | ||
33 | + <view class="pd20"> | ||
34 | + <view class=""><text class="fs24 c-9">订单编号:</text>191561561565555</view> | ||
35 | + <view class="ellipsis-2 title">卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称项名称卡项名称卡项名称</view> | ||
36 | + <view class="flex ai-center"> | ||
37 | + <text class="rmb fs40 c-red">2{{filters.price(item.group_price)}}</text> | ||
38 | + <view class="fs22 del pdl10 c-c7">零售价<text class="rmb">3{{item.market_price}}</text></view> | ||
39 | + </view> | ||
40 | + <view class="fs24 c-red">*兑换截止日期:2022-01-01至2022-12-31</view> | ||
41 | + </view> | ||
42 | + | ||
43 | + <view class="pd20 bdt fs24 t-r"> | ||
44 | + <view class="btn bg-gray white">已核销</view> | ||
45 | + </view> | ||
46 | + </view> | ||
47 | + | ||
48 | + </view> | ||
49 | +</view> | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | +<view class="no-more" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底啦 ——</view> | ||
55 | +<nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata> | ||
56 | + | ||
57 | + |
packageB/pages/boxes-list/boxes-list.wxss
0 → 100644
1 | +.bdt { | ||
2 | + border-top: 2rpx solid #f5f5f5; | ||
3 | +} | ||
4 | + | ||
5 | +page { | ||
6 | + background-color: #f2f2f2; | ||
7 | +} | ||
8 | + | ||
9 | +.btn { | ||
10 | + display: inline-block; | ||
11 | + min-width: 120rpx; | ||
12 | + text-align: center; | ||
13 | + /* border: 2rpx solid #ff6768; */ | ||
14 | + padding: 10rpx 20rpx; | ||
15 | + border-radius: 40rpx; | ||
16 | +} | ||
17 | + | ||
18 | +.btn.gray { | ||
19 | + border-color: #ccc; | ||
20 | +} | ||
21 | + | ||
22 | +.tab-hd { | ||
23 | + display: flex; | ||
24 | + text-align: center; | ||
25 | + font-size: 28rpx; | ||
26 | + background-color: white; | ||
27 | + position: sticky; | ||
28 | + top: 0; | ||
29 | + z-index: 2; | ||
30 | +} | ||
31 | + | ||
32 | +.tab-hd-item { | ||
33 | + flex-grow: 1; | ||
34 | + padding: 20rpx; | ||
35 | + position: relative; | ||
36 | +} | ||
37 | + | ||
38 | +.tab-hd-item.active { | ||
39 | + color: #ff6768; | ||
40 | +} | ||
41 | + | ||
42 | +.tab-hd-item.active::after { | ||
43 | + content: ''; | ||
44 | + position: absolute; | ||
45 | + width: 30%; | ||
46 | + height: 4rpx; | ||
47 | + left: 0; | ||
48 | + right: 0; | ||
49 | + bottom: 0; | ||
50 | + margin: 0 auto; | ||
51 | + background-color: #ff6768; | ||
52 | +} | ||
53 | + | ||
54 | +.title { | ||
55 | + /* max-height: 88rpx; */ | ||
56 | + box-sizing: border-box; | ||
57 | + margin-top: 10rpx; | ||
58 | + margin-bottom: 10rpx; | ||
59 | + height: 90rpx; | ||
60 | +} | ||
61 | + | ||
62 | +.tab-bd { | ||
63 | + padding-left: 20rpx; | ||
64 | + padding-right: 20rpx; | ||
65 | +} | ||
66 | + | ||
67 | +.list { | ||
68 | + overflow: hidden; | ||
69 | +} | ||
70 | + | ||
71 | +.list-item { | ||
72 | + background-color: white; | ||
73 | + margin-top: 20rpx; | ||
74 | + border-radius: 12rpx; | ||
75 | + font-size: 28rpx; | ||
76 | +} | ||
77 | + | ||
78 | +.arrow { | ||
79 | + position: relative; | ||
80 | +} | ||
81 | + | ||
82 | +.arrow::after { | ||
83 | + font-family: iconfont; | ||
84 | + content: '\e61f'; | ||
85 | + position: absolute; | ||
86 | + right: 0; | ||
87 | + color: #ccc; | ||
88 | +} | ||
89 | + | ||
90 | +.img-container { | ||
91 | + width: 200rpx; | ||
92 | + height: 200rpx; | ||
93 | + flex-shrink: 0; | ||
94 | + margin-right: 20rpx; | ||
95 | + border-radius: 14rpx; | ||
96 | + overflow: hidden; | ||
97 | +} | ||
98 | + | ||
99 | +.rmb::before { | ||
100 | + content: '¥'; | ||
101 | + font-size: 24rpx; | ||
102 | +} | ||
103 | + | ||
104 | +.del { | ||
105 | + text-decoration: line-through; | ||
106 | +} | ||
107 | + | ||
108 | +.no-more { | ||
109 | + font-size: 24rpx; | ||
110 | + line-height: 3; | ||
111 | + text-align: center; | ||
112 | + /* margin-top: 10rpx; */ | ||
113 | + color: #ccc; | ||
114 | +} | ||
115 | + | ||
116 | + | ||
117 | +.popup-container { | ||
118 | + position: fixed; | ||
119 | + top: 0; | ||
120 | + bottom: 0; | ||
121 | + left: 0; | ||
122 | + right: 0; | ||
123 | + background-color: rgba(0,0,0,.8); | ||
124 | +} | ||
125 | + | ||
126 | +.popup { | ||
127 | + background-color: #FFFAE7; | ||
128 | + position: fixed; | ||
129 | + left: 50%; | ||
130 | + top: 50%; | ||
131 | + transform: translate(-50%, -50%); | ||
132 | + border-radius: 12rpx; | ||
133 | + min-width: 600rpx; | ||
134 | + color: #AF481D; | ||
135 | +} | ||
136 | + | ||
137 | +.popup-list { | ||
138 | + max-height: 700rpx; | ||
139 | + overflow-y: auto; | ||
140 | +} | ||
141 | + | ||
142 | +.popup-list-item { | ||
143 | + display: flex; | ||
144 | + align-items: center; | ||
145 | + padding: 20rpx; | ||
146 | +} | ||
147 | + | ||
148 | +.popup-list-item .img-container { | ||
149 | + width: 120rpx; | ||
150 | + height: 100rpx; | ||
151 | +} | ||
152 | + | ||
153 | + .popup-title { | ||
154 | + font-size: 28rpx; | ||
155 | + height: 88rpx; | ||
156 | + } | ||
157 | + | ||
158 | + .bg-red { | ||
159 | + background-image: -webkit-linear-gradient(315deg,#f2140c,#f2270c 70%,#f24d0c); | ||
160 | + background-image: linear-gradient(135deg,#f2140c,#f2270c 70%,#f24d0c); | ||
161 | + } | ||
162 | + | ||
163 | + .bg-gray { | ||
164 | + background-image: -webkit-linear-gradient(315deg,#bfbfbf,#c3c3c3 70%,#d4d3d3); | ||
165 | + background-image: linear-gradient(135deg,#bfbfbf,#c3c3c3 70%,#d4d3d3); | ||
166 | + } | ||
0 | \ No newline at end of file | 167 | \ No newline at end of file |