|
@@ -12,36 +12,13 @@ const helpers = global.yoho.helpers; |
|
@@ -12,36 +12,13 @@ const helpers = global.yoho.helpers; |
12
|
exports.QRcode = (req, res, next) => {
|
12
|
exports.QRcode = (req, res, next) => {
|
13
|
let id = req.query.orderCode || 0;
|
13
|
let id = req.query.orderCode || 0;
|
14
|
|
14
|
|
15
|
- let bg = {
|
|
|
16
|
- '16-1': '//img13.static.yhbimg.com/yhb-img02/2016/08/04/14/02004edaf02b52363c27cea0e2cbbe9b59.jpg',
|
|
|
17
|
- '17-1': '//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/023d0470ffc2b0efe89bfdd1c6b73ab894.jpg',
|
|
|
18
|
- '16-2': '//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/02fcb3d6cdd6be244c836c520a0d034fed.jpg',
|
|
|
19
|
- '17-2': '//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/02ed77b564211c3246ab7be81794ed17cd.jpg'
|
|
|
20
|
- };
|
|
|
21
|
-
|
|
|
22
|
- let bgkey = '16-1', ticktypeName = '展览票';
|
|
|
23
|
-
|
|
|
24
|
QRcodeModel.getQRcodeData(id, req.user.uid).then((result)=>{
|
15
|
QRcodeModel.getQRcodeData(id, req.user.uid).then((result)=>{
|
25
|
- if (result) {
|
|
|
26
|
- result.ticks = result.ticks.map(item=>{
|
|
|
27
|
- if (+item.ticket_type === 2) {
|
|
|
28
|
- item.isgroup = true;
|
|
|
29
|
- }
|
|
|
30
|
- return item;
|
|
|
31
|
- });
|
|
|
32
|
- if (result.ticks.length) {
|
|
|
33
|
- bgkey = [/月(\d+)/g.exec(result.ticks[0].entrance_time)[1], result.ticks[0].ticket_type].join('-');
|
|
|
34
|
- ticktypeName = result.ticks[0].ticket_type === '2' ? '套票' : '展览票';
|
|
|
35
|
- }
|
|
|
36
|
- }
|
|
|
37
|
-
|
|
|
38
|
let vm = {
|
16
|
let vm = {
|
39
|
path: [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'},
|
17
|
path: [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'},
|
40
|
{name: '个人中心'}, {name: '订单中心'}, {name: '查看二维码'}],
|
18
|
{name: '个人中心'}, {name: '订单中心'}, {name: '查看二维码'}],
|
41
|
qrcodeData: result,
|
19
|
qrcodeData: result,
|
42
|
code: id,
|
20
|
code: id,
|
43
|
- bgsrc: bg[bgkey],
|
|
|
44
|
- ticktypeName: ticktypeName,
|
21
|
+ ticktypeName: result.title,
|
45
|
returnOrder: helpers.urlFormat('/home/orders')
|
22
|
returnOrder: helpers.urlFormat('/home/orders')
|
46
|
};
|
23
|
};
|
47
|
|
24
|
|