Authored by 李靖

限流提示

... ... @@ -77,6 +77,7 @@ exports.ensure = (req, res, next) => {
paymentOption.activity_id = activityId = skillData.activityId;
let orderComputerData;
let limitMessage;
if (orderInfo) {
orderComputerData = yield req.ctx(seckillModel).compute(_.assign(paymentOption, {
... ... @@ -85,6 +86,10 @@ exports.ensure = (req, res, next) => {
use_yoho_coin: orderInfo.yohoCoin || 0,
gift_card_code: orderInfo.gift_card_code || null
}));
if (orderComputerData.code === 9999992) {
limitMessage = '人太多啦,请稍后再试!';
}
}
let [userProfile, address, paymentInfo, validGiftCardCountData] = yield Promise.all([
... ... @@ -134,6 +139,7 @@ exports.ensure = (req, res, next) => {
}
res.locals.title = '确认订单';
view.limitMessage = limitMessage;
res.render('order-ensure', Object.assign({
module: 'cart',
page: 'seckill',
... ...
<div class="order-ensure-page yoho-page">
{{#if limitMessage}}
<div class="order-ensure-error">
{{limitMessage}}
</div>
{{else}}
<input id="cart-token" type="hidden" name="token" value="{{cartToken}}">
{{# orderEnsure}}
{{#if addressInfo}}
... ... @@ -227,5 +232,6 @@
{{message}}
</div>
{{/ orderEnsure}}
{{/if}}
</div>
{{> rich_tip}}
... ...