...
|
...
|
@@ -112,11 +112,15 @@ function getShoppingKey() { |
|
|
|
|
|
//根据页面内容重新设置通用底部的显示
|
|
|
function rePosFooter() {
|
|
|
var winH;
|
|
|
|
|
|
if ($footer.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if ($('body').height() <= $(window).height() - parseInt($footer.css('height'), 0)) {
|
|
|
winH = Math.min($(window).height(), window.screen.availHeight);
|
|
|
|
|
|
if ($('body').height() <= winH - parseInt($footer.css('height'), 0)) {
|
|
|
$footer.addClass('bottom');
|
|
|
} else {
|
|
|
$footer.removeClass('bottom');
|
...
|
...
|
@@ -488,10 +492,10 @@ function searchResult() { |
|
|
|
|
|
brandHtml.push('<p><a href="' + brand.url + '">' + brand.name);
|
|
|
if (brand.isNew) {
|
|
|
brandHtml.push('<i class="icon-hot">HOT</i>');
|
|
|
brandHtml.push('<i class="icon-new">NEW</i>');
|
|
|
}
|
|
|
if (brand.isHot) {
|
|
|
brandHtml.push('<i class="icon-new">NEW</i>');
|
|
|
brandHtml.push('<i class="icon-hot">HOT</i>');
|
|
|
}
|
|
|
brandHtml.push('</a></p>');
|
|
|
});
|
...
|
...
|
@@ -1980,6 +1984,8 @@ chHammer.on('tap', function() { |
|
|
localStorage.removeItem('historys');
|
|
|
|
|
|
$history.html('');
|
|
|
|
|
|
window.rePosFooter();
|
|
|
});
|
|
|
|
|
|
$input.on('input', function() {
|
...
|
...
|
@@ -2027,6 +2033,8 @@ $('#search').on('touchend', function() { |
|
|
|
|
|
$history.html(html);
|
|
|
$clearHistory.removeClass('hide');
|
|
|
|
|
|
window.rePosFooter();
|
|
|
}
|
|
|
}
|
|
|
}());
|
...
|
...
|
@@ -2794,6 +2802,8 @@ $loginBtn.on('touchstart', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
$loginBtn.text('正在登录...').addClass('disable');
|
|
|
|
|
|
//验证账号(数字或者邮箱)和密码合理性
|
|
|
if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) {
|
|
|
$.ajax({
|
...
|
...
|
@@ -2804,28 +2814,40 @@ $loginBtn.on('touchstart', function() { |
|
|
password: pwd
|
|
|
},
|
|
|
success: function(data) {
|
|
|
var res;
|
|
|
var res,
|
|
|
time;
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
res = data.data;
|
|
|
|
|
|
showErrTip('登录成功');
|
|
|
|
|
|
$.ajax({
|
|
|
url: res.session,
|
|
|
dataType: 'jsonp'
|
|
|
dataType: 'jsonp',
|
|
|
success: function() {
|
|
|
clearTimeout(time);
|
|
|
|
|
|
//Cookie写入成功后,1s后跳转页面
|
|
|
setTimeout(function() {
|
|
|
location.href = res.href;
|
|
|
}, 1000);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//2s后跳转页面
|
|
|
setTimeout(function() {
|
|
|
//3秒后强制跳转
|
|
|
time = setTimeout(function() {
|
|
|
location.href = res.href;
|
|
|
}, 2000);
|
|
|
}, 3000);
|
|
|
|
|
|
showErrTip('登录成功');
|
|
|
} else {
|
|
|
showErrTip(data.message);
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
showErrTip('网络断开连接啦~');
|
|
|
},
|
|
|
complete: function() {
|
|
|
$loginBtn.text('登录').removeClass('disable');
|
|
|
}
|
|
|
});
|
|
|
} else {
|
...
|
...
|
@@ -2927,6 +2949,8 @@ $loginBtn.on('touchstart', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
$loginBtn.text('正在登录...').addClass('disable');
|
|
|
|
|
|
if (api.phoneRegx[areaCode].test(pn) && api.pwdValidate(pwd)) {
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
...
|
...
|
@@ -2937,7 +2961,8 @@ $loginBtn.on('touchstart', function() { |
|
|
password: pwd
|
|
|
},
|
|
|
success: function(data) {
|
|
|
var res;
|
|
|
var res,
|
|
|
time;
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
res = data.data;
|
...
|
...
|
@@ -2945,19 +2970,32 @@ $loginBtn.on('touchstart', function() { |
|
|
|
|
|
$.ajax({
|
|
|
url: res.session,
|
|
|
dataType: 'jsonp'
|
|
|
dataType: 'jsonp',
|
|
|
success: function() {
|
|
|
clearTimeout(time);
|
|
|
|
|
|
//Cookie写入成功后,1s后跳转页面
|
|
|
setTimeout(function() {
|
|
|
location.href = res.href;
|
|
|
}, 1000);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//2000ms后跳转页面
|
|
|
setTimeout(function() {
|
|
|
//3秒后强制跳转
|
|
|
time = setTimeout(function() {
|
|
|
location.href = res.href;
|
|
|
}, 2000);
|
|
|
}, 3000);
|
|
|
|
|
|
showErrTip('登录成功');
|
|
|
} else {
|
|
|
showErrTip(data.message);
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
showErrTip('网络断开连接啦~');
|
|
|
},
|
|
|
complete: function() {
|
|
|
$loginBtn.text('登录').removeClass('disable');
|
|
|
}
|
|
|
});
|
|
|
} else {
|
...
|
...
|
@@ -4733,7 +4771,10 @@ var goodsSwiper, |
|
|
var goodsDiscountEl = document.getElementById('goodsDiscount'),
|
|
|
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
|
|
|
|
|
|
var $cart = $('.cart-bar');
|
|
|
var $cart = $('.cart-bar'),
|
|
|
$goodsSubtitle = $('.goodsSubtitle'),
|
|
|
divH,
|
|
|
$goodsSubtitleSpan;
|
|
|
|
|
|
require("js/product/detail/desc");
|
|
|
require("js/product/detail/comments-consults");
|
...
|
...
|
@@ -4800,6 +4841,14 @@ $.ajax({ |
|
|
}
|
|
|
});
|
|
|
|
|
|
//限制goodsSubtitle为两行
|
|
|
if ($goodsSubtitle[0]) {
|
|
|
divH = $goodsSubtitle.height();
|
|
|
$goodsSubtitleSpan = $goodsSubtitle.find('span');
|
|
|
while ($goodsSubtitleSpan.outerHeight() > divH) {
|
|
|
$goodsSubtitleSpan.text($goodsSubtitleSpan.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, '...'));
|
|
|
}
|
|
|
}
|
|
|
require("js/product/detail/like");
|
|
|
|
|
|
});
|
...
|
...
|
@@ -4912,7 +4961,16 @@ var $ = require("jquery"), |
|
|
var commentsNum,consultsNum;
|
|
|
|
|
|
var consultFooterEle = document.getElementById('consult-content-footer'),
|
|
|
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle);
|
|
|
consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
|
|
|
|
|
|
navtabEle = document.getElementById('nav-tab'),
|
|
|
navtabHammer = navtabEle && new Hammer(navtabEle),
|
|
|
|
|
|
gotoConsultEle = document.getElementById('goto-consult'),
|
|
|
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
|
|
|
|
|
|
$gotoConsult = $('#goto-consult');
|
|
|
|
|
|
|
|
|
|
|
|
(function() {
|
...
|
...
|
@@ -4938,32 +4996,60 @@ var consultFooterEle = document.getElementById('consult-content-footer'), |
|
|
|
|
|
})();
|
|
|
|
|
|
$('#nav-tab li').on('touchend', function() {
|
|
|
var index = $(this).index();
|
|
|
if (navtabHammer) {
|
|
|
navtabHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target).closest('li');
|
|
|
var index = $this.index();
|
|
|
|
|
|
if ($(this).hasClass('comment-nav') && 0 === commentsNum) {
|
|
|
tip.show('暂无商品评价');
|
|
|
} else {
|
|
|
if (!$(this).hasClass('focus')) {
|
|
|
if ($this.hasClass('comment-nav') && 0 === commentsNum) {
|
|
|
tip.show('暂无商品评价');
|
|
|
} else {
|
|
|
if (!$this.hasClass('focus')) {
|
|
|
|
|
|
$('#nav-tab li').each(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
$('#feedback-content .content').each(function() {
|
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
$('#nav-tab li').each(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
$('#feedback-content .content').each(function() {
|
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
|
|
|
$(this).addClass('focus');
|
|
|
$('#feedback-content .content:eq(' + index + ')').removeClass('hide');
|
|
|
$this.addClass('focus');
|
|
|
$('#feedback-content .content:eq(' + index + ')').removeClass('hide');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (consultFooterHammer) {
|
|
|
consultFooterHammer.on('tap', function() {
|
|
|
location.href = $(consultFooterEle).find('a').attr('href');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (gotoConsultHammer) {
|
|
|
gotoConsultHammer.on('tap', function() {
|
|
|
location.href = $(gotoConsultEle).find('a').attr('href');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function fixConsultBar() {
|
|
|
if ($(window).scrollTop() > $('#yoho-header').outerHeight()) {
|
|
|
$gotoConsult.css('position', 'fixed');
|
|
|
$gotoConsult.css('top', '0');
|
|
|
} else {
|
|
|
$gotoConsult.css('position', 'static');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//滚动时顶部固定 我要咨询
|
|
|
function scrollHandler() {
|
|
|
fixConsultBar();
|
|
|
}
|
|
|
|
|
|
$(window).scroll(function() {
|
|
|
window.requestAnimationFrame(scrollHandler);
|
|
|
});
|
|
|
|
|
|
});
|
|
|
define("js/product/recommend-for-you-product-desc", ["swiper","jquery","index"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -5155,7 +5241,9 @@ $consultForm.on('submit', function() { |
|
|
loading.hideLoadingMask();
|
|
|
} else {
|
|
|
tip.show('提交成功~');
|
|
|
setTimeout(window.history.go(-1), 3000);
|
|
|
setTimeout(function() {
|
|
|
window.history.go(-1);
|
|
|
}, 3000);
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络出了点问题~');
|
...
|
...
|
@@ -5206,11 +5294,14 @@ function hotrank(page, sort, tabId, notab) { |
|
|
}
|
|
|
} else {
|
|
|
$('.no-result').remove();
|
|
|
$('.rank-main').remove();
|
|
|
if (page === 1) {
|
|
|
$('.rank-main').remove();
|
|
|
}
|
|
|
$('#hotRank').append(data);
|
|
|
}
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
$('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
|
|
|
$('.rank-main ul li:gt(9)').find('.item-content i').removeClass('top');
|
|
|
winH = $(window).height();
|
|
|
if ($('.rank-main').length !== 0) {
|
|
|
$('#yoho-footer').css('position', 'static');
|
...
|
...
|
@@ -5338,7 +5429,7 @@ function getOrders(option) { |
|
|
page: order.page + 1
|
|
|
};
|
|
|
|
|
|
var show = option && option.showLoadingMask;
|
|
|
var show = option && !option.noLoadingMask;
|
|
|
|
|
|
if (inAjax) {
|
|
|
return;
|
...
|
...
|
@@ -5484,7 +5575,7 @@ orderHammer.on('tap', function(e) { |
|
|
}
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
} else if ($cur.closest('.order-goods').length > 0) {
|
|
|
|
|
|
//Location to order detail
|
|
|
url = $order.data('href');
|
...
|
...
|
@@ -5552,6 +5643,7 @@ exports.showDialog = function(data, callback) { |
|
|
|
|
|
var dialogStr = dialogTemplate(data),
|
|
|
$dialogBox,
|
|
|
defaultHideDuraton,
|
|
|
dialogWrapperHammer;
|
|
|
|
|
|
$('.dialog-wrapper').remove();
|
...
|
...
|
@@ -5578,9 +5670,13 @@ exports.showDialog = function(data, callback) { |
|
|
|
|
|
//隐藏
|
|
|
if (data.autoHide) {
|
|
|
defaultHideDuraton = 1000;
|
|
|
if (data.autoHide > 1) {
|
|
|
defaultHideDuraton = data.autoHide;
|
|
|
}
|
|
|
setTimeout(function() {
|
|
|
$dialogWrapper.fadeOut();
|
|
|
}, 1000);
|
|
|
}, defaultHideDuraton);
|
|
|
}
|
|
|
|
|
|
dialogWrapperHammer.on('tap', function(event) {
|
...
|
...
|
@@ -5591,12 +5687,8 @@ exports.showDialog = function(data, callback) { |
|
|
callback();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
exports.hideDialog = function() {
|
|
|
$dialogWrapper.fadeOut();
|
|
|
};
|
|
|
|
|
|
});
|
|
|
define("js/me/order-detail", ["jquery","lazyload","hammer"], function(require, exports, module){
|
...
|
...
|
@@ -5959,11 +6051,21 @@ lazyLoad(); |
|
|
headerNavHammer = new Hammer(document.getElementById('yoho-header'));
|
|
|
|
|
|
headerNavHammer.on('tap', function(e) {
|
|
|
var suggestText = $('#suggest-textarea').val();
|
|
|
var suggestText = $('#suggest-textarea').val(),
|
|
|
textReg = /\S+/;
|
|
|
|
|
|
|
|
|
if ($(e.target).hasClass('nav-btn')) {
|
|
|
|
|
|
if (!textReg.test(suggestText)) {
|
|
|
diaLog.showDialog({
|
|
|
autoHide: true,
|
|
|
dialogText: '意见不能为空'
|
|
|
});
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
method: 'post',
|
|
|
url: '/home/savesuggest',
|
...
|
...
|
@@ -5980,10 +6082,18 @@ headerNavHammer.on('tap', function(e) { |
|
|
setTimeout(function() {
|
|
|
location.pathname = 'home/suggest';
|
|
|
}, 2000);
|
|
|
} else {
|
|
|
diaLog.showDialog({
|
|
|
autoHide: true,
|
|
|
dialogText: '提交失败~'
|
|
|
});
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
|
|
|
//TODO
|
|
|
diaLog.showDialog({
|
|
|
autoHide: true,
|
|
|
dialogText: '网络错误~'
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -7089,12 +7199,9 @@ define("js/me/address", ["jquery"], function(require, exports, module){ |
|
|
|
|
|
var $ = require("jquery"),
|
|
|
tip = require("js/plugin/tip"),
|
|
|
security = require("js/plugin/security"),
|
|
|
loading = require("js/plugin/loading");
|
|
|
|
|
|
var $action = $('.action'),
|
|
|
$addressForm = $('.edit-address'),
|
|
|
$submit = $('.submit'),
|
|
|
$addAddress = $('.add-address'),
|
|
|
$footer = $('#yoho-footer'),
|
|
|
$confim = $('.confim-mask'),
|
...
|
...
|
@@ -7107,12 +7214,13 @@ $pageWrap.first().css('min-height', function() { |
|
|
});
|
|
|
window.rePosFooter();
|
|
|
|
|
|
$confim.on('touchend', '.cancel', function() {
|
|
|
$confim.on('touchend', '.cancel', function(e) {
|
|
|
deleteId = null;
|
|
|
$confim.hide();
|
|
|
$confim.fadeOut();
|
|
|
return false;
|
|
|
}).on('touchend', '.confim', function() {
|
|
|
loading.showLoadingMask();
|
|
|
$confim.hide();
|
|
|
$confim.fadeOut();
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/home/delAddress',
|
...
|
...
|
@@ -7135,6 +7243,7 @@ $confim.on('touchend', '.cancel', function() { |
|
|
}).always(function() {
|
|
|
deleteId = null;
|
|
|
});
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
@@ -7152,19 +7261,7 @@ $addAddress.on('touchend', function() { |
|
|
// 删除
|
|
|
$action.on('touchend', '.del', function() {
|
|
|
deleteId = $(this).data('id');
|
|
|
$confim.show();
|
|
|
});
|
|
|
|
|
|
$submit.on('touchend', function() {
|
|
|
if (security.hasDangerInput(false)) {
|
|
|
return false;
|
|
|
}
|
|
|
$addressForm.submit();
|
|
|
return false;
|
|
|
}).on('touchstart', function() {
|
|
|
$(this).addClass('highlight');
|
|
|
}).on('touchend touchcancel', function() {
|
|
|
$(this).removeClass('highlight');
|
|
|
$confim.fadeIn();
|
|
|
});
|
|
|
|
|
|
});
|
...
|
...
|
@@ -7279,17 +7376,14 @@ $page.on('touchstart', '.del-icon', function() { |
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
dialog.showDialog({
|
|
|
dialogText: '删除浏览记录成功',
|
|
|
autoHide: true,
|
|
|
fast: true
|
|
|
});
|
|
|
dialogText: '删除浏览记录成功',
|
|
|
autoHide: 2000,
|
|
|
fast: true
|
|
|
});
|
|
|
setTimeout(function() {
|
|
|
window.history.go(0);
|
|
|
}, 2500);
|
|
|
}, 1200);
|
|
|
}
|
|
|
},
|
|
|
complete: function() {
|
|
|
dialog.hideDialog(); //隐藏dialog
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -7399,6 +7493,9 @@ $addressForm.on('submit', function() { |
|
|
});
|
|
|
|
|
|
$submit.on('touchend', function() {
|
|
|
if (security.hasDangerInput(false)) {
|
|
|
return false;
|
|
|
}
|
|
|
$input.blur();
|
|
|
$addressForm.submit();
|
|
|
return false;
|
...
|
...
|
@@ -7508,16 +7605,100 @@ $(document).ready(addFooterTopBorder); |
|
|
|
|
|
|
|
|
});
|
|
|
define("js/me/pay", ["jquery"], function(require, exports, module){
|
|
|
define("js/me/pay", ["jquery","hammer"], function(require, exports, module){
|
|
|
/**
|
|
|
* 支付页面
|
|
|
* @author: 赵彪<bill.zhao@yoho.cn>
|
|
|
* @date: 2015/12/03
|
|
|
*/
|
|
|
var loading = require("js/plugin/loading");
|
|
|
var $ = require("jquery");
|
|
|
|
|
|
var loading = require("js/plugin/loading"),
|
|
|
tip = require("js/plugin/tip"),
|
|
|
Hammer = require("hammer");
|
|
|
|
|
|
var theOrderCode = document.getElementById('ordercode').value;
|
|
|
|
|
|
var wxPayEl = document.getElementById('weixin'),
|
|
|
wxHammer = wxPayEl && new Hammer(wxPayEl);
|
|
|
|
|
|
var appIconPosition = {
|
|
|
baidu: '-2.7rem',
|
|
|
weixin: '-1.2rem',
|
|
|
QQ: '-5.4rem',
|
|
|
bank: '-4rem'
|
|
|
};
|
|
|
|
|
|
//隐藏微信分享选项
|
|
|
if (window.wx) {
|
|
|
wx.hideOptionMenu();
|
|
|
}
|
|
|
|
|
|
function onBridgeReady() {
|
|
|
document.addEventListener('WeixinJSBridgeReady', function() {
|
|
|
window.WeixinJSBridge && window.WeixinJSBridge.call('hideOptionMenu');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (typeof WeixinJSBridge === undefined) {
|
|
|
if (document.addEventListener) {
|
|
|
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
|
|
|
} else if (document.attachEvent) {
|
|
|
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
|
|
|
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
|
|
|
}
|
|
|
onBridgeReady();
|
|
|
} else {
|
|
|
onBridgeReady();
|
|
|
}
|
|
|
|
|
|
//调用微信JS api 支付
|
|
|
function jsApiCall(orderCode, jsApiParameters) {
|
|
|
|
|
|
//防止重复操作弹框
|
|
|
window.WeixinJSBridge && window.WeixinJSBridge.invoke(
|
|
|
'getBrandWCPayRequest',
|
|
|
jsApiParameters,
|
|
|
function(res) {
|
|
|
window.location.href = '/home/orders/detail?order_code=' + orderCode;
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//微信支付
|
|
|
function callpay(orderCode) {
|
|
|
var jsApiParameters;
|
|
|
|
|
|
if (typeof WeixinJSBridge === undefined) {
|
|
|
if (document.addEventListener) {
|
|
|
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
|
|
|
} else if (document.attachEvent) {
|
|
|
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
|
|
|
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
|
|
|
}
|
|
|
} else {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/shopping/pay/wechatwapapi?order_code=' + orderCode,
|
|
|
dataType: 'json',
|
|
|
success: function(res) {
|
|
|
if (res.code === 200) {
|
|
|
jsApiParameters = res.data.jsApiParameters;
|
|
|
jsApiCall(orderCode, jsApiParameters);
|
|
|
} else {
|
|
|
tip.show('微信支付调取失败');
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|
|
|
tip.show('请刷新本页面,完成微信支付');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
function isWXOpen() {
|
|
|
var ua = navigator.userAgent.toLowerCase();
|
|
|
var ua = window.navigator.userAgent.toLowerCase();
|
|
|
|
|
|
if (ua.match(/MicroMessenger/i) === 'micromessenger') {
|
|
|
return true;
|
...
|
...
|
@@ -7527,11 +7708,11 @@ function isWXOpen() { |
|
|
}
|
|
|
|
|
|
function hideWeChatPay() {
|
|
|
var payApps = document.getElementsByClassName('app');
|
|
|
var $payApps = $('.app');
|
|
|
|
|
|
[].forEach.call(payApps, function(app, index) {
|
|
|
if (app.innerHTML.indexOf('微信') !== -1) {
|
|
|
app.parentNode.style.display = 'none';
|
|
|
$payApps.each(function(idx, app) {
|
|
|
if ($(app).parent().attr('id') === 'weixin') {
|
|
|
$(app).parent().css('display', 'none');
|
|
|
return false;
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -7543,47 +7724,37 @@ function handleForWX() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
function setIcon(div, appName) {
|
|
|
|
|
|
if (appName.indexOf('百度') !== -1) {
|
|
|
div.style.backgroundPositionY = '-2.7rem';
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (appName.indexOf('微信') !== -1) {
|
|
|
div.style.backgroundPositionY = '-1.2rem';
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (appName.indexOf('银联') !== -1) {
|
|
|
div.style.backgroundPositionY = '-4rem';
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (appName.indexOf('QQ') !== -1) {
|
|
|
div.style.backgroundPositionY = '-5.4rem';
|
|
|
return false;
|
|
|
}
|
|
|
function setAppIcon(el, position) {
|
|
|
$(el).css('background-position-y', position);
|
|
|
}
|
|
|
|
|
|
function loadIcon() {
|
|
|
var boxs = document.getElementsByClassName('box');
|
|
|
var div = null;
|
|
|
var appName = null;
|
|
|
|
|
|
[].forEach.call(boxs, function(box, index) {
|
|
|
div = box.getElementsByClassName('icon')[0].getElementsByTagName('div')[0];
|
|
|
if (div) {
|
|
|
appName = box.getElementsByClassName('app')[0].innerHTML;
|
|
|
setIcon(div, appName);
|
|
|
var $boxs = $('.box');
|
|
|
var $div = null;
|
|
|
var appid = null;
|
|
|
|
|
|
$boxs.each(function(idx, box) {
|
|
|
$div = $(box).find('.icon').find('div');
|
|
|
if ($div.length > 0) {
|
|
|
appid = $(box).attr('id');
|
|
|
if (appid !== 'alipay') {
|
|
|
setAppIcon($div, appIconPosition[appid]);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function showPage() {
|
|
|
var pageList = document.getElementsByClassName('payapp-list')[0];
|
|
|
var $pageList = $('.payapp-list');
|
|
|
|
|
|
pageList.style.visibility = 'visible';
|
|
|
$pageList.css('visibility', 'visible');
|
|
|
}
|
|
|
|
|
|
if (wxHammer) {
|
|
|
wxHammer.on('tap', function() {
|
|
|
callpay(theOrderCode);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function main() {
|
...
|
...
|
|