Authored by 郝肖肖

Merge branch 'feature/orderEnsurefreight' into release/5.4.1

... ... @@ -15,6 +15,7 @@ var $ = require('yoho-jquery'),
var isGetData;
var $newCoupon = $('#new-coupon'),
linkUrl = document.referrer,
$couponList = $('#coupon-list');
var winH = $(window).height();
... ... @@ -37,6 +38,14 @@ function fixedLayOut() {
ellipsis.init();
function goToBack() {
if (linkUrl) {
window.location.href = linkUrl;
} else {
history.go(-1);
}
}
$newCoupon.on('submit', function() {
var $this = $(this);
... ... @@ -59,7 +68,7 @@ $newCoupon.on('submit', function() {
orderInfo('yohoCoin', 0);
orderInfo('couponCode', res.data.coupon_code);
orderInfo('couponName', res.data.coupon_title);
history.go(-1);
goToBack();
}
}).fail(function() {
tip.show('网络错误');
... ... @@ -85,7 +94,7 @@ $('body').on('touchend', '.not-use', function() {
// 实付金额发生变化,使用有货币为0
orderInfo('yohoCoin', 0);
history.go(-1);
goToBack();
});
... ... @@ -142,7 +151,7 @@ function getCouponHandle(allCoupons) {
// 实付金额发生变化,使用有货币为0
orderInfo('yohoCoin', 0);
history.go(-1);
goToBack();
} else if (res.message) {
tip.show(res.message);
}
... ...
... ... @@ -18,6 +18,7 @@ var $invoiceNotice = $('.invoice-notice'),
$company = $('.company'),
$telArea = $('.tel-area'),
orderInfo = order.orderInfo,
linkUrl = document.referrer,
$chooseContLi = $('.invoice-cont').find('.icon-cb-radio').parent(),
$copyTel = $('.copy-tel'),
isModifyTel = false;
... ... @@ -33,6 +34,14 @@ if (window.getUid() !== orderInfo('uid')) {
window.location.reload();
}
function goToBack() {
if (linkUrl) {
window.location.href = linkUrl;
} else {
history.go(-1);
}
}
// 单选效果
function chooseAction(pDom, dom) {
if (dom.hasClass('icon-cb-radio')) {
... ... @@ -92,13 +101,13 @@ function confirmAction() {
autoHide: true,
fast: true
});
history.go(-1);
goToBack();
}, function() {
history.go(-1);
goToBack();
});
}
} else {
history.go(-1);
goToBack();
}
}
... ...