Authored by 郝肖肖

套餐 结算页修复

... ... @@ -118,7 +118,7 @@ exports.orderEnsure = (req, res, next) => {
exports.orderCompute = (req, res, next) => {
let cartType = req.body.cartType || 'ordinary';
let deliveryId = req.body.deliveryId || 1;
let paymentTypeId = req.body.paymentTypeId || 1;
let paymentType = req.body.paymentType || 1;
let couponCode = req.body.couponCode || null;
let yohoCoin = req.body.yohoCoin || null;
let productSku = req.body.productSku || null;
... ... @@ -131,11 +131,11 @@ exports.orderCompute = (req, res, next) => {
if (req.body.cartType === 'bundle') {
let activityInfo = JSON.parse(req.cookies['activity-info']);
cartModel.orderCompute(uid, cartType, deliveryId, paymentTypeId, couponCode, yohoCoin, null, activityInfo).then(result => {
cartModel.orderCompute(uid, cartType, deliveryId, paymentType, couponCode, yohoCoin, null, activityInfo).then(result => {
res.json(result);
}).catch(next);
} else {
cartModel.orderCompute(uid, cartType, deliveryId, paymentTypeId, couponCode, yohoCoin, skuList).then(result => {
cartModel.orderCompute(uid, cartType, deliveryId, paymentType, couponCode, yohoCoin, skuList).then(result => {
res.json(result);
}).catch(next);
}
... ... @@ -159,7 +159,7 @@ exports.orderSub = (req, res, next) => {
let paymentType = req.body.paymentType || 1;
let msg = req.body.msg || null;
let couponCode = req.body.couponCode || null;
let yohoCoin = req.body.yohoCoin || 1;
let yohoCoin = req.body.yohoCoin || 0;
let skuList = req.body.skuList || '';
let orderInfo;
... ... @@ -224,7 +224,7 @@ exports.orderSub = (req, res, next) => {
let result;
/* tar modified 161206 套餐 */
if (req.body.activityType === 'bundle') {
if (req.body.cartType === 'bundle') {
let activityInfo = JSON.parse(req.cookies['activity-info']);
result = yield cartModel.orderSub(uid, addressId, 'bundle', deliveryTimeId,
... ...
... ... @@ -12,8 +12,8 @@ const BAD_REQUEST = '非法请求';
const SLAT = 'yohobuyseckill98';
exports.ensure = (req, res, next) => {
const sku = Number.parseInt(req.query.sku, 10);
const skn = Number.parseInt(req.query.skn, 10);
const sku = parseInt(req.query.sku, 10);
const skn = parseInt(req.query.skn, 10);
const uid = req.user.uid;
let activityId;
... ... @@ -116,7 +116,7 @@ exports.ensure = (req, res, next) => {
exports.compute = (req, res, next) => {
const uid = req.user.uid,
sku = req.body.sku,
paymentType = Number.parseInt(req.body.paymentType || 1, 10),
paymentType = parseInt(req.body.paymentType || 1, 10),
activityId = req.body.activityId;
if (!req.xhr) {
... ... @@ -155,10 +155,10 @@ exports.submit = (req, res, next) => {
const uid = req.user.uid,
sku = req.body.sku,
activityId = req.body.activityId,
deliveryTime = Number.parseInt(req.body.deliveryTime, 10),
deliveryWay = Number.parseInt(req.body.deliveryWay, 10),
paymentId = Number.parseInt(req.body.paymentId, 10),
paymentType = Number.parseInt(req.body.paymentType, 10),
deliveryTime = parseInt(req.body.deliveryTime, 10),
deliveryWay = parseInt(req.body.deliveryWay, 10),
paymentId = parseInt(req.body.paymentId, 10),
paymentType = parseInt(req.body.paymentType, 10),
token = req.body.cartToken;
let addressId = req.body.addressId || '';
... ... @@ -176,7 +176,7 @@ exports.submit = (req, res, next) => {
if (!addressId) {
return res.json({code: 400, message: '请选择地址'});
} else {
addressId = Number.parseInt(crypto.decrypt(null, req.body.addressId), 10);
addressId = parseInt(crypto.decrypt(null, req.body.addressId), 10);
}
if ([uid, sku, activityId, addressId, deliveryTime,
... ... @@ -193,7 +193,7 @@ exports.submit = (req, res, next) => {
buy_number: 1,
invoices_title: req.body.invoicesTitle || '',
invoices_type_id: req.body.invoicesTypeId || '',
use_yoho_coin: Number.parseFloat(req.body.useYohoCoin) || 0,
use_yoho_coin: parseFloat(req.body.useYohoCoin) || 0,
remark: req.body.remark || '',
address_id: addressId,
... ...
... ... @@ -71,7 +71,7 @@ exports.cartPay = (uid, cartType, orderInfo, limitProductCode, sku, skn, buyNumb
orderInfo.deliveryId,
orderInfo.paymentType,
orderInfo.couponCode,
orderInfo.yohoCoin, skuList
orderInfo.yohoCoin, skuList, activityInfo
);
}
... ...
... ... @@ -58,8 +58,6 @@ function invoiceInit() {
$('.invoice-type').text(invoiceCont[orderCont.invoiceType] + '(' + invoicesType[orderCont.invoicesType] + ')');
} else {
$('.invoice-type').text('服装(电子)');
// $('.invoice-type').text('服装(纸质)');
}
}
... ... @@ -191,7 +189,7 @@ function orderCompute() {
data = {
cartType: orderInfo('cartType') || 'ordinary',
deliveryId: orderInfo('deliveryId'),
paymentTypeId: orderInfo('paymentTypeId'),
paymentType: orderInfo('paymentType'),
couponCode: orderInfo('couponCode'),
yohoCoin: yohoCoin,
skuList: isLimitGood() ? orderInfo('skuList') : undefined
... ... @@ -294,7 +292,6 @@ function submitOrder() {
couponCode: orderInfo('couponCode'),
yohoCoin: orderInfo('yohoCoin'),
skuList: isLimitGood() ? orderInfo('skuList') : undefined
}
}).then(function(res) {
var url;
... ... @@ -358,7 +355,10 @@ $('.delivery-id').on('touchend', 'li', function() {
});
$('.payment-type').on('touchend', 'li', function() {
orderInfo('paymentType', $('.icon-cb-radio', this).data('id'));
var $paymentType = $('.icon-cb-radio', this);
orderInfo('paymentTypeId', $paymentType.data('id')); // 支付方式id
orderInfo('paymentType', $paymentType.data('payment-type')); // 支付方式
});
$('.dispatch-time').on('touchend', 'li', function() {
... ... @@ -418,14 +418,6 @@ $('#msg').find('textarea').on('blur', function() {
orderInfo('msg', $(this).val());
});
$('.pay-mode').on('click', 'li', function() {
var $this = $(this);
orderInfo('paymentTypeId', $this.data('pay-id'));
orderInfo('paymentType', $this.data('pay-type'));
payType = $this.data('pay-type');
});
$('form').on('submit', function() {
return false;
});
... ... @@ -478,15 +470,18 @@ $subBlock.on('touchstart', 'li', function() {
$('.bill a').on('touchstart', function() {
var $paymentType;
if (isTickets) {
ticketsConfirm(); // eslint-disable-line
return;
}
orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id'));
orderInfo('paymentType', $('.payment-type .icon-cb-radio').data('id'));
payType = $('.payment-type .icon-cb-radio').data('id');
$paymentType = $('.payment-type .icon-cb-radio');
orderInfo('paymentTypeId', $paymentType.data('id')); // 支付方式id
orderInfo('paymentType', $paymentType.data('payment-type')); // 支付方式
payType = $paymentType.data('payment-type');
submitOrder();
});
... ...