Commit d006bc5c21b7437d4f1426d9a7996a018957847d
1 parent
70482432
优化券换新界面去掉旧的
Showing
26 changed files
with
1349 additions
and
4498 deletions
app.json
@@ -40,9 +40,6 @@ | @@ -40,9 +40,6 @@ | ||
40 | "pages/user/member/account_unable/account_unable", | 40 | "pages/user/member/account_unable/account_unable", |
41 | "pages/user/member/cash_record/cash_record", | 41 | "pages/user/member/cash_record/cash_record", |
42 | "pages/user/coupons/coupons", | 42 | "pages/user/coupons/coupons", |
43 | - "pages/user/coupons/qr_code/qr_code", | ||
44 | - "pages/user/coupons/query/index", | ||
45 | - "pages/user/coupons/exchange/exchange", | ||
46 | "pages/user/integral/integral", | 43 | "pages/user/integral/integral", |
47 | "pages/user/integral/query/index", | 44 | "pages/user/integral/query/index", |
48 | "pages/user/integral/msg/msg", | 45 | "pages/user/integral/msg/msg", |
packageB/pages/coupons/filter.wxs deleted
1 | -var numFr = { | ||
2 | - getNum: function(x) { | ||
3 | - var f = parseFloat(x); | ||
4 | - if (isNaN(f)) { | ||
5 | - return false; | ||
6 | - } | ||
7 | - var f = Math.round(x * 100) / 100; | ||
8 | - var s = f.toString(); | ||
9 | - var rs = s.indexOf('.'); | ||
10 | - if (rs < 0) { | ||
11 | - rs = s.length; | ||
12 | - s += '.'; | ||
13 | - } | ||
14 | - while (s.length <= rs + 2) { | ||
15 | - s += '0'; | ||
16 | - } | ||
17 | - return s; | ||
18 | - }, | ||
19 | - showBtnText: function(index) { | ||
20 | - switch(index) { | ||
21 | - case 1: { | ||
22 | - return '已使用'; | ||
23 | - break; | ||
24 | - }; | ||
25 | - case 2: { | ||
26 | - return '已过期'; | ||
27 | - break; | ||
28 | - }; | ||
29 | - default: { | ||
30 | - return '立即使用'; | ||
31 | - }; | ||
32 | - }; | ||
33 | - }, | ||
34 | -} | ||
35 | -module.exports = { | ||
36 | - getNum: numFr.getNum, | ||
37 | - showBtnText: numFr.showBtnText, | ||
38 | -} | ||
39 | \ No newline at end of file | 0 | \ No newline at end of file |
packageB/pages/coupons/query/index.js deleted
1 | -var t = getApp(), | ||
2 | - a = t.request, | ||
3 | - o = t.globalData.setting, | ||
4 | - os = o, | ||
5 | - i = require("../../../../utils/util.js"), | ||
6 | - ut = i, | ||
7 | - s = require("../../../../utils/common.js"); | ||
8 | -var regeneratorRuntime = require('../../../../utils/runtime.js'); | ||
9 | -const { | ||
10 | - barcode, | ||
11 | - qrcode | ||
12 | -} = require('../../../../utils/index.js'); | ||
13 | -let _this = null; | ||
14 | - | ||
15 | -Page({ | ||
16 | - data: { | ||
17 | - | ||
18 | - val:false, | ||
19 | - datet: "", | ||
20 | - dates: "", | ||
21 | - parameter: false, | ||
22 | - details:[],//数据 | ||
23 | - isBind:true,//控制清空时间日期的按钮 | ||
24 | - isBinds: true, | ||
25 | - select: false,//下拉框 | ||
26 | - grade_name: '未使用', | ||
27 | - // grades: [ //old | ||
28 | - // '所有', | ||
29 | - // '已使用', | ||
30 | - // '已过期', | ||
31 | - // '未使用', | ||
32 | - // ], | ||
33 | - currentIndex: 0, //tab项当前指示器 | ||
34 | - grades: [ | ||
35 | - '未使用', | ||
36 | - '已使用', | ||
37 | - '已过期', | ||
38 | - ], | ||
39 | - display:false, | ||
40 | - is_no_more: 0, | ||
41 | - current_page:1, | ||
42 | - by_list:[], | ||
43 | - isloading:0, | ||
44 | - pageNum: 1, | ||
45 | - }, | ||
46 | - /** | ||
47 | - * 生命周期函数--监听页面加载 | ||
48 | - */ | ||
49 | - onLoad: function (options) { | ||
50 | - _this = this; | ||
51 | - this.setData({ | ||
52 | - details: [] | ||
53 | - }); | ||
54 | - this.wjquery(); | ||
55 | - }, | ||
56 | - /** | ||
57 | - * 生命周期函数--监听页面显示 | ||
58 | - */ | ||
59 | - onShow: function (options) { | ||
60 | - var th = this; | ||
61 | - | ||
62 | - wx.setNavigationBarTitle({ | ||
63 | - title: "微券查询", | ||
64 | - }); | ||
65 | - | ||
66 | - /** | ||
67 | - * 控制显示微券兑换 | ||
68 | - * by sty | ||
69 | - */ | ||
70 | - getApp().getConfig2(function (ee) { | ||
71 | - var json_d = JSON.parse(ee.switch_list); | ||
72 | - let is_show_dhwz = json_d.dhwz_switch; | ||
73 | - let grades = th.data.grades; | ||
74 | - // console.log('is_show_dhwz----------------------------',is_show_dhwz); | ||
75 | - if(is_show_dhwz) { | ||
76 | - grades.push('微券兑换'); | ||
77 | - th.setData({ grades }); | ||
78 | - }; | ||
79 | - th.setData({ is_show_dhwz }); | ||
80 | - },1); | ||
81 | - }, | ||
82 | - | ||
83 | - | ||
84 | - | ||
85 | - | ||
86 | - // 点击选中二维码 | ||
87 | - click: function (e) { | ||
88 | - var val = e.currentTarget.dataset.cashrepno; | ||
89 | - getApp().globalData.val = val; | ||
90 | - wx.navigateTo({ | ||
91 | - url: '../qr_code/qr_code', | ||
92 | - }) | ||
93 | - }, | ||
94 | - // 点击返回主页 | ||
95 | - // clicks: function () { | ||
96 | - // this.setData({ | ||
97 | - // hide:true, display:false | ||
98 | - // }) | ||
99 | - // }, | ||
100 | - //监听输入框显示清空按钮 | ||
101 | - watchPassWord: function (event) { | ||
102 | - var val = event.detail.value; | ||
103 | - if (val != "" && val != null) { | ||
104 | - var isBind = false; | ||
105 | - this.setData({ isBind: isBind }); | ||
106 | - | ||
107 | - } | ||
108 | - }, | ||
109 | - /** | ||
110 | - * 点击下拉框 | ||
111 | - */ | ||
112 | - bindShowMsg() { | ||
113 | - this.setData({ | ||
114 | - select: !this.data.select | ||
115 | - }) | ||
116 | - }, | ||
117 | - /** | ||
118 | - * 已选下拉框 | ||
119 | - */ | ||
120 | - // mySelect(e) { | ||
121 | - // var name = e.currentTarget.dataset.name; | ||
122 | - // this.setData({ | ||
123 | - // grade_name: name, | ||
124 | - // select: false | ||
125 | - // }) | ||
126 | - // }, | ||
127 | - | ||
128 | - /** | ||
129 | - * 点击tab | ||
130 | - * by sty | ||
131 | - */ | ||
132 | - clickTab(e) { | ||
133 | - let index = e.target.dataset.index; | ||
134 | - let name = e.target.dataset.name; | ||
135 | - | ||
136 | - this.setData({ | ||
137 | - is_get: 0, | ||
138 | - pageNum: 1, | ||
139 | - grade_name: name, | ||
140 | - currentIndex: index, | ||
141 | - is_no_more: 0, | ||
142 | - current_page: 1, | ||
143 | - noMore: false, | ||
144 | - details: [], | ||
145 | - by_list: [], | ||
146 | - }); | ||
147 | - | ||
148 | - | ||
149 | - if(index == 3) {//微券兑换 | ||
150 | - this.exchange(); | ||
151 | - } else {//其他 | ||
152 | - this.wjquery(); | ||
153 | - }; | ||
154 | - }, | ||
155 | - | ||
156 | - /** | ||
157 | - * 点击"立即使用" | ||
158 | - * by sty | ||
159 | - */ | ||
160 | - clickUse(e) { | ||
161 | - let useIndex = e.currentTarget.dataset.index; | ||
162 | - let val = e.currentTarget.dataset.cashrepno; | ||
163 | - | ||
164 | - this.setData({ | ||
165 | - showQr: true, | ||
166 | - useIndex, | ||
167 | - }); | ||
168 | - this.qrcode(val); | ||
169 | - }, | ||
170 | - | ||
171 | - /** | ||
172 | - * 关闭二维码 | ||
173 | - * by sty | ||
174 | - */ | ||
175 | - closeQr() { | ||
176 | - this.setData({ | ||
177 | - showQr: false, | ||
178 | - }); | ||
179 | - }, | ||
180 | - | ||
181 | - /** | ||
182 | - * 生成二维码 | ||
183 | - * by sty | ||
184 | - */ | ||
185 | - qrcode:function(val){ | ||
186 | - // console.log(val); | ||
187 | - // barcode('barcode', val, 600,160); | ||
188 | - qrcode('qrcode', val, 300, 300); | ||
189 | - }, | ||
190 | - | ||
191 | - /** | ||
192 | - * 请求微券列表 | ||
193 | - * by sty | ||
194 | - */ | ||
195 | - async exchange() { | ||
196 | - var result; | ||
197 | - var user_id = getApp().globalData.user_id; | ||
198 | - var store_id = os.stoid; | ||
199 | - | ||
200 | - | ||
201 | - this.getData(true, '/api/weshop/users/listExchangeCoupons', { | ||
202 | - user_id: user_id, store_id: store_id, | ||
203 | - }).then(()=>{ | ||
204 | - _this.setData({ | ||
205 | - result: _this.data.list.pageData, | ||
206 | - }); | ||
207 | - }); | ||
208 | - | ||
209 | - // await getApp().request.promiseGet("/api/weshop/users/listExchangeCoupons", { | ||
210 | - // data: { | ||
211 | - // user_id: user_id, store_id: store_id, | ||
212 | - // } | ||
213 | - // }).then(res => { | ||
214 | - // // var msg = res.data; | ||
215 | - // // result = msg.data.pageData; | ||
216 | - // }) | ||
217 | - // e.setData({ | ||
218 | - // result: result | ||
219 | - // }) | ||
220 | - }, | ||
221 | - | ||
222 | - /** | ||
223 | - * 微券兑换对话框 | ||
224 | - * by sty | ||
225 | - */ | ||
226 | - async clickExchange(e) { | ||
227 | - var th=this; | ||
228 | - var index = e.currentTarget.dataset.index; | ||
229 | - var item = this.data.result[index]; | ||
230 | - this.data.monye = item.ToSum; | ||
231 | - this.data.integr = item.Integral; | ||
232 | - this.data.number = item.Number; | ||
233 | - | ||
234 | - let content = `确定使用${th.data.integr}积分兑换代金券面值${th.data.monye}元吗?`; | ||
235 | - wx.showModal({ | ||
236 | - title: '提示', | ||
237 | - content: content, | ||
238 | - success (res) { | ||
239 | - if (res.confirm) { | ||
240 | - console.log('用户点击确定'); | ||
241 | - th.sure_pay(); | ||
242 | - } else if (res.cancel) { | ||
243 | - console.log('用户点击取消') | ||
244 | - } | ||
245 | - } | ||
246 | - }); | ||
247 | - | ||
248 | - | ||
249 | - | ||
250 | - // var my_con = this.selectComponent("#my_con"); //组件的id | ||
251 | - // var title="是否使用"+th.data.integr+"积分兑换代金券面值"+th.data.monye+"元"; | ||
252 | - // my_con.open(title, "确定", "取消", th.sure_pay, null) | ||
253 | - }, | ||
254 | - | ||
255 | - | ||
256 | - /** | ||
257 | - * 微券兑换 | ||
258 | - * by sty | ||
259 | - */ | ||
260 | - sure_pay:function(){ | ||
261 | - var monye=this.data.monye; | ||
262 | - var integr=this.data.integr; | ||
263 | - var number=this.data.number; | ||
264 | - | ||
265 | - var user_id = getApp().globalData.user_id; | ||
266 | - console.log(integr,"是什么微卷",typeof integr,monye); | ||
267 | - var store_id = os.stoid; | ||
268 | - getApp().request.post("/api/weshop/users/saveInterToCash", { | ||
269 | - data: { | ||
270 | - user_id: user_id, | ||
271 | - store_id: store_id, | ||
272 | - money:monye, | ||
273 | - integ:integr, | ||
274 | - number:number, | ||
275 | - }, | ||
276 | - success: function (su) { | ||
277 | - if (su.data.data!=null) { | ||
278 | - // getApp().showWarning("兑换成功"); | ||
279 | - wx.showToast({ | ||
280 | - title: '兑换成功', | ||
281 | - icon: 'success', | ||
282 | - }); | ||
283 | - }else{ | ||
284 | - // getApp().showWarning("积分不足"); | ||
285 | - wx.showToast({ | ||
286 | - title: '积分不足', | ||
287 | - icon: 'error', | ||
288 | - }); | ||
289 | - } | ||
290 | - } | ||
291 | - | ||
292 | - }) | ||
293 | - }, | ||
294 | - | ||
295 | - | ||
296 | - //明细查询 | ||
297 | - Gettime:function(e){ | ||
298 | - var page = 0; | ||
299 | - //开始获取时间 | ||
300 | - var th = this; | ||
301 | - var stime = th.data.datet; | ||
302 | - var etime = th.data.dates; | ||
303 | - var tpye = th.data.grade_name; | ||
304 | - | ||
305 | - //开始获取时间结束 | ||
306 | - //删除字符中的—— | ||
307 | - var datatk = stime.replace(/[-]/g, ""); | ||
308 | - var dataj = etime.replace(/[-]/g, ""); | ||
309 | - //转换类型 | ||
310 | - var datak = parseInt(datatk); | ||
311 | - var dataj = parseInt(dataj); | ||
312 | - | ||
313 | - //判断初始时间小于结束时间 | ||
314 | - if (datak > dataj) { | ||
315 | - getApp().showWarning("结束时间错误"); | ||
316 | - } else { | ||
317 | - this.setData({ details: [] }); | ||
318 | - this.data.current_page=1; | ||
319 | - this.data.is_no_more=0; | ||
320 | - this.data.by_list=[]; | ||
321 | - this.data.details=[]; | ||
322 | - this.wjquery(); | ||
323 | - } | ||
324 | - | ||
325 | - }, | ||
326 | - | ||
327 | - //微卷查询流水明细 | ||
328 | - async wjquery() { | ||
329 | - if(this.data.isloading) return; | ||
330 | - if(this.data.is_no_more) return; | ||
331 | - this.data.isloading=1; | ||
332 | - var th=this; | ||
333 | - | ||
334 | - var len = this.data.details.length; | ||
335 | - | ||
336 | - var e = this,sum, val, number; | ||
337 | - var user_id = getApp().globalData.user_id; | ||
338 | - var store_id = os.stoid; | ||
339 | - | ||
340 | - var stime = this.data.datet; | ||
341 | - var etime = this.data.dates; | ||
342 | - | ||
343 | - var tpye = this.data.grade_name; | ||
344 | - console.log("是什么类型",tpye); | ||
345 | - var IsUse = 0; | ||
346 | - var e = this; | ||
347 | - var get_data = { | ||
348 | - user_id: user_id, | ||
349 | - store_id: store_id, | ||
350 | - // pageSize: 10, | ||
351 | - page: e.data.current_page, | ||
352 | - }; | ||
353 | - | ||
354 | - var dd={ | ||
355 | - user_id: user_id, | ||
356 | - store_id: store_id, | ||
357 | - // pageSize: 10, | ||
358 | - }; | ||
359 | - dd.isuse=0; | ||
360 | - // 判断下拉框,添加类型 | ||
361 | - if (tpye == "已使用"){ | ||
362 | - get_data.IsUse = 1; | ||
363 | - dd.isuse=1; | ||
364 | - } else if (tpye == "已过期"){ | ||
365 | - get_data.IsUse = 2; | ||
366 | - } else if (tpye == "未使用"){ | ||
367 | - get_data.IsUse = 0; | ||
368 | - }; | ||
369 | - if (etime != "" && etime != null) { | ||
370 | - get_data.EndDate = etime; | ||
371 | - | ||
372 | - //时间要转成时间戳 | ||
373 | - var new_t=new Date(etime)/1000; | ||
374 | - dd.etime=new_t; | ||
375 | - } | ||
376 | - | ||
377 | - if (stime != "" && stime != null) { | ||
378 | - get_data.BeginDate= stime; | ||
379 | - //时间要转成时间戳 | ||
380 | - var new_t=new Date(stime)/1000; | ||
381 | - dd.stime=new_t; | ||
382 | - } | ||
383 | - | ||
384 | - var by_list=[]; | ||
385 | - if(th.data.current_page==1){ | ||
386 | - //先拿包邮券 | ||
387 | - await getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea?pageSize=100", { | ||
388 | - data: dd, | ||
389 | - }).then(res => { | ||
390 | - | ||
391 | - if(res.data.code == 0) { | ||
392 | - th.setData({ | ||
393 | - byTotal: res.data.data.total, | ||
394 | - }); | ||
395 | - }; | ||
396 | - | ||
397 | - if(res.data.code==0 && res.data.data && res.data.data.total>0){ | ||
398 | - | ||
399 | - by_list=res.data.data.pageData; | ||
400 | - for(var i in by_list){ | ||
401 | - by_list[i].isby=1; | ||
402 | - //过滤是时间的范围 | ||
403 | - if(get_data.IsUse == 2 && by_list[i].use_end_time<=ut.gettimestamp()){ | ||
404 | - th.data.by_list.push(by_list[i]); | ||
405 | - }else if(get_data.IsUse == 0){ | ||
406 | - th.data.by_list.push(by_list[i]); | ||
407 | - }else if(get_data.IsUse==1){ | ||
408 | - th.data.by_list.push(by_list[i]); | ||
409 | - }else if(get_data.IsUse==undefined){ | ||
410 | - th.data.by_list.push(by_list[i]); | ||
411 | - } | ||
412 | - } | ||
413 | - } | ||
414 | - }) | ||
415 | - } | ||
416 | - | ||
417 | - var big_arr = this.data.details; ///api/weshop / users / listQuan | ||
418 | - if(th.data.current_page==1 && th.data.by_list.length>0) { | ||
419 | - big_arr=th.data.by_list; | ||
420 | - }; | ||
421 | - | ||
422 | - | ||
423 | - await getApp().request.promiseGet("/api/weshop/users/listQuan", { | ||
424 | - data: get_data, | ||
425 | - isShowLoading: 1 | ||
426 | - | ||
427 | - }).then(res => { | ||
428 | - | ||
429 | - th.data.isloading=0; | ||
430 | - var a = res.data; | ||
431 | - var len = e.data.details.length; | ||
432 | - var details = a.data.pageData; | ||
433 | - | ||
434 | - th.setData({ | ||
435 | - pageSize: a.data.pageSize, | ||
436 | - wjTotal: a.data.total, | ||
437 | - }); | ||
438 | - | ||
439 | - if (details.length == 0) { | ||
440 | - this.setData({ | ||
441 | - is_no_more: 1, | ||
442 | - }); | ||
443 | - // getApp().showWarning("未找更多数据"); | ||
444 | - if(th.data.by_list && th.data.current_page==1){ | ||
445 | - th.setData({ val: val,details:th.data.by_list}); | ||
446 | - details=th.data.by_list; | ||
447 | - setTimeout(function () { | ||
448 | - for (var i = 0; i < details.length; i++) { | ||
449 | - var no = i + len; | ||
450 | - qrcode('qrcode' + no, details[i].no,460, 460); | ||
451 | - } | ||
452 | - }, 100) | ||
453 | - } | ||
454 | - return false; | ||
455 | - } | ||
456 | - | ||
457 | - th.data.current_page++; | ||
458 | - val = a.data.total+th.data.by_list.length; | ||
459 | - | ||
460 | - big_arr=big_arr.concat(details); | ||
461 | - this.setData({ | ||
462 | - details: big_arr,val: val, | ||
463 | - is_get: 1, | ||
464 | - current_page: this.data.current_page, | ||
465 | - }); | ||
466 | - | ||
467 | - setTimeout(function () { | ||
468 | - if(by_list) details=big_arr; | ||
469 | - for (var i = 0; i < details.length; i++) { | ||
470 | - var no = i + len; | ||
471 | - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no,460, 460); | ||
472 | - } | ||
473 | - }, 100) | ||
474 | - }) | ||
475 | - | ||
476 | - | ||
477 | - | ||
478 | - }, | ||
479 | - | ||
480 | - | ||
481 | - // 使用说明详情展开 | ||
482 | - clickDetails: function(e) { | ||
483 | - let details = this.data.details; | ||
484 | - let index = e.currentTarget.dataset.index; | ||
485 | - details[index].isShowDetails = !details[index].isShowDetails; | ||
486 | - this.setData({ | ||
487 | - details, | ||
488 | - }); | ||
489 | - }, | ||
490 | - | ||
491 | - | ||
492 | - | ||
493 | - //---加载更多是靠这个函数---- | ||
494 | - onReachBottom: function () { | ||
495 | - if(this.data.currentIndex != 3) { | ||
496 | - this.wjquery(); | ||
497 | - } else { | ||
498 | - this.scrollToLower('/api/weshop/users/listExchangeCoupons', { | ||
499 | - user_id: getApp().globalData.user_id, | ||
500 | - store_id: os.stoid, | ||
501 | - }, function() { | ||
502 | - // console.log('!!!!!', _this.data.list.pageData); | ||
503 | - _this.setData({ | ||
504 | - result: _this.data.list.pageData, | ||
505 | - }); | ||
506 | - }); | ||
507 | - }; | ||
508 | - }, | ||
509 | - | ||
510 | - | ||
511 | - //起始时间 | ||
512 | - // bindDateChenge: function(e) { | ||
513 | - // console.log("是什么", e.detail.value); | ||
514 | - // var isBind = false; | ||
515 | - // this.setData({ | ||
516 | - // datet: e.detail.value, isBind: isBind | ||
517 | - // }); | ||
518 | - // }, | ||
519 | - // 结束时间 | ||
520 | - // bindDateChenges: function(e) { | ||
521 | - // console.log("是什么", e.detail.value); | ||
522 | - // var isBinds = false; | ||
523 | - // this.setData({ | ||
524 | - // dates: e.detail.value, isBinds: isBinds | ||
525 | - // }); | ||
526 | - // }, | ||
527 | - //catchtap阻止冒泡,点击清除开始时间的按钮 | ||
528 | - // eliminate:function(){ | ||
529 | - // console.log("试试"); | ||
530 | - // var isBind= true; | ||
531 | - // var data=""; | ||
532 | - // this.setData({ datet: data, isBind: isBind}) | ||
533 | - // }, | ||
534 | - //catchtap阻止冒泡,点击清除结束时间的按钮 | ||
535 | - // eliminates: function () { | ||
536 | - // console.log("试试"); | ||
537 | - // var isBinds = true; | ||
538 | - // var dates = ""; | ||
539 | - // this.setData({ dates: dates, isBinds: isBinds }) | ||
540 | - // }, | ||
541 | - | ||
542 | - | ||
543 | - | ||
544 | - | ||
545 | - | ||
546 | - | ||
547 | - // 上拉加载请求数据 | ||
548 | - getData: function(isInit, url, data) { | ||
549 | - return getApp().request.promiseGet(url, {data: data, isShowLoading: true,}) | ||
550 | - .then((res) => { | ||
551 | - _this.data.isLoading = false; | ||
552 | - if(res.data.code == 0) { | ||
553 | - if(isInit) {// 第一次加载 | ||
554 | - _this.setData({ | ||
555 | - list: res.data.data | ||
556 | - }); | ||
557 | - } else { | ||
558 | - _this.setData({ | ||
559 | - 'list.pageData': _this.data.list.pageData.concat(res.data.data.pageData) | ||
560 | - }); | ||
561 | - }; | ||
562 | - | ||
563 | - if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) { | ||
564 | - _this.setData({ | ||
565 | - noMore: true | ||
566 | - }); | ||
567 | - }; | ||
568 | - }; | ||
569 | - }); | ||
570 | - }, | ||
571 | - | ||
572 | - | ||
573 | - // 上拉加载 | ||
574 | - scrollToLower(url, requestData, callback) { | ||
575 | - // 页面数据 | ||
576 | - // let pageData = this.data.list.pageData; | ||
577 | - // 数据总量 | ||
578 | - let total = this.data.list.total; | ||
579 | - // 单页最大数据量 | ||
580 | - let pageSize = this.data.list.pageSize; | ||
581 | - // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’ | ||
582 | - if((total != 0)&&(total <= pageSize)) { | ||
583 | - this.setData({ | ||
584 | - noMore: true | ||
585 | - }); | ||
586 | - }; | ||
587 | - | ||
588 | - if(!this.data.isloading && !this.data.noMore) { | ||
589 | - this.setData({ | ||
590 | - isLoading: true, | ||
591 | - pageNum: this.data.pageNum + 1 | ||
592 | - }); | ||
593 | - requestData.page = this.data.pageNum; | ||
594 | - this.getData(false, url, requestData).then(()=>{ | ||
595 | - if(callback) { | ||
596 | - callback(); | ||
597 | - }; | ||
598 | - }); | ||
599 | - }; | ||
600 | - }, | ||
601 | - | ||
602 | -}) | ||
603 | \ No newline at end of file | 0 | \ No newline at end of file |
packageB/pages/coupons/query/index.json deleted
packageB/pages/coupons/query/index.wxml deleted
1 | -<wxs module="filter" src="../filter.wxs"></wxs> | ||
2 | -<wxs module="time" src="../../../../utils/filter.wxs"></wxs> | ||
3 | - | ||
4 | - | ||
5 | -<!-- <view class="big-rim"> | ||
6 | - <form bindsubmit='Gettime'> | ||
7 | - <view class="min-rim"> | ||
8 | - <view class="rq">日期:</view> | ||
9 | - | ||
10 | - <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'> | ||
11 | - <view class="rq-rim"> | ||
12 | - <view class='kssj'><text class="wz"name="datat"value='{{datet}}'bindinput='watchPassWord'>{{datet}}</text></view> --> | ||
13 | - <!-- 清除输入框中的内容--> | ||
14 | - <!-- <view hidden='{{isBind}}' class="qc-rim"> | ||
15 | - <button class="empty" catchtap="eliminate">x</button> | ||
16 | - </view> | ||
17 | - </view> | ||
18 | - </picker> | ||
19 | - | ||
20 | - <view class="zi">至 </view> | ||
21 | - <picker class="pi"mode="date" value='{{dates}}' start="2019/1/1" end="" bindchange='bindDateChenges'> | ||
22 | - <view class="rim"> | ||
23 | - <view class="kssj"> | ||
24 | - <text class='wz' name="datas" value='{{dates}}'>{{dates}}</text> | ||
25 | - </view> --> | ||
26 | - <!-- 清除输入框中的内容 --> | ||
27 | - <!-- <view class="end-rim" hidden="{{isBinds}}"> | ||
28 | - <button class="end" catchtap="eliminates">x</button> | ||
29 | - </view> | ||
30 | - </view> | ||
31 | - </picker> | ||
32 | - </view> | ||
33 | - <view class="xknr-rim"> | ||
34 | - <view class="cxnr">查询内容 </view> | ||
35 | - <view class='top'> --> | ||
36 | - <!-- 下拉框 --> | ||
37 | - <!-- <view class='top-selected' bindtap='bindShowMsg'> | ||
38 | - <input name="grade_name" class="texts" value='{{grade_name}}'>{{grade_name}}</input> | ||
39 | - <view class="rim-images"> | ||
40 | - <image class="images" src='{{iurl}}/miniapp/images/usermoney/ico-pt4.png'></image> | ||
41 | - </view> | ||
42 | - </view> --> | ||
43 | - <!-- 下拉需要显示的列表 --> | ||
44 | - <!-- <view class="select-box" wx:if="{{select}}"> | ||
45 | - <view wx:for="{{grades}}" wx:key="unique"> | ||
46 | - <view class="select_one" bindtap="mySelect" data-name="{{item}}">{{item}}</view> | ||
47 | - </view> | ||
48 | - </view> | ||
49 | - </view> | ||
50 | - </view> | ||
51 | - <button class="botton" form-type='submit' data-query='{{item}}'>查询明细</button> | ||
52 | - </form> | ||
53 | -</view> --> | ||
54 | - | ||
55 | - | ||
56 | -<view class="tab-head" bindtap="clickTab"> | ||
57 | - <view wx:for="{{grades}}" wx:key="unique" class="tab-head-item {{currentIndex == index ? 'active':''}}" data-name="{{item}}" data-index="{{index}}">{{item}}</view> | ||
58 | -</view> | ||
59 | - | ||
60 | -<view class="tab-body"> | ||
61 | - <block wx:if="{{currentIndex != 3}}"> | ||
62 | - <view class="tab-list-item" wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> | ||
63 | - <block wx:if="{{detail.isby}}"> | ||
64 | - <view class="coupon"> | ||
65 | - <view class="flex"> | ||
66 | - <view class="c-l"><text class="fs40">包邮券</text></view> | ||
67 | - <view class="c-r dash"> | ||
68 | - <view class="flex jc_sb ai_c"> | ||
69 | - <view class="pdr20"> | ||
70 | - <view class="fs28 ellipsis-1x">包邮券</view> | ||
71 | - <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: 微信商城</view> | ||
72 | - </view> | ||
73 | - <view class="shrink0"><text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.no}}">{{filter.showBtnText(currentIndex)}}</text></view> | ||
74 | - </view> | ||
75 | - <view class="c-time"> | ||
76 | - <text class="ellipsis-1x" wx:if="{{detail.use_end_time!=null}}">有效期:{{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} 至 {{time.format_time(detail.use_end_time)}}</text> | ||
77 | - <text wx:else>有效期:不限</text> | ||
78 | - </view> | ||
79 | - </view> | ||
80 | - </view> | ||
81 | - </view> | ||
82 | - <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> | ||
83 | - <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?',不包邮地区:'+detail.title:''}}</text> | ||
84 | - </view> | ||
85 | - </block> | ||
86 | - | ||
87 | - <block wx:else> | ||
88 | - <view class="coupon"> | ||
89 | - <view class="flex"> | ||
90 | - <view class="c-l"><text class="rmb fs40">{{filter.getNum(detail.Sum)}}</text></view> | ||
91 | - <view class="c-r dash"> | ||
92 | - <view class="flex jc_sb ai_c"> | ||
93 | - <view class="pdr20"> | ||
94 | - <view class="fs28 ellipsis-1x">{{filter.getNum(detail.Sum)}}元微券</view> | ||
95 | - <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> | ||
96 | - </view> | ||
97 | - <view class="shrink0"> | ||
98 | - <text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.CashRepNo}}">{{filter.showBtnText(currentIndex)}}</text> | ||
99 | - </view> | ||
100 | - </view> | ||
101 | - <view class="c-time"> | ||
102 | - <text wx:if="{{detail.ValidDate}}" class="ellipsis-1x">有效期:{{detail.BeginDate==null ? " " : time.replace_time2(detail.BeginDate)}} 至 {{time.replace_time2(detail.ValidDate)}}</text> | ||
103 | - <text wx:else>有效期:不限</text> | ||
104 | - </view> | ||
105 | - </view> | ||
106 | - </view> | ||
107 | - </view> | ||
108 | - <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> | ||
109 | - <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1}}">{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}}</text> | ||
110 | - <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:else>使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}}</text> | ||
111 | - </view> | ||
112 | - </block> | ||
113 | - </view> | ||
114 | - </block> | ||
115 | - | ||
116 | - | ||
117 | - <block wx:else> | ||
118 | - <view class="tab-list-item" wx:for="{{result}}" wx:for-item="result"> | ||
119 | - <view class="coupon2"> | ||
120 | - <view class="flex"> | ||
121 | - <view class="c-l"><text class="rmb fs40">{{filter.getNum(result.ToSum)}}</text></view> | ||
122 | - <view class="c-r dash"> | ||
123 | - <view class="flex jc_sb ai_c"> | ||
124 | - <view class="pdr20"> | ||
125 | - <view class="fs26 ellipsis-1x breakall">{{result.Integral}}积分兑换{{filter.getNum(result.ToSum)}}元微券</view> | ||
126 | - <!-- <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: 微信商城</view> --> | ||
127 | - </view> | ||
128 | - <view class="shrink0"><text class="btn2" bindtap="clickExchange" data-index="{{index}}">立即兑换</text></view> | ||
129 | - </view> | ||
130 | - <!-- <view class="c-time"> | ||
131 | - <text class="ellipsis-1x" wx:if="{{detail.use_end_time!=null}}">有效期:{{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}}至{{ time.format_time(detail.use_end_time)}}</text> | ||
132 | - <text wx:else>有效期:不限</text> | ||
133 | - </view> --> | ||
134 | - </view> | ||
135 | - </view> | ||
136 | - </view> | ||
137 | - </view> | ||
138 | - </block> | ||
139 | - | ||
140 | - <!-- 暂无数据 --> | ||
141 | - <nodata nodataContainer="t-c" wx:if="{{(is_no_more == 1 && current_page == 1) || (result.length == 0)}}"></nodata> | ||
142 | - | ||
143 | - <block wx:if="{{is_get}}"> | ||
144 | - <!-- 没有更多数据 --> | ||
145 | - <view class="noMore 1" wx:if="{{(is_no_more == 1)||((details.length !== 0) && (pageSize >= (byTotal+wjTotal)))}}">—— 已经到底了 ——</view> | ||
146 | - </block> | ||
147 | - <view class="noMore 2" wx:if="{{noMore}}">—— 已经到底了 ——</view> | ||
148 | -</view> | ||
149 | - | ||
150 | -<!-- 遮罩层 --> | ||
151 | -<view class="mask" hidden="{{!showQr}}"></view> | ||
152 | -<!-- 码 --> | ||
153 | -<view class="popup-container" hidden="{{!showQr}}"> | ||
154 | - <view class="t-r pdb20"><text class="iconfont icon-close fs40" bindtap="closeQr"></text></view> | ||
155 | - <view class="popup"> | ||
156 | - <view class="popup-title"> | ||
157 | - <block wx:if="{{details[useIndex].isby == 1}}">包邮券</block> | ||
158 | - <block wx:else> | ||
159 | - {{filter.getNum(details[useIndex].Sum)}}元微券 | ||
160 | - </block> | ||
161 | - </view> | ||
162 | - <view class="pdt20 c-fe0000"><text class="rmb fs80" wx:if="{{details[useIndex].isby != 1}}">{{filter.getNum(details[useIndex].Sum)}}</text></view> | ||
163 | - <!-- <img src="" alt="" class="img-qr"/> --> | ||
164 | - <view class="qr-container"> | ||
165 | - <canvas class="qrcode" canvas-id="qrcode"/> | ||
166 | - </view> | ||
167 | - <view class="pdt20 pdb10 fs26" wx:if="{{details[useIndex].CashRepNo}}">{{details[useIndex].CashRepNo}}</view> | ||
168 | - <view class="pdt20 pdb10 fs26" wx:else>{{details[useIndex].no}}</view> | ||
169 | - <view class="pdv30 c-7b fs26 bdt"> | ||
170 | - <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> | ||
171 | - <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> | ||
172 | - <text wx:else>有效期:不限</text> | ||
173 | - </view> | ||
174 | - </view> | ||
175 | -</view> | ||
176 | - | ||
177 | - | ||
178 | -<!-- <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> | ||
179 | - | ||
180 | - <block wx:if="{{detail.isby}}"> --> | ||
181 | - <!-- 判断有没有数据有显示没有不显示 --> | ||
182 | - <!-- <view class="data" data-cashrepno='{{detail.no}}' bindtap='click'> | ||
183 | - <view class="code_rim"> | ||
184 | - <canvas class="code" canvas-id="qrcode{{idx}}" /> | ||
185 | - <view class="code_val">{{detail.no}}</view> | ||
186 | - </view> | ||
187 | - | ||
188 | - <view class="moneys">包邮券</view> | ||
189 | - <view class="car-rim"> | ||
190 | - <view class="text">微券来源: 微信商城</view> | ||
191 | - <view wx:if="{{detail.use_end_time!=null}}"> --> | ||
192 | - <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | ||
193 | - <!-- <view class="text">有效期: | ||
194 | - {{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} | ||
195 | - 至 {{ time.format_time(detail.use_end_time)}}</view> | ||
196 | - </view> | ||
197 | - <view wx:else> | ||
198 | - <view class="text">有效期: 不限</view> | ||
199 | - </view> | ||
200 | - <view class="textss">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?",不包邮地区:"+detail.title:""}} | ||
201 | - </view> | ||
202 | - </view> | ||
203 | - </view> | ||
204 | - | ||
205 | - | ||
206 | - | ||
207 | - </block> | ||
208 | - <block wx:else> --> | ||
209 | - <!-- 判断有没有数据有显示没有不显示 --> | ||
210 | - <!-- <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'> | ||
211 | - <view class="code_rim"> | ||
212 | - <canvas class="code" canvas-id="qrcode{{idx}}" /> | ||
213 | - <view class="code_val">{{detail.CashRepNo}}</view> | ||
214 | - </view> | ||
215 | - | ||
216 | - <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view> | ||
217 | - <view class="car-rim"> | ||
218 | - <view class="text"> | ||
219 | - 微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> | ||
220 | - <view wx:if="{{detail.ValidDate!=null}}"> --> | ||
221 | - <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | ||
222 | - <!-- <view class="text">有效期: | ||
223 | - {{detail.BeginDate==null?" " : time.replace_time2(detail.BeginDate)}} | ||
224 | - 至 {{ time.replace_time2(detail.ValidDate)}}</view> | ||
225 | - </view> | ||
226 | - <view wx:else> | ||
227 | - <view class="text">有效期: 不限</view> | ||
228 | - </view> | ||
229 | - <view wx:if="{{detail.Remark1}}" class="textss"> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}}</view> | ||
230 | - <view wx:else class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} | ||
231 | - </view> | ||
232 | - </view> | ||
233 | - </view> | ||
234 | - </block> | ||
235 | -</block> --> | ||
236 | - |
packageB/pages/coupons/query/index.wxss deleted
1 | -/* 大边框 */ | ||
2 | -.big-rim{ | ||
3 | - margin-top: 15rpx; | ||
4 | - width: 100%; | ||
5 | - height: 310rpx; | ||
6 | -border-bottom: 8px solid #EEEEEE; | ||
7 | -} | ||
8 | -.min-rim{ | ||
9 | -display: flex; | ||
10 | -width: 100%; | ||
11 | -height: auto; | ||
12 | -margin-left: 30rpx; | ||
13 | -} | ||
14 | - | ||
15 | -/* 开始时间 */ | ||
16 | -.kssj{ | ||
17 | - | ||
18 | -display: inline-block; | ||
19 | -height: 50rpx; | ||
20 | -background-color: #EEEEEE; | ||
21 | -border: 1px solid #DADADA; | ||
22 | -width:200rpx; | ||
23 | -border-radius: 3px; | ||
24 | -line-height:40rpx; | ||
25 | -} | ||
26 | -/* 开始时间的文字 */ | ||
27 | -.wz{ | ||
28 | - display: inline-block; | ||
29 | -font-size: 25rpx; | ||
30 | -color: #333; | ||
31 | -} | ||
32 | -/* 日期控件 */ | ||
33 | -.pi{ | ||
34 | - width:200rpx; | ||
35 | - height:auto; | ||
36 | - margin-left:20rpx; | ||
37 | - | ||
38 | -} | ||
39 | - | ||
40 | - | ||
41 | - | ||
42 | -/* 查询内容 */ | ||
43 | -.cxnr{ | ||
44 | - margin-left:30rpx; | ||
45 | - font-size:28rpx; | ||
46 | - font-family: 'SimHei',Arial; | ||
47 | -} | ||
48 | -.rq-rim{ | ||
49 | -position:relative; | ||
50 | -left:0; | ||
51 | -top:0; | ||
52 | -} | ||
53 | -/* 至 */ | ||
54 | -.zi{ | ||
55 | - | ||
56 | - margin-top:14rpx; | ||
57 | - font-size:28rpx; | ||
58 | - font-family: 'SimHei',Arial; | ||
59 | - margin-left:20rpx; | ||
60 | - | ||
61 | -} | ||
62 | -/* 结束时间 */ | ||
63 | - | ||
64 | -.jssj{ | ||
65 | - padding-left: 10rpx; | ||
66 | - margin-left: 30rpx; | ||
67 | -padding-bottom: 10rpx; | ||
68 | -height: 35rpx; | ||
69 | -font-size: 25rpx; | ||
70 | -color: #333; | ||
71 | -background-color: #EEEEEE; | ||
72 | -border: 1px solid #DADADA; | ||
73 | -width:85%; | ||
74 | -font-family: 'SimHei',Arial; | ||
75 | -border-radius: 3px; | ||
76 | -} | ||
77 | -/* 查询内容的备考的边框 */ | ||
78 | -.xknr-rim{ | ||
79 | - display: flex; | ||
80 | - width: 100%; | ||
81 | - height: 55rpx; | ||
82 | - line-height:105rpx; | ||
83 | - margin-top:10rpx; | ||
84 | - | ||
85 | -} | ||
86 | -/* 明细查询 */ | ||
87 | -.botton{ | ||
88 | - margin-left: 30rpx; | ||
89 | - margin-top: 63rpx; | ||
90 | - background-color: #C4182E; | ||
91 | - width: 95%; | ||
92 | - border-radius:10rpx; | ||
93 | - text-align: center; | ||
94 | - height: 70rpx; | ||
95 | - line-height: 70rpx; | ||
96 | - color: #FFF; | ||
97 | - font-size: 25rpx; | ||
98 | - border: none; | ||
99 | - font-family: '微软雅黑'; | ||
100 | - } | ||
101 | - /* 底部边框线 | ||
102 | - .bottom{ | ||
103 | - width: 100%; | ||
104 | - border-bottom: 20rpx solid #eeeeee; | ||
105 | - } */ | ||
106 | - /* 清空按钮的 边框*/ | ||
107 | -.qc-rim{ | ||
108 | - position:absolute; | ||
109 | - top:10rpx; | ||
110 | - left:175rpx; | ||
111 | -} | ||
112 | - | ||
113 | -/*开始时间清空输入框的按钮*/ | ||
114 | -.empty{ | ||
115 | - width: 25rpx; | ||
116 | - height: 25rpx; | ||
117 | - border-radius:50%; | ||
118 | - background: #767676; | ||
119 | - color: #fff; | ||
120 | - font-size: 25rpx; | ||
121 | - text-align: center; | ||
122 | - line-height:18rpx; | ||
123 | -} | ||
124 | -/* 结束时间清空输入框的按钮的边框 */ | ||
125 | -.end-rim{ | ||
126 | -position: absolute; | ||
127 | - top: 11rpx; | ||
128 | - left:173rpx; | ||
129 | - width: 25rpx; | ||
130 | - height: 25rpx; | ||
131 | -} | ||
132 | -/*结束时间清空输入框的按钮*/ | ||
133 | -.end{ | ||
134 | - | ||
135 | - width: 25rpx; | ||
136 | - height: 25rpx; | ||
137 | - border-radius:50%; | ||
138 | - background: #767676; | ||
139 | - color: #fff; | ||
140 | - font-size: 25rpx; | ||
141 | - text-align: center; | ||
142 | - line-height:21rpx; | ||
143 | - | ||
144 | -} | ||
145 | - | ||
146 | -/* 顶部 */ | ||
147 | -.top{ | ||
148 | - width: 200rpx; | ||
149 | - height: 50rpx; | ||
150 | - padding: 0 10rpx; | ||
151 | - line-height: 50rpx; | ||
152 | - font-size: 34rpx; | ||
153 | - margin-top: 25rpx; | ||
154 | - | ||
155 | - | ||
156 | -} | ||
157 | -.images{ | ||
158 | - width:35rpx; | ||
159 | -height:30rpx; | ||
160 | -margin-top:10rpx; | ||
161 | -margin-left:-14rpx; | ||
162 | - | ||
163 | -} | ||
164 | -.rim-images{ | ||
165 | - width: 45rpx; | ||
166 | - height: 46rpx; | ||
167 | - line-height: 37rpx; | ||
168 | - /* border-style: inset;padding:4rpx;text-align: center; */ | ||
169 | - background: #f1f1f1; | ||
170 | - border-color:#000000; | ||
171 | - border-width: 1rpx; | ||
172 | - transform:translateX(28%); | ||
173 | - margin-top:-3rpx; | ||
174 | -border-radius:5rpx; | ||
175 | - | ||
176 | - | ||
177 | -} | ||
178 | -/* 下拉框 */ | ||
179 | -.top-selected{ | ||
180 | - width: 100%; | ||
181 | - display: flex; | ||
182 | - align-items: center; | ||
183 | - justify-content: space-between; | ||
184 | - border: 1px solid #ccc; | ||
185 | - padding: 0 10rpx; | ||
186 | - font-size: 30rpx; | ||
187 | - background:#eeeeee; | ||
188 | - height:50rpx; | ||
189 | - border-radius:6rpx; | ||
190 | -} | ||
191 | -.texts{ | ||
192 | - margin:0 auto; | ||
193 | - font-size: 25rpx; | ||
194 | - | ||
195 | -} | ||
196 | -/* 下拉内容 */ | ||
197 | -.select-box { | ||
198 | - background-color: #eeeeee; | ||
199 | - width:225rpx; | ||
200 | - position: relative; | ||
201 | - z-index:1; | ||
202 | - overflow: hidden; | ||
203 | - text-align: left; | ||
204 | - animation: myfirst 0.5s; | ||
205 | - font-size: 25rpx; | ||
206 | -} | ||
207 | -.select_one { | ||
208 | - padding-left: 20rpx; | ||
209 | - width: 100%; | ||
210 | - height: 60rpx; | ||
211 | - line-height: 60rpx; | ||
212 | -} | ||
213 | -/* 优惠券样式 */ | ||
214 | -.body{ | ||
215 | - text-align: center; | ||
216 | - padding: 20rpx; | ||
217 | - margin: 20rpx auto; | ||
218 | - width: 80%; | ||
219 | - max-width: 1000rpx; | ||
220 | - font-size: 28rpx; | ||
221 | - color: #333333; | ||
222 | - border-bottom: 2rpx solid #EEEEEE; | ||
223 | -} | ||
224 | - | ||
225 | -.b_iimg{ | ||
226 | - background-color: red; | ||
227 | - width: 400rpx; | ||
228 | - height: 400rpx; | ||
229 | -} | ||
230 | - | ||
231 | -.b_sz2{ | ||
232 | - font-size: 40rpx; | ||
233 | - color: #6fd137; | ||
234 | - margin: 20rpx 0; | ||
235 | - text-align: center; | ||
236 | -} | ||
237 | -/* 二维码列表查询 */ | ||
238 | -/* 列表数据*/ | ||
239 | -.data{ | ||
240 | - width: 80%; | ||
241 | - | ||
242 | - height:auto; | ||
243 | - margin-left:80rpx; | ||
244 | - | ||
245 | -} | ||
246 | -.rim{ | ||
247 | - position: relative; | ||
248 | - top:0rpx; | ||
249 | - left: 0rpx; | ||
250 | -} | ||
251 | -/* 二维码边框 */ | ||
252 | -.code_rim{ | ||
253 | - width: 100%; | ||
254 | - height: auto; | ||
255 | - text-align: center; | ||
256 | - font-size: 25rpx; | ||
257 | - padding-top: -30rpx; | ||
258 | - margin-top:-20rpx; | ||
259 | -padding-left:45rpx; | ||
260 | - | ||
261 | -} | ||
262 | - | ||
263 | -/* 二维码 */ | ||
264 | -.code{ | ||
265 | - height: 520rpx; | ||
266 | - display: flex; | ||
267 | - flex-direction: column; | ||
268 | - justify-content: flex-end; | ||
269 | - align-items: center; | ||
270 | - margin-left:40rpx; | ||
271 | - | ||
272 | -} | ||
273 | -.car-rim{ | ||
274 | -width:98%; | ||
275 | -height:177rpx; | ||
276 | -text-align:center; | ||
277 | -border-bottom:2rpx solid #eee; | ||
278 | -margin-left:22rpx; | ||
279 | - | ||
280 | -} | ||
281 | -/* 二维码值 */ | ||
282 | -.code_val{ | ||
283 | - margin-top:-104rpx; | ||
284 | -margin-left:-59rpx; | ||
285 | -color:#999999; | ||
286 | - | ||
287 | -} | ||
288 | -/* 金额 */ | ||
289 | -.moneys{ | ||
290 | - margin-top:20rpx; | ||
291 | - height: 47rpx; | ||
292 | - width: 100%; | ||
293 | - color:#6fd137; | ||
294 | - text-align: center; | ||
295 | - font-size: 38rpx; | ||
296 | - font-family: 'SimHei',Arial; | ||
297 | - margin-bottom:20rpx; | ||
298 | - margin-left:11rpx; | ||
299 | - | ||
300 | -} | ||
301 | -/* 文字 */ | ||
302 | -.text{ | ||
303 | - width: 100%; | ||
304 | - font-size: 25rpx; | ||
305 | - text-align: center; | ||
306 | - | ||
307 | - height: 41rpx; | ||
308 | - color: #999999; | ||
309 | -} | ||
310 | -/* 二维码和条形码的边框 */ | ||
311 | -.barqrcode{ | ||
312 | - width: 100%; | ||
313 | - height: auto; | ||
314 | - margin-top:50rpx; | ||
315 | - | ||
316 | -} | ||
317 | -/* 日期 */ | ||
318 | -.rq{ | ||
319 | - height: 25rpx; | ||
320 | - font-size: 28rpx; | ||
321 | - margin-top:12rpx; | ||
322 | - font-family:'SimHei',Arial; | ||
323 | -} | ||
324 | -/* 点击条形 */ | ||
325 | -.barcode { | ||
326 | - height: 320rpx; | ||
327 | - flex-direction: column; | ||
328 | - justify-content: center; | ||
329 | - align-items: center; | ||
330 | - margin-left: 30rpx; | ||
331 | -} | ||
332 | -/* 二维码边框*/ | ||
333 | -.qrcode_rim { | ||
334 | - width: 100%; | ||
335 | - height: 420rpx; | ||
336 | - display: flex; | ||
337 | - flex-direction: column; | ||
338 | - justify-content: flex-end; | ||
339 | - align-items: center; | ||
340 | - margin-left: 80rpx; | ||
341 | - margin-top:-210rpx; | ||
342 | - | ||
343 | -} | ||
344 | -.qrcode{ | ||
345 | - /* margin-left: 100rpx; */ | ||
346 | -} | ||
347 | -/* 使用说明 */ | ||
348 | -.textss{ | ||
349 | - width: 100%; | ||
350 | - font-size: 25rpx; | ||
351 | - text-align: center; | ||
352 | - | ||
353 | - min-height: 47rpx; | ||
354 | - height:auto; | ||
355 | - color: #999999; | ||
356 | -} | ||
357 | - | ||
358 | - | ||
359 | - | ||
360 | - | ||
361 | - | ||
362 | - | ||
363 | -page { | ||
364 | - background-color: #f0f0f0; | ||
365 | - scroll-behavior: smooth; | ||
366 | -} | ||
367 | - | ||
368 | -.c-fe0000 { | ||
369 | - color: #fe0000; | ||
370 | -} | ||
371 | - | ||
372 | -.tab-head { | ||
373 | - display: flex; | ||
374 | - position: sticky; | ||
375 | - top: 0; | ||
376 | - background-color: white; | ||
377 | - font-size: 28rpx; | ||
378 | - z-index: 2; | ||
379 | -} | ||
380 | - | ||
381 | -.tab-head-item { | ||
382 | - flex: 1; | ||
383 | - text-align: center; | ||
384 | - padding: 30rpx 0; | ||
385 | - position: relative; | ||
386 | -} | ||
387 | - | ||
388 | -.tab-head-item.active { | ||
389 | - color: #fe0000; | ||
390 | -} | ||
391 | - | ||
392 | -.tab-head-item.active::after { | ||
393 | - content: ''; | ||
394 | - width: 60%; | ||
395 | - height: 2rpx; | ||
396 | - background-color: #fe0000; | ||
397 | - position: absolute; | ||
398 | - bottom: 0; | ||
399 | - left: 50%; | ||
400 | - transform: translateX(-50%); | ||
401 | -} | ||
402 | - | ||
403 | -.tab-body { | ||
404 | - padding: 0 20rpx; | ||
405 | - overflow: hidden; | ||
406 | -} | ||
407 | - | ||
408 | - .tab-list-item { | ||
409 | - border-radius: 10rpx; | ||
410 | - overflow: hidden; | ||
411 | - margin-top: 30rpx; | ||
412 | - } | ||
413 | - | ||
414 | - | ||
415 | - | ||
416 | -.coupon { | ||
417 | - position: relative; | ||
418 | - | ||
419 | - background: radial-gradient(transparent 0, #FFD3D6 0) top left / 200rpx no-repeat, | ||
420 | - radial-gradient(transparent 6px, #fff 0), | ||
421 | - radial-gradient(transparent 6px, #fff 0); | ||
422 | -} | ||
423 | - | ||
424 | - | ||
425 | -.coupon::after { | ||
426 | - content: ''; | ||
427 | - position: absolute; | ||
428 | - height: 100%; | ||
429 | - width:4px; | ||
430 | - top: 0; | ||
431 | - left: 0; | ||
432 | - background-image: linear-gradient(to bottom, #FFD3D6 4px, transparent 4px, transparent), | ||
433 | - radial-gradient(4px circle at 0px 8px, #f0f0f0 4px, #FFD3D6 4px); | ||
434 | - background-size: 4px 12px; | ||
435 | - background-repeat: repeat-y; | ||
436 | - } | ||
437 | - | ||
438 | - | ||
439 | - .coupon2 { | ||
440 | - /* width: 300px; */ | ||
441 | - padding: 40rpx 0; | ||
442 | - position: relative; | ||
443 | - background: radial-gradient(circle at right top, transparent 16rpx, #FFD3D6 0) top left / 200rpx 51% no-repeat, | ||
444 | - radial-gradient(circle at right bottom, transparent 16rpx, #FFD3D6 0) bottom left /200rpx 51% no-repeat, | ||
445 | - radial-gradient(circle at left top, transparent 16rpx, white 0) top right /calc(100% - 200rpx) 51% no-repeat, | ||
446 | - radial-gradient(circle at left bottom, transparent 16rpx, white 0) bottom right /calc(100% - 200rpx) 51% no-repeat; | ||
447 | - /* filter: drop-shadow(2px 2px 2px rgba(0,0,0,.2)); */ | ||
448 | - } | ||
449 | - | ||
450 | - .coupon2::after { | ||
451 | - content: ''; | ||
452 | - height: 70%; | ||
453 | - border: 2rpx dashed #fff; | ||
454 | - position: absolute; | ||
455 | - left: 198rpx; | ||
456 | - top: 0; | ||
457 | - bottom: 0; | ||
458 | - margin: auto; | ||
459 | - } | ||
460 | - | ||
461 | -/* .coupon2 .c-l, | ||
462 | - .coupon2 .c-r { | ||
463 | - border: 2rpx solid red; | ||
464 | - padding: 20rpx 0; | ||
465 | - } */ | ||
466 | - | ||
467 | - | ||
468 | - | ||
469 | - .c-l { | ||
470 | - color: #fe0000; | ||
471 | - width: 200rpx; | ||
472 | - display: flex; | ||
473 | - align-items: center; | ||
474 | - justify-content: center; | ||
475 | - flex-shrink: 0; | ||
476 | - } | ||
477 | - | ||
478 | - .rmb::before { | ||
479 | - content: '¥'; | ||
480 | - font-size: 28rpx; | ||
481 | - } | ||
482 | - | ||
483 | - .c-r { | ||
484 | - box-sizing: border-box; | ||
485 | - padding: 20rpx; | ||
486 | - flex: 1; | ||
487 | - } | ||
488 | - | ||
489 | - .c-time { | ||
490 | - color: #7b7b7b; | ||
491 | - font-size: 24rpx; | ||
492 | - padding-top: 10rpx; | ||
493 | - word-break: break-all; | ||
494 | - } | ||
495 | - | ||
496 | - .btn, .btn2 { | ||
497 | - font-size: 26rpx; | ||
498 | - padding: 10rpx 20rpx; | ||
499 | - border: 2rpx solid #fe0000; | ||
500 | - border-radius: 30rpx; | ||
501 | - flex-shrink: 0; | ||
502 | - } | ||
503 | - | ||
504 | - .btn { | ||
505 | - color: #fe0000; | ||
506 | - } | ||
507 | - | ||
508 | - .btn.gray { | ||
509 | - color: #ccc; | ||
510 | - border-color: #ccc; | ||
511 | - } | ||
512 | - | ||
513 | - .btn2 { | ||
514 | - color: white; | ||
515 | - background-color: #fe0000; | ||
516 | - } | ||
517 | - | ||
518 | - .c-info { | ||
519 | - border-top: 2rpx dashed #f0f0f0; | ||
520 | - padding: 10rpx 40rpx 10rpx 10rpx; | ||
521 | - font-size: 22rpx; | ||
522 | - background-color: #fefefe; | ||
523 | - color: #7b7b7b; | ||
524 | - position: relative; | ||
525 | - } | ||
526 | - | ||
527 | - .arrow-down::after { | ||
528 | - font-family: iconfont; | ||
529 | - content: '\e600'; | ||
530 | - font-size: 32rpx; | ||
531 | - position: absolute; | ||
532 | - right: 10rpx; | ||
533 | - top: 10rpx; | ||
534 | - /* transform: translateY(-50%); */ | ||
535 | - transition: all 0.3s; | ||
536 | - } | ||
537 | - | ||
538 | - .arrow-down.active::after { | ||
539 | - transform: rotateZ(180deg); | ||
540 | - } | ||
541 | - | ||
542 | - .mask { | ||
543 | - position: fixed; | ||
544 | - width: 100%; | ||
545 | - height: 100%; | ||
546 | - top: 0; | ||
547 | - background-color: rgba(0,0,0,.7); | ||
548 | - z-index: 1; | ||
549 | - } | ||
550 | - | ||
551 | - .popup-container { | ||
552 | - position: fixed; | ||
553 | - width: 70%; | ||
554 | - border-radius: 12rpx; | ||
555 | - top: 50%; | ||
556 | - left: 50%; | ||
557 | - transform: translate(-50%, -50%); | ||
558 | - z-index: 3; | ||
559 | - } | ||
560 | - | ||
561 | - .popup { | ||
562 | - text-align: center; | ||
563 | - border-radius: 12rpx; | ||
564 | - background-color: white; | ||
565 | - overflow: hidden; | ||
566 | - /* width: 80%; */ | ||
567 | - } | ||
568 | - | ||
569 | - .popup-container .icon-close { | ||
570 | - color: rgba(255,255,255,.6); | ||
571 | - } | ||
572 | - | ||
573 | - .popup-title { | ||
574 | - padding: 40rpx 0; | ||
575 | - color: #fe0000; | ||
576 | - background-color: #FFD3D6; | ||
577 | - position: relative; | ||
578 | - } | ||
579 | - | ||
580 | - .popup-title::after { | ||
581 | - content: ''; | ||
582 | - position: absolute; | ||
583 | - left: -20rpx; | ||
584 | - bottom: -12rpx; | ||
585 | - width: 130%; | ||
586 | - height: 20rpx; | ||
587 | - background-image: -webkit-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
588 | - background-image: -moz-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
589 | - background-image: radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
590 | - background-size: 40rpx 40rpx; | ||
591 | - transform: rotate(180deg); | ||
592 | - -webkit-transform: rotate(180deg); | ||
593 | - } | ||
594 | - | ||
595 | - | ||
596 | - .popup .rmb::before { | ||
597 | - font-size: 40rpx; | ||
598 | - } | ||
599 | - | ||
600 | - .img-qr { | ||
601 | - display: block; | ||
602 | - width: 300rpx; | ||
603 | - height: 300rpx; | ||
604 | - margin: 0 auto; | ||
605 | - background-color: pink; | ||
606 | - } | ||
607 | - | ||
608 | - .qrcode { | ||
609 | - width: 300rpx; | ||
610 | - height: 300rpx; | ||
611 | - margin: 0 auto; | ||
612 | - } | ||
613 | - | ||
614 | - | ||
615 | - .noMore { | ||
616 | - padding: 20rpx; | ||
617 | - color: #bbb; | ||
618 | - text-align: center; | ||
619 | - font-size: 22rpx; | ||
620 | - } | ||
621 | - | ||
622 | - .breakall { | ||
623 | - word-break: break-all; | ||
624 | - } | ||
625 | - | ||
626 | - | ||
627 | - | ||
628 | - | ||
629 | - | ||
630 | - | ||
631 | - | ||
632 | - | ||
633 | - | ||
634 | - | ||
635 | - | ||
636 | - | ||
637 | - | ||
638 | - | ||
639 | - | ||
640 | - |
pages/user/coupons/code.js deleted
1 | -var CHAR_TILDE = 126; | ||
2 | -var CODE_FNC1 = 102; | ||
3 | - | ||
4 | -var SET_STARTA = 103; | ||
5 | -var SET_STARTB = 104; | ||
6 | -var SET_STARTC = 105; | ||
7 | -var SET_SHIFT = 98; | ||
8 | -var SET_CODEA = 101; | ||
9 | -var SET_CODEB = 100; | ||
10 | -var SET_STOP = 106; | ||
11 | - | ||
12 | - | ||
13 | -var REPLACE_CODES = { | ||
14 | - CHAR_TILDE: CODE_FNC1 //~ corresponds to FNC1 in GS1-128 standard | ||
15 | -} | ||
16 | - | ||
17 | -var CODESET = { | ||
18 | - ANY: 1, | ||
19 | - AB: 2, | ||
20 | - A: 3, | ||
21 | - B: 4, | ||
22 | - C: 5 | ||
23 | -}; | ||
24 | - | ||
25 | -function getBytes(str) { | ||
26 | - var bytes = []; | ||
27 | - for (var i = 0; i < str.length; i++) { | ||
28 | - bytes.push(str.charCodeAt(i)); | ||
29 | - } | ||
30 | - return bytes; | ||
31 | -} | ||
32 | - | ||
33 | -exports.code128 = function (ctx, text, width, height) { | ||
34 | - | ||
35 | - width = parseInt(width); | ||
36 | - | ||
37 | - height = parseInt(height); | ||
38 | - | ||
39 | - var codes = stringToCode128(text); | ||
40 | - | ||
41 | - var g = new Graphics(ctx, width, height); | ||
42 | - | ||
43 | - var barWeight = g.area.width / ((codes.length - 3) * 11 + 35); | ||
44 | - | ||
45 | - var x = g.area.left; | ||
46 | - var y = g.area.top; | ||
47 | - for (var i = 0; i < codes.length; i++) { | ||
48 | - var c = codes[i]; | ||
49 | - //two bars at a time: 1 black and 1 white | ||
50 | - for (var bar = 0; bar < 8; bar += 2) { | ||
51 | - var barW = PATTERNS[c][bar] * barWeight; | ||
52 | - // var barH = height - y - this.border; | ||
53 | - var barH = height - y; | ||
54 | - var spcW = PATTERNS[c][bar + 1] * barWeight; | ||
55 | - | ||
56 | - //no need to draw if 0 width | ||
57 | - if (barW > 0) { | ||
58 | - g.fillFgRect(x, y, barW, barH); | ||
59 | - } | ||
60 | - | ||
61 | - x += barW + spcW; | ||
62 | - } | ||
63 | - } | ||
64 | - | ||
65 | - ctx.draw(); | ||
66 | -} | ||
67 | - | ||
68 | - | ||
69 | -function stringToCode128(text) { | ||
70 | - | ||
71 | - var barc = { | ||
72 | - currcs: CODESET.C | ||
73 | - }; | ||
74 | - | ||
75 | - var bytes = getBytes(text); | ||
76 | - //decide starting codeset | ||
77 | - var index = bytes[0] == CHAR_TILDE ? 1 : 0; | ||
78 | - | ||
79 | - var csa1 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; | ||
80 | - var csa2 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; | ||
81 | - barc.currcs = getBestStartSet(csa1, csa2); | ||
82 | - barc.currcs = perhapsCodeC(bytes, barc.currcs); | ||
83 | - | ||
84 | - //if no codeset changes this will end up with bytes.length+3 | ||
85 | - //start, checksum and stop | ||
86 | - var codes = new Array(); | ||
87 | - | ||
88 | - switch (barc.currcs) { | ||
89 | - case CODESET.A: | ||
90 | - codes.push(SET_STARTA); | ||
91 | - break; | ||
92 | - case CODESET.B: | ||
93 | - codes.push(SET_STARTB); | ||
94 | - break; | ||
95 | - default: | ||
96 | - codes.push(SET_STARTC); | ||
97 | - break; | ||
98 | - } | ||
99 | - | ||
100 | - | ||
101 | - for (var i = 0; i < bytes.length; i++) { | ||
102 | - var b1 = bytes[i]; //get the first of a pair | ||
103 | - //should we translate/replace | ||
104 | - if (b1 in REPLACE_CODES) { | ||
105 | - codes.push(REPLACE_CODES[b1]); | ||
106 | - i++ //jump to next | ||
107 | - b1 = bytes[i]; | ||
108 | - } | ||
109 | - | ||
110 | - //get the next in the pair if possible | ||
111 | - var b2 = bytes.length > (i + 1) ? bytes[i + 1] : -1; | ||
112 | - | ||
113 | - codes = codes.concat(codesForChar(b1, b2, barc.currcs)); | ||
114 | - //code C takes 2 chars each time | ||
115 | - if (barc.currcs == CODESET.C) i++; | ||
116 | - } | ||
117 | - | ||
118 | - //calculate checksum according to Code 128 standards | ||
119 | - var checksum = codes[0]; | ||
120 | - for (var weight = 1; weight < codes.length; weight++) { | ||
121 | - checksum += (weight * codes[weight]); | ||
122 | - } | ||
123 | - codes.push(checksum % 103); | ||
124 | - | ||
125 | - codes.push(SET_STOP); | ||
126 | - | ||
127 | - //encoding should now be complete | ||
128 | - return codes; | ||
129 | - | ||
130 | - function getBestStartSet(csa1, csa2) { | ||
131 | - //tries to figure out the best codeset | ||
132 | - //to start with to get the most compact code | ||
133 | - var vote = 0; | ||
134 | - vote += csa1 == CODESET.A ? 1 : 0; | ||
135 | - vote += csa1 == CODESET.B ? -1 : 0; | ||
136 | - vote += csa2 == CODESET.A ? 1 : 0; | ||
137 | - vote += csa2 == CODESET.B ? -1 : 0; | ||
138 | - //tie goes to B due to my own predudices | ||
139 | - return vote > 0 ? CODESET.A : CODESET.B; | ||
140 | - } | ||
141 | - | ||
142 | - function perhapsCodeC(bytes, codeset) { | ||
143 | - for (var i = 0; i < bytes.length; i++) { | ||
144 | - var b = bytes[i] | ||
145 | - if ((b < 48 || b > 57) && b != CHAR_TILDE) | ||
146 | - return codeset; | ||
147 | - } | ||
148 | - return CODESET.C; | ||
149 | - } | ||
150 | - | ||
151 | - //chr1 is current byte | ||
152 | - //chr2 is the next byte to process. looks ahead. | ||
153 | - function codesForChar(chr1, chr2, currcs) { | ||
154 | - var result = []; | ||
155 | - var shifter = -1; | ||
156 | - | ||
157 | - if (charCompatible(chr1, currcs)) { | ||
158 | - if (currcs == CODESET.C) { | ||
159 | - if (chr2 == -1) { | ||
160 | - shifter = SET_CODEB; | ||
161 | - currcs = CODESET.B; | ||
162 | - } | ||
163 | - else if ((chr2 != -1) && !charCompatible(chr2, currcs)) { | ||
164 | - //need to check ahead as well | ||
165 | - if (charCompatible(chr2, CODESET.A)) { | ||
166 | - shifter = SET_CODEA; | ||
167 | - currcs = CODESET.A; | ||
168 | - } | ||
169 | - else { | ||
170 | - shifter = SET_CODEB; | ||
171 | - currcs = CODESET.B; | ||
172 | - } | ||
173 | - } | ||
174 | - } | ||
175 | - } | ||
176 | - else { | ||
177 | - //if there is a next char AND that next char is also not compatible | ||
178 | - if ((chr2 != -1) && !charCompatible(chr2, currcs)) { | ||
179 | - //need to switch code sets | ||
180 | - switch (currcs) { | ||
181 | - case CODESET.A: | ||
182 | - shifter = SET_CODEB; | ||
183 | - currcs = CODESET.B; | ||
184 | - break; | ||
185 | - case CODESET.B: | ||
186 | - shifter = SET_CODEA; | ||
187 | - currcs = CODESET.A; | ||
188 | - break; | ||
189 | - } | ||
190 | - } | ||
191 | - else { | ||
192 | - //no need to shift code sets, a temporary SHIFT will suffice | ||
193 | - shifter = SET_SHIFT; | ||
194 | - } | ||
195 | - } | ||
196 | - | ||
197 | - //ok some type of shift is nessecary | ||
198 | - if (shifter != -1) { | ||
199 | - result.push(shifter); | ||
200 | - result.push(codeValue(chr1)); | ||
201 | - } | ||
202 | - else { | ||
203 | - if (currcs == CODESET.C) { | ||
204 | - //include next as well | ||
205 | - result.push(codeValue(chr1, chr2)); | ||
206 | - } | ||
207 | - else { | ||
208 | - result.push(codeValue(chr1)); | ||
209 | - } | ||
210 | - } | ||
211 | - barc.currcs = currcs; | ||
212 | - | ||
213 | - return result; | ||
214 | - } | ||
215 | -} | ||
216 | - | ||
217 | -//reduce the ascii code to fit into the Code128 char table | ||
218 | -function codeValue(chr1, chr2) { | ||
219 | - if (typeof chr2 == "undefined") { | ||
220 | - return chr1 >= 32 ? chr1 - 32 : chr1 + 64; | ||
221 | - } | ||
222 | - else { | ||
223 | - return parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2)); | ||
224 | - } | ||
225 | -} | ||
226 | - | ||
227 | -function charCompatible(chr, codeset) { | ||
228 | - var csa = codeSetAllowedFor(chr); | ||
229 | - if (csa == CODESET.ANY) return true; | ||
230 | - //if we need to change from current | ||
231 | - if (csa == CODESET.AB) return true; | ||
232 | - if (csa == CODESET.A && codeset == CODESET.A) return true; | ||
233 | - if (csa == CODESET.B && codeset == CODESET.B) return true; | ||
234 | - return false; | ||
235 | -} | ||
236 | - | ||
237 | -function codeSetAllowedFor(chr) { | ||
238 | - if (chr >= 48 && chr <= 57) { | ||
239 | - //0-9 | ||
240 | - return CODESET.ANY; | ||
241 | - } | ||
242 | - else if (chr >= 32 && chr <= 95) { | ||
243 | - //0-9 A-Z | ||
244 | - return CODESET.AB; | ||
245 | - } | ||
246 | - else { | ||
247 | - //if non printable | ||
248 | - return chr < 32 ? CODESET.A : CODESET.B; | ||
249 | - } | ||
250 | -} | ||
251 | - | ||
252 | -var Graphics = function (ctx, width, height) { | ||
253 | - | ||
254 | - this.width = width; | ||
255 | - this.height = height; | ||
256 | - this.quiet = Math.round(this.width / 40); | ||
257 | - | ||
258 | - this.border_size = 0; | ||
259 | - this.padding_width = 0; | ||
260 | - | ||
261 | - this.area = { | ||
262 | - width: width - this.padding_width * 2 - this.quiet * 2, | ||
263 | - height: height - this.border_size * 2, | ||
264 | - top: this.border_size - 4, | ||
265 | - left: this.padding_width + this.quiet | ||
266 | - }; | ||
267 | - | ||
268 | - this.ctx = ctx; | ||
269 | - this.fg = "#000000"; | ||
270 | - this.bg = "#ffffff"; | ||
271 | - | ||
272 | - // fill background | ||
273 | - this.fillBgRect(0, 0, width, height); | ||
274 | - | ||
275 | - // fill center to create border | ||
276 | - this.fillBgRect(0, this.border_size, width, height - this.border_size * 2); | ||
277 | -} | ||
278 | - | ||
279 | -//use native color | ||
280 | -Graphics.prototype._fillRect = function (x, y, width, height, color) { | ||
281 | - this.ctx.setFillStyle(color) | ||
282 | - this.ctx.fillRect(x, y, width, height) | ||
283 | -} | ||
284 | - | ||
285 | -Graphics.prototype.fillFgRect = function (x, y, width, height) { | ||
286 | - this._fillRect(x, y, width, height, this.fg); | ||
287 | -} | ||
288 | - | ||
289 | -Graphics.prototype.fillBgRect = function (x, y, width, height) { | ||
290 | - this._fillRect(x, y, width, height, this.bg); | ||
291 | -} | ||
292 | - | ||
293 | -var PATTERNS = [ | ||
294 | - [2, 1, 2, 2, 2, 2, 0, 0], // 0 | ||
295 | - [2, 2, 2, 1, 2, 2, 0, 0], // 1 | ||
296 | - [2, 2, 2, 2, 2, 1, 0, 0], // 2 | ||
297 | - [1, 2, 1, 2, 2, 3, 0, 0], // 3 | ||
298 | - [1, 2, 1, 3, 2, 2, 0, 0], // 4 | ||
299 | - [1, 3, 1, 2, 2, 2, 0, 0], // 5 | ||
300 | - [1, 2, 2, 2, 1, 3, 0, 0], // 6 | ||
301 | - [1, 2, 2, 3, 1, 2, 0, 0], // 7 | ||
302 | - [1, 3, 2, 2, 1, 2, 0, 0], // 8 | ||
303 | - [2, 2, 1, 2, 1, 3, 0, 0], // 9 | ||
304 | - [2, 2, 1, 3, 1, 2, 0, 0], // 10 | ||
305 | - [2, 3, 1, 2, 1, 2, 0, 0], // 11 | ||
306 | - [1, 1, 2, 2, 3, 2, 0, 0], // 12 | ||
307 | - [1, 2, 2, 1, 3, 2, 0, 0], // 13 | ||
308 | - [1, 2, 2, 2, 3, 1, 0, 0], // 14 | ||
309 | - [1, 1, 3, 2, 2, 2, 0, 0], // 15 | ||
310 | - [1, 2, 3, 1, 2, 2, 0, 0], // 16 | ||
311 | - [1, 2, 3, 2, 2, 1, 0, 0], // 17 | ||
312 | - [2, 2, 3, 2, 1, 1, 0, 0], // 18 | ||
313 | - [2, 2, 1, 1, 3, 2, 0, 0], // 19 | ||
314 | - [2, 2, 1, 2, 3, 1, 0, 0], // 20 | ||
315 | - [2, 1, 3, 2, 1, 2, 0, 0], // 21 | ||
316 | - [2, 2, 3, 1, 1, 2, 0, 0], // 22 | ||
317 | - [3, 1, 2, 1, 3, 1, 0, 0], // 23 | ||
318 | - [3, 1, 1, 2, 2, 2, 0, 0], // 24 | ||
319 | - [3, 2, 1, 1, 2, 2, 0, 0], // 25 | ||
320 | - [3, 2, 1, 2, 2, 1, 0, 0], // 26 | ||
321 | - [3, 1, 2, 2, 1, 2, 0, 0], // 27 | ||
322 | - [3, 2, 2, 1, 1, 2, 0, 0], // 28 | ||
323 | - [3, 2, 2, 2, 1, 1, 0, 0], // 29 | ||
324 | - [2, 1, 2, 1, 2, 3, 0, 0], // 30 | ||
325 | - [2, 1, 2, 3, 2, 1, 0, 0], // 31 | ||
326 | - [2, 3, 2, 1, 2, 1, 0, 0], // 32 | ||
327 | - [1, 1, 1, 3, 2, 3, 0, 0], // 33 | ||
328 | - [1, 3, 1, 1, 2, 3, 0, 0], // 34 | ||
329 | - [1, 3, 1, 3, 2, 1, 0, 0], // 35 | ||
330 | - [1, 1, 2, 3, 1, 3, 0, 0], // 36 | ||
331 | - [1, 3, 2, 1, 1, 3, 0, 0], // 37 | ||
332 | - [1, 3, 2, 3, 1, 1, 0, 0], // 38 | ||
333 | - [2, 1, 1, 3, 1, 3, 0, 0], // 39 | ||
334 | - [2, 3, 1, 1, 1, 3, 0, 0], // 40 | ||
335 | - [2, 3, 1, 3, 1, 1, 0, 0], // 41 | ||
336 | - [1, 1, 2, 1, 3, 3, 0, 0], // 42 | ||
337 | - [1, 1, 2, 3, 3, 1, 0, 0], // 43 | ||
338 | - [1, 3, 2, 1, 3, 1, 0, 0], // 44 | ||
339 | - [1, 1, 3, 1, 2, 3, 0, 0], // 45 | ||
340 | - [1, 1, 3, 3, 2, 1, 0, 0], // 46 | ||
341 | - [1, 3, 3, 1, 2, 1, 0, 0], // 47 | ||
342 | - [3, 1, 3, 1, 2, 1, 0, 0], // 48 | ||
343 | - [2, 1, 1, 3, 3, 1, 0, 0], // 49 | ||
344 | - [2, 3, 1, 1, 3, 1, 0, 0], // 50 | ||
345 | - [2, 1, 3, 1, 1, 3, 0, 0], // 51 | ||
346 | - [2, 1, 3, 3, 1, 1, 0, 0], // 52 | ||
347 | - [2, 1, 3, 1, 3, 1, 0, 0], // 53 | ||
348 | - [3, 1, 1, 1, 2, 3, 0, 0], // 54 | ||
349 | - [3, 1, 1, 3, 2, 1, 0, 0], // 55 | ||
350 | - [3, 3, 1, 1, 2, 1, 0, 0], // 56 | ||
351 | - [3, 1, 2, 1, 1, 3, 0, 0], // 57 | ||
352 | - [3, 1, 2, 3, 1, 1, 0, 0], // 58 | ||
353 | - [3, 3, 2, 1, 1, 1, 0, 0], // 59 | ||
354 | - [3, 1, 4, 1, 1, 1, 0, 0], // 60 | ||
355 | - [2, 2, 1, 4, 1, 1, 0, 0], // 61 | ||
356 | - [4, 3, 1, 1, 1, 1, 0, 0], // 62 | ||
357 | - [1, 1, 1, 2, 2, 4, 0, 0], // 63 | ||
358 | - [1, 1, 1, 4, 2, 2, 0, 0], // 64 | ||
359 | - [1, 2, 1, 1, 2, 4, 0, 0], // 65 | ||
360 | - [1, 2, 1, 4, 2, 1, 0, 0], // 66 | ||
361 | - [1, 4, 1, 1, 2, 2, 0, 0], // 67 | ||
362 | - [1, 4, 1, 2, 2, 1, 0, 0], // 68 | ||
363 | - [1, 1, 2, 2, 1, 4, 0, 0], // 69 | ||
364 | - [1, 1, 2, 4, 1, 2, 0, 0], // 70 | ||
365 | - [1, 2, 2, 1, 1, 4, 0, 0], // 71 | ||
366 | - [1, 2, 2, 4, 1, 1, 0, 0], // 72 | ||
367 | - [1, 4, 2, 1, 1, 2, 0, 0], // 73 | ||
368 | - [1, 4, 2, 2, 1, 1, 0, 0], // 74 | ||
369 | - [2, 4, 1, 2, 1, 1, 0, 0], // 75 | ||
370 | - [2, 2, 1, 1, 1, 4, 0, 0], // 76 | ||
371 | - [4, 1, 3, 1, 1, 1, 0, 0], // 77 | ||
372 | - [2, 4, 1, 1, 1, 2, 0, 0], // 78 | ||
373 | - [1, 3, 4, 1, 1, 1, 0, 0], // 79 | ||
374 | - [1, 1, 1, 2, 4, 2, 0, 0], // 80 | ||
375 | - [1, 2, 1, 1, 4, 2, 0, 0], // 81 | ||
376 | - [1, 2, 1, 2, 4, 1, 0, 0], // 82 | ||
377 | - [1, 1, 4, 2, 1, 2, 0, 0], // 83 | ||
378 | - [1, 2, 4, 1, 1, 2, 0, 0], // 84 | ||
379 | - [1, 2, 4, 2, 1, 1, 0, 0], // 85 | ||
380 | - [4, 1, 1, 2, 1, 2, 0, 0], // 86 | ||
381 | - [4, 2, 1, 1, 1, 2, 0, 0], // 87 | ||
382 | - [4, 2, 1, 2, 1, 1, 0, 0], // 88 | ||
383 | - [2, 1, 2, 1, 4, 1, 0, 0], // 89 | ||
384 | - [2, 1, 4, 1, 2, 1, 0, 0], // 90 | ||
385 | - [4, 1, 2, 1, 2, 1, 0, 0], // 91 | ||
386 | - [1, 1, 1, 1, 4, 3, 0, 0], // 92 | ||
387 | - [1, 1, 1, 3, 4, 1, 0, 0], // 93 | ||
388 | - [1, 3, 1, 1, 4, 1, 0, 0], // 94 | ||
389 | - [1, 1, 4, 1, 1, 3, 0, 0], // 95 | ||
390 | - [1, 1, 4, 3, 1, 1, 0, 0], // 96 | ||
391 | - [4, 1, 1, 1, 1, 3, 0, 0], // 97 | ||
392 | - [4, 1, 1, 3, 1, 1, 0, 0], // 98 | ||
393 | - [1, 1, 3, 1, 4, 1, 0, 0], // 99 | ||
394 | - [1, 1, 4, 1, 3, 1, 0, 0], // 100 | ||
395 | - [3, 1, 1, 1, 4, 1, 0, 0], // 101 | ||
396 | - [4, 1, 1, 1, 3, 1, 0, 0], // 102 | ||
397 | - [2, 1, 1, 4, 1, 2, 0, 0], // 103 | ||
398 | - [2, 1, 1, 2, 1, 4, 0, 0], // 104 | ||
399 | - [2, 1, 1, 2, 3, 2, 0, 0], // 105 | ||
400 | - [2, 3, 3, 1, 1, 1, 2, 0] // 106 | ||
401 | -] | ||
402 | -var QR = (function () { | ||
403 | - | ||
404 | - // alignment pattern | ||
405 | - var adelta = [ | ||
406 | - 0, 11, 15, 19, 23, 27, 31, // force 1 pat | ||
407 | - 16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24, | ||
408 | - 26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28 | ||
409 | - ]; | ||
410 | - | ||
411 | - // version block | ||
412 | - var vpat = [ | ||
413 | - 0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d, | ||
414 | - 0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9, | ||
415 | - 0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75, | ||
416 | - 0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64, | ||
417 | - 0x541, 0xc69 | ||
418 | - ]; | ||
419 | - | ||
420 | - // final format bits with mask: level << 3 | mask | ||
421 | - var fmtword = [ | ||
422 | - 0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L | ||
423 | - 0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M | ||
424 | - 0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q | ||
425 | - 0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H | ||
426 | - ]; | ||
427 | - | ||
428 | - // 4 per version: number of blocks 1,2; data width; ecc width | ||
429 | - var eccblocks = [ | ||
430 | - 1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17, | ||
431 | - 1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28, | ||
432 | - 1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22, | ||
433 | - 1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16, | ||
434 | - 1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22, | ||
435 | - 2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28, | ||
436 | - 2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26, | ||
437 | - 2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26, | ||
438 | - 2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24, | ||
439 | - 2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28, | ||
440 | - 4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24, | ||
441 | - 2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28, | ||
442 | - 4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22, | ||
443 | - 3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24, | ||
444 | - 5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24, | ||
445 | - 5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30, | ||
446 | - 1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28, | ||
447 | - 5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28, | ||
448 | - 3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26, | ||
449 | - 3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28, | ||
450 | - 4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30, | ||
451 | - 2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24, | ||
452 | - 4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30, | ||
453 | - 6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30, | ||
454 | - 8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30, | ||
455 | - 10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30, | ||
456 | - 8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30, | ||
457 | - 3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30, | ||
458 | - 7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30, | ||
459 | - 5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30, | ||
460 | - 13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30, | ||
461 | - 17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30, | ||
462 | - 17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30, | ||
463 | - 13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30, | ||
464 | - 12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30, | ||
465 | - 6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30, | ||
466 | - 17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30, | ||
467 | - 4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30, | ||
468 | - 20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30, | ||
469 | - 19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30 | ||
470 | - ]; | ||
471 | - | ||
472 | - // Galois field log table | ||
473 | - var glog = [ | ||
474 | - 0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, | ||
475 | - 0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71, | ||
476 | - 0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45, | ||
477 | - 0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6, | ||
478 | - 0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88, | ||
479 | - 0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40, | ||
480 | - 0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d, | ||
481 | - 0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57, | ||
482 | - 0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18, | ||
483 | - 0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e, | ||
484 | - 0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61, | ||
485 | - 0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2, | ||
486 | - 0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6, | ||
487 | - 0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a, | ||
488 | - 0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7, | ||
489 | - 0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf | ||
490 | - ]; | ||
491 | - | ||
492 | - // Galios field exponent table | ||
493 | - var gexp = [ | ||
494 | - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, | ||
495 | - 0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, | ||
496 | - 0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23, | ||
497 | - 0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1, | ||
498 | - 0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0, | ||
499 | - 0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2, | ||
500 | - 0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce, | ||
501 | - 0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc, | ||
502 | - 0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54, | ||
503 | - 0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73, | ||
504 | - 0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff, | ||
505 | - 0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41, | ||
506 | - 0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6, | ||
507 | - 0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09, | ||
508 | - 0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16, | ||
509 | - 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00 | ||
510 | - ]; | ||
511 | - | ||
512 | - // Working buffers: | ||
513 | - // data input and ecc append, image working buffer, fixed part of image, run lengths for badness | ||
514 | - var strinbuf = [], eccbuf = [], qrframe = [], framask = [], rlens = []; | ||
515 | - // Control values - width is based on version, last 4 are from table. | ||
516 | - var version, width, neccblk1, neccblk2, datablkw, eccblkwid; | ||
517 | - var ecclevel = 2; | ||
518 | - // set bit to indicate cell in qrframe is immutable. symmetric around diagonal | ||
519 | - function setmask(x, y) { | ||
520 | - var bt; | ||
521 | - if (x > y) { | ||
522 | - bt = x; | ||
523 | - x = y; | ||
524 | - y = bt; | ||
525 | - } | ||
526 | - // y*y = 1+3+5... | ||
527 | - bt = y; | ||
528 | - bt *= y; | ||
529 | - bt += y; | ||
530 | - bt >>= 1; | ||
531 | - bt += x; | ||
532 | - framask[bt] = 1; | ||
533 | - } | ||
534 | - | ||
535 | - // enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask) | ||
536 | - function putalign(x, y) { | ||
537 | - var j; | ||
538 | - | ||
539 | - qrframe[x + width * y] = 1; | ||
540 | - for (j = -2; j < 2; j++) { | ||
541 | - qrframe[(x + j) + width * (y - 2)] = 1; | ||
542 | - qrframe[(x - 2) + width * (y + j + 1)] = 1; | ||
543 | - qrframe[(x + 2) + width * (y + j)] = 1; | ||
544 | - qrframe[(x + j + 1) + width * (y + 2)] = 1; | ||
545 | - } | ||
546 | - for (j = 0; j < 2; j++) { | ||
547 | - setmask(x - 1, y + j); | ||
548 | - setmask(x + 1, y - j); | ||
549 | - setmask(x - j, y - 1); | ||
550 | - setmask(x + j, y + 1); | ||
551 | - } | ||
552 | - } | ||
553 | - | ||
554 | - //======================================================================== | ||
555 | - // Reed Solomon error correction | ||
556 | - // exponentiation mod N | ||
557 | - function modnn(x) { | ||
558 | - while (x >= 255) { | ||
559 | - x -= 255; | ||
560 | - x = (x >> 8) + (x & 255); | ||
561 | - } | ||
562 | - return x; | ||
563 | - } | ||
564 | - | ||
565 | - var genpoly = []; | ||
566 | - | ||
567 | - // Calculate and append ECC data to data block. Block is in strinbuf, indexes to buffers given. | ||
568 | - function appendrs(data, dlen, ecbuf, eclen) { | ||
569 | - var i, j, fb; | ||
570 | - | ||
571 | - for (i = 0; i < eclen; i++) | ||
572 | - strinbuf[ecbuf + i] = 0; | ||
573 | - for (i = 0; i < dlen; i++) { | ||
574 | - fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]]; | ||
575 | - if (fb != 255) /* fb term is non-zero */ | ||
576 | - for (j = 1; j < eclen; j++) | ||
577 | - strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])]; | ||
578 | - else | ||
579 | - for (j = ecbuf; j < ecbuf + eclen; j++) | ||
580 | - strinbuf[j] = strinbuf[j + 1]; | ||
581 | - strinbuf[ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])]; | ||
582 | - } | ||
583 | - } | ||
584 | - | ||
585 | - //======================================================================== | ||
586 | - // Frame data insert following the path rules | ||
587 | - | ||
588 | - // check mask - since symmetrical use half. | ||
589 | - function ismasked(x, y) { | ||
590 | - var bt; | ||
591 | - if (x > y) { | ||
592 | - bt = x; | ||
593 | - x = y; | ||
594 | - y = bt; | ||
595 | - } | ||
596 | - bt = y; | ||
597 | - bt += y * y; | ||
598 | - bt >>= 1; | ||
599 | - bt += x; | ||
600 | - return framask[bt]; | ||
601 | - } | ||
602 | - | ||
603 | - //======================================================================== | ||
604 | - // Apply the selected mask out of the 8. | ||
605 | - function applymask(m) { | ||
606 | - var x, y, r3x, r3y; | ||
607 | - | ||
608 | - switch (m) { | ||
609 | - case 0: | ||
610 | - for (y = 0; y < width; y++) | ||
611 | - for (x = 0; x < width; x++) | ||
612 | - if (!((x + y) & 1) && !ismasked(x, y)) | ||
613 | - qrframe[x + y * width] ^= 1; | ||
614 | - break; | ||
615 | - case 1: | ||
616 | - for (y = 0; y < width; y++) | ||
617 | - for (x = 0; x < width; x++) | ||
618 | - if (!(y & 1) && !ismasked(x, y)) | ||
619 | - qrframe[x + y * width] ^= 1; | ||
620 | - break; | ||
621 | - case 2: | ||
622 | - for (y = 0; y < width; y++) | ||
623 | - for (r3x = 0, x = 0; x < width; x++ , r3x++) { | ||
624 | - if (r3x == 3) | ||
625 | - r3x = 0; | ||
626 | - if (!r3x && !ismasked(x, y)) | ||
627 | - qrframe[x + y * width] ^= 1; | ||
628 | - } | ||
629 | - break; | ||
630 | - case 3: | ||
631 | - for (r3y = 0, y = 0; y < width; y++ , r3y++) { | ||
632 | - if (r3y == 3) | ||
633 | - r3y = 0; | ||
634 | - for (r3x = r3y, x = 0; x < width; x++ , r3x++) { | ||
635 | - if (r3x == 3) | ||
636 | - r3x = 0; | ||
637 | - if (!r3x && !ismasked(x, y)) | ||
638 | - qrframe[x + y * width] ^= 1; | ||
639 | - } | ||
640 | - } | ||
641 | - break; | ||
642 | - case 4: | ||
643 | - for (y = 0; y < width; y++) | ||
644 | - for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++ , r3x++) { | ||
645 | - if (r3x == 3) { | ||
646 | - r3x = 0; | ||
647 | - r3y = !r3y; | ||
648 | - } | ||
649 | - if (!r3y && !ismasked(x, y)) | ||
650 | - qrframe[x + y * width] ^= 1; | ||
651 | - } | ||
652 | - break; | ||
653 | - case 5: | ||
654 | - for (r3y = 0, y = 0; y < width; y++ , r3y++) { | ||
655 | - if (r3y == 3) | ||
656 | - r3y = 0; | ||
657 | - for (r3x = 0, x = 0; x < width; x++ , r3x++) { | ||
658 | - if (r3x == 3) | ||
659 | - r3x = 0; | ||
660 | - if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y)) | ||
661 | - qrframe[x + y * width] ^= 1; | ||
662 | - } | ||
663 | - } | ||
664 | - break; | ||
665 | - case 6: | ||
666 | - for (r3y = 0, y = 0; y < width; y++ , r3y++) { | ||
667 | - if (r3y == 3) | ||
668 | - r3y = 0; | ||
669 | - for (r3x = 0, x = 0; x < width; x++ , r3x++) { | ||
670 | - if (r3x == 3) | ||
671 | - r3x = 0; | ||
672 | - if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y)) | ||
673 | - qrframe[x + y * width] ^= 1; | ||
674 | - } | ||
675 | - } | ||
676 | - break; | ||
677 | - case 7: | ||
678 | - for (r3y = 0, y = 0; y < width; y++ , r3y++) { | ||
679 | - if (r3y == 3) | ||
680 | - r3y = 0; | ||
681 | - for (r3x = 0, x = 0; x < width; x++ , r3x++) { | ||
682 | - if (r3x == 3) | ||
683 | - r3x = 0; | ||
684 | - if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y)) | ||
685 | - qrframe[x + y * width] ^= 1; | ||
686 | - } | ||
687 | - } | ||
688 | - break; | ||
689 | - } | ||
690 | - return; | ||
691 | - } | ||
692 | - | ||
693 | - // Badness coefficients. | ||
694 | - var N1 = 3, N2 = 3, N3 = 40, N4 = 10; | ||
695 | - | ||
696 | - // Using the table of the length of each run, calculate the amount of bad image | ||
697 | - // - long runs or those that look like finders; called twice, once each for X and Y | ||
698 | - function badruns(length) { | ||
699 | - var i; | ||
700 | - var runsbad = 0; | ||
701 | - for (i = 0; i <= length; i++) | ||
702 | - if (rlens[i] >= 5) | ||
703 | - runsbad += N1 + rlens[i] - 5; | ||
704 | - // BwBBBwB as in finder | ||
705 | - for (i = 3; i < length - 1; i += 2) | ||
706 | - if (rlens[i - 2] == rlens[i + 2] | ||
707 | - && rlens[i + 2] == rlens[i - 1] | ||
708 | - && rlens[i - 1] == rlens[i + 1] | ||
709 | - && rlens[i - 1] * 3 == rlens[i] | ||
710 | - // white around the black pattern? Not part of spec | ||
711 | - && (rlens[i - 3] == 0 // beginning | ||
712 | - || i + 3 > length // end | ||
713 | - || rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4) | ||
714 | - ) | ||
715 | - runsbad += N3; | ||
716 | - return runsbad; | ||
717 | - } | ||
718 | - | ||
719 | - // Calculate how bad the masked image is - blocks, imbalance, runs, or finders. | ||
720 | - function badcheck() { | ||
721 | - var x, y, h, b, b1; | ||
722 | - var thisbad = 0; | ||
723 | - var bw = 0; | ||
724 | - | ||
725 | - // blocks of same color. | ||
726 | - for (y = 0; y < width - 1; y++) | ||
727 | - for (x = 0; x < width - 1; x++) | ||
728 | - if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y] | ||
729 | - && qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black | ||
730 | - || !(qrframe[x + width * y] || qrframe[(x + 1) + width * y] | ||
731 | - || qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white | ||
732 | - thisbad += N2; | ||
733 | - | ||
734 | - // X runs | ||
735 | - for (y = 0; y < width; y++) { | ||
736 | - rlens[0] = 0; | ||
737 | - for (h = b = x = 0; x < width; x++) { | ||
738 | - if ((b1 = qrframe[x + width * y]) == b) | ||
739 | - rlens[h]++; | ||
740 | - else | ||
741 | - rlens[++h] = 1; | ||
742 | - b = b1; | ||
743 | - bw += b ? 1 : -1; | ||
744 | - } | ||
745 | - thisbad += badruns(h); | ||
746 | - } | ||
747 | - | ||
748 | - // black/white imbalance | ||
749 | - if (bw < 0) | ||
750 | - bw = -bw; | ||
751 | - | ||
752 | - var big = bw; | ||
753 | - var count = 0; | ||
754 | - big += big << 2; | ||
755 | - big <<= 1; | ||
756 | - while (big > width * width) | ||
757 | - big -= width * width, count++; | ||
758 | - thisbad += count * N4; | ||
759 | - | ||
760 | - // Y runs | ||
761 | - for (x = 0; x < width; x++) { | ||
762 | - rlens[0] = 0; | ||
763 | - for (h = b = y = 0; y < width; y++) { | ||
764 | - if ((b1 = qrframe[x + width * y]) == b) | ||
765 | - rlens[h]++; | ||
766 | - else | ||
767 | - rlens[++h] = 1; | ||
768 | - b = b1; | ||
769 | - } | ||
770 | - thisbad += badruns(h); | ||
771 | - } | ||
772 | - return thisbad; | ||
773 | - } | ||
774 | - | ||
775 | - function genframe(instring) { | ||
776 | - var x, y, k, t, v, i, j, m; | ||
777 | - | ||
778 | - // find the smallest version that fits the string | ||
779 | - t = instring.length; | ||
780 | - version = 0; | ||
781 | - do { | ||
782 | - version++; | ||
783 | - k = (ecclevel - 1) * 4 + (version - 1) * 16; | ||
784 | - neccblk1 = eccblocks[k++]; | ||
785 | - neccblk2 = eccblocks[k++]; | ||
786 | - datablkw = eccblocks[k++]; | ||
787 | - eccblkwid = eccblocks[k]; | ||
788 | - k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9); | ||
789 | - if (t <= k) | ||
790 | - break; | ||
791 | - } while (version < 40); | ||
792 | - | ||
793 | - // FIXME - insure that it fits insted of being truncated | ||
794 | - width = 17 + 4 * version; | ||
795 | - | ||
796 | - // allocate, clear and setup data structures | ||
797 | - v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; | ||
798 | - for (t = 0; t < v; t++) | ||
799 | - eccbuf[t] = 0; | ||
800 | - strinbuf = instring.slice(0); | ||
801 | - | ||
802 | - for (t = 0; t < width * width; t++) | ||
803 | - qrframe[t] = 0; | ||
804 | - | ||
805 | - for (t = 0; t < (width * (width + 1) + 1) / 2; t++) | ||
806 | - framask[t] = 0; | ||
807 | - | ||
808 | - // insert finders - black to frame, white to mask | ||
809 | - for (t = 0; t < 3; t++) { | ||
810 | - k = 0; | ||
811 | - y = 0; | ||
812 | - if (t == 1) | ||
813 | - k = (width - 7); | ||
814 | - if (t == 2) | ||
815 | - y = (width - 7); | ||
816 | - qrframe[(y + 3) + width * (k + 3)] = 1; | ||
817 | - for (x = 0; x < 6; x++) { | ||
818 | - qrframe[(y + x) + width * k] = 1; | ||
819 | - qrframe[y + width * (k + x + 1)] = 1; | ||
820 | - qrframe[(y + 6) + width * (k + x)] = 1; | ||
821 | - qrframe[(y + x + 1) + width * (k + 6)] = 1; | ||
822 | - } | ||
823 | - for (x = 1; x < 5; x++) { | ||
824 | - setmask(y + x, k + 1); | ||
825 | - setmask(y + 1, k + x + 1); | ||
826 | - setmask(y + 5, k + x); | ||
827 | - setmask(y + x + 1, k + 5); | ||
828 | - } | ||
829 | - for (x = 2; x < 4; x++) { | ||
830 | - qrframe[(y + x) + width * (k + 2)] = 1; | ||
831 | - qrframe[(y + 2) + width * (k + x + 1)] = 1; | ||
832 | - qrframe[(y + 4) + width * (k + x)] = 1; | ||
833 | - qrframe[(y + x + 1) + width * (k + 4)] = 1; | ||
834 | - } | ||
835 | - } | ||
836 | - | ||
837 | - // alignment blocks | ||
838 | - if (version > 1) { | ||
839 | - t = adelta[version]; | ||
840 | - y = width - 7; | ||
841 | - for (; ;) { | ||
842 | - x = width - 7; | ||
843 | - while (x > t - 3) { | ||
844 | - putalign(x, y); | ||
845 | - if (x < t) | ||
846 | - break; | ||
847 | - x -= t; | ||
848 | - } | ||
849 | - if (y <= t + 9) | ||
850 | - break; | ||
851 | - y -= t; | ||
852 | - putalign(6, y); | ||
853 | - putalign(y, 6); | ||
854 | - } | ||
855 | - } | ||
856 | - | ||
857 | - // single black | ||
858 | - qrframe[8 + width * (width - 8)] = 1; | ||
859 | - | ||
860 | - // timing gap - mask only | ||
861 | - for (y = 0; y < 7; y++) { | ||
862 | - setmask(7, y); | ||
863 | - setmask(width - 8, y); | ||
864 | - setmask(7, y + width - 7); | ||
865 | - } | ||
866 | - for (x = 0; x < 8; x++) { | ||
867 | - setmask(x, 7); | ||
868 | - setmask(x + width - 8, 7); | ||
869 | - setmask(x, width - 8); | ||
870 | - } | ||
871 | - | ||
872 | - // reserve mask-format area | ||
873 | - for (x = 0; x < 9; x++) | ||
874 | - setmask(x, 8); | ||
875 | - for (x = 0; x < 8; x++) { | ||
876 | - setmask(x + width - 8, 8); | ||
877 | - setmask(8, x); | ||
878 | - } | ||
879 | - for (y = 0; y < 7; y++) | ||
880 | - setmask(8, y + width - 7); | ||
881 | - | ||
882 | - // timing row/col | ||
883 | - for (x = 0; x < width - 14; x++) | ||
884 | - if (x & 1) { | ||
885 | - setmask(8 + x, 6); | ||
886 | - setmask(6, 8 + x); | ||
887 | - } | ||
888 | - else { | ||
889 | - qrframe[(8 + x) + width * 6] = 1; | ||
890 | - qrframe[6 + width * (8 + x)] = 1; | ||
891 | - } | ||
892 | - | ||
893 | - // version block | ||
894 | - if (version > 6) { | ||
895 | - t = vpat[version - 7]; | ||
896 | - k = 17; | ||
897 | - for (x = 0; x < 6; x++) | ||
898 | - for (y = 0; y < 3; y++ , k--) | ||
899 | - if (1 & (k > 11 ? version >> (k - 12) : t >> k)) { | ||
900 | - qrframe[(5 - x) + width * (2 - y + width - 11)] = 1; | ||
901 | - qrframe[(2 - y + width - 11) + width * (5 - x)] = 1; | ||
902 | - } | ||
903 | - else { | ||
904 | - setmask(5 - x, 2 - y + width - 11); | ||
905 | - setmask(2 - y + width - 11, 5 - x); | ||
906 | - } | ||
907 | - } | ||
908 | - | ||
909 | - // sync mask bits - only set above for white spaces, so add in black bits | ||
910 | - for (y = 0; y < width; y++) | ||
911 | - for (x = 0; x <= y; x++) | ||
912 | - if (qrframe[x + width * y]) | ||
913 | - setmask(x, y); | ||
914 | - | ||
915 | - // convert string to bitstream | ||
916 | - // 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported) | ||
917 | - v = strinbuf.length; | ||
918 | - | ||
919 | - // string to array | ||
920 | - for (i = 0; i < v; i++) | ||
921 | - eccbuf[i] = strinbuf.charCodeAt(i); | ||
922 | - strinbuf = eccbuf.slice(0); | ||
923 | - | ||
924 | - // calculate max string length | ||
925 | - x = datablkw * (neccblk1 + neccblk2) + neccblk2; | ||
926 | - if (v >= x - 2) { | ||
927 | - v = x - 2; | ||
928 | - if (version > 9) | ||
929 | - v--; | ||
930 | - } | ||
931 | - | ||
932 | - // shift and repack to insert length prefix | ||
933 | - i = v; | ||
934 | - if (version > 9) { | ||
935 | - strinbuf[i + 2] = 0; | ||
936 | - strinbuf[i + 3] = 0; | ||
937 | - while (i--) { | ||
938 | - t = strinbuf[i]; | ||
939 | - strinbuf[i + 3] |= 255 & (t << 4); | ||
940 | - strinbuf[i + 2] = t >> 4; | ||
941 | - } | ||
942 | - strinbuf[2] |= 255 & (v << 4); | ||
943 | - strinbuf[1] = v >> 4; | ||
944 | - strinbuf[0] = 0x40 | (v >> 12); | ||
945 | - } | ||
946 | - else { | ||
947 | - strinbuf[i + 1] = 0; | ||
948 | - strinbuf[i + 2] = 0; | ||
949 | - while (i--) { | ||
950 | - t = strinbuf[i]; | ||
951 | - strinbuf[i + 2] |= 255 & (t << 4); | ||
952 | - strinbuf[i + 1] = t >> 4; | ||
953 | - } | ||
954 | - strinbuf[1] |= 255 & (v << 4); | ||
955 | - strinbuf[0] = 0x40 | (v >> 4); | ||
956 | - } | ||
957 | - // fill to end with pad pattern | ||
958 | - i = v + 3 - (version < 10); | ||
959 | - while (i < x) { | ||
960 | - strinbuf[i++] = 0xec; | ||
961 | - // buffer has room if (i == x) break; | ||
962 | - strinbuf[i++] = 0x11; | ||
963 | - } | ||
964 | - | ||
965 | - // calculate and append ECC | ||
966 | - | ||
967 | - // calculate generator polynomial | ||
968 | - genpoly[0] = 1; | ||
969 | - for (i = 0; i < eccblkwid; i++) { | ||
970 | - genpoly[i + 1] = 1; | ||
971 | - for (j = i; j > 0; j--) | ||
972 | - genpoly[j] = genpoly[j] | ||
973 | - ? genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1]; | ||
974 | - genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)]; | ||
975 | - } | ||
976 | - for (i = 0; i <= eccblkwid; i++) | ||
977 | - genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step | ||
978 | - | ||
979 | - // append ecc to data buffer | ||
980 | - k = x; | ||
981 | - y = 0; | ||
982 | - for (i = 0; i < neccblk1; i++) { | ||
983 | - appendrs(y, datablkw, k, eccblkwid); | ||
984 | - y += datablkw; | ||
985 | - k += eccblkwid; | ||
986 | - } | ||
987 | - for (i = 0; i < neccblk2; i++) { | ||
988 | - appendrs(y, datablkw + 1, k, eccblkwid); | ||
989 | - y += datablkw + 1; | ||
990 | - k += eccblkwid; | ||
991 | - } | ||
992 | - // interleave blocks | ||
993 | - y = 0; | ||
994 | - for (i = 0; i < datablkw; i++) { | ||
995 | - for (j = 0; j < neccblk1; j++) | ||
996 | - eccbuf[y++] = strinbuf[i + j * datablkw]; | ||
997 | - for (j = 0; j < neccblk2; j++) | ||
998 | - eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; | ||
999 | - } | ||
1000 | - for (j = 0; j < neccblk2; j++) | ||
1001 | - eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; | ||
1002 | - for (i = 0; i < eccblkwid; i++) | ||
1003 | - for (j = 0; j < neccblk1 + neccblk2; j++) | ||
1004 | - eccbuf[y++] = strinbuf[x + i + j * eccblkwid]; | ||
1005 | - strinbuf = eccbuf; | ||
1006 | - | ||
1007 | - // pack bits into frame avoiding masked area. | ||
1008 | - x = y = width - 1; | ||
1009 | - k = v = 1; // up, minus | ||
1010 | - /* inteleaved data and ecc codes */ | ||
1011 | - m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; | ||
1012 | - for (i = 0; i < m; i++) { | ||
1013 | - t = strinbuf[i]; | ||
1014 | - for (j = 0; j < 8; j++ , t <<= 1) { | ||
1015 | - if (0x80 & t) | ||
1016 | - qrframe[x + width * y] = 1; | ||
1017 | - do { // find next fill position | ||
1018 | - if (v) | ||
1019 | - x--; | ||
1020 | - else { | ||
1021 | - x++; | ||
1022 | - if (k) { | ||
1023 | - if (y != 0) | ||
1024 | - y--; | ||
1025 | - else { | ||
1026 | - x -= 2; | ||
1027 | - k = !k; | ||
1028 | - if (x == 6) { | ||
1029 | - x--; | ||
1030 | - y = 9; | ||
1031 | - } | ||
1032 | - } | ||
1033 | - } | ||
1034 | - else { | ||
1035 | - if (y != width - 1) | ||
1036 | - y++; | ||
1037 | - else { | ||
1038 | - x -= 2; | ||
1039 | - k = !k; | ||
1040 | - if (x == 6) { | ||
1041 | - x--; | ||
1042 | - y -= 8; | ||
1043 | - } | ||
1044 | - } | ||
1045 | - } | ||
1046 | - } | ||
1047 | - v = !v; | ||
1048 | - } while (ismasked(x, y)); | ||
1049 | - } | ||
1050 | - } | ||
1051 | - | ||
1052 | - // save pre-mask copy of frame | ||
1053 | - strinbuf = qrframe.slice(0); | ||
1054 | - t = 0; // best | ||
1055 | - y = 30000; // demerit | ||
1056 | - // for instead of while since in original arduino code | ||
1057 | - // if an early mask was "good enough" it wouldn't try for a better one | ||
1058 | - // since they get more complex and take longer. | ||
1059 | - for (k = 0; k < 8; k++) { | ||
1060 | - applymask(k); // returns black-white imbalance | ||
1061 | - x = badcheck(); | ||
1062 | - if (x < y) { // current mask better than previous best? | ||
1063 | - y = x; | ||
1064 | - t = k; | ||
1065 | - } | ||
1066 | - if (t == 7) | ||
1067 | - break; // don't increment i to a void redoing mask | ||
1068 | - qrframe = strinbuf.slice(0); // reset for next pass | ||
1069 | - } | ||
1070 | - if (t != k) // redo best mask - none good enough, last wasn't t | ||
1071 | - applymask(t); | ||
1072 | - | ||
1073 | - // add in final mask/ecclevel bytes | ||
1074 | - y = fmtword[t + ((ecclevel - 1) << 3)]; | ||
1075 | - // low byte | ||
1076 | - for (k = 0; k < 8; k++ , y >>= 1) | ||
1077 | - if (y & 1) { | ||
1078 | - qrframe[(width - 1 - k) + width * 8] = 1; | ||
1079 | - if (k < 6) | ||
1080 | - qrframe[8 + width * k] = 1; | ||
1081 | - else | ||
1082 | - qrframe[8 + width * (k + 1)] = 1; | ||
1083 | - } | ||
1084 | - // high byte | ||
1085 | - for (k = 0; k < 7; k++ , y >>= 1) | ||
1086 | - if (y & 1) { | ||
1087 | - qrframe[8 + width * (width - 7 + k)] = 1; | ||
1088 | - if (k) | ||
1089 | - qrframe[(6 - k) + width * 8] = 1; | ||
1090 | - else | ||
1091 | - qrframe[7 + width * 8] = 1; | ||
1092 | - } | ||
1093 | - | ||
1094 | - // return image | ||
1095 | - return qrframe; | ||
1096 | - } | ||
1097 | - | ||
1098 | - var _canvas = null, | ||
1099 | - _size = null; | ||
1100 | - | ||
1101 | - var api = { | ||
1102 | - | ||
1103 | - get ecclevel() { | ||
1104 | - return ecclevel; | ||
1105 | - }, | ||
1106 | - | ||
1107 | - set ecclevel(val) { | ||
1108 | - ecclevel = val; | ||
1109 | - }, | ||
1110 | - | ||
1111 | - get size() { | ||
1112 | - return _size; | ||
1113 | - }, | ||
1114 | - | ||
1115 | - set size(val) { | ||
1116 | - _size = val | ||
1117 | - }, | ||
1118 | - | ||
1119 | - get canvas() { | ||
1120 | - return _canvas; | ||
1121 | - }, | ||
1122 | - | ||
1123 | - set canvas(el) { | ||
1124 | - _canvas = el; | ||
1125 | - }, | ||
1126 | - | ||
1127 | - getFrame: function (string) { | ||
1128 | - return genframe(string); | ||
1129 | - }, | ||
1130 | - | ||
1131 | - draw: function (string, canvas, size, ecc) { | ||
1132 | - | ||
1133 | - ecclevel = ecc || ecclevel; | ||
1134 | - canvas = canvas || _canvas; | ||
1135 | - | ||
1136 | - if (!canvas) { | ||
1137 | - console.warn('No canvas provided to draw QR code in!') | ||
1138 | - return; | ||
1139 | - } | ||
1140 | - | ||
1141 | - size = size || _size || Math.min(canvas.width, canvas.height); | ||
1142 | - | ||
1143 | - var frame = genframe(string), | ||
1144 | - ctx = canvas.ctx, | ||
1145 | - px = Math.round(size / (width + 8)); | ||
1146 | - | ||
1147 | - var roundedSize = px * (width + 8), | ||
1148 | - offset = Math.floor((size - roundedSize) / 2); | ||
1149 | - | ||
1150 | - size = roundedSize; | ||
1151 | - | ||
1152 | - ctx.clearRect(0, 0, canvas.width, canvas.height); | ||
1153 | - ctx.setFillStyle('#000000'); | ||
1154 | - | ||
1155 | - for (var i = 0; i < width; i++) { | ||
1156 | - for (var j = 0; j < width; j++) { | ||
1157 | - if (frame[j * width + i]) { | ||
1158 | - ctx.fillRect(px * (4 + i) + offset, px * (4 + j) + offset, px, px); | ||
1159 | - } | ||
1160 | - } | ||
1161 | - } | ||
1162 | - ctx.draw(); | ||
1163 | - } | ||
1164 | - } | ||
1165 | - | ||
1166 | - module.exports = { | ||
1167 | - api: api | ||
1168 | - } | ||
1169 | - | ||
1170 | -})() | ||
1171 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/coupons.js
1 | -var e = function(e) { | ||
2 | - return e && e.__esModule ? e : { | ||
3 | - default: e | ||
4 | - }; | ||
5 | - }(require("../../../utils/LoadMore.js")), | ||
6 | - t = getApp(), | 1 | +var t = getApp(), |
7 | a = t.request, | 2 | a = t.request, |
8 | o = t.globalData.setting, | 3 | o = t.globalData.setting, |
9 | os = o, | 4 | os = o, |
10 | - i = require("../../../utils/util.js"), | 5 | + i = require("../../../utils/util.js"), |
11 | ut = i, | 6 | ut = i, |
12 | - b = require("../../../app.js"), | ||
13 | - app = b, | ||
14 | - s = require("../../../utils/common.js"), | ||
15 | - | ||
16 | - n = new e.default(); | 7 | + s = require("../../../utils/common.js"); |
17 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 8 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
18 | -var auth = require("../../../utils/auth.js"),rq = require("../../../utils/request.js"); | ||
19 | const { | 9 | const { |
20 | barcode, | 10 | barcode, |
21 | qrcode | 11 | qrcode |
22 | -} = require('../../../utils/index.js') | ||
23 | -Page({ | 12 | +} = require('../../../utils/index.js'); |
13 | +let _this = null; | ||
24 | 14 | ||
25 | - /** | ||
26 | - * 页面的初始数据 | ||
27 | - */ | 15 | +Page({ |
28 | data: { | 16 | data: { |
29 | - sheng:1, //是否有更多 | ||
30 | - overdue_sheng:1, //是否有更多 | ||
31 | - | ||
32 | - details: [], //可使用的数据 | ||
33 | - sum: 0, //全部票 | ||
34 | - val: 0, //可使用票 | ||
35 | - number: 0, //已过期票 | ||
36 | - //判断已过期的 | ||
37 | - ygq: false, | ||
38 | - ksy: true, | ||
39 | - pageSize: 10, | ||
40 | - page: 1, | ||
41 | - current_page: 0, | ||
42 | - is_no_more: 0, | ||
43 | - /** | ||
44 | - * 页面配置 | ||
45 | - */ | ||
46 | - winWidth: 0, | ||
47 | - winHeight: 0, | ||
48 | - currentTab: 0, | ||
49 | - // 点击选中二维码 | ||
50 | - show: true, | ||
51 | - udata: null, | ||
52 | - iurl:os.imghost, | ||
53 | - is_show_dhwz:0, | ||
54 | - | ||
55 | - b_can_arr:null, //包邮券的未使用内容 | ||
56 | - b_out_arr:null, //包邮券的已过期的内容 | ||
57 | - b_isuse_arr:null,//包邮券的已使用的内容 | ||
58 | - | ||
59 | - isloading:0, //正在加载中的代码 | ||
60 | - isset:0, | ||
61 | - }, | ||
62 | - // 点击选中二维码 | ||
63 | - click: function(e) { | ||
64 | - var val = e.currentTarget.dataset.cashrepno; | ||
65 | - getApp().globalData.val =val; | ||
66 | - wx.navigateTo({ | ||
67 | - url: 'qr_code/qr_code', | ||
68 | - }) | ||
69 | 17 | ||
18 | + val:false, | ||
19 | + datet: "", | ||
20 | + dates: "", | ||
21 | + parameter: false, | ||
22 | + details:[],//数据 | ||
23 | + isBind:true,//控制清空时间日期的按钮 | ||
24 | + isBinds: true, | ||
25 | + select: false,//下拉框 | ||
26 | + grade_name: '未使用', | ||
27 | + // grades: [ //old | ||
28 | + // '所有', | ||
29 | + // '已使用', | ||
30 | + // '已过期', | ||
31 | + // '未使用', | ||
32 | + // ], | ||
33 | + currentIndex: 0, //tab项当前指示器 | ||
34 | + grades: [ | ||
35 | + '未使用', | ||
36 | + '已使用', | ||
37 | + '已过期', | ||
38 | + ], | ||
39 | + display:false, | ||
40 | + is_no_more: 0, | ||
41 | + current_page:1, | ||
42 | + by_list:[], | ||
43 | + isloading:0, | ||
44 | + pageNum: 1, | ||
70 | }, | 45 | }, |
71 | - // 点击返回主页 | ||
72 | - clicks: function() { | 46 | + /** |
47 | + * 生命周期函数--监听页面加载 | ||
48 | + */ | ||
49 | + onLoad: function (options) { | ||
50 | + _this = this; | ||
73 | this.setData({ | 51 | this.setData({ |
74 | - show: true | ||
75 | - }) | 52 | + details: [] |
53 | + }); | ||
54 | + this.wjquery(); | ||
76 | }, | 55 | }, |
77 | /** | 56 | /** |
78 | - * 点击tab切换,已过期,控制页面显示隐藏和样式的显示隐藏 | ||
79 | - */ | ||
80 | - swichNav: function(e) { | ||
81 | - this.setData({ current_page:0}) | ||
82 | - this.data.details=[]; | ||
83 | - | ||
84 | - var that = this; | ||
85 | - var current = e.currentTarget.dataset.current | ||
86 | - | ||
87 | - //控制显示隐藏 | ||
88 | - if (e.currentTarget.dataset.current == 0) { | ||
89 | - | ||
90 | - var ygq = true; | ||
91 | - var ksy = false; | ||
92 | - that.setData({ | ||
93 | - details:[], | ||
94 | - ygq: ygq, | ||
95 | - ksy: ksy, | ||
96 | - currentTab: e.currentTarget.dataset.current | ||
97 | - }); | ||
98 | - this.myyhj(); | ||
99 | - } else { | ||
100 | - | ||
101 | - var ygq = false; | ||
102 | - var ksy = true; | ||
103 | - var currentTab=this.data.currentTab; | ||
104 | - | ||
105 | - that.setData({ | ||
106 | - details: [], | ||
107 | - ygq: ygq, | ||
108 | - ksy: ksy, | ||
109 | - currentTab: e.currentTarget.dataset.current | ||
110 | - }); | ||
111 | - this.overdue(); | ||
112 | - | ||
113 | - } //控制样式 | ||
114 | - if (this.data.currentTab === e.currentTarget.dataset.current) { | ||
115 | - | ||
116 | - return false; | ||
117 | - } else { | ||
118 | - var details=this.data.details; | ||
119 | - | ||
120 | - that.setData({ | ||
121 | - currentTab: e.currentTarget.dataset.current, | ||
122 | - details:[], | ||
123 | - }) | ||
124 | - } | ||
125 | - | 57 | + * 生命周期函数--监听页面显示 |
58 | + */ | ||
59 | + onShow: function (options) { | ||
60 | + var th = this; | ||
61 | + | ||
62 | + wx.setNavigationBarTitle({ | ||
63 | + title: "微券查询", | ||
64 | + }); | ||
65 | + | ||
66 | + /** | ||
67 | + * 控制显示微券兑换 | ||
68 | + * by sty | ||
69 | + */ | ||
70 | + getApp().getConfig2(function (ee) { | ||
71 | + var json_d = JSON.parse(ee.switch_list); | ||
72 | + let is_show_dhwz = json_d.dhwz_switch; | ||
73 | + let grades = th.data.grades; | ||
74 | + // console.log('is_show_dhwz----------------------------',is_show_dhwz); | ||
75 | + if(is_show_dhwz) { | ||
76 | + grades.push('微券兑换'); | ||
77 | + th.setData({ grades }); | ||
78 | + }; | ||
79 | + th.setData({ is_show_dhwz }); | ||
80 | + },1); | ||
126 | }, | 81 | }, |
127 | - // 微卷兑换 | ||
128 | - exchange: function() { | 82 | + |
83 | + | ||
84 | + | ||
85 | + | ||
86 | + // 点击选中二维码 | ||
87 | + click: function (e) { | ||
88 | + var val = e.currentTarget.dataset.cashrepno; | ||
89 | + getApp().globalData.val = val; | ||
129 | wx.navigateTo({ | 90 | wx.navigateTo({ |
130 | - url: 'exchange/exchange' | 91 | + url: '../qr_code/qr_code', |
131 | }) | 92 | }) |
132 | }, | 93 | }, |
133 | - // 维劵查询 | ||
134 | - query: function() { | ||
135 | - wx.navigateTo({ | ||
136 | - url: 'query/index' | ||
137 | - }) | 94 | + // 点击返回主页 |
95 | + // clicks: function () { | ||
96 | + // this.setData({ | ||
97 | + // hide:true, display:false | ||
98 | + // }) | ||
99 | + // }, | ||
100 | + //监听输入框显示清空按钮 | ||
101 | + watchPassWord: function (event) { | ||
102 | + var val = event.detail.value; | ||
103 | + if (val != "" && val != null) { | ||
104 | + var isBind = false; | ||
105 | + this.setData({ isBind: isBind }); | ||
106 | + | ||
107 | + } | ||
138 | }, | 108 | }, |
139 | /** | 109 | /** |
140 | - * 生命周期函数--监听页面加载 | 110 | + * 点击下拉框 |
141 | */ | 111 | */ |
142 | - onLoad: function(options) { | ||
143 | - | 112 | + bindShowMsg() { |
113 | + this.setData({ | ||
114 | + select: !this.data.select | ||
115 | + }) | ||
144 | }, | 116 | }, |
117 | + /** | ||
118 | + * 已选下拉框 | ||
119 | + */ | ||
120 | + // mySelect(e) { | ||
121 | + // var name = e.currentTarget.dataset.name; | ||
122 | + // this.setData({ | ||
123 | + // grade_name: name, | ||
124 | + // select: false | ||
125 | + // }) | ||
126 | + // }, | ||
127 | + | ||
128 | + /** | ||
129 | + * 点击tab | ||
130 | + * by sty | ||
131 | + */ | ||
132 | + clickTab(e) { | ||
133 | + let index = e.target.dataset.index; | ||
134 | + let name = e.target.dataset.name; | ||
135 | + | ||
136 | + this.setData({ | ||
137 | + is_get: 0, | ||
138 | + pageNum: 1, | ||
139 | + grade_name: name, | ||
140 | + currentIndex: index, | ||
141 | + is_no_more: 0, | ||
142 | + current_page: 1, | ||
143 | + noMore: false, | ||
144 | + details: [], | ||
145 | + by_list: [], | ||
146 | + }); | ||
147 | + | ||
148 | + | ||
149 | + if(index == 3) {//微券兑换 | ||
150 | + this.exchange(); | ||
151 | + } else {//其他 | ||
152 | + this.wjquery(); | ||
153 | + }; | ||
154 | + }, | ||
155 | + | ||
156 | + /** | ||
157 | + * 点击"立即使用" | ||
158 | + * by sty | ||
159 | + */ | ||
160 | + clickUse(e) { | ||
161 | + let useIndex = e.currentTarget.dataset.index; | ||
162 | + let val = e.currentTarget.dataset.cashrepno; | ||
163 | + | ||
164 | + this.setData({ | ||
165 | + showQr: true, | ||
166 | + useIndex, | ||
167 | + }); | ||
168 | + this.qrcode(val); | ||
169 | + }, | ||
170 | + | ||
171 | + /** | ||
172 | + * 关闭二维码 | ||
173 | + * by sty | ||
174 | + */ | ||
175 | + closeQr() { | ||
176 | + this.setData({ | ||
177 | + showQr: false, | ||
178 | + }); | ||
179 | + }, | ||
180 | + | ||
181 | + /** | ||
182 | + * 生成二维码 | ||
183 | + * by sty | ||
184 | + */ | ||
185 | + qrcode:function(val){ | ||
186 | + // console.log(val); | ||
187 | + // barcode('barcode', val, 600,160); | ||
188 | + qrcode('qrcode', val, 300, 300); | ||
189 | + }, | ||
190 | + | ||
191 | + /** | ||
192 | + * 请求微券列表 | ||
193 | + * by sty | ||
194 | + */ | ||
195 | + async exchange() { | ||
196 | + var result; | ||
197 | + var user_id = getApp().globalData.user_id; | ||
198 | + var store_id = os.stoid; | ||
199 | + | ||
200 | + | ||
201 | + this.getData(true, '/api/weshop/users/listExchangeCoupons', { | ||
202 | + user_id: user_id, store_id: store_id, | ||
203 | + }).then(()=>{ | ||
204 | + _this.setData({ | ||
205 | + result: _this.data.list.pageData, | ||
206 | + }); | ||
207 | + }); | ||
208 | + | ||
209 | + // await getApp().request.promiseGet("/api/weshop/users/listExchangeCoupons", { | ||
210 | + // data: { | ||
211 | + // user_id: user_id, store_id: store_id, | ||
212 | + // } | ||
213 | + // }).then(res => { | ||
214 | + // // var msg = res.data; | ||
215 | + // // result = msg.data.pageData; | ||
216 | + // }) | ||
217 | + // e.setData({ | ||
218 | + // result: result | ||
219 | + // }) | ||
220 | + }, | ||
221 | + | ||
222 | + /** | ||
223 | + * 微券兑换对话框 | ||
224 | + * by sty | ||
225 | + */ | ||
226 | + async clickExchange(e) { | ||
227 | + var th=this; | ||
228 | + var index = e.currentTarget.dataset.index; | ||
229 | + var item = this.data.result[index]; | ||
230 | + this.data.monye = item.ToSum; | ||
231 | + this.data.integr = item.Integral; | ||
232 | + this.data.number = item.Number; | ||
233 | + | ||
234 | + let content = `确定使用${th.data.integr}积分兑换代金券面值${th.data.monye}元吗?`; | ||
235 | + wx.showModal({ | ||
236 | + title: '提示', | ||
237 | + content: content, | ||
238 | + success (res) { | ||
239 | + if (res.confirm) { | ||
240 | + console.log('用户点击确定'); | ||
241 | + th.sure_pay(); | ||
242 | + } else if (res.cancel) { | ||
243 | + console.log('用户点击取消') | ||
244 | + } | ||
245 | + } | ||
246 | + }); | ||
247 | + | ||
145 | 248 | ||
146 | - | ||
147 | - onShow: function() { | ||
148 | - var th=this; | ||
149 | - wx.setNavigationBarTitle({ title: "我的优惠券", }) | ||
150 | - | ||
151 | - //--先判断会员状态-- | ||
152 | - var user_info = getApp().globalData.userInfo; | ||
153 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
154 | - wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
155 | - return false; | ||
156 | - } | ||
157 | - this.init(th.myyhj,th.s_guoqi); | ||
158 | - var th = this; | ||
159 | - //-- 要实时 -- | ||
160 | - getApp().getConfig2(function (ee) { | ||
161 | - var json_d = JSON.parse(ee.switch_list); | ||
162 | - th.setData({ is_show_dhwz: json_d.dhwz_switch }); | ||
163 | - },1) | ||
164 | 249 | ||
165 | - | ||
166 | - }, | ||
167 | - | ||
168 | - //----------券的界面初始化----------- | ||
169 | - init:function(func,s_guoqi){ | 250 | + // var my_con = this.selectComponent("#my_con"); //组件的id |
251 | + // var title="是否使用"+th.data.integr+"积分兑换代金券面值"+th.data.monye+"元"; | ||
252 | + // my_con.open(title, "确定", "取消", th.sure_pay, null) | ||
253 | + }, | ||
254 | + | ||
255 | + | ||
256 | + /** | ||
257 | + * 微券兑换 | ||
258 | + * by sty | ||
259 | + */ | ||
260 | + sure_pay:function(){ | ||
261 | + var monye=this.data.monye; | ||
262 | + var integr=this.data.integr; | ||
263 | + var number=this.data.number; | ||
264 | + | ||
170 | var user_id = getApp().globalData.user_id; | 265 | var user_id = getApp().globalData.user_id; |
266 | + console.log(integr,"是什么微卷",typeof integr,monye); | ||
171 | var store_id = os.stoid; | 267 | var store_id = os.stoid; |
172 | - var th=this; | ||
173 | - rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + user_id, { | ||
174 | - isShowLoading: 0, | ||
175 | - success: function (su) { | ||
176 | - | ||
177 | - var data = su.data.data; | ||
178 | - data.cashcount = parseInt(data.CashCount); | ||
179 | - getApp().globalData.Integral = data.Integral; | ||
180 | - | ||
181 | - getApp().request.get("/api/weshop/userfeemail/pageAndArea",{ | ||
182 | - data:{user_id: user_id, store_id: os.stoid, pageSize:200}, | ||
183 | - success:function(res){ | ||
184 | - if(res.data.code==0 && res.data.data && res.data.data.total>0 ){ | ||
185 | - var b_arr=res.data.data.pageData; | ||
186 | - var b_can_arr=[]; //未使用 | ||
187 | - var b_out_arr=[]; //已过期 | ||
188 | - var b_isuse_arr=[]; //已过期 | ||
189 | - for(var i in b_arr){ | ||
190 | - b_arr[i].isby=1; | ||
191 | - if(b_arr[i].isuse==0){ | ||
192 | - if(b_arr[i].use_end_time<=ut.gettimestamp()){ | ||
193 | - b_out_arr.push(b_arr[i]); | ||
194 | - }else{ | ||
195 | - b_can_arr.push(b_arr[i]); | ||
196 | - } | ||
197 | - | ||
198 | - }else{ | ||
199 | - b_isuse_arr.push(b_arr[i]); | ||
200 | - } | ||
201 | - } | ||
202 | - data.cashcount= data.cashcount+b_can_arr.length; //加上包邮券的数量 | ||
203 | - th.data.b_can_arr=b_can_arr; //可使用 | ||
204 | - th.data.b_out_arr=b_out_arr; //过期 | ||
205 | - th.data.b_isuse_arr=b_isuse_arr; //已使用 | ||
206 | - th.setData({ udata: data}); | ||
207 | - func();s_guoqi(); | ||
208 | - | ||
209 | - }else{ | ||
210 | - th.setData({ udata: data}); | ||
211 | - func();s_guoqi(); | ||
212 | - } | ||
213 | - } | ||
214 | - }) | ||
215 | - | ||
216 | - } | ||
217 | - }) | ||
218 | - }, | ||
219 | - | ||
220 | - s_guoqi:function(){ | 268 | + getApp().request.post("/api/weshop/users/saveInterToCash", { |
269 | + data: { | ||
270 | + user_id: user_id, | ||
271 | + store_id: store_id, | ||
272 | + money:monye, | ||
273 | + integ:integr, | ||
274 | + number:number, | ||
275 | + }, | ||
276 | + success: function (su) { | ||
277 | + if (su.data.data!=null) { | ||
278 | + // getApp().showWarning("兑换成功"); | ||
279 | + wx.showToast({ | ||
280 | + title: '兑换成功', | ||
281 | + icon: 'success', | ||
282 | + }); | ||
283 | + }else{ | ||
284 | + // getApp().showWarning("积分不足"); | ||
285 | + wx.showToast({ | ||
286 | + title: '积分不足', | ||
287 | + icon: 'error', | ||
288 | + }); | ||
289 | + } | ||
290 | + } | ||
221 | 291 | ||
222 | - var th = this, number=0; | ||
223 | - var user_id = getApp().globalData.user_id; | ||
224 | - var store_id = os.stoid; | ||
225 | - var get_data = { | ||
226 | - user_id: user_id, | ||
227 | - store_id: store_id, | ||
228 | - IsUse: 2, | ||
229 | - pageSize: 1, | ||
230 | - page: 1 | ||
231 | - }; | ||
232 | - | ||
233 | - getApp().request.get("/api/weshop/users/listQuan", { | ||
234 | - data:get_data, | ||
235 | - success:function(res){ | ||
236 | - if(res.data.code==0 && res.data){ | ||
237 | - var a = res.data,val = a.data.total; | ||
238 | - var details = a.data.pageData; | ||
239 | - if (details.length == 0){ | ||
240 | - if(th.data.b_out_arr) th.setData({ number: th.data.b_out_arr.length}); | ||
241 | - return false; | ||
242 | - } | ||
243 | - var all_length=val; | ||
244 | - if(th.data.b_out_arr) all_length+=th.data.b_out_arr.length; | ||
245 | - th.setData({ number: all_length}); | ||
246 | - } | ||
247 | - } | ||
248 | }) | 292 | }) |
249 | - }, | ||
250 | - | ||
251 | - //获取劵的数量 | ||
252 | - myyhj:function() { | ||
253 | - if(this.data.isloading) return; | ||
254 | - var len = this.data.details.length; | ||
255 | - this.data.current_page++; | ||
256 | - var e = this, sum, val, number; | ||
257 | - var user_id = getApp().globalData.user_id; | ||
258 | - var store_id = os.stoid; | ||
259 | - var th=this; var init_num=0; | ||
260 | - | ||
261 | - var get_data = { | ||
262 | - user_id: user_id, | ||
263 | - store_id: store_id, | ||
264 | - IsUse: 0, | ||
265 | - pageSize: 10, | ||
266 | - page: e.data.current_page | ||
267 | - }; | ||
268 | - var big_arr = this.data.details; | ||
269 | - //可用券加入包邮券 | ||
270 | - if(big_arr.length==0 && this.data.b_can_arr){ | ||
271 | - big_arr=this.data.b_can_arr; | ||
272 | - } | ||
273 | - if(this.data.b_can_arr) init_num=this.data.b_can_arr.length; | ||
274 | - | ||
275 | - wx.showLoading(); th.data.isloading=1; | ||
276 | - getApp().request.get("/api/weshop/users/listQuan", { | ||
277 | - data: get_data, | ||
278 | - success:function(res){ | ||
279 | - th.data.isloading=0; | ||
280 | - var a = res.data; | ||
281 | - val = a.data.total; | ||
282 | - var details = a.data.pageData; | ||
283 | - th.setData({isset:1}); | ||
284 | - | ||
285 | - //没有找到优惠券的时候 | ||
286 | - if (details.length == 0 && th.data.current_page==1) { | ||
287 | - th.setData({sheng:0}); | ||
288 | - getApp().showWarning("未找更多数据"); | ||
289 | - if(big_arr.length>0) { | ||
290 | - th.setData({ details: big_arr, }); | ||
291 | - th.setData({ val: init_num}); | ||
292 | - setTimeout(function(){ | ||
293 | - details=big_arr; | ||
294 | - for (var i = 0; i < details.length; i++) { | ||
295 | - var no = i + len; | ||
296 | - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460); | ||
297 | - } | ||
298 | - },1000) | ||
299 | - } | ||
300 | - return false; | ||
301 | - } | ||
302 | - | ||
303 | - th.setData({ val: val+init_num }); | ||
304 | - //数组合并 | ||
305 | - big_arr=big_arr.concat(details); | ||
306 | - //设置数组 | ||
307 | - th.setData({ details: big_arr, }); | ||
308 | - //延迟显示二维码的内容 | ||
309 | - setTimeout(function () { | ||
310 | - if(th.data.current_page==1) details=big_arr; | ||
311 | - for (var i = 0; i < details.length; i++) { | ||
312 | - var no = i + len; | ||
313 | - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460); | ||
314 | - } | ||
315 | - wx.hideLoading(); | ||
316 | - }, 1200) | ||
317 | - } | ||
318 | - }) | 293 | + }, |
319 | 294 | ||
320 | - | ||
321 | 295 | ||
296 | + //明细查询 | ||
297 | + Gettime:function(e){ | ||
298 | + var page = 0; | ||
299 | + //开始获取时间 | ||
300 | + var th = this; | ||
301 | + var stime = th.data.datet; | ||
302 | + var etime = th.data.dates; | ||
303 | + var tpye = th.data.grade_name; | ||
304 | + | ||
305 | + //开始获取时间结束 | ||
306 | + //删除字符中的—— | ||
307 | + var datatk = stime.replace(/[-]/g, ""); | ||
308 | + var dataj = etime.replace(/[-]/g, ""); | ||
309 | + //转换类型 | ||
310 | + var datak = parseInt(datatk); | ||
311 | + var dataj = parseInt(dataj); | ||
312 | + | ||
313 | + //判断初始时间小于结束时间 | ||
314 | + if (datak > dataj) { | ||
315 | + getApp().showWarning("结束时间错误"); | ||
316 | + } else { | ||
317 | + this.setData({ details: [] }); | ||
318 | + this.data.current_page=1; | ||
319 | + this.data.is_no_more=0; | ||
320 | + this.data.by_list=[]; | ||
321 | + this.data.details=[]; | ||
322 | + this.wjquery(); | ||
323 | + } | ||
324 | + | ||
322 | }, | 325 | }, |
323 | - | ||
324 | - overdue:function(){ | ||
325 | 326 | ||
326 | - if(this.data.isloading) return; | ||
327 | - | 327 | + //微卷查询流水明细 |
328 | + async wjquery() { | ||
329 | + if(this.data.isloading) return; | ||
330 | + if(this.data.is_no_more) return; | ||
331 | + this.data.isloading=1; | ||
332 | + var th=this; | ||
333 | + | ||
328 | var len = this.data.details.length; | 334 | var len = this.data.details.length; |
329 | - this.data.current_page++; | 335 | + |
330 | var e = this,sum, val, number; | 336 | var e = this,sum, val, number; |
331 | var user_id = getApp().globalData.user_id; | 337 | var user_id = getApp().globalData.user_id; |
332 | - var store_id = os.stoid,init_num=0,th=this; | ||
333 | - | 338 | + var store_id = os.stoid; |
339 | + | ||
340 | + var stime = this.data.datet; | ||
341 | + var etime = this.data.dates; | ||
342 | + | ||
343 | + var tpye = this.data.grade_name; | ||
344 | + console.log("是什么类型",tpye); | ||
345 | + var IsUse = 0; | ||
346 | + var e = this; | ||
334 | var get_data = { | 347 | var get_data = { |
335 | user_id: user_id, | 348 | user_id: user_id, |
336 | store_id: store_id, | 349 | store_id: store_id, |
337 | - IsUse: 2, | ||
338 | - pageSize: 10, | ||
339 | - page: e.data.current_page | 350 | + // pageSize: 10, |
351 | + page: e.data.current_page, | ||
340 | }; | 352 | }; |
341 | - var big_arr= this.data.details; | ||
342 | - //可用券加入包邮券 | ||
343 | - if(big_arr.length==0 && this.data.b_out_arr){ | ||
344 | - big_arr=this.data.b_out_arr; | ||
345 | - } | ||
346 | - if(this.data.b_out_arr) | ||
347 | - init_num=this.data.b_out_arr.length; | ||
348 | 353 | ||
354 | + var dd={ | ||
355 | + user_id: user_id, | ||
356 | + store_id: store_id, | ||
357 | + // pageSize: 10, | ||
358 | + }; | ||
359 | + dd.isuse=0; | ||
360 | + // 判断下拉框,添加类型 | ||
361 | + if (tpye == "已使用"){ | ||
362 | + get_data.IsUse = 1; | ||
363 | + dd.isuse=1; | ||
364 | + } else if (tpye == "已过期"){ | ||
365 | + get_data.IsUse = 2; | ||
366 | + } else if (tpye == "未使用"){ | ||
367 | + get_data.IsUse = 0; | ||
368 | + }; | ||
369 | + if (etime != "" && etime != null) { | ||
370 | + get_data.EndDate = etime; | ||
371 | + | ||
372 | + //时间要转成时间戳 | ||
373 | + var new_t=new Date(etime)/1000; | ||
374 | + dd.etime=new_t; | ||
375 | + } | ||
376 | + | ||
377 | + if (stime != "" && stime != null) { | ||
378 | + get_data.BeginDate= stime; | ||
379 | + //时间要转成时间戳 | ||
380 | + var new_t=new Date(stime)/1000; | ||
381 | + dd.stime=new_t; | ||
382 | + } | ||
383 | + | ||
384 | + var by_list=[]; | ||
385 | + if(th.data.current_page==1){ | ||
386 | + //先拿包邮券 | ||
387 | + await getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea?pageSize=100", { | ||
388 | + data: dd, | ||
389 | + }).then(res => { | ||
390 | + | ||
391 | + if(res.data.code == 0) { | ||
392 | + th.setData({ | ||
393 | + byTotal: res.data.data.total, | ||
394 | + }); | ||
395 | + }; | ||
396 | + | ||
397 | + if(res.data.code==0 && res.data.data && res.data.data.total>0){ | ||
398 | + | ||
399 | + by_list=res.data.data.pageData; | ||
400 | + for(var i in by_list){ | ||
401 | + by_list[i].isby=1; | ||
402 | + //过滤是时间的范围 | ||
403 | + if(get_data.IsUse == 2 && by_list[i].use_end_time<=ut.gettimestamp()){ | ||
404 | + th.data.by_list.push(by_list[i]); | ||
405 | + }else if(get_data.IsUse == 0){ | ||
406 | + th.data.by_list.push(by_list[i]); | ||
407 | + }else if(get_data.IsUse==1){ | ||
408 | + th.data.by_list.push(by_list[i]); | ||
409 | + }else if(get_data.IsUse==undefined){ | ||
410 | + th.data.by_list.push(by_list[i]); | ||
411 | + } | ||
412 | + } | ||
413 | + } | ||
414 | + }) | ||
415 | + } | ||
416 | + | ||
417 | + var big_arr = this.data.details; ///api/weshop / users / listQuan | ||
418 | + if(th.data.current_page==1 && th.data.by_list.length>0) { | ||
419 | + big_arr=th.data.by_list; | ||
420 | + }; | ||
421 | + | ||
349 | 422 | ||
350 | - wx.showLoading();th.data.isloading=1; | ||
351 | - getApp().request.get("/api/weshop/users/listQuan" | ||
352 | - , { | 423 | + await getApp().request.promiseGet("/api/weshop/users/listQuan", { |
353 | data: get_data, | 424 | data: get_data, |
354 | - success:function(res){ | ||
355 | - th.data.isloading=0; | ||
356 | - var a = res.data; | ||
357 | - number = a.data.total; | ||
358 | - var details = a.data.pageData; | ||
359 | - | ||
360 | - if (details.length == 0) { | ||
361 | - this.setData({overdue_sheng:0}); | ||
362 | - getApp().showWarning("未找更多数据"); | ||
363 | - if( big_arr.length>0 && th.data.current_page==1) { | ||
364 | - th.setData({ details: big_arr, }); | ||
365 | - th.setData({ number: init_num}); | ||
366 | - setTimeout(function(){ | ||
367 | - details=big_arr; | ||
368 | - for (var i = 0; i < details.length; i++) { | ||
369 | - var no = i + len; | ||
370 | - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460); | ||
371 | - } | ||
372 | - },1000) | ||
373 | - | ||
374 | - } | ||
375 | - return false; | ||
376 | - } | ||
377 | - | ||
378 | - big_arr=big_arr.concat(details); | ||
379 | - | ||
380 | - this.setData({ | ||
381 | - details: big_arr, number:number+init_num, | ||
382 | - }); | ||
383 | - | 425 | + isShowLoading: 1 |
426 | + | ||
427 | + }).then(res => { | ||
428 | + | ||
429 | + th.data.isloading=0; | ||
430 | + var a = res.data; | ||
431 | + var len = e.data.details.length; | ||
432 | + var details = a.data.pageData; | ||
384 | 433 | ||
385 | - setTimeout(function () { | ||
386 | - if(th.data.current_page==1) details=big_arr; | ||
387 | - for (var i = 0; i < details.length; i++) { | ||
388 | - var no = i + len; | ||
389 | - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no, 460, 460); | ||
390 | - | ||
391 | - } | ||
392 | - wx.hideLoading(); | ||
393 | - }, 800) | ||
394 | - } | ||
395 | - }) | 434 | + th.setData({ |
435 | + pageSize: a.data.pageSize, | ||
436 | + wjTotal: a.data.total, | ||
437 | + }); | ||
438 | + | ||
439 | + if (details.length == 0) { | ||
440 | + this.setData({ | ||
441 | + is_no_more: 1, | ||
442 | + }); | ||
443 | + // getApp().showWarning("未找更多数据"); | ||
444 | + if(th.data.by_list && th.data.current_page==1){ | ||
445 | + th.setData({ val: val,details:th.data.by_list}); | ||
446 | + details=th.data.by_list; | ||
447 | + setTimeout(function () { | ||
448 | + for (var i = 0; i < details.length; i++) { | ||
449 | + var no = i + len; | ||
450 | + qrcode('qrcode' + no, details[i].no,460, 460); | ||
451 | + } | ||
452 | + }, 100) | ||
453 | + } | ||
454 | + return false; | ||
455 | + } | ||
456 | + | ||
457 | + th.data.current_page++; | ||
458 | + val = a.data.total+th.data.by_list.length; | ||
459 | + | ||
460 | + big_arr=big_arr.concat(details); | ||
461 | + this.setData({ | ||
462 | + details: big_arr,val: val, | ||
463 | + is_get: 1, | ||
464 | + current_page: this.data.current_page, | ||
465 | + }); | ||
466 | + | ||
467 | + setTimeout(function () { | ||
468 | + if(by_list) details=big_arr; | ||
469 | + for (var i = 0; i < details.length; i++) { | ||
470 | + var no = i + len; | ||
471 | + qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no,460, 460); | ||
472 | + } | ||
473 | + }, 100) | ||
474 | + }) | ||
475 | + | ||
476 | + | ||
477 | + | ||
396 | }, | 478 | }, |
397 | - | 479 | + |
480 | + | ||
481 | + // 使用说明详情展开 | ||
482 | + clickDetails: function(e) { | ||
483 | + let details = this.data.details; | ||
484 | + let index = e.currentTarget.dataset.index; | ||
485 | + details[index].isShowDetails = !details[index].isShowDetails; | ||
486 | + this.setData({ | ||
487 | + details, | ||
488 | + }); | ||
489 | + }, | ||
490 | + | ||
491 | + | ||
492 | + | ||
398 | //---加载更多是靠这个函数---- | 493 | //---加载更多是靠这个函数---- |
399 | - onReachBottom: function() { | ||
400 | - if(this.data.isloading) return false; //正在加载中,则不处理 | ||
401 | - var currentTab=this.data.currentTab; | ||
402 | - if (currentTab==2){ | ||
403 | - if(this.data.overdue_sheng==0) return false; | ||
404 | - this.overdue(); | ||
405 | - } | ||
406 | - if (currentTab==0){ | ||
407 | - if(this.data.sheng==0) return false; | ||
408 | - this.myyhj(); | ||
409 | - } | ||
410 | - }, | ||
411 | - /** | ||
412 | - * 生命周期函数--监听页面隐藏 | ||
413 | - */ | ||
414 | - onHide: function() { | ||
415 | - | 494 | + onReachBottom: function () { |
495 | + if(this.data.currentIndex != 3) { | ||
496 | + this.wjquery(); | ||
497 | + } else { | ||
498 | + this.scrollToLower('/api/weshop/users/listExchangeCoupons', { | ||
499 | + user_id: getApp().globalData.user_id, | ||
500 | + store_id: os.stoid, | ||
501 | + }, function() { | ||
502 | + // console.log('!!!!!', _this.data.list.pageData); | ||
503 | + _this.setData({ | ||
504 | + result: _this.data.list.pageData, | ||
505 | + }); | ||
506 | + }); | ||
507 | + }; | ||
416 | }, | 508 | }, |
417 | - | ||
418 | - /** | ||
419 | - * 用户点击右上角分享 | ||
420 | - */ | ||
421 | - onShareAppMessage: function() { | ||
422 | - | ||
423 | - } | 509 | + |
510 | + | ||
511 | + //起始时间 | ||
512 | + // bindDateChenge: function(e) { | ||
513 | + // console.log("是什么", e.detail.value); | ||
514 | + // var isBind = false; | ||
515 | + // this.setData({ | ||
516 | + // datet: e.detail.value, isBind: isBind | ||
517 | + // }); | ||
518 | + // }, | ||
519 | + // 结束时间 | ||
520 | + // bindDateChenges: function(e) { | ||
521 | + // console.log("是什么", e.detail.value); | ||
522 | + // var isBinds = false; | ||
523 | + // this.setData({ | ||
524 | + // dates: e.detail.value, isBinds: isBinds | ||
525 | + // }); | ||
526 | + // }, | ||
527 | + //catchtap阻止冒泡,点击清除开始时间的按钮 | ||
528 | + // eliminate:function(){ | ||
529 | + // console.log("试试"); | ||
530 | + // var isBind= true; | ||
531 | + // var data=""; | ||
532 | + // this.setData({ datet: data, isBind: isBind}) | ||
533 | + // }, | ||
534 | + //catchtap阻止冒泡,点击清除结束时间的按钮 | ||
535 | + // eliminates: function () { | ||
536 | + // console.log("试试"); | ||
537 | + // var isBinds = true; | ||
538 | + // var dates = ""; | ||
539 | + // this.setData({ dates: dates, isBinds: isBinds }) | ||
540 | + // }, | ||
541 | + | ||
542 | + | ||
543 | + | ||
544 | + | ||
545 | + | ||
546 | + | ||
547 | + // 上拉加载请求数据 | ||
548 | + getData: function(isInit, url, data) { | ||
549 | + return getApp().request.promiseGet(url, {data: data, isShowLoading: true,}) | ||
550 | + .then((res) => { | ||
551 | + _this.data.isLoading = false; | ||
552 | + if(res.data.code == 0) { | ||
553 | + if(isInit) {// 第一次加载 | ||
554 | + _this.setData({ | ||
555 | + list: res.data.data | ||
556 | + }); | ||
557 | + } else { | ||
558 | + _this.setData({ | ||
559 | + 'list.pageData': _this.data.list.pageData.concat(res.data.data.pageData) | ||
560 | + }); | ||
561 | + }; | ||
562 | + | ||
563 | + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) { | ||
564 | + _this.setData({ | ||
565 | + noMore: true | ||
566 | + }); | ||
567 | + }; | ||
568 | + }; | ||
569 | + }); | ||
570 | + }, | ||
571 | + | ||
572 | + | ||
573 | + // 上拉加载 | ||
574 | + scrollToLower(url, requestData, callback) { | ||
575 | + // 页面数据 | ||
576 | + // let pageData = this.data.list.pageData; | ||
577 | + // 数据总量 | ||
578 | + let total = this.data.list.total; | ||
579 | + // 单页最大数据量 | ||
580 | + let pageSize = this.data.list.pageSize; | ||
581 | + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’ | ||
582 | + if((total != 0)&&(total <= pageSize)) { | ||
583 | + this.setData({ | ||
584 | + noMore: true | ||
585 | + }); | ||
586 | + }; | ||
587 | + | ||
588 | + if(!this.data.isloading && !this.data.noMore) { | ||
589 | + this.setData({ | ||
590 | + isLoading: true, | ||
591 | + pageNum: this.data.pageNum + 1 | ||
592 | + }); | ||
593 | + requestData.page = this.data.pageNum; | ||
594 | + this.getData(false, url, requestData).then(()=>{ | ||
595 | + if(callback) { | ||
596 | + callback(); | ||
597 | + }; | ||
598 | + }); | ||
599 | + }; | ||
600 | + }, | ||
601 | + | ||
424 | }) | 602 | }) |
425 | \ No newline at end of file | 603 | \ No newline at end of file |
pages/user/coupons/coupons.json
pages/user/coupons/coupons.wxml
1 | <wxs module="filter" src="filter.wxs"></wxs> | 1 | <wxs module="filter" src="filter.wxs"></wxs> |
2 | <wxs module="time" src="../../../utils/filter.wxs"></wxs> | 2 | <wxs module="time" src="../../../utils/filter.wxs"></wxs> |
3 | 3 | ||
4 | -<view class='money'> | ||
5 | - <view class='mt1'>账户微券</view> | ||
6 | - <view class='mt10'> | ||
7 | - <text class='sz'>{{udata.cashcount}}</text>张 | ||
8 | - </view> | ||
9 | -</view> | ||
10 | -<view class='center'> | ||
11 | - <view class='cen-left' bindtap='query'>微券查询</view> | ||
12 | - <view wx:if="{{is_show_dhwz}}" class='cen-right' bindtap='exchange'>微券兑换</view> | 4 | + |
5 | +<!-- <view class="big-rim"> | ||
6 | + <form bindsubmit='Gettime'> | ||
7 | + <view class="min-rim"> | ||
8 | + <view class="rq">日期:</view> | ||
9 | + | ||
10 | + <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'> | ||
11 | + <view class="rq-rim"> | ||
12 | + <view class='kssj'><text class="wz"name="datat"value='{{datet}}'bindinput='watchPassWord'>{{datet}}</text></view> --> | ||
13 | + <!-- 清除输入框中的内容--> | ||
14 | + <!-- <view hidden='{{isBind}}' class="qc-rim"> | ||
15 | + <button class="empty" catchtap="eliminate">x</button> | ||
16 | + </view> | ||
17 | + </view> | ||
18 | + </picker> | ||
19 | + | ||
20 | + <view class="zi">至 </view> | ||
21 | + <picker class="pi"mode="date" value='{{dates}}' start="2019/1/1" end="" bindchange='bindDateChenges'> | ||
22 | + <view class="rim"> | ||
23 | + <view class="kssj"> | ||
24 | + <text class='wz' name="datas" value='{{dates}}'>{{dates}}</text> | ||
25 | + </view> --> | ||
26 | + <!-- 清除输入框中的内容 --> | ||
27 | + <!-- <view class="end-rim" hidden="{{isBinds}}"> | ||
28 | + <button class="end" catchtap="eliminates">x</button> | ||
29 | + </view> | ||
30 | + </view> | ||
31 | + </picker> | ||
32 | + </view> | ||
33 | + <view class="xknr-rim"> | ||
34 | + <view class="cxnr">查询内容 </view> | ||
35 | + <view class='top'> --> | ||
36 | + <!-- 下拉框 --> | ||
37 | + <!-- <view class='top-selected' bindtap='bindShowMsg'> | ||
38 | + <input name="grade_name" class="texts" value='{{grade_name}}'>{{grade_name}}</input> | ||
39 | + <view class="rim-images"> | ||
40 | + <image class="images" src='{{iurl}}/miniapp/images/usermoney/ico-pt4.png'></image> | ||
41 | + </view> | ||
42 | + </view> --> | ||
43 | + <!-- 下拉需要显示的列表 --> | ||
44 | + <!-- <view class="select-box" wx:if="{{select}}"> | ||
45 | + <view wx:for="{{grades}}" wx:key="unique"> | ||
46 | + <view class="select_one" bindtap="mySelect" data-name="{{item}}">{{item}}</view> | ||
47 | + </view> | ||
48 | + </view> | ||
49 | + </view> | ||
50 | + </view> | ||
51 | + <button class="botton" form-type='submit' data-query='{{item}}'>查询明细</button> | ||
52 | + </form> | ||
53 | +</view> --> | ||
54 | + | ||
55 | + | ||
56 | +<view class="tab-head" bindtap="clickTab"> | ||
57 | + <view wx:for="{{grades}}" wx:key="unique" class="tab-head-item {{currentIndex == index ? 'active':''}}" data-name="{{item}}" data-index="{{index}}">{{item}}</view> | ||
13 | </view> | 58 | </view> |
14 | -<!--选择款--> | ||
15 | -<view class='top'> | ||
16 | - <!--class='tyi'//class='ter'// --> | ||
17 | - <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">可使用( | ||
18 | - <text class='k_sz'>{{val}}</text> )</view> | ||
19 | - <view class="swiper-tab-list {{currentTab==2? 'on' : ''}}" data-current="2" bindtap="swichNav">已过期 | ||
20 | - (<text class='y_sz'>{{number}}</text>)</view> | 59 | + |
60 | +<view class="tab-body"> | ||
61 | + <block wx:if="{{currentIndex != 3}}"> | ||
62 | + <view class="tab-list-item" wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> | ||
63 | + <block wx:if="{{detail.isby}}"> | ||
64 | + <view class="coupon"> | ||
65 | + <view class="flex"> | ||
66 | + <view class="c-l"><text class="fs40">包邮券</text></view> | ||
67 | + <view class="c-r dash"> | ||
68 | + <view class="flex jc_sb ai_c"> | ||
69 | + <view class="pdr20"> | ||
70 | + <view class="fs28 ellipsis-1x">包邮券</view> | ||
71 | + <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: 微信商城</view> | ||
72 | + </view> | ||
73 | + <view class="shrink0"><text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.no}}">{{filter.showBtnText(currentIndex)}}</text></view> | ||
74 | + </view> | ||
75 | + <view class="c-time"> | ||
76 | + <text class="ellipsis-1x" wx:if="{{detail.use_end_time!=null}}">有效期:{{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} 至 {{time.format_time(detail.use_end_time)}}</text> | ||
77 | + <text wx:else>有效期:不限</text> | ||
78 | + </view> | ||
79 | + </view> | ||
80 | + </view> | ||
81 | + </view> | ||
82 | + <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> | ||
83 | + <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?',不包邮地区:'+detail.title:''}}</text> | ||
84 | + </view> | ||
85 | + </block> | ||
86 | + | ||
87 | + <block wx:else> | ||
88 | + <view class="coupon"> | ||
89 | + <view class="flex"> | ||
90 | + <view class="c-l"><text class="rmb fs40">{{filter.getNum(detail.Sum)}}</text></view> | ||
91 | + <view class="c-r dash"> | ||
92 | + <view class="flex jc_sb ai_c"> | ||
93 | + <view class="pdr20"> | ||
94 | + <view class="fs28 ellipsis-1x">{{filter.getNum(detail.Sum)}}元微券</view> | ||
95 | + <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> | ||
96 | + </view> | ||
97 | + <view class="shrink0"> | ||
98 | + <text class="btn {{currentIndex != 0 ? 'gray':''}}" bindtap="{{currentIndex == 0 ? 'clickUse':''}}" data-index="{{idx}}" data-cashrepno="{{detail.CashRepNo}}">{{filter.showBtnText(currentIndex)}}</text> | ||
99 | + </view> | ||
100 | + </view> | ||
101 | + <view class="c-time"> | ||
102 | + <text wx:if="{{detail.ValidDate}}" class="ellipsis-1x">有效期:{{detail.BeginDate==null ? " " : time.replace_time2(detail.BeginDate)}} 至 {{time.replace_time2(detail.ValidDate)}}</text> | ||
103 | + <text wx:else>有效期:不限</text> | ||
104 | + </view> | ||
105 | + </view> | ||
106 | + </view> | ||
107 | + </view> | ||
108 | + <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> | ||
109 | + <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1}}">{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}}</text> | ||
110 | + <text class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:else>使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}}</text> | ||
111 | + </view> | ||
112 | + </block> | ||
113 | + </view> | ||
114 | + </block> | ||
115 | + | ||
116 | + | ||
117 | + <block wx:else> | ||
118 | + <view class="tab-list-item" wx:for="{{result}}" wx:for-item="result"> | ||
119 | + <view class="coupon2"> | ||
120 | + <view class="flex"> | ||
121 | + <view class="c-l"><text class="rmb fs40">{{filter.getNum(result.ToSum)}}</text></view> | ||
122 | + <view class="c-r dash"> | ||
123 | + <view class="flex jc_sb ai_c"> | ||
124 | + <view class="pdr20"> | ||
125 | + <view class="fs26 ellipsis-1x breakall">{{result.Integral}}积分兑换{{filter.getNum(result.ToSum)}}元微券</view> | ||
126 | + <!-- <view class="fs24 c-7b pdt4 ellipsis-1x">微券来源: 微信商城</view> --> | ||
127 | + </view> | ||
128 | + <view class="shrink0"><text class="btn2" bindtap="clickExchange" data-index="{{index}}">立即兑换</text></view> | ||
129 | + </view> | ||
130 | + <!-- <view class="c-time"> | ||
131 | + <text class="ellipsis-1x" wx:if="{{detail.use_end_time!=null}}">有效期:{{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}}至{{ time.format_time(detail.use_end_time)}}</text> | ||
132 | + <text wx:else>有效期:不限</text> | ||
133 | + </view> --> | ||
134 | + </view> | ||
135 | + </view> | ||
136 | + </view> | ||
137 | + </view> | ||
138 | + </block> | ||
139 | + | ||
140 | + <!-- 暂无数据 --> | ||
141 | + <nodata nodataContainer="t-c" wx:if="{{(is_no_more == 1 && current_page == 1) || (result.length == 0)}}"></nodata> | ||
142 | + | ||
143 | + <block wx:if="{{is_get}}"> | ||
144 | + <!-- 没有更多数据 --> | ||
145 | + <view class="noMore 1" wx:if="{{(is_no_more == 1)||((details.length !== 0) && (pageSize >= (byTotal+wjTotal)))}}">—— 已经到底了 ——</view> | ||
146 | + </block> | ||
147 | + <view class="noMore 2" wx:if="{{noMore}}">—— 已经到底了 ——</view> | ||
21 | </view> | 148 | </view> |
22 | 149 | ||
23 | -<view class='noCoupons' wx:if='{{details.length==0 && isset}}'> | ||
24 | - <image src='{{iurl}}miniapp/images/user/wqnone.png'></image> | ||
25 | - <block wx:if="{{is_show_dhwz}}"> | ||
26 | - <view class='no_wz1'>没有微券?</view> | ||
27 | - <view class='no_wz2'>快去兑换吧</view> | ||
28 | - <view class='no_btn' bindtap='exchange'>立即兑换</view> | ||
29 | - </block> | ||
30 | - <block wx:else> | ||
31 | - <view class='no_wz1'>暂无数据</view> | ||
32 | - </block> | 150 | +<!-- 遮罩层 --> |
151 | +<view class="mask" hidden="{{!showQr}}"></view> | ||
152 | +<!-- 码 --> | ||
153 | +<view class="popup-container" hidden="{{!showQr}}"> | ||
154 | + <view class="t-r pdb20"><text class="iconfont icon-close fs40" bindtap="closeQr"></text></view> | ||
155 | + <view class="popup"> | ||
156 | + <view class="popup-title"> | ||
157 | + <block wx:if="{{details[useIndex].isby == 1}}">包邮券</block> | ||
158 | + <block wx:else> | ||
159 | + {{filter.getNum(details[useIndex].Sum)}}元微券 | ||
160 | + </block> | ||
161 | + </view> | ||
162 | + <view class="pdt20 c-fe0000"><text class="rmb fs80" wx:if="{{details[useIndex].isby != 1}}">{{filter.getNum(details[useIndex].Sum)}}</text></view> | ||
163 | + <!-- <img src="" alt="" class="img-qr"/> --> | ||
164 | + <view class="qr-container"> | ||
165 | + <canvas class="qrcode" canvas-id="qrcode"/> | ||
166 | + </view> | ||
167 | + <view class="pdt20 pdb10 fs26" wx:if="{{details[useIndex].CashRepNo}}">{{details[useIndex].CashRepNo}}</view> | ||
168 | + <view class="pdt20 pdb10 fs26" wx:else>{{details[useIndex].no}}</view> | ||
169 | + <view class="pdv30 c-7b fs26 bdt"> | ||
170 | + <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> | ||
171 | + <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> | ||
172 | + <text wx:else>有效期:不限</text> | ||
173 | + </view> | ||
174 | + </view> | ||
33 | </view> | 175 | </view> |
34 | -<view wx:else> | ||
35 | - <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> | ||
36 | - <block wx:if="{{detail.isby}}"> | ||
37 | - <view class="data" data-cashrepno='{{detail.no}}' bindtap='click'> | ||
38 | - <canvas class="code" canvas-id="qrcode{{idx}}" /><view class="code_val">{{detail.no}}</view> | ||
39 | - </view> | ||
40 | - <view class="moneys">包邮券</view> | 176 | + |
177 | + | ||
178 | +<!-- <block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> | ||
179 | + | ||
180 | + <block wx:if="{{detail.isby}}"> --> | ||
181 | + <!-- 判断有没有数据有显示没有不显示 --> | ||
182 | + <!-- <view class="data" data-cashrepno='{{detail.no}}' bindtap='click'> | ||
183 | + <view class="code_rim"> | ||
184 | + <canvas class="code" canvas-id="qrcode{{idx}}" /> | ||
185 | + <view class="code_val">{{detail.no}}</view> | ||
186 | + </view> | ||
187 | + | ||
188 | + <view class="moneys">包邮券</view> | ||
41 | <view class="car-rim"> | 189 | <view class="car-rim"> |
42 | - <view class="coupon_from">微券来源: 微信商城</view> | ||
43 | - <view wx:if="{{detail.use_end_time!='' && detail.use_end_time!=null}}"> | ||
44 | - | ||
45 | - <view class="text">有效期: {{time.format_time(detail.use_start_time)}}至{{time.format_time(detail.use_end_time)}}</view> | ||
46 | - </view> | ||
47 | - <view wx:else> | ||
48 | - <view class="text" wx:if="{{detail.use_start_time!='' && detail.use_start_time!=null}}">有效期: time.format_time(detail.use_start_time)至不限</view> | ||
49 | - <view class="text" wx:else>有效期:不限</view> | ||
50 | - </view> | ||
51 | - <view class="textss">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用 {{detail.title==null?"":",不包邮地区:"+detail.title}}</view> | ||
52 | - </view> | ||
53 | - </block> | ||
54 | - <block wx:else> | ||
55 | - | ||
56 | - | ||
57 | - <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'> | ||
58 | - <canvas class="code" canvas-id="qrcode{{idx}}" /> | ||
59 | - <view class="code_val">{{detail.CashRepNo}}</view> | ||
60 | - </view> | ||
61 | - <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view> | ||
62 | - <view class="car-rim"> | ||
63 | - <view class="coupon_from">微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> | ||
64 | - <view wx:if="{{detail.ValidDate!=null&&detail.BeginDate!=null}}"> | 190 | + <view class="text">微券来源: 微信商城</view> |
191 | + <view wx:if="{{detail.use_end_time!=null}}"> --> | ||
192 | + <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | ||
193 | + <!-- <view class="text">有效期: | ||
194 | + {{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} | ||
195 | + 至 {{ time.format_time(detail.use_end_time)}}</view> | ||
196 | + </view> | ||
197 | + <view wx:else> | ||
198 | + <view class="text">有效期: 不限</view> | ||
199 | + </view> | ||
200 | + <view class="textss">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?",不包邮地区:"+detail.title:""}} | ||
201 | + </view> | ||
202 | + </view> | ||
203 | + </view> | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | + </block> | ||
208 | + <block wx:else> --> | ||
209 | + <!-- 判断有没有数据有显示没有不显示 --> | ||
210 | + <!-- <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'> | ||
211 | + <view class="code_rim"> | ||
212 | + <canvas class="code" canvas-id="qrcode{{idx}}" /> | ||
213 | + <view class="code_val">{{detail.CashRepNo}}</view> | ||
214 | + </view> | ||
215 | + | ||
216 | + <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view> | ||
217 | + <view class="car-rim"> | ||
218 | + <view class="text"> | ||
219 | + 微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> | ||
220 | + <view wx:if="{{detail.ValidDate!=null}}"> --> | ||
65 | <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | 221 | <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> |
66 | - <view class="text">有效期: {{(detail.BeginDate==null || detail.BeginDate=='')?"":time.replace_time2(detail.BeginDate)}}至{{time.replace_time2(detail.ValidDate)}}</view> | 222 | + <!-- <view class="text">有效期: |
223 | + {{detail.BeginDate==null?" " : time.replace_time2(detail.BeginDate)}} | ||
224 | + 至 {{ time.replace_time2(detail.ValidDate)}}</view> | ||
67 | </view> | 225 | </view> |
68 | <view wx:else> | 226 | <view wx:else> |
69 | - <view class="text">有效期:不限</view> | 227 | + <view class="text">有效期: 不限</view> |
70 | </view> | 228 | </view> |
71 | - <view wx:if="{{detail.Remark1}}" class="textss"> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}}</view> | 229 | + <view wx:if="{{detail.Remark1}}" class="textss"> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}}</view> |
72 | <view wx:else class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} | 230 | <view wx:else class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} |
73 | </view> | 231 | </view> |
74 | - | ||
75 | </view> | 232 | </view> |
76 | - </block> | 233 | + </view> |
234 | + </block> | ||
235 | +</block> --> | ||
77 | 236 | ||
78 | - </block> | ||
79 | -</view> | ||
80 | \ No newline at end of file | 237 | \ No newline at end of file |
pages/user/coupons/coupons.wxss
1 | -/* pages/yhq/yhq.wxss */ | ||
2 | - | ||
3 | -.money{ | ||
4 | - background-image: url(https://mshopimg.yolipai.net/miniapp/images/user/redbg.jpg); | ||
5 | - color: #FFFFFF; | ||
6 | - padding: 40rpx; | ||
7 | - text-align: left; | ||
8 | - height:70rpx; | 1 | +/* 大边框 */ |
2 | +.big-rim{ | ||
3 | + margin-top: 15rpx; | ||
4 | + width: 100%; | ||
5 | + height: 310rpx; | ||
6 | +border-bottom: 8px solid #EEEEEE; | ||
7 | +} | ||
8 | +.min-rim{ | ||
9 | +display: flex; | ||
10 | +width: 100%; | ||
11 | +height: auto; | ||
12 | +margin-left: 30rpx; | ||
13 | +} | ||
9 | 14 | ||
15 | +/* 开始时间 */ | ||
16 | +.kssj{ | ||
17 | + | ||
18 | +display: inline-block; | ||
19 | +height: 50rpx; | ||
20 | +background-color: #EEEEEE; | ||
21 | +border: 1px solid #DADADA; | ||
22 | +width:200rpx; | ||
23 | +border-radius: 3px; | ||
24 | +line-height:40rpx; | ||
25 | +} | ||
26 | +/* 开始时间的文字 */ | ||
27 | +.wz{ | ||
28 | + display: inline-block; | ||
29 | +font-size: 25rpx; | ||
30 | +color: #333; | ||
31 | +} | ||
32 | +/* 日期控件 */ | ||
33 | +.pi{ | ||
34 | + width:200rpx; | ||
35 | + height:auto; | ||
36 | + margin-left:20rpx; | ||
37 | + | ||
10 | } | 38 | } |
11 | 39 | ||
12 | -.mt1{ | ||
13 | -font-size:28rpx; | ||
14 | -margin-top:-15rpx; | ||
15 | 40 | ||
16 | -} | ||
17 | 41 | ||
18 | -.mt10{ | ||
19 | - margin-top: 15rpx !important; | ||
20 | - width: 80%; | ||
21 | - font-size:28rpx; | ||
22 | - position: relative; | ||
23 | - font-family: 'SimHei',Arial; | 42 | +/* 查询内容 */ |
43 | +.cxnr{ | ||
44 | + margin-left:30rpx; | ||
45 | + font-size:28rpx; | ||
46 | + font-family: 'SimHei',Arial; | ||
24 | } | 47 | } |
48 | +.rq-rim{ | ||
49 | +position:relative; | ||
50 | +left:0; | ||
51 | +top:0; | ||
52 | +} | ||
53 | +/* 至 */ | ||
54 | +.zi{ | ||
55 | + | ||
56 | + margin-top:14rpx; | ||
57 | + font-size:28rpx; | ||
58 | + font-family: 'SimHei',Arial; | ||
59 | + margin-left:20rpx; | ||
25 | 60 | ||
26 | - | ||
27 | -/* pages/team_ping/team_ping.wxss */ | ||
28 | -.top{ | ||
29 | - display: flex; | ||
30 | - flex-direction: row; | 61 | +} |
62 | +/* 结束时间 */ | ||
63 | + | ||
64 | +.jssj{ | ||
65 | + padding-left: 10rpx; | ||
66 | + margin-left: 30rpx; | ||
67 | +padding-bottom: 10rpx; | ||
68 | +height: 35rpx; | ||
69 | +font-size: 25rpx; | ||
70 | +color: #333; | ||
71 | +background-color: #EEEEEE; | ||
72 | +border: 1px solid #DADADA; | ||
73 | +width:85%; | ||
74 | +font-family: 'SimHei',Arial; | ||
75 | +border-radius: 3px; | ||
76 | +} | ||
77 | +/* 查询内容的备考的边框 */ | ||
78 | +.xknr-rim{ | ||
79 | + display: flex; | ||
31 | width: 100%; | 80 | width: 100%; |
32 | - min-height: 50rpx; | ||
33 | - color: #000000; | ||
34 | - line-height: 50rpx; | ||
35 | - text-align: center; | 81 | + height: 55rpx; |
82 | + line-height:105rpx; | ||
83 | + margin-top:10rpx; | ||
84 | + | ||
85 | +} | ||
86 | +/* 明细查询 */ | ||
87 | +.botton{ | ||
88 | + margin-left: 30rpx; | ||
89 | + margin-top: 63rpx; | ||
90 | + background-color: #C4182E; | ||
91 | + width: 95%; | ||
92 | + border-radius:10rpx; | ||
93 | + text-align: center; | ||
94 | + height: 70rpx; | ||
95 | + line-height: 70rpx; | ||
96 | + color: #FFF; | ||
97 | + font-size: 25rpx; | ||
98 | + border: none; | ||
99 | + font-family: '微软雅黑'; | ||
100 | + } | ||
101 | + /* 底部边框线 | ||
102 | + .bottom{ | ||
103 | + width: 100%; | ||
104 | + border-bottom: 20rpx solid #eeeeee; | ||
105 | + } */ | ||
106 | + /* 清空按钮的 边框*/ | ||
107 | +.qc-rim{ | ||
108 | + position:absolute; | ||
109 | + top:10rpx; | ||
110 | + left:175rpx; | ||
111 | +} | ||
112 | + | ||
113 | +/*开始时间清空输入框的按钮*/ | ||
114 | +.empty{ | ||
115 | + width: 25rpx; | ||
116 | + height: 25rpx; | ||
117 | + border-radius:50%; | ||
118 | + background: #767676; | ||
119 | + color: #fff; | ||
36 | font-size: 25rpx; | 120 | font-size: 25rpx; |
37 | - border-bottom: 20rpx solid #eeeeee; | ||
38 | - | 121 | + text-align: center; |
122 | + line-height:18rpx; | ||
39 | } | 123 | } |
40 | - | ||
41 | - | ||
42 | - | ||
43 | -.tsan{ | ||
44 | - background-color: blue; | ||
45 | - flex:1; | ||
46 | - min-height: 90rpx; | ||
47 | - color: #000000; | ||
48 | - line-height: 90rpx; | 124 | +/* 结束时间清空输入框的按钮的边框 */ |
125 | +.end-rim{ | ||
126 | +position: absolute; | ||
127 | + top: 11rpx; | ||
128 | + left:173rpx; | ||
129 | + width: 25rpx; | ||
130 | + height: 25rpx; | ||
49 | } | 131 | } |
50 | - | ||
51 | -.tsan{ | ||
52 | - background-color: brown; | ||
53 | - flex:1; | ||
54 | - min-height: 90rpx; | ||
55 | - color: #000000; | ||
56 | - line-height: 90rpx; | 132 | +/*结束时间清空输入框的按钮*/ |
133 | +.end{ | ||
134 | + | ||
135 | + width: 25rpx; | ||
136 | + height: 25rpx; | ||
137 | + border-radius:50%; | ||
138 | + background: #767676; | ||
139 | + color: #fff; | ||
140 | + font-size: 25rpx; | ||
141 | + text-align: center; | ||
142 | + line-height:21rpx; | ||
143 | + | ||
57 | } | 144 | } |
58 | 145 | ||
59 | -.tsi{ | ||
60 | - background-color: yellowgreen; | ||
61 | - flex:1; | ||
62 | - min-height: 90rpx; | ||
63 | - color: #000000; | ||
64 | - line-height: 90rpx; | 146 | +/* 顶部 */ |
147 | +.top{ | ||
148 | + width: 200rpx; | ||
149 | + height: 50rpx; | ||
150 | + padding: 0 10rpx; | ||
151 | + line-height: 50rpx; | ||
152 | + font-size: 34rpx; | ||
153 | + margin-top: 25rpx; | ||
154 | + | ||
155 | + | ||
65 | } | 156 | } |
157 | +.images{ | ||
158 | + width:35rpx; | ||
159 | +height:30rpx; | ||
160 | +margin-top:10rpx; | ||
161 | +margin-left:-14rpx; | ||
66 | 162 | ||
163 | +} | ||
164 | +.rim-images{ | ||
165 | + width: 45rpx; | ||
166 | + height: 46rpx; | ||
167 | + line-height: 37rpx; | ||
168 | + /* border-style: inset;padding:4rpx;text-align: center; */ | ||
169 | + background: #f1f1f1; | ||
170 | + border-color:#000000; | ||
171 | + border-width: 1rpx; | ||
172 | + transform:translateX(28%); | ||
173 | + margin-top:-3rpx; | ||
174 | +border-radius:5rpx; | ||
67 | 175 | ||
68 | -.swiper-tab{ | ||
69 | - width: 100%; | ||
70 | - border-bottom: 2rpx solid #777777; | ||
71 | - text-align: center; | ||
72 | - line-height: 80rpx; | ||
73 | - } | ||
74 | 176 | ||
75 | -.swiper-tab-list{ | ||
76 | - font-size: 25rpx; | ||
77 | - display: inline-block; | ||
78 | - width: 50%; | ||
79 | - color: #777777; | ||
80 | - border-left: 2rpx solid #eeeeee; | ||
81 | } | 177 | } |
82 | -.on{ color: red; | ||
83 | - border-bottom: 5rpx solid red; | ||
84 | - width: 50%; | ||
85 | - } | 178 | +/* 下拉框 */ |
179 | +.top-selected{ | ||
180 | + width: 100%; | ||
181 | + display: flex; | ||
182 | + align-items: center; | ||
183 | + justify-content: space-between; | ||
184 | + border: 1px solid #ccc; | ||
185 | + padding: 0 10rpx; | ||
186 | + font-size: 30rpx; | ||
187 | + background:#eeeeee; | ||
188 | + height:50rpx; | ||
189 | + border-radius:6rpx; | ||
190 | +} | ||
191 | +.texts{ | ||
192 | + margin:0 auto; | ||
193 | + font-size: 25rpx; | ||
86 | 194 | ||
87 | -.swiper-box{ display: block; height: 100%; width: 100%; overflow: hidden; } | ||
88 | -.swiper-box view{ | ||
89 | - text-align: center; | ||
90 | } | 195 | } |
91 | - | 196 | +/* 下拉内容 */ |
197 | +.select-box { | ||
198 | + background-color: #eeeeee; | ||
199 | + width:225rpx; | ||
200 | + position: relative; | ||
201 | + z-index:1; | ||
202 | + overflow: hidden; | ||
203 | + text-align: left; | ||
204 | + animation: myfirst 0.5s; | ||
205 | + font-size: 25rpx; | ||
206 | +} | ||
207 | +.select_one { | ||
208 | + padding-left: 20rpx; | ||
209 | + width: 100%; | ||
210 | + height: 60rpx; | ||
211 | + line-height: 60rpx; | ||
212 | +} | ||
213 | +/* 优惠券样式 */ | ||
92 | .body{ | 214 | .body{ |
93 | text-align: center; | 215 | text-align: center; |
94 | padding: 20rpx; | 216 | padding: 20rpx; |
@@ -112,152 +234,407 @@ margin-top:-15rpx; | @@ -112,152 +234,407 @@ margin-top:-15rpx; | ||
112 | margin: 20rpx 0; | 234 | margin: 20rpx 0; |
113 | text-align: center; | 235 | text-align: center; |
114 | } | 236 | } |
115 | - | ||
116 | -.center{ | ||
117 | - border: 2rpx solid #e03835; | ||
118 | - background-color: #C4182E; | ||
119 | - color: #FFFFFF; | ||
120 | - display: flex; | ||
121 | - height:70rpx; | ||
122 | -} | ||
123 | - | ||
124 | -.cen-left{ | ||
125 | - width: 49%; | ||
126 | - text-align: center; | ||
127 | - margin: 17rpx 0; | ||
128 | - border-right: 2px solid #e03835; | ||
129 | - overflow: hidden; | ||
130 | - text-overflow: ellipsis; | ||
131 | - white-space: nowrap; | ||
132 | - height:35rpx; | ||
133 | - font-size:25rpx; | ||
134 | - | ||
135 | -} | ||
136 | - | ||
137 | -.cen-right{ | ||
138 | - width: 49%; | ||
139 | - text-align: center; | ||
140 | - margin: 17rpx 0; | ||
141 | - height:30rpx; | ||
142 | - font-size:25rpx; | ||
143 | -} | ||
144 | - | ||
145 | - | ||
146 | -/* 没有维券【】 */ | ||
147 | -.noCoupons{ | ||
148 | - text-align: center; | ||
149 | - font-size: 30rpx; | ||
150 | - color: #666666; | ||
151 | - margin: 30rpx; | ||
152 | -} | ||
153 | - | ||
154 | -.noCoupons image{ | ||
155 | - width:300rpx; | ||
156 | - height:200rpx; | ||
157 | -} | ||
158 | - | ||
159 | -.no_wz1{ | ||
160 | - margin-top: 25rpx; | ||
161 | - | ||
162 | -} | ||
163 | - | ||
164 | -.no_wz2{ | ||
165 | - margin-top: 30rpx; | ||
166 | -} | ||
167 | - | ||
168 | -.no_btn{ | ||
169 | - background-color: #C4182E; | ||
170 | - color: #fff; | ||
171 | - font-size: 35rpx; | ||
172 | - height: 90rpx; | ||
173 | - line-height: 90rpx; | ||
174 | - margin: 40rpx auto; | ||
175 | - width: 350rpx; | ||
176 | - | ||
177 | -} | ||
178 | - | 237 | +/* 二维码列表查询 */ |
179 | /* 列表数据*/ | 238 | /* 列表数据*/ |
180 | .data{ | 239 | .data{ |
181 | - width: 100%; | ||
182 | - text-align:center; | ||
183 | -height:440rpx; | 240 | + width: 80%; |
184 | 241 | ||
242 | + height:auto; | ||
243 | + margin-left:80rpx; | ||
244 | + | ||
245 | +} | ||
246 | +.rim{ | ||
247 | + position: relative; | ||
248 | + top:0rpx; | ||
249 | + left: 0rpx; | ||
185 | } | 250 | } |
186 | /* 二维码边框 */ | 251 | /* 二维码边框 */ |
187 | .code_rim{ | 252 | .code_rim{ |
188 | - width: 100%; | 253 | + width: 100%; |
189 | height: auto; | 254 | height: auto; |
190 | text-align: center; | 255 | text-align: center; |
191 | font-size: 25rpx; | 256 | font-size: 25rpx; |
192 | padding-top: -30rpx; | 257 | padding-top: -30rpx; |
193 | margin-top:-20rpx; | 258 | margin-top:-20rpx; |
259 | +padding-left:45rpx; | ||
194 | 260 | ||
195 | } | 261 | } |
196 | 262 | ||
197 | /* 二维码 */ | 263 | /* 二维码 */ |
198 | .code{ | 264 | .code{ |
199 | - height:415rpx; | ||
200 | - width:61%; | ||
201 | -position:relative; | ||
202 | -left:20%; | 265 | + height: 520rpx; |
266 | + display: flex; | ||
267 | + flex-direction: column; | ||
268 | + justify-content: flex-end; | ||
269 | + align-items: center; | ||
270 | + margin-left:40rpx; | ||
203 | 271 | ||
204 | - | ||
205 | } | 272 | } |
273 | +.car-rim{ | ||
274 | +width:98%; | ||
275 | +height:177rpx; | ||
276 | +text-align:center; | ||
277 | +border-bottom:2rpx solid #eee; | ||
278 | +margin-left:22rpx; | ||
279 | + | ||
280 | +} | ||
281 | +/* 二维码值 */ | ||
282 | +.code_val{ | ||
283 | + margin-top:-104rpx; | ||
284 | +margin-left:-59rpx; | ||
285 | +color:#999999; | ||
206 | 286 | ||
207 | -/* 单据时间 */ | ||
208 | -.time{ | ||
209 | - margin-top: 10rpx; | ||
210 | - font-size: 25rpx; | ||
211 | - color: #999999; | ||
212 | - width: 100%; | ||
213 | } | 287 | } |
214 | /* 金额 */ | 288 | /* 金额 */ |
215 | .moneys{ | 289 | .moneys{ |
216 | - margin-top:20rpx; | ||
217 | - height: 45rpx; | 290 | + margin-top:20rpx; |
291 | + height: 47rpx; | ||
218 | width: 100%; | 292 | width: 100%; |
219 | color:#6fd137; | 293 | color:#6fd137; |
220 | text-align: center; | 294 | text-align: center; |
221 | - font-size: 40rpx; | 295 | + font-size: 38rpx; |
222 | font-family: 'SimHei',Arial; | 296 | font-family: 'SimHei',Arial; |
223 | margin-bottom:20rpx; | 297 | margin-bottom:20rpx; |
224 | - | 298 | + margin-left:11rpx; |
225 | 299 | ||
226 | - | ||
227 | } | 300 | } |
228 | /* 文字 */ | 301 | /* 文字 */ |
229 | .text{ | 302 | .text{ |
303 | + width: 100%; | ||
304 | + font-size: 25rpx; | ||
305 | + text-align: center; | ||
306 | + | ||
307 | + height: 41rpx; | ||
308 | + color: #999999; | ||
309 | +} | ||
310 | +/* 二维码和条形码的边框 */ | ||
311 | +.barqrcode{ | ||
230 | width: 100%; | 312 | width: 100%; |
313 | + height: auto; | ||
314 | + margin-top:50rpx; | ||
315 | + | ||
316 | +} | ||
317 | +/* 日期 */ | ||
318 | +.rq{ | ||
319 | + height: 25rpx; | ||
231 | font-size: 28rpx; | 320 | font-size: 28rpx; |
232 | - text-align: center; | ||
233 | - height: 43rpx; | 321 | + margin-top:12rpx; |
322 | + font-family:'SimHei',Arial; | ||
234 | } | 323 | } |
235 | -/* 二维码值 */ | ||
236 | -.code_val{ | ||
237 | -font-size:27rpx; | 324 | +/* 点击条形 */ |
325 | +.barcode { | ||
326 | + height: 320rpx; | ||
327 | + flex-direction: column; | ||
328 | + justify-content: center; | ||
329 | + align-items: center; | ||
330 | + margin-left: 30rpx; | ||
238 | } | 331 | } |
239 | -.car-rim{ | ||
240 | -width:85%; | ||
241 | -min-height:135rpx; | ||
242 | -text-align:center; | ||
243 | -border-bottom:2rpx solid #eee; | ||
244 | -margin-left:54rpx; | ||
245 | -height: auto; | ||
246 | -padding-bottom:10rpx; | 332 | +/* 二维码边框*/ |
333 | +.qrcode_rim { | ||
334 | + width: 100%; | ||
335 | + height: 420rpx; | ||
336 | + display: flex; | ||
337 | + flex-direction: column; | ||
338 | + justify-content: flex-end; | ||
339 | + align-items: center; | ||
340 | + margin-left: 80rpx; | ||
341 | + margin-top:-210rpx; | ||
247 | 342 | ||
248 | } | 343 | } |
344 | +.qrcode{ | ||
345 | + /* margin-left: 100rpx; */ | ||
346 | +} | ||
249 | /* 使用说明 */ | 347 | /* 使用说明 */ |
250 | .textss{ | 348 | .textss{ |
251 | width: 100%; | 349 | width: 100%; |
252 | - font-size: 28rpx; | 350 | + font-size: 25rpx; |
253 | text-align: center; | 351 | text-align: center; |
254 | - padding-bottom:15rpx; | 352 | + |
353 | + min-height: 47rpx; | ||
354 | + height:auto; | ||
355 | + color: #999999; | ||
255 | } | 356 | } |
256 | 357 | ||
257 | -.coupon_from{ | ||
258 | -width:100%; | ||
259 | -font-size:28rpx; | ||
260 | -text-align:center; | ||
261 | -height:40rpx; | ||
262 | 358 | ||
263 | -} | ||
264 | \ No newline at end of file | 359 | \ No newline at end of file |
360 | + | ||
361 | + | ||
362 | + | ||
363 | + | ||
364 | +page { | ||
365 | + background-color: #f0f0f0; | ||
366 | + scroll-behavior: smooth; | ||
367 | +} | ||
368 | + | ||
369 | +.c-fe0000 { | ||
370 | + color: #fe0000; | ||
371 | +} | ||
372 | + | ||
373 | +.tab-head { | ||
374 | + display: flex; | ||
375 | + position: sticky; | ||
376 | + top: 0; | ||
377 | + background-color: white; | ||
378 | + font-size: 28rpx; | ||
379 | + z-index: 2; | ||
380 | +} | ||
381 | + | ||
382 | +.tab-head-item { | ||
383 | + flex: 1; | ||
384 | + text-align: center; | ||
385 | + padding: 30rpx 0; | ||
386 | + position: relative; | ||
387 | +} | ||
388 | + | ||
389 | +.tab-head-item.active { | ||
390 | + color: #fe0000; | ||
391 | +} | ||
392 | + | ||
393 | +.tab-head-item.active::after { | ||
394 | + content: ''; | ||
395 | + width: 60%; | ||
396 | + height: 2rpx; | ||
397 | + background-color: #fe0000; | ||
398 | + position: absolute; | ||
399 | + bottom: 0; | ||
400 | + left: 50%; | ||
401 | + transform: translateX(-50%); | ||
402 | +} | ||
403 | + | ||
404 | +.tab-body { | ||
405 | + padding: 0 20rpx; | ||
406 | + overflow: hidden; | ||
407 | +} | ||
408 | + | ||
409 | + .tab-list-item { | ||
410 | + border-radius: 10rpx; | ||
411 | + overflow: hidden; | ||
412 | + margin-top: 30rpx; | ||
413 | + } | ||
414 | + | ||
415 | + | ||
416 | + | ||
417 | +.coupon { | ||
418 | + position: relative; | ||
419 | + | ||
420 | + background: radial-gradient(transparent 0, #FFD3D6 0) top left / 200rpx no-repeat, | ||
421 | + radial-gradient(transparent 6px, #fff 0), | ||
422 | + radial-gradient(transparent 6px, #fff 0); | ||
423 | +} | ||
424 | + | ||
425 | + | ||
426 | +.coupon::after { | ||
427 | + content: ''; | ||
428 | + position: absolute; | ||
429 | + height: 100%; | ||
430 | + width:4px; | ||
431 | + top: 0; | ||
432 | + left: 0; | ||
433 | + background-image: linear-gradient(to bottom, #FFD3D6 4px, transparent 4px, transparent), | ||
434 | + radial-gradient(4px circle at 0px 8px, #f0f0f0 4px, #FFD3D6 4px); | ||
435 | + background-size: 4px 12px; | ||
436 | + background-repeat: repeat-y; | ||
437 | + } | ||
438 | + | ||
439 | + | ||
440 | + .coupon2 { | ||
441 | + /* width: 300px; */ | ||
442 | + padding: 40rpx 0; | ||
443 | + position: relative; | ||
444 | + background: radial-gradient(circle at right top, transparent 16rpx, #FFD3D6 0) top left / 200rpx 51% no-repeat, | ||
445 | + radial-gradient(circle at right bottom, transparent 16rpx, #FFD3D6 0) bottom left /200rpx 51% no-repeat, | ||
446 | + radial-gradient(circle at left top, transparent 16rpx, white 0) top right /calc(100% - 200rpx) 51% no-repeat, | ||
447 | + radial-gradient(circle at left bottom, transparent 16rpx, white 0) bottom right /calc(100% - 200rpx) 51% no-repeat; | ||
448 | + /* filter: drop-shadow(2px 2px 2px rgba(0,0,0,.2)); */ | ||
449 | + } | ||
450 | + | ||
451 | + .coupon2::after { | ||
452 | + content: ''; | ||
453 | + height: 70%; | ||
454 | + border: 2rpx dashed #fff; | ||
455 | + position: absolute; | ||
456 | + left: 198rpx; | ||
457 | + top: 0; | ||
458 | + bottom: 0; | ||
459 | + margin: auto; | ||
460 | + } | ||
461 | + | ||
462 | +/* .coupon2 .c-l, | ||
463 | + .coupon2 .c-r { | ||
464 | + border: 2rpx solid red; | ||
465 | + padding: 20rpx 0; | ||
466 | + } */ | ||
467 | + | ||
468 | + | ||
469 | + | ||
470 | + .c-l { | ||
471 | + color: #fe0000; | ||
472 | + width: 200rpx; | ||
473 | + display: flex; | ||
474 | + align-items: center; | ||
475 | + justify-content: center; | ||
476 | + flex-shrink: 0; | ||
477 | + } | ||
478 | + | ||
479 | + .rmb::before { | ||
480 | + content: '¥'; | ||
481 | + font-size: 28rpx; | ||
482 | + } | ||
483 | + | ||
484 | + .c-r { | ||
485 | + box-sizing: border-box; | ||
486 | + padding: 20rpx; | ||
487 | + flex: 1; | ||
488 | + } | ||
489 | + | ||
490 | + .c-time { | ||
491 | + color: #7b7b7b; | ||
492 | + font-size: 24rpx; | ||
493 | + padding-top: 10rpx; | ||
494 | + word-break: break-all; | ||
495 | + } | ||
496 | + | ||
497 | + .btn, .btn2 { | ||
498 | + font-size: 26rpx; | ||
499 | + padding: 10rpx 20rpx; | ||
500 | + border: 2rpx solid #fe0000; | ||
501 | + border-radius: 30rpx; | ||
502 | + flex-shrink: 0; | ||
503 | + } | ||
504 | + | ||
505 | + .btn { | ||
506 | + color: #fe0000; | ||
507 | + } | ||
508 | + | ||
509 | + .btn.gray { | ||
510 | + color: #ccc; | ||
511 | + border-color: #ccc; | ||
512 | + } | ||
513 | + | ||
514 | + .btn2 { | ||
515 | + color: white; | ||
516 | + background-color: #fe0000; | ||
517 | + } | ||
518 | + | ||
519 | + .c-info { | ||
520 | + border-top: 2rpx dashed #f0f0f0; | ||
521 | + padding: 10rpx 40rpx 10rpx 10rpx; | ||
522 | + font-size: 22rpx; | ||
523 | + background-color: #fefefe; | ||
524 | + color: #7b7b7b; | ||
525 | + position: relative; | ||
526 | + } | ||
527 | + | ||
528 | + .arrow-down::after { | ||
529 | + font-family: iconfont; | ||
530 | + content: '\e600'; | ||
531 | + font-size: 32rpx; | ||
532 | + position: absolute; | ||
533 | + right: 10rpx; | ||
534 | + top: 10rpx; | ||
535 | + /* transform: translateY(-50%); */ | ||
536 | + transition: all 0.3s; | ||
537 | + } | ||
538 | + | ||
539 | + .arrow-down.active::after { | ||
540 | + transform: rotateZ(180deg); | ||
541 | + } | ||
542 | + | ||
543 | + .mask { | ||
544 | + position: fixed; | ||
545 | + width: 100%; | ||
546 | + height: 100%; | ||
547 | + top: 0; | ||
548 | + background-color: rgba(0,0,0,.7); | ||
549 | + z-index: 1; | ||
550 | + } | ||
551 | + | ||
552 | + .popup-container { | ||
553 | + position: fixed; | ||
554 | + width: 70%; | ||
555 | + border-radius: 12rpx; | ||
556 | + top: 50%; | ||
557 | + left: 50%; | ||
558 | + transform: translate(-50%, -50%); | ||
559 | + z-index: 3; | ||
560 | + } | ||
561 | + | ||
562 | + .popup { | ||
563 | + text-align: center; | ||
564 | + border-radius: 12rpx; | ||
565 | + background-color: white; | ||
566 | + overflow: hidden; | ||
567 | + /* width: 80%; */ | ||
568 | + } | ||
569 | + | ||
570 | + .popup-container .icon-close { | ||
571 | + color: rgba(255,255,255,.6); | ||
572 | + } | ||
573 | + | ||
574 | + .popup-title { | ||
575 | + padding: 40rpx 0; | ||
576 | + color: #fe0000; | ||
577 | + background-color: #FFD3D6; | ||
578 | + position: relative; | ||
579 | + } | ||
580 | + | ||
581 | + .popup-title::after { | ||
582 | + content: ''; | ||
583 | + position: absolute; | ||
584 | + left: -20rpx; | ||
585 | + bottom: -12rpx; | ||
586 | + width: 130%; | ||
587 | + height: 20rpx; | ||
588 | + background-image: -webkit-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
589 | + background-image: -moz-radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
590 | + background-image: radial-gradient(circle, #FFD3D6, #FFD3D6 20rpx, transparent 20rpx, transparent); | ||
591 | + background-size: 40rpx 40rpx; | ||
592 | + transform: rotate(180deg); | ||
593 | + -webkit-transform: rotate(180deg); | ||
594 | + } | ||
595 | + | ||
596 | + | ||
597 | + .popup .rmb::before { | ||
598 | + font-size: 40rpx; | ||
599 | + } | ||
600 | + | ||
601 | + .img-qr { | ||
602 | + display: block; | ||
603 | + width: 300rpx; | ||
604 | + height: 300rpx; | ||
605 | + margin: 0 auto; | ||
606 | + background-color: pink; | ||
607 | + } | ||
608 | + | ||
609 | + .qrcode { | ||
610 | + width: 300rpx; | ||
611 | + height: 300rpx; | ||
612 | + margin: 0 auto; | ||
613 | + } | ||
614 | + | ||
615 | + | ||
616 | + .noMore { | ||
617 | + padding: 20rpx; | ||
618 | + color: #bbb; | ||
619 | + text-align: center; | ||
620 | + font-size: 22rpx; | ||
621 | + } | ||
622 | + | ||
623 | + .breakall { | ||
624 | + word-break: break-all; | ||
625 | + } | ||
626 | + | ||
627 | + | ||
628 | + | ||
629 | + | ||
630 | + | ||
631 | + | ||
632 | + | ||
633 | + | ||
634 | + | ||
635 | + | ||
636 | + | ||
637 | + | ||
638 | + | ||
639 | + | ||
640 | + | ||
641 | + |
pages/user/coupons/exchange/exchange.js deleted
1 | -// pages/user/yhq/exchange/exchange.js | ||
2 | -var e = function (e) { | ||
3 | - return e && e.__esModule ? e : { | ||
4 | - default: e | ||
5 | - }; | ||
6 | -}(require("../../../../utils/LoadMore.js")), | ||
7 | - t = getApp(), | ||
8 | - a = t.request, | ||
9 | - o = t.globalData.setting, | ||
10 | - os = o, | ||
11 | - i = require("../../../../utils/util.js"), | ||
12 | - ut = i, | ||
13 | - b = require("../../../../app.js"), | ||
14 | - app = b, | ||
15 | - s = require("../../../../utils/common.js"), | ||
16 | - n = new e.default(); | ||
17 | -var regeneratorRuntime = require('../../../../utils/runtime.js'); | ||
18 | -Page({ | ||
19 | - | ||
20 | - /** | ||
21 | - * 页面的初始数据 | ||
22 | - */ | ||
23 | - data: { | ||
24 | - result:[],//结果 | ||
25 | - }, | ||
26 | - | ||
27 | - /** | ||
28 | - * 生命周期函数--监听页面加载 | ||
29 | - */ | ||
30 | - onLoad: function (options) { | ||
31 | - | ||
32 | - }, | ||
33 | - | ||
34 | - /** | ||
35 | - * 生命周期函数--监听页面初次渲染完成 | ||
36 | - */ | ||
37 | - onReady: function () { | ||
38 | - | ||
39 | - }, | ||
40 | - // 刷出兑换劵 | ||
41 | - async exchange() { | ||
42 | - var e = this, result; | ||
43 | - var user_id = getApp().globalData.user_id; | ||
44 | - var store_id = os.stoid; | ||
45 | - await getApp().request.promiseGet("/api/weshop/users/listExchangeCoupons", { | ||
46 | - data: { | ||
47 | - user_id: user_id, store_id: store_id, | ||
48 | - } | ||
49 | - }).then(res => { | ||
50 | - var msg=res.data; | ||
51 | - result=msg.data.pageData; | ||
52 | - | ||
53 | - }) | ||
54 | - e.setData({ | ||
55 | - result: result | ||
56 | - }) | ||
57 | - | ||
58 | - }, | ||
59 | - /** | ||
60 | - * 点击兑换 | ||
61 | - */ | ||
62 | - async click(e) { | ||
63 | - var th=this; | ||
64 | - | ||
65 | - var index=e.currentTarget.dataset.index; | ||
66 | - var item=this.data.result[index]; | ||
67 | - this.data.monye=item.ToSum; | ||
68 | - this.data.integr=item.Integral; | ||
69 | - this.data.number=item.Number; | ||
70 | - | ||
71 | - var my_con = this.selectComponent("#my_con"); //组件的id | ||
72 | - var title="是否使用"+th.data.integr+"积分兑换代金券面值"+th.data.monye+"元"; | ||
73 | - my_con.open(title, "确定", "取消", th.sure_pay, null) | ||
74 | - }, | ||
75 | - | ||
76 | - sure_pay:function(){ | ||
77 | - var monye=this.data.monye; | ||
78 | - var integr=this.data.integr; | ||
79 | - var number=this.data.number; | ||
80 | - | ||
81 | - var user_id = getApp().globalData.user_id; | ||
82 | - console.log(integr,"是什么微卷",typeof integr,monye); | ||
83 | - var store_id = os.stoid; | ||
84 | - getApp().request.post("/api/weshop/users/saveInterToCash", { | ||
85 | - data: { | ||
86 | - user_id: user_id, | ||
87 | - store_id: store_id, | ||
88 | - money:monye, | ||
89 | - integ:integr, | ||
90 | - number:number, | ||
91 | - }, | ||
92 | - success: function (su) { | ||
93 | - if (su.data.data!=null) { | ||
94 | - getApp().showWarning("兑换成功"); | ||
95 | - }else{ | ||
96 | - getApp().showWarning("积分不足"); | ||
97 | - } | ||
98 | - } | ||
99 | - | ||
100 | - }) | ||
101 | - }, | ||
102 | - | ||
103 | - | ||
104 | - /** | ||
105 | - * 生命周期函数--监听页面显示 | ||
106 | - */ | ||
107 | - onShow: function () { | ||
108 | - this.exchange(); | ||
109 | - wx.setNavigationBarTitle({ | ||
110 | - title: "微券兑换", | ||
111 | - }) | ||
112 | - }, | ||
113 | - | ||
114 | - /** | ||
115 | - * 生命周期函数--监听页面隐藏 | ||
116 | - */ | ||
117 | - onHide: function () { | ||
118 | - | ||
119 | - }, | ||
120 | - | ||
121 | - /** | ||
122 | - * 生命周期函数--监听页面卸载 | ||
123 | - */ | ||
124 | - onUnload: function () { | ||
125 | - | ||
126 | - }, | ||
127 | - | ||
128 | - /** | ||
129 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
130 | - */ | ||
131 | - onPullDownRefresh: function () { | ||
132 | - | ||
133 | - }, | ||
134 | - | ||
135 | - /** | ||
136 | - * 页面上拉触底事件的处理函数 | ||
137 | - */ | ||
138 | - onReachBottom: function () { | ||
139 | - | ||
140 | - }, | ||
141 | - | ||
142 | - /** | ||
143 | - * 用户点击右上角分享 | ||
144 | - */ | ||
145 | - onShareAppMessage: function () { | ||
146 | - | ||
147 | - } | ||
148 | -}) | ||
149 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/exchange/exchange.json deleted
pages/user/coupons/exchange/exchange.wxml deleted
1 | -<wxs module="filter" src="filter.wxs"></wxs> | ||
2 | -<block wx:for="{{result}}" wx:for-index="idx" wx:for-item="result"> | ||
3 | - <view class='jfcz1'> | ||
4 | - <view class='jf-w'> | ||
5 | - <view class="symbol">¥</view> | ||
6 | - <view><text class='f-big'>{{filter.getNum(result.ToSum)}}</text></view> | ||
7 | - </view> | ||
8 | - <view class='mb20'>{{result.Integral}}积分兑换{{filter.getNum(result.ToSum)}}元微券</view> | ||
9 | - <view class='jf-btn' bindtap='click' data-index="{{idx}}">立即兑换</view> | ||
10 | - </view> | ||
11 | -</block> | ||
12 | -<my_confirm id="my_con"></my_confirm> | ||
13 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/exchange/exchange.wxss deleted
1 | -/* 替换【】 */ | ||
2 | -.jfcz1{ | ||
3 | - background: url(https://mshopimg.yolipai.net/miniapp/images/user/jfzyc1.png); | ||
4 | - text-align: center; | ||
5 | - padding: 20px 0; | ||
6 | - font-size: 18px; | ||
7 | - color: #FFF; | ||
8 | - margin: 20px 2% 0 0; | ||
9 | - margin-left: 40rpx; | ||
10 | - width:88%; | ||
11 | - vertical-align: top; | ||
12 | - display: inline-block; | ||
13 | -} | ||
14 | -.jf-w{ | ||
15 | - display: flex; | ||
16 | - width: 100%; | ||
17 | - height: auto; | ||
18 | -} | ||
19 | -/* 人民币的符号 */ | ||
20 | -.symbol{ | ||
21 | - width: 35rpx; | ||
22 | - height: 45rpx; | ||
23 | - margin-left: 279rpx; | ||
24 | - margin-top:5rpx; | ||
25 | - | ||
26 | -} | ||
27 | -/* 钱 */ | ||
28 | -.f-big{ | ||
29 | - font-size: 25px; | ||
30 | - font-family: 'SimHei',Arial; | ||
31 | - margin-left:4rpx; | ||
32 | - | ||
33 | -} | ||
34 | - | ||
35 | -.mb20{ | ||
36 | - margin-bottom: 20px; | ||
37 | -} | ||
38 | - | ||
39 | -.jf-btn{ | ||
40 | - background-color: #C4182E; | ||
41 | - display: inline-block; | ||
42 | - height: 50px; | ||
43 | - line-height: 50px; | ||
44 | - width: 80%; | ||
45 | - margin: auto; | ||
46 | - border-radius: 4px; | ||
47 | - text-align: center; | ||
48 | -} | ||
49 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/exchange/filter.wxs deleted
1 | -var numFr = { | ||
2 | - getNum: function(x) { | ||
3 | - var f = parseFloat(x); | ||
4 | - if (isNaN(f)) { | ||
5 | - return false; | ||
6 | - } | ||
7 | - var f = Math.round(x * 100) / 100; | ||
8 | - var s = f.toString(); | ||
9 | - var rs = s.indexOf('.'); | ||
10 | - if (rs < 0) { | ||
11 | - rs = s.length; | ||
12 | - s += '.'; | ||
13 | - } | ||
14 | - while (s.length <= rs + 2) { | ||
15 | - s += '0'; | ||
16 | - } | ||
17 | - return s; | ||
18 | - } | ||
19 | -} | ||
20 | -module.exports = { | ||
21 | - getNum: numFr.getNum | ||
22 | -} | ||
23 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/filter.wxs
@@ -15,8 +15,24 @@ var numFr = { | @@ -15,8 +15,24 @@ var numFr = { | ||
15 | s += '0'; | 15 | s += '0'; |
16 | } | 16 | } |
17 | return s; | 17 | return s; |
18 | - } | 18 | + }, |
19 | + showBtnText: function(index) { | ||
20 | + switch(index) { | ||
21 | + case 1: { | ||
22 | + return '已使用'; | ||
23 | + break; | ||
24 | + }; | ||
25 | + case 2: { | ||
26 | + return '已过期'; | ||
27 | + break; | ||
28 | + }; | ||
29 | + default: { | ||
30 | + return '立即使用'; | ||
31 | + }; | ||
32 | + }; | ||
33 | + }, | ||
19 | } | 34 | } |
20 | module.exports = { | 35 | module.exports = { |
21 | - getNum: numFr.getNum | 36 | + getNum: numFr.getNum, |
37 | + showBtnText: numFr.showBtnText, | ||
22 | } | 38 | } |
23 | \ No newline at end of file | 39 | \ No newline at end of file |
pages/user/coupons/index.wxs deleted
1 | -var formatNumber = function (n) { | ||
2 | - n = n.toString() | ||
3 | - return n[1] ? n : '0' + n | ||
4 | -} | ||
5 | - | ||
6 | -var regYear = getRegExp("(y+)", "i"); | ||
7 | - | ||
8 | -var dateFormat = function (timestamp, format) { | ||
9 | - if (!format) { | ||
10 | - format = "yyyy-MM-dd hh:mm:ss"; | ||
11 | - } | ||
12 | - timestamp = parseInt(timestamp)*1000;; | ||
13 | - var realDate = getDate(timestamp); | ||
14 | - function timeFormat(num) { | ||
15 | - return num < 10 ? '0' + num : num; | ||
16 | - } | ||
17 | - var date = [ | ||
18 | - ["M+", timeFormat(realDate.getMonth() + 1)], | ||
19 | - ["d+", timeFormat(realDate.getDate())], | ||
20 | - ["h+", timeFormat(realDate.getHours())], | ||
21 | - ["m+", timeFormat(realDate.getMinutes())], | ||
22 | - ["s+", timeFormat(realDate.getSeconds())], | ||
23 | - ["q+", Math.floor((realDate.getMonth() + 3) / 3)], | ||
24 | - ["S+", realDate.getMilliseconds()], | ||
25 | - ]; | ||
26 | - var reg1 = regYear.exec(format); | ||
27 | - // console.log(reg1[0]); | ||
28 | - if (reg1) { | ||
29 | - | ||
30 | - format = format.replace(reg1[1], (realDate.getFullYear() + '').substring(4 - reg1[1].length)); | ||
31 | - } | ||
32 | - for (var i = 0; i < date.length; i++) { | ||
33 | - var k = date[i][0]; | ||
34 | - var v = date[i][1]; | ||
35 | - | ||
36 | - var reg2 = getRegExp("(" + k + ")").exec(format); | ||
37 | - if (reg2) { | ||
38 | - format = format.replace(reg2[1], reg2[1].length == 1 | ||
39 | - ? v : ("00" + v).substring(("" + v).length)); | ||
40 | - } | ||
41 | - } | ||
42 | - return format; | ||
43 | -} | ||
44 | - | ||
45 | - | ||
46 | -module.exports = { | ||
47 | - dateFormat: dateFormat | ||
48 | -}; | ||
49 | - | ||
50 | - | ||
51 | -function parse(fmt) { | ||
52 | - | ||
53 | - var a = fmt.slice(0, 4); | ||
54 | - console.log("a",a); | ||
55 | - var b=+"-"; | ||
56 | - console.log("b", b); | ||
57 | - var c = fmt.slice(5, 7); | ||
58 | - var d=+"-"; | ||
59 | - console.log("d", d); | ||
60 | - var e = fmt.slice(8, 9); | ||
61 | - console.log("e", e); | ||
62 | - | ||
63 | -} | ||
64 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/qr_code/qr_code.js deleted
1 | -// pages/user/yhq/qr_code/qr_code.js | ||
2 | -const { | ||
3 | - barcode, | ||
4 | - qrcode | ||
5 | -} = require('../../../../utils/index.js') | ||
6 | -Page({ | ||
7 | - | ||
8 | - /** | ||
9 | - * 页面的初始数据 | ||
10 | - */ | ||
11 | - data: { | ||
12 | - | ||
13 | - }, | ||
14 | - | ||
15 | - /** | ||
16 | - * 生命周期函数--监听页面加载 | ||
17 | - */ | ||
18 | - onLoad: function (options) { | ||
19 | - var val = getApp().globalData.val; | ||
20 | - console.log(val); | ||
21 | - this.qrcode(val); | ||
22 | - }, | ||
23 | - clicks:function(){ | ||
24 | - | ||
25 | - wx.navigateBack(); | ||
26 | - | ||
27 | - }, | ||
28 | - /** | ||
29 | - * 生命周期函数--监听页面初次渲染完成 | ||
30 | - */ | ||
31 | - onReady: function () { | ||
32 | - | ||
33 | - }, | ||
34 | - | ||
35 | - /** | ||
36 | - * 生命周期函数--监听页面显示 | ||
37 | - */ | ||
38 | - onShow: function () { | ||
39 | - wx.setNavigationBarTitle({ | ||
40 | - title: "微券查询", | ||
41 | - }) | ||
42 | - }, | ||
43 | -qrcode:function(val){ | ||
44 | - console.log(val); | ||
45 | - barcode('barcode', val, 600,160); | ||
46 | - qrcode('qrcode', val,520,520); | ||
47 | -}, | ||
48 | - /** | ||
49 | - * 生命周期函数--监听页面隐藏 | ||
50 | - */ | ||
51 | - onHide: function () { | ||
52 | - | ||
53 | - }, | ||
54 | - | ||
55 | - /** | ||
56 | - * 生命周期函数--监听页面卸载 | ||
57 | - */ | ||
58 | - onUnload: function () { | ||
59 | - | ||
60 | - }, | ||
61 | - | ||
62 | - /** | ||
63 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
64 | - */ | ||
65 | - onPullDownRefresh: function () { | ||
66 | - | ||
67 | - }, | ||
68 | - | ||
69 | - /** | ||
70 | - * 页面上拉触底事件的处理函数 | ||
71 | - */ | ||
72 | - onReachBottom: function () { | ||
73 | - | ||
74 | - }, | ||
75 | - | ||
76 | - /** | ||
77 | - * 用户点击右上角分享 | ||
78 | - */ | ||
79 | - onShareAppMessage: function () { | ||
80 | - | ||
81 | - } | ||
82 | -}) | ||
83 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/qr_code/qr_code.json deleted
pages/user/coupons/qr_code/qr_code.wxml deleted
pages/user/coupons/qr_code/qr_code.wxss deleted
1 | -/* 二维码和条形码的边框 */ | ||
2 | -.barqrcode{ | ||
3 | - width: 100%; | ||
4 | - height: auto; | ||
5 | - margin-top:225rpx; | ||
6 | - | ||
7 | -} | ||
8 | -/* 点击条形 */ | ||
9 | -.barcode { | ||
10 | - height:150rpx; | ||
11 | - width: 600rpx; | ||
12 | - flex-direction: column; | ||
13 | - justify-content: center; | ||
14 | - align-items: center; | ||
15 | - padding-left:40px; | ||
16 | - | ||
17 | -} | ||
18 | -/* 二维码边框*/ | ||
19 | -.qrcode_rim { | ||
20 | - width: 550rpx; | ||
21 | - height:550rpx; | ||
22 | -display:flex; | ||
23 | -flex-direction:column; | ||
24 | -justify-content:flex-end; | ||
25 | -align-items:center; | ||
26 | -margin-left:121rpx; | ||
27 | -margin-top:-13rpx; | ||
28 | - | ||
29 | -} | ||
30 | - | ||
31 | -.qrcode{ | ||
32 | - width:550rpx; | ||
33 | -height:550rpx; | ||
34 | - | ||
35 | - | ||
36 | -} | ||
37 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/query/index.js deleted
1 | -var t = getApp(), | ||
2 | - a = t.request, | ||
3 | - o = t.globalData.setting, | ||
4 | - os = o, | ||
5 | - i = require("../../../../utils/util.js"), | ||
6 | - ut = i, | ||
7 | - s = require("../../../../utils/common.js"); | ||
8 | -var regeneratorRuntime = require('../../../../utils/runtime.js'); | ||
9 | -const { | ||
10 | - barcode, | ||
11 | - qrcode | ||
12 | -} = require('../../../../utils/index.js') | ||
13 | -Page({ | ||
14 | - data: { | ||
15 | - | ||
16 | - val:false, | ||
17 | - datet: "", | ||
18 | - dates: "", | ||
19 | - parameter: false, | ||
20 | - details:[],//数据 | ||
21 | - isBind:true,//控制清空时间日期的按钮 | ||
22 | - isBinds: true, | ||
23 | - select: false,//下拉框 | ||
24 | - grade_name: '所有', | ||
25 | - grades: [ | ||
26 | - '所有', | ||
27 | - '已使用', | ||
28 | - '已过期', | ||
29 | - '未使用', | ||
30 | - ], | ||
31 | - display:false, | ||
32 | - is_no_more: 0, | ||
33 | - current_page:1, | ||
34 | - by_list:[], | ||
35 | - islading:0, | ||
36 | - }, | ||
37 | - /** | ||
38 | - * 生命周期函数--监听页面加载 | ||
39 | - */ | ||
40 | - onLoad: function (options) { | ||
41 | - this.setData({ | ||
42 | - details: [] | ||
43 | - }); | ||
44 | - this.wjquery(); | ||
45 | - }, | ||
46 | - /** | ||
47 | - * 生命周期函数--监听页面显示 | ||
48 | - */ | ||
49 | - onShow: function (options) { | ||
50 | - wx.setNavigationBarTitle({ | ||
51 | - title: "微券查询", | ||
52 | - }) | ||
53 | - }, | ||
54 | - // 点击选中二维码 | ||
55 | - click: function (e) { | ||
56 | - var val = e.currentTarget.dataset.cashrepno; | ||
57 | - getApp().globalData.val = val; | ||
58 | - wx.navigateTo({ | ||
59 | - url: '../qr_code/qr_code', | ||
60 | - }) | ||
61 | - }, | ||
62 | - // 点击返回主页 | ||
63 | - // clicks: function () { | ||
64 | - // this.setData({ | ||
65 | - // hide:true, display:false | ||
66 | - // }) | ||
67 | - // }, | ||
68 | - //监听输入框显示清空按钮 | ||
69 | - watchPassWord: function (event) { | ||
70 | - var val = event.detail.value; | ||
71 | - if (val != "" && val != null) { | ||
72 | - var isBind = false; | ||
73 | - this.setData({ isBind: isBind }); | ||
74 | - | ||
75 | - } | ||
76 | - }, | ||
77 | - /** | ||
78 | - * 点击下拉框 | ||
79 | - */ | ||
80 | - bindShowMsg() { | ||
81 | - this.setData({ | ||
82 | - select: !this.data.select | ||
83 | - }) | ||
84 | - }, | ||
85 | - /** | ||
86 | - * 已选下拉框 | ||
87 | - */ | ||
88 | - mySelect(e) { | ||
89 | - var name = e.currentTarget.dataset.name; | ||
90 | - this.setData({ | ||
91 | - grade_name: name, | ||
92 | - select: false | ||
93 | - }) | ||
94 | - }, | ||
95 | - | ||
96 | - //明细查询 | ||
97 | - Gettime:function(e){ | ||
98 | - var page = 0; | ||
99 | - //开始获取时间 | ||
100 | - var th = this; | ||
101 | - var stime = th.data.datet; | ||
102 | - var etime = th.data.dates; | ||
103 | - var tpye = th.data.grade_name; | ||
104 | - | ||
105 | - //开始获取时间结束 | ||
106 | - //删除字符中的—— | ||
107 | - var datatk = stime.replace(/[-]/g, ""); | ||
108 | - var dataj = etime.replace(/[-]/g, ""); | ||
109 | - //转换类型 | ||
110 | - var datak = parseInt(datatk); | ||
111 | - var dataj = parseInt(dataj); | ||
112 | - | ||
113 | - //判断初始时间小于结束时间 | ||
114 | - if (datak > dataj) { | ||
115 | - getApp().showWarning("结束时间错误"); | ||
116 | - } else { | ||
117 | - this.setData({ details: [] }); | ||
118 | - this.data.current_page=1; | ||
119 | - this.data.is_no_more=0; | ||
120 | - this.data.by_list=[]; | ||
121 | - this.data.details=[]; | ||
122 | - this.wjquery(); | ||
123 | - } | ||
124 | - | ||
125 | - }, | ||
126 | - //微卷查询流水明细 | ||
127 | - async wjquery() { | ||
128 | - if (this.data.islading) return; | ||
129 | - if(this.data.is_no_more) return; | ||
130 | - this.data.islading=1; | ||
131 | - var th=this; | ||
132 | - | ||
133 | - var len = this.data.details.length; | ||
134 | - | ||
135 | - var e = this,sum, val, number; | ||
136 | - var user_id = getApp().globalData.user_id; | ||
137 | - var store_id = os.stoid; | ||
138 | - var stime = this.data.datet; | ||
139 | - var etime = this.data.dates; | ||
140 | - var tpye = this.data.grade_name; | ||
141 | - console.log("是什么类型",tpye); | ||
142 | - var IsUse = 0; | ||
143 | - var e = this; | ||
144 | - var get_data = { | ||
145 | - user_id: user_id, | ||
146 | - store_id: store_id, | ||
147 | - pageSize: 10, | ||
148 | - page: e.data.current_page | ||
149 | - }; | ||
150 | - | ||
151 | - var dd={ user_id: user_id, store_id: store_id,pageSize: 100}; | ||
152 | - dd.isuse=0; | ||
153 | - // 判断下拉框,添加类型 | ||
154 | - if (tpye == "已使用"){ | ||
155 | - get_data.IsUse = 1; | ||
156 | - dd.isuse=1; | ||
157 | - } else if (tpye == "已过期"){ | ||
158 | - get_data.IsUse = 2; | ||
159 | - } else if (tpye == "未使用"){ | ||
160 | - get_data.IsUse = 0; | ||
161 | - } | ||
162 | - if (etime != "" && etime != null) { | ||
163 | - get_data.EndDate = etime; | ||
164 | - | ||
165 | - //时间要转成时间戳 | ||
166 | - var new_t=new Date(etime)/1000; | ||
167 | - dd.etime=new_t; | ||
168 | - } | ||
169 | - | ||
170 | - if (stime != "" && stime != null) { | ||
171 | - get_data.BeginDate= stime; | ||
172 | - //时间要转成时间戳 | ||
173 | - var new_t=new Date(stime)/1000; | ||
174 | - dd.stime=new_t; | ||
175 | - } | ||
176 | - | ||
177 | - var by_list=[]; | ||
178 | - if(th.data.current_page==1){ | ||
179 | - //先拿包邮券 | ||
180 | - await getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | ||
181 | - data: dd, | ||
182 | - }).then(res => { | ||
183 | - if(res.data.code==0 && res.data.data && res.data.data.total>0){ | ||
184 | - by_list=res.data.data.pageData; | ||
185 | - for(var i in by_list){ | ||
186 | - by_list[i].isby=1; | ||
187 | - //过滤是时间的范围 | ||
188 | - if(get_data.IsUse == 2 && by_list[i].use_end_time>=ut.gettimestamp()){ | ||
189 | - th.data.by_list.push(by_list[i]); | ||
190 | - }else if(get_data.IsUse == 0 && by_list[i].use_end_time<ut.gettimestamp()){ | ||
191 | - th.data.by_list.push(by_list[i]); | ||
192 | - }else if(get_data.IsUse==1){ | ||
193 | - th.data.by_list.push(by_list[i]); | ||
194 | - }else if(get_data.IsUse==undefined){ | ||
195 | - th.data.by_list.push(by_list[i]); | ||
196 | - } | ||
197 | - } | ||
198 | - } | ||
199 | - }) | ||
200 | - } | ||
201 | - | ||
202 | - var big_arr = this.data.details; ///api/weshop / users / listQuan | ||
203 | - if(th.data.current_page==1 && th.data.by_list.length>0) | ||
204 | - big_arr=th.data.by_list; | ||
205 | - | ||
206 | - await getApp().request.promiseGet("/api/weshop/users/listQuan", { | ||
207 | - data: get_data, | ||
208 | - isShowLoading: 1 | ||
209 | - | ||
210 | - }).then(res => { | ||
211 | - | ||
212 | - th.data.islading=0; | ||
213 | - var a = res.data; | ||
214 | - var len = e.data.details.length; | ||
215 | - var details = a.data.pageData; | ||
216 | - | ||
217 | - if (details.length == 0 ) { | ||
218 | - this.data.is_no_more = 1; | ||
219 | - getApp().showWarning("未找更多数据"); | ||
220 | - if(th.data.by_list && th.data.current_page==1){ | ||
221 | - th.setData({ val: val,details:th.data.by_list}); | ||
222 | - details=th.data.by_list; | ||
223 | - setTimeout(function () { | ||
224 | - for (var i = 0; i < details.length; i++) { | ||
225 | - var no = i + len; | ||
226 | - qrcode('qrcode' + no, details[i].no,460, 460); | ||
227 | - } | ||
228 | - }, 100) | ||
229 | - } | ||
230 | - return false; | ||
231 | - } | ||
232 | - | ||
233 | - th.data.current_page++; | ||
234 | - val = a.data.total+th.data.by_list.length; | ||
235 | - | ||
236 | - big_arr=big_arr.concat(details); | ||
237 | - this.setData({ | ||
238 | - details: big_arr,val: val | ||
239 | - }); | ||
240 | - | ||
241 | - setTimeout(function () { | ||
242 | - if(by_list) details=big_arr; | ||
243 | - for (var i = 0; i < details.length; i++) { | ||
244 | - var no = i + len; | ||
245 | - qrcode('qrcode' + no, details[i].CashRepNo?details[i].CashRepNo:details[i].no,460, 460); | ||
246 | - } | ||
247 | - }, 100) | ||
248 | - }) | ||
249 | - | ||
250 | - | ||
251 | - | ||
252 | - }, | ||
253 | - //---加载更多是靠这个函数---- | ||
254 | - onReachBottom: function () { | ||
255 | - this.wjquery(); | ||
256 | - }, | ||
257 | - //起始时间 | ||
258 | - bindDateChenge: function(e) { | ||
259 | - console.log("是什么", e.detail.value); | ||
260 | - var isBind = false; | ||
261 | - this.setData({ | ||
262 | - datet: e.detail.value, isBind: isBind | ||
263 | - }); | ||
264 | - }, | ||
265 | - // 结束时间 | ||
266 | - bindDateChenges: function(e) { | ||
267 | - console.log("是什么", e.detail.value); | ||
268 | - var isBinds = false; | ||
269 | - this.setData({ | ||
270 | - dates: e.detail.value, isBinds: isBinds | ||
271 | - }); | ||
272 | - }, | ||
273 | - //catchtap阻止冒泡,点击清除开始时间的按钮 | ||
274 | - eliminate:function(){ | ||
275 | - console.log("试试"); | ||
276 | - var isBind= true; | ||
277 | - var data=""; | ||
278 | - this.setData({ datet: data, isBind: isBind}) | ||
279 | - }, | ||
280 | - //catchtap阻止冒泡,点击清除结束时间的按钮 | ||
281 | - eliminates: function () { | ||
282 | - console.log("试试"); | ||
283 | - var isBinds = true; | ||
284 | - var dates = ""; | ||
285 | - this.setData({ dates: dates, isBinds: isBinds }) | ||
286 | - } | ||
287 | - | ||
288 | -}) | ||
289 | \ No newline at end of file | 0 | \ No newline at end of file |
pages/user/coupons/query/index.json deleted
pages/user/coupons/query/index.wxml deleted
1 | -<wxs module="filter" src="../filter.wxs"></wxs> | ||
2 | -<wxs module="time" src="../../../../utils/filter.wxs"></wxs> | ||
3 | - | ||
4 | - | ||
5 | -<view class="big-rim"> | ||
6 | - <form bindsubmit='Gettime'> | ||
7 | - <view class="min-rim"> | ||
8 | - <view class="rq">日期:</view> | ||
9 | - | ||
10 | - <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'> | ||
11 | - <view class="rq-rim"> | ||
12 | - <view class='kssj'><text class="wz"name="datat"value='{{datet}}'bindinput='watchPassWord'>{{datet}}</text></view> | ||
13 | - <!-- 清除输入框中的内容--> | ||
14 | - <view hidden='{{isBind}}' class="qc-rim"> | ||
15 | - <button class="empty" catchtap="eliminate">x</button> | ||
16 | - </view> | ||
17 | - </view> | ||
18 | - </picker> | ||
19 | - | ||
20 | - <view class="zi">至 </view> | ||
21 | - <picker class="pi"mode="date" value='{{dates}}' start="2019/1/1" end="" bindchange='bindDateChenges'> | ||
22 | - <view class="rim"> | ||
23 | - <view class="kssj"> | ||
24 | - <text class='wz' name="datas" value='{{dates}}'>{{dates}}</text> | ||
25 | - </view> | ||
26 | - <!-- 清除输入框中的内容 --> | ||
27 | - <view class="end-rim" hidden="{{isBinds}}"> | ||
28 | - <button class="end" catchtap="eliminates">x</button> | ||
29 | - </view> | ||
30 | - </view> | ||
31 | - </picker> | ||
32 | - </view> | ||
33 | - <view class="xknr-rim"> | ||
34 | - <view class="cxnr">查询内容 </view> | ||
35 | - <view class='top'> | ||
36 | - <!-- 下拉框 --> | ||
37 | - <view class='top-selected' bindtap='bindShowMsg'> | ||
38 | - <input name="grade_name" class="texts" value='{{grade_name}}'>{{grade_name}}</input> | ||
39 | - <view class="rim-images"> | ||
40 | - <image class="images" src='{{iurl}}/miniapp/images/usermoney/ico-pt4.png'></image> | ||
41 | - </view> | ||
42 | - </view> | ||
43 | - <!-- 下拉需要显示的列表 --> | ||
44 | - <view class="select-box" wx:if="{{select}}"> | ||
45 | - <view wx:for="{{grades}}" wx:key="unique"> | ||
46 | - <view class="select_one" bindtap="mySelect" data-name="{{item}}">{{item}}</view> | ||
47 | - </view> | ||
48 | - </view> | ||
49 | - </view> | ||
50 | - </view> | ||
51 | - <button class="botton" form-type='submit' data-query='{{item}}'>查询明细</button> | ||
52 | - </form> | ||
53 | -</view> | ||
54 | -<block wx:for="{{details}}" wx:for-index="idx" wx:for-item="detail"> | ||
55 | - | ||
56 | - <block wx:if="{{detail.isby}}"> | ||
57 | - <!-- 判断有没有数据有显示没有不显示 --> | ||
58 | - <view class="data" data-cashrepno='{{detail.no}}' bindtap='click'> | ||
59 | - <view class="code_rim"> | ||
60 | - <canvas class="code" canvas-id="qrcode{{idx}}" /> | ||
61 | - <view class="code_val">{{detail.no}}</view> | ||
62 | - </view> | ||
63 | - | ||
64 | - <view class="moneys">包邮券</view> | ||
65 | - <view class="car-rim"> | ||
66 | - <view class="text">微券来源: 微信商城</view> | ||
67 | - <view wx:if="{{detail.use_end_time!=null}}"> | ||
68 | - <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | ||
69 | - <view class="text">有效期: | ||
70 | - {{detail.use_start_time==null?" " : time.format_time(detail.use_start_time)}} | ||
71 | - 至 {{ time.format_time(detail.use_end_time)}}</view> | ||
72 | - </view> | ||
73 | - <view wx:else> | ||
74 | - <view class="text">有效期: 不限</view> | ||
75 | - </view> | ||
76 | - <view class="textss">使用说明: 包邮券,全场通用,满 {{detail.condition}}元使用{{detail.title?",不包邮地区:"+detail.title:""}} | ||
77 | - </view> | ||
78 | - </view> | ||
79 | - </view> | ||
80 | - | ||
81 | - | ||
82 | - | ||
83 | - </block> | ||
84 | - <block wx:else> | ||
85 | - <!-- 判断有没有数据有显示没有不显示 --> | ||
86 | - <view class="data" data-cashrepno='{{detail.CashRepNo}}' bindtap='click'> | ||
87 | - <view class="code_rim"> | ||
88 | - <canvas class="code" canvas-id="qrcode{{idx}}" /> | ||
89 | - <view class="code_val">{{detail.CashRepNo}}</view> | ||
90 | - </view> | ||
91 | - | ||
92 | - <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view> | ||
93 | - <view class="car-rim"> | ||
94 | - <view class="text"> | ||
95 | - 微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view> | ||
96 | - <view wx:if="{{detail.ValidDate!=null}}"> | ||
97 | - <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 --> | ||
98 | - <view class="text">有效期: | ||
99 | - {{detail.BeginDate==null?" " : time.replace_time2(detail.BeginDate)}} | ||
100 | - 至 {{ time.replace_time2(detail.ValidDate)}}</view> | ||
101 | - </view> | ||
102 | - <view wx:else> | ||
103 | - <view class="text">有效期: 不限</view> | ||
104 | - </view> | ||
105 | - <view wx:if="{{detail.Remark1}}" class="textss"> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark}}</view> | ||
106 | - <view wx:else class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}} | ||
107 | - </view> | ||
108 | - </view> | ||
109 | - </view> | ||
110 | - </block> | ||
111 | -</block> | ||
112 | - |
pages/user/coupons/query/index.wxss deleted
1 | -/* 大边框 */ | ||
2 | -.big-rim{ | ||
3 | - margin-top: 15rpx; | ||
4 | - width: 100%; | ||
5 | - height: 310rpx; | ||
6 | -border-bottom: 8px solid #EEEEEE; | ||
7 | -} | ||
8 | -.min-rim{ | ||
9 | -display: flex; | ||
10 | -width: 100%; | ||
11 | -height: auto; | ||
12 | -margin-left: 30rpx; | ||
13 | -} | ||
14 | - | ||
15 | -/* 开始时间 */ | ||
16 | -.kssj{ | ||
17 | - | ||
18 | -display: inline-block; | ||
19 | -height: 50rpx; | ||
20 | -background-color: #EEEEEE; | ||
21 | -border: 1px solid #DADADA; | ||
22 | -width:200rpx; | ||
23 | -border-radius: 3px; | ||
24 | -line-height:40rpx; | ||
25 | -} | ||
26 | -/* 开始时间的文字 */ | ||
27 | -.wz{ | ||
28 | - display: inline-block; | ||
29 | -font-size: 25rpx; | ||
30 | -color: #333; | ||
31 | -} | ||
32 | -/* 日期控件 */ | ||
33 | -.pi{ | ||
34 | - width:200rpx; | ||
35 | - height:auto; | ||
36 | - margin-left:20rpx; | ||
37 | - | ||
38 | -} | ||
39 | - | ||
40 | - | ||
41 | - | ||
42 | -/* 查询内容 */ | ||
43 | -.cxnr{ | ||
44 | - margin-left:30rpx; | ||
45 | - font-size:28rpx; | ||
46 | - font-family: 'SimHei',Arial; | ||
47 | -} | ||
48 | -.rq-rim{ | ||
49 | -position:relative; | ||
50 | -left:0; | ||
51 | -top:0; | ||
52 | -} | ||
53 | -/* 至 */ | ||
54 | -.zi{ | ||
55 | - | ||
56 | - margin-top:14rpx; | ||
57 | - font-size:28rpx; | ||
58 | - font-family: 'SimHei',Arial; | ||
59 | - margin-left:20rpx; | ||
60 | - | ||
61 | -} | ||
62 | -/* 结束时间 */ | ||
63 | - | ||
64 | -.jssj{ | ||
65 | - padding-left: 10rpx; | ||
66 | - margin-left: 30rpx; | ||
67 | -padding-bottom: 10rpx; | ||
68 | -height: 35rpx; | ||
69 | -font-size: 25rpx; | ||
70 | -color: #333; | ||
71 | -background-color: #EEEEEE; | ||
72 | -border: 1px solid #DADADA; | ||
73 | -width:85%; | ||
74 | -font-family: 'SimHei',Arial; | ||
75 | -border-radius: 3px; | ||
76 | -} | ||
77 | -/* 查询内容的备考的边框 */ | ||
78 | -.xknr-rim{ | ||
79 | - display: flex; | ||
80 | - width: 100%; | ||
81 | - height: 55rpx; | ||
82 | - line-height:105rpx; | ||
83 | - margin-top:10rpx; | ||
84 | - | ||
85 | -} | ||
86 | -/* 明细查询 */ | ||
87 | -.botton{ | ||
88 | - margin-left: 30rpx; | ||
89 | - margin-top: 63rpx; | ||
90 | - background-color: #C4182E; | ||
91 | - width: 95%; | ||
92 | - border-radius:10rpx; | ||
93 | - text-align: center; | ||
94 | - height: 70rpx; | ||
95 | - line-height: 70rpx; | ||
96 | - color: #FFF; | ||
97 | - font-size: 25rpx; | ||
98 | - border: none; | ||
99 | - font-family: '微软雅黑'; | ||
100 | - } | ||
101 | - /* 底部边框线 | ||
102 | - .bottom{ | ||
103 | - width: 100%; | ||
104 | - border-bottom: 20rpx solid #eeeeee; | ||
105 | - } */ | ||
106 | - /* 清空按钮的 边框*/ | ||
107 | -.qc-rim{ | ||
108 | - position:absolute; | ||
109 | - top:10rpx; | ||
110 | - left:175rpx; | ||
111 | -} | ||
112 | - | ||
113 | -/*开始时间清空输入框的按钮*/ | ||
114 | -.empty{ | ||
115 | - width: 25rpx; | ||
116 | - height: 25rpx; | ||
117 | - border-radius:50%; | ||
118 | - background: #767676; | ||
119 | - color: #fff; | ||
120 | - font-size: 25rpx; | ||
121 | - text-align: center; | ||
122 | - line-height:18rpx; | ||
123 | -} | ||
124 | -/* 结束时间清空输入框的按钮的边框 */ | ||
125 | -.end-rim{ | ||
126 | -position: absolute; | ||
127 | - top: 11rpx; | ||
128 | - left:173rpx; | ||
129 | - width: 25rpx; | ||
130 | - height: 25rpx; | ||
131 | -} | ||
132 | -/*结束时间清空输入框的按钮*/ | ||
133 | -.end{ | ||
134 | - | ||
135 | - width: 25rpx; | ||
136 | - height: 25rpx; | ||
137 | - border-radius:50%; | ||
138 | - background: #767676; | ||
139 | - color: #fff; | ||
140 | - font-size: 25rpx; | ||
141 | - text-align: center; | ||
142 | - line-height:21rpx; | ||
143 | - | ||
144 | -} | ||
145 | - | ||
146 | -/* 顶部 */ | ||
147 | -.top{ | ||
148 | - width: 200rpx; | ||
149 | - height: 50rpx; | ||
150 | - padding: 0 10rpx; | ||
151 | - line-height: 50rpx; | ||
152 | - font-size: 34rpx; | ||
153 | - margin-top: 25rpx; | ||
154 | - | ||
155 | - | ||
156 | -} | ||
157 | -.images{ | ||
158 | - width:35rpx; | ||
159 | -height:30rpx; | ||
160 | -margin-top:10rpx; | ||
161 | -margin-left:-14rpx; | ||
162 | - | ||
163 | -} | ||
164 | -.rim-images{ | ||
165 | - width: 45rpx; | ||
166 | - height: 46rpx; | ||
167 | - line-height: 37rpx; | ||
168 | - /* border-style: inset;padding:4rpx;text-align: center; */ | ||
169 | - background: #f1f1f1; | ||
170 | - border-color:#000000; | ||
171 | - border-width: 1rpx; | ||
172 | - transform:translateX(28%); | ||
173 | - margin-top:-3rpx; | ||
174 | -border-radius:5rpx; | ||
175 | - | ||
176 | - | ||
177 | -} | ||
178 | -/* 下拉框 */ | ||
179 | -.top-selected{ | ||
180 | - width: 100%; | ||
181 | - display: flex; | ||
182 | - align-items: center; | ||
183 | - justify-content: space-between; | ||
184 | - border: 1px solid #ccc; | ||
185 | - padding: 0 10rpx; | ||
186 | - font-size: 30rpx; | ||
187 | - background:#eeeeee; | ||
188 | - height:50rpx; | ||
189 | - border-radius:6rpx; | ||
190 | -} | ||
191 | -.texts{ | ||
192 | - margin:0 auto; | ||
193 | - font-size: 25rpx; | ||
194 | - | ||
195 | -} | ||
196 | -/* 下拉内容 */ | ||
197 | -.select-box { | ||
198 | - background-color: #eeeeee; | ||
199 | - width:225rpx; | ||
200 | - position: relative; | ||
201 | - z-index:1; | ||
202 | - overflow: hidden; | ||
203 | - text-align: left; | ||
204 | - animation: myfirst 0.5s; | ||
205 | - font-size: 25rpx; | ||
206 | -} | ||
207 | -.select_one { | ||
208 | - padding-left: 20rpx; | ||
209 | - width: 100%; | ||
210 | - height: 60rpx; | ||
211 | - line-height: 60rpx; | ||
212 | -} | ||
213 | -/* 优惠券样式 */ | ||
214 | -.body{ | ||
215 | - text-align: center; | ||
216 | - padding: 20rpx; | ||
217 | - margin: 20rpx auto; | ||
218 | - width: 80%; | ||
219 | - max-width: 1000rpx; | ||
220 | - font-size: 28rpx; | ||
221 | - color: #333333; | ||
222 | - border-bottom: 2rpx solid #EEEEEE; | ||
223 | -} | ||
224 | - | ||
225 | -.b_iimg{ | ||
226 | - background-color: red; | ||
227 | - width: 400rpx; | ||
228 | - height: 400rpx; | ||
229 | -} | ||
230 | - | ||
231 | -.b_sz2{ | ||
232 | - font-size: 40rpx; | ||
233 | - color: #6fd137; | ||
234 | - margin: 20rpx 0; | ||
235 | - text-align: center; | ||
236 | -} | ||
237 | -/* 二维码列表查询 */ | ||
238 | -/* 列表数据*/ | ||
239 | -.data{ | ||
240 | - width: 80%; | ||
241 | - | ||
242 | - height:auto; | ||
243 | - margin-left:80rpx; | ||
244 | - | ||
245 | -} | ||
246 | -.rim{ | ||
247 | - position: relative; | ||
248 | - top:0rpx; | ||
249 | - left: 0rpx; | ||
250 | -} | ||
251 | -/* 二维码边框 */ | ||
252 | -.code_rim{ | ||
253 | - width: 100%; | ||
254 | - height: auto; | ||
255 | - text-align: center; | ||
256 | - font-size: 25rpx; | ||
257 | - padding-top: -30rpx; | ||
258 | - margin-top:-20rpx; | ||
259 | -padding-left:45rpx; | ||
260 | - | ||
261 | -} | ||
262 | - | ||
263 | -/* 二维码 */ | ||
264 | -.code{ | ||
265 | - height: 520rpx; | ||
266 | - display: flex; | ||
267 | - flex-direction: column; | ||
268 | - justify-content: flex-end; | ||
269 | - align-items: center; | ||
270 | - margin-left:40rpx; | ||
271 | - | ||
272 | -} | ||
273 | -.car-rim{ | ||
274 | -width:98%; | ||
275 | -height:177rpx; | ||
276 | -text-align:center; | ||
277 | -border-bottom:2rpx solid #eee; | ||
278 | -margin-left:22rpx; | ||
279 | - | ||
280 | -} | ||
281 | -/* 二维码值 */ | ||
282 | -.code_val{ | ||
283 | - margin-top:-104rpx; | ||
284 | -margin-left:-59rpx; | ||
285 | -color:#999999; | ||
286 | - | ||
287 | -} | ||
288 | -/* 金额 */ | ||
289 | -.moneys{ | ||
290 | - margin-top:20rpx; | ||
291 | - height: 47rpx; | ||
292 | - width: 100%; | ||
293 | - color:#6fd137; | ||
294 | - text-align: center; | ||
295 | - font-size: 38rpx; | ||
296 | - font-family: 'SimHei',Arial; | ||
297 | - margin-bottom:20rpx; | ||
298 | - margin-left:11rpx; | ||
299 | - | ||
300 | -} | ||
301 | -/* 文字 */ | ||
302 | -.text{ | ||
303 | - width: 100%; | ||
304 | - font-size: 25rpx; | ||
305 | - text-align: center; | ||
306 | - | ||
307 | - height: 41rpx; | ||
308 | - color: #999999; | ||
309 | -} | ||
310 | -/* 二维码和条形码的边框 */ | ||
311 | -.barqrcode{ | ||
312 | - width: 100%; | ||
313 | - height: auto; | ||
314 | - margin-top:50rpx; | ||
315 | - | ||
316 | -} | ||
317 | -/* 日期 */ | ||
318 | -.rq{ | ||
319 | - height: 25rpx; | ||
320 | - font-size: 28rpx; | ||
321 | - margin-top:12rpx; | ||
322 | - font-family:'SimHei',Arial; | ||
323 | -} | ||
324 | -/* 点击条形 */ | ||
325 | -.barcode { | ||
326 | - height: 320rpx; | ||
327 | - flex-direction: column; | ||
328 | - justify-content: center; | ||
329 | - align-items: center; | ||
330 | - margin-left: 30rpx; | ||
331 | -} | ||
332 | -/* 二维码边框*/ | ||
333 | -.qrcode_rim { | ||
334 | - width: 100%; | ||
335 | - height: 420rpx; | ||
336 | - display: flex; | ||
337 | - flex-direction: column; | ||
338 | - justify-content: flex-end; | ||
339 | - align-items: center; | ||
340 | - margin-left: 80rpx; | ||
341 | - margin-top:-210rpx; | ||
342 | - | ||
343 | -} | ||
344 | -.qrcode{ | ||
345 | - margin-left: 100rpx; | ||
346 | -} | ||
347 | -/* 使用说明 */ | ||
348 | -.textss{ | ||
349 | - width: 100%; | ||
350 | - font-size: 25rpx; | ||
351 | - text-align: center; | ||
352 | - | ||
353 | - min-height: 47rpx; | ||
354 | - height:auto; | ||
355 | - color: #999999; | ||
356 | -} | ||
357 | - |