Authored by htoooth

fix

... ... @@ -12,36 +12,13 @@ const helpers = global.yoho.helpers;
exports.QRcode = (req, res, next) => {
let id = req.query.orderCode || 0;
let bg = {
'16-1': '//img13.static.yhbimg.com/yhb-img02/2016/08/04/14/02004edaf02b52363c27cea0e2cbbe9b59.jpg',
'17-1': '//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/023d0470ffc2b0efe89bfdd1c6b73ab894.jpg',
'16-2': '//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/02fcb3d6cdd6be244c836c520a0d034fed.jpg',
'17-2': '//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/02ed77b564211c3246ab7be81794ed17cd.jpg'
};
let bgkey = '16-1', ticktypeName = '展览票';
QRcodeModel.getQRcodeData(id, req.user.uid).then((result)=>{
if (result) {
result.ticks = result.ticks.map(item=>{
if (+item.ticket_type === 2) {
item.isgroup = true;
}
return item;
});
if (result.ticks.length) {
bgkey = [/月(\d+)/g.exec(result.ticks[0].entrance_time)[1], result.ticks[0].ticket_type].join('-');
ticktypeName = result.ticks[0].ticket_type === '2' ? '套票' : '展览票';
}
}
let vm = {
path: [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'},
{name: '个人中心'}, {name: '订单中心'}, {name: '查看二维码'}],
qrcodeData: result,
code: id,
bgsrc: bg[bgkey],
ticktypeName: ticktypeName,
ticktypeName: result.title,
returnOrder: helpers.urlFormat('/home/orders')
};
... ...
... ... @@ -6,7 +6,7 @@
<h2 class="title">
</h2>
<div class='subtitle'>
<h2>虚拟商品 <span class='pad20'>2017 YO'HOOD</span> {{ticktypeName}} <i id="qrid"></i></h2>
<h2>虚拟商品 <span class='pad20'>{{ticktypeName}}</span><i id="qrid"></i></h2>
<a class='r-go' href="{{returnOrder}}">返回我的订单</a>
</div>
{{#qrcodeData}}
... ... @@ -27,9 +27,6 @@
<div class='center'>
<img src='{{image2 qr_image}}'>
<p class='bianhao'><label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</label><i>{{ticket_code}}</i></p>
{{#if isgroup}}
<p class='zuoweihao'><label>&nbsp;&nbsp;&nbsp;&nbsp;号:</label>{{seat_no}}</p>
{{/if}}
<p><label>进场时间:</label>{{entrance_time}}</p>
</div>
</li>
... ...