Authored by 毕凯

Merge branch 'hotfix/paybtn' into 'master'

pay-cancel



See merge request !880
... ... @@ -3,11 +3,11 @@
* @Author: Targaryen
* @Date: 2017-01-04 15:17:51
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-20 20:42:55
*/
'use strict';
const _ = require('lodash');
const mRoot = '../models';
const payModel = require(`${mRoot}/pay`);
const payTool = payModel.payTool;
... ... @@ -56,6 +56,12 @@ const payCenter = (req, res, next) => {
sessionKey: sessionKey
});
let attribute = _.parseInt(_.get(orderDetail, 'attribute'));
if (attribute === 9 || attribute === 11) {
return res.redirect('/home/orders');
}
/* 判断订单是否已付款, 已付款跳到订单详情页 */
if (orderDetail.payment_status === 'Y') {
logger.info(`payCenter: orderCode-${orderCode} already paied`);
... ... @@ -148,6 +154,15 @@ const pay = (req, res, next) => {
});
}
let attribute = _.parseInt(_.get(orderDetail, 'data.attribute'));
if (attribute === 9 || attribute === 11) {
return res.json({
code: 400,
message: '此订单只能通过 APP 支付'
});
}
if (orderDetail.data.is_cancel === 'Y') {
let url = helpers.urlFormat('/home/orders/detail', { order_code: orderCode });
... ...
... ... @@ -69,6 +69,7 @@ module.exports = class extends global.yoho.BaseModel {
orderBtn.push({
isAdvance: true
});
return { orderBtn: orderBtn };
}
/* 倒计时时间 订单详情页倒计时不在同一级*/
... ...