Authored by 陈轩

秒杀简单错误提示

... ... @@ -5,6 +5,7 @@
const co = require('bluebird').coroutine;
const seckillModel = require('../models/seckill');
const buyNowModel = require('../models/buynow');
const headerModel = require('../../../doraemon/models/header'); // 头部model
const BAD_REQUEST = '非法请求';
... ... @@ -61,10 +62,13 @@ exports.ensure = (req, res, next) => {
}, paymentInfo.data);
}
// console.log(view);
res.locals.title = '确认订单';
res.render('order-ensure', view);
res.render('order-ensure', Object.assign({
pageHeader: headerModel.setNav({
navTitle: '确认订单'
})
}, view));
})().catch(next);
};
... ...
... ... @@ -194,6 +194,8 @@
<input type="hidden" id="activity-id" name="activity-id" value="{{activityId}}">
{{/with}}
{{else}}
<div class="order-ensure-error">
{{message}}
</div>
{{/if}}
</div>
... ...
... ... @@ -88,7 +88,11 @@ const index = (req, res, next) => {
resultActivity.data.secKillProductVoList.length
)
) {
return res.send('来晚啦~秒杀已结束_(:з」∠)_');
return res.render('seckill', {
title: '秒杀活动',
pageHeader: headerData,
error: '来晚啦~秒杀已结束_(:з」∠)_'
});
}
result.activitys = resultActivity.data.secKillProductVoList.sort((a, b) => a.startTime > b.startTime);
... ...
<div class="seckill-list yoho-page">
{{> seckill/nav}}
<div class="product-list">
{{# products}}
{{> seckill/product}}
{{/products}}
</div>
{{#unless error}}
{{> seckill/nav}}
<div class="product-list">
{{# products}}
{{> seckill/product}}
{{/products}}
</div>
{{else}}
<div class="seckill-error">{{error}}</div>
{{/unless}}
<section class="tips">
<h5>秒杀活动说明</h5>
<ol>
... ...
.order-ensure-page {
background: #f0f0f0;
.order-ensure-error {
margin-top: 100px;
text-align: center;
background-color: #fff;
}
.block {
background: #fff;
margin: 20px 0;
... ...
... ... @@ -15,4 +15,9 @@
list-style: decimal inside;
}
}
}
.seckill-error {
text-align: center;
margin-top: 150px;
}
\ No newline at end of file
... ...