Authored by 郭成尧

'gulpge'

... ... @@ -13187,6 +13187,7 @@ var $ = require("jquery");
var loading = require("js/plugin/loading"),
tip = require("js/plugin/tip"),
richTip = require("js/plugin/rich-tip"),
Hammer = require("hammer");
// 点击微信显示加载
var $loadingToast = $(".loading-toast");
... ... @@ -13202,6 +13203,24 @@ var appIconPosition = {
bank: '-4rem'
};
$('.nav-back').on('touchend', function() {
richTip.show(
['超过支付失效后订单会被取消,', '请尽快到我的订单完成支付哦!'],
[
{
href: '/cart/index/index',
text: '确认离开',
class: ''
},
{
href: '',
text: '继续支付',
class: 'order-tip-btnred'
}
]
);
});
// 隐藏微信分享选项
if (window.wx) {
wx.hideOptionMenu();
... ... @@ -13367,6 +13386,92 @@ loading.showLoadingMask();
$(document).ready(main);
});
define("js/plugin/rich-tip", ["jquery"], function(require, exports, module){
/**
* Created by yoho on 2016/11/22.
*/
var $ = require("jquery");
var $tip = $('#yoho-order-bg'),
$tipMsg = $tip.find('.order-tip-msg'),
$tipBtns = $tip.find('.order-tip-btn-group');
var touchCallback,
params;
function setCallback(t, p) {
touchCallback = t;
params = p;
}
/**
* 跳转还是消失控制
*/
(function() {
$tip.on('touchend', function(event) {
if ('SPAN' !== event.target.tagName) {
$tip.hide();
} else {
if (touchCallback) {
touchCallback(params);
}
setTimeout(function() {
$tip.hide();
}, 5);
}
});
}());
/**
* 显示提示
*/
function show(con, btn) {
var content = '',
buttons = '';
if (con && $.isArray(con)) {
$.each(con, function(key, value) {
content += '<p>' + value + '</p>';
});
}
if (btn && $.isArray(btn) && btn.length === 1) {
if (!btn[0].href) {
buttons += '<a class="order-tip-btn1 ' + btn[0].class
+ '"><span>' + btn[0].text
+ '</span></a>';
} else {
buttons += '<a href="' + btn[0].href
+ '" class="order-tip-btn1 ' + btn[0].class
+ '"><span>' + btn[0].text
+ '</span></a>';
}
}
if (btn && $.isArray(btn) && btn.length > 1) {
$.each(btn, function(key, value) {
if (!value.href) {
buttons += '<a class="' + value.class
+ '"><span>' + value.text
+ '</span></a>';
} else {
buttons += '<a href="' + value.href
+ '" class="' + value.class
+ '"><span>' + value.text
+ '</span></a>';
}
});
}
$tipMsg.html(content);
$tipBtns.html(buttons);
$tip.show();
}
exports.setCallback = setCallback;
exports.show = show;
});
define("js/me/personal-details", ["jquery"], function(require, exports, module){
/**
* 个人信息
... ... @@ -14341,7 +14446,8 @@ var $ = require("jquery"),
lazyLoad = require("lazyload"),
tip = require("js/plugin/tip"),
loading = require("js/plugin/loading"),
order = require("js/cart/order-info");
order = require("js/cart/order-info"),
richTip = require("js/plugin/rich-tip");
var $invoice = $('.invoice'),
$couponUse = $('.coupon-use.used'),
... ... @@ -14579,7 +14685,11 @@ function orderCompute() {
});
}
function submitOrder() {
/**
* submit order
* @param times
*/
function submitOrder(times) {
var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
msg = $('#msg').find('input').val() || orderInfo('msg');
... ... @@ -14622,8 +14732,8 @@ function submitOrder() {
paymentType: orderInfo('paymentType'), //支付方式
couponCode: orderInfo('couponCode'),
yohoCoin: orderInfo('yohoCoin'),
skuList: isLimitGood() ? orderInfo('skuList') : undefined
skuList: isLimitGood() ? orderInfo('skuList') : undefined,
times: times || 1
}
}).then(function(res) {
var url;
... ... @@ -14658,6 +14768,8 @@ function submitOrder() {
window.setCookie('order-info', '');
window.location.href = url;
} else if (res.code === 409) {
richTip.show(res.message, res.buttons);
} else if (res.message) {
tip.show(res.message);
}
... ... @@ -14798,7 +14910,9 @@ $subBlock.on('touchstart', 'li', function() {
}
});
/**
* submit order first
*/
$('.bill a').on('touchstart', function() {
if (isTickets) {
ticketsConfirm();
... ... @@ -14809,7 +14923,8 @@ $('.bill a').on('touchstart', function() {
orderInfo('paymentType', $('.payment-type .icon-cb-radio').data('id'));
payType = $('.payment-type .icon-cb-radio').data('id');
submitOrder();
submitOrder(1);
richTip.setCallback(submitOrder, 2);
});
function phoneHidden(phone) {
... ... @@ -14867,7 +14982,8 @@ $ticketsMobile.blur(function function_name (e) {
if (!reg.test(mobile)) {
tip.show('手机号码不正确!');
}
})
});
// 初始化发票信息内容
invoiceInit();
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.