Authored by htoooth

fix

@@ -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
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <h2 class="title"> 6 <h2 class="title">
7 </h2> 7 </h2>
8 <div class='subtitle'> 8 <div class='subtitle'>
9 - <h2>虚拟商品 <span class='pad20'>2017 YO'HOOD</span> {{ticktypeName}} <i id="qrid"></i></h2> 9 + <h2>虚拟商品 <span class='pad20'>{{ticktypeName}}</span><i id="qrid"></i></h2>
10 <a class='r-go' href="{{returnOrder}}">返回我的订单</a> 10 <a class='r-go' href="{{returnOrder}}">返回我的订单</a>
11 </div> 11 </div>
12 {{#qrcodeData}} 12 {{#qrcodeData}}
@@ -27,9 +27,6 @@ @@ -27,9 +27,6 @@
27 <div class='center'> 27 <div class='center'>
28 <img src='{{image2 qr_image}}'> 28 <img src='{{image2 qr_image}}'>
29 <p class='bianhao'><label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</label><i>{{ticket_code}}</i></p> 29 <p class='bianhao'><label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</label><i>{{ticket_code}}</i></p>
30 - {{#if isgroup}}  
31 - <p class='zuoweihao'><label>&nbsp;&nbsp;&nbsp;&nbsp;号:</label>{{seat_no}}</p>  
32 - {{/if}}  
33 <p><label>进场时间:</label>{{entrance_time}}</p> 30 <p><label>进场时间:</label>{{entrance_time}}</p>
34 </div> 31 </div>
35 </li> 32 </li>