Authored by 郭成尧

Merge branch 'release/5.1' of git.yoho.cn:fe/yohobuywap-node into release/5.1

... ... @@ -83,7 +83,7 @@ exports.compute = (req, res, next) => {
uid: req.user.uid,
product_sku: sku,
delivery_way: req.body.deliveryId || 1,
use_yoho_coin: req.body.use_yoho_coin || 0,
use_yoho_coin: req.body.yohoCoin || 0,
activity_id: activityId
};
... ... @@ -134,7 +134,10 @@ exports.submit = (req, res, next) => {
delivery_time: deliveryTime,
delivery_way: deliveryWay,
payment_id: paymentId,
payment_type: paymentType
payment_type: paymentType,
product_sku: sku,
activity_id: activityId,
uid
};
return buyNowModel.submit(options)
... ...
... ... @@ -114,19 +114,20 @@ const index = (req, res, next) => {
if (result.activitys.length && result.activitys.findIndex(activity => activity.focus) < 0) {
let i = result.activitys.length;
// focus 最后一个 over 的活动
do {
i = i - 1;
let isOver = result.activitys[i].over;
// 没有focus的活动,则focus 最后一个 over 的活动
while (i) {
let activity = result.activitys[i - 1];
if (isOver) {
result.activitys[i].focus = true;
if (activity.over) {
activity.focus = true;
break;
}
} while (i >= 0);
i = i - 1;
}
// 没有over,全部都是未开抢,则focus第一个
if (i < 0) {
if (!i) {
result.activitys[0].focus = true;
}
}
... ...
... ... @@ -130,7 +130,7 @@ function tranformPayment(data, orderInfo) {
// 有货币
result.yohoCoin = data.yoho_coin;
result.useYohoCoin = Boolean(data.use_yoho_coin);
result.useYohoCoin = data.use_yoho_coin;
// 发票
if (data.invoices) {
... ...