...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
let $ = require('yoho-jquery'),
|
|
|
cookie = require('yoho-cookie'),
|
|
|
tip = require('plugin/tip'),
|
|
|
loading = require('plugin/loading'),
|
|
|
dialog = require('plugin/dialog');
|
|
|
|
|
|
let cartObj = {
|
...
|
...
|
@@ -154,16 +155,39 @@ let cartObj = { |
|
|
self.toOrderEnsure(cartType);
|
|
|
},
|
|
|
toOrderEnsure(cartType) {
|
|
|
if (this.isEnsure) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
this.isEnsure = true;
|
|
|
loading.showLoading();
|
|
|
|
|
|
cookie.get('_realyGift') && cookie.remove('_realyGift');
|
|
|
cookie.get('order-info') && cookie.remove('order-info');
|
|
|
|
|
|
$.get('/cart/index/new/orderEnsure', {cartType: cartType}, function(result) {
|
|
|
if (result.error) {
|
|
|
tip.show(result.message);
|
|
|
return false;
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: 'get',
|
|
|
url: '/cart/index/new/orderEnsure',
|
|
|
timeout: 10000, // 10s overtime
|
|
|
data: {
|
|
|
cartType: cartType
|
|
|
},
|
|
|
success: (result) => {
|
|
|
this.isEnsure = false;
|
|
|
loading.hideLoading();
|
|
|
|
|
|
if (result.error) {
|
|
|
tip.show(result.message);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
window.location.href = '/cart/index/new/orderEnsure?cartType=' + cartType;
|
|
|
window.location.href = '/cart/index/new/orderEnsure?cartType=' + cartType;
|
|
|
},
|
|
|
error: () => {
|
|
|
this.isEnsure = false;
|
|
|
loading.hideLoading();
|
|
|
tip.show('网络出现了问题,请稍后再试...');
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
toOrderEnsureGift() {
|
...
|
...
|
|