Authored by 郭成尧

showSafeCheckDialog

... ... @@ -128,7 +128,7 @@
</li>
{{!-- 礼品卡 --}}
{{#ifand isOrdinaryCart giftCards}}
{{#if giftCards}}
<li class="gift-card">
<a href="{{choseGiftCard}}">
<span class="title">礼品卡</span>
... ... @@ -140,7 +140,7 @@
{{/giftCards}}
</a>
</li>
{{/ifand}}
{{/if}}
{{!-- 发票 --}}
{{#if invoice}}
... ...
... ... @@ -7,6 +7,7 @@
require('cart/order-ensure.page.css');
require('common.js');
const OrderEnsure = require('../cartbuynow/order-ensure');
let lazyLoad = require('yoho-jquery-lazyload'),
tip = require('plugin/tip'),
cookie = require('yoho-cookie');
... ... @@ -51,6 +52,8 @@ let actCkOpthn = {
path: '/cart/index'
};
const orderEnsure = new OrderEnsure(order);
lazyLoad();
// 初始化发票信息
... ... @@ -237,7 +240,7 @@ function orderCompute() {
});
}
function submitOrder() {
function submitOrder(verifyCode) {
let invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
msg = $('#msg').find('input').val() || orderInfo('msg');
... ... @@ -281,7 +284,8 @@ function submitOrder() {
paymentId: orderInfo('paymentTypeId'), // 支付方式id
paymentType: orderInfo('paymentType'), // 支付方式
useYohoCoin: orderInfo('yohoCoin'),
cartToken: $('#cart-token').val()
cartToken: $('#cart-token').val(),
verifyCode: verifyCode || null
}
}).then(function(res) {
let url;
... ... @@ -298,6 +302,10 @@ function submitOrder() {
}
cookie.set('order-info', '', actCkOpthn);
window.location.href = url;
} else if (res.code === 411) {
orderEnsure.showSafeCheckDialog({
message: res.message
}, submitOrder);
} else if (res.message) {
tip.show(res.message);
}
... ...