...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
* @Author: Targaryen
|
|
|
* @Date: 2017-06-21 10:30:21
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2017-06-23 11:23:09
|
|
|
* @Last Modified time: 2017-06-23 15:28:40
|
|
|
*/
|
|
|
require('buynow/order-ensure.page.css');
|
|
|
const $ = require('yoho-jquery');
|
...
|
...
|
@@ -145,25 +145,22 @@ $('.checkbox').on('touchstart', function(e) { |
|
|
}
|
|
|
});
|
|
|
|
|
|
$invoice.on('touchend', '.checkbox', function() {
|
|
|
$invoice.on('touchend', '.checkbox', function(e) {
|
|
|
let $this = $(this);
|
|
|
|
|
|
orderInfo('invoice', $this.hasClass('icon-cb-radio'));
|
|
|
if ($this.hasClass('icon-cb-radio')) {
|
|
|
$invoice.addClass('focus');
|
|
|
orderInfo('invoices_title', '');
|
|
|
orderInfo('invoices_type_id', '7');
|
|
|
orderInfo('receiverMobile', $('.user-mobile').val());
|
|
|
orderInfo('invoicesType', '2');
|
|
|
orderInfo('invoiceTitle', '个人');
|
|
|
}
|
|
|
if ($this.hasClass('icon-radio')) {
|
|
|
$invoice.removeClass('focus');
|
|
|
orderInfo('invoices_title', null);
|
|
|
orderInfo('invoices_type_id', null);
|
|
|
orderInfo('invoices_type', null);
|
|
|
orderInfo('receiverMobile', null);
|
|
|
orderInfo('invoicesType', null);
|
|
|
orderInfo('invoiceTitle', null);
|
|
|
orderInfo('buyerTaxNumber', null);
|
|
|
}
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
@@ -241,8 +238,7 @@ function orderCompute() { |
|
|
}
|
|
|
|
|
|
function submitOrder() {
|
|
|
let invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoices_title'),
|
|
|
msg = $('#msg').find('input').val() || orderInfo('msg');
|
|
|
let msg = $('#msg').find('input').val() || orderInfo('msg');
|
|
|
|
|
|
if (isSubmiting) {
|
|
|
return false;
|
...
|
...
|
@@ -256,26 +252,34 @@ function submitOrder() { |
|
|
}
|
|
|
loading.showLoadingMask();
|
|
|
isSubmiting = true;
|
|
|
|
|
|
let postData = {
|
|
|
product_sku: qs.product_sku,
|
|
|
address_id: orderInfo('address_id'),
|
|
|
delivery_way: orderInfo('delivery_way'),
|
|
|
delivery_time: orderInfo('delivery_time'),
|
|
|
msg: msg,
|
|
|
is_print_price: orderInfo('is_print_price'),
|
|
|
payment_id: orderInfo('payment_id'),
|
|
|
payment_type: orderInfo('payment_type'), // 支付方式
|
|
|
coupon_code: orderInfo('coupon_code'),
|
|
|
use_yoho_coin: orderInfo('use_yoho_coin')
|
|
|
};
|
|
|
|
|
|
if (orderInfo('invoice')) {
|
|
|
Object.assign(postData, {
|
|
|
invoice: orderInfo('invoice'),
|
|
|
invoices_title: orderInfo('invoices_title'), // 发票抬头
|
|
|
invoices_type: orderInfo('invoices_type'), // 发票类型 1 纸质 2 电子
|
|
|
receiverMobile: orderInfo('receiverMobile'), // 接收人电话
|
|
|
buyerTaxNumber: orderInfo('buyerTaxNumber') // 购买方纳税人识别号,需要开具
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/cart/index/buynow/ordersub',
|
|
|
data: {
|
|
|
product_sku: qs.product_sku,
|
|
|
address_id: orderInfo('address_id'),
|
|
|
delivery_way: orderInfo('delivery_way'),
|
|
|
delivery_time: orderInfo('delivery_time'),
|
|
|
invoice: orderInfo('invoice') || null,
|
|
|
invoices_title: orderInfo('invoice') ? invoiceText : null,
|
|
|
invoices_type_id: orderInfo('invoice') ? ($invoice.find('.invoice-type').val() ||
|
|
|
orderInfo('invoices_type_id')) : null,
|
|
|
receiverMobile: orderInfo('receiverMobile') || null,
|
|
|
msg: msg,
|
|
|
is_print_price: orderInfo('is_print_price'),
|
|
|
payment_id: orderInfo('payment_id'),
|
|
|
payment_type: orderInfo('payment_type'), // 支付方式
|
|
|
coupon_code: orderInfo('coupon_code'),
|
|
|
use_yoho_coin: orderInfo('use_yoho_coin')
|
|
|
}
|
|
|
data: postData
|
|
|
}).then(function(res) {
|
|
|
let url;
|
|
|
|
...
|
...
|
@@ -314,7 +318,7 @@ function submitOrder() { |
|
|
}, []]);
|
|
|
}
|
|
|
|
|
|
cookie.remove(['order-info', 'activity-info']);
|
|
|
cookie.remove(['buynow_info']);
|
|
|
window.location.href = url;
|
|
|
} else if (res.code === 409) {
|
|
|
richTip.show(res.message, res.buttons);
|
...
|
...
|
@@ -390,14 +394,6 @@ $('.coin').on('touchend', function(e) { |
|
|
orderCompute();
|
|
|
});
|
|
|
|
|
|
$invoice.on('touchend', '.checkbox', function(e) {
|
|
|
let $this = $(this);
|
|
|
|
|
|
orderInfo('invoice', $this.hasClass('icon-cb-radio'));
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 是否打印价格
|
|
|
*/
|
...
|
...
|
|