...
|
...
|
@@ -437,6 +437,7 @@ define("js/category/brand", ["jquery","hammer","swiper","lazyload","index"], fun |
|
|
var $ = require("jquery"),
|
|
|
Hammer = require("hammer"),
|
|
|
Swiper = require("swiper"),
|
|
|
loading = require("js/plugin/loading"),
|
|
|
lazyLoad = require("lazyload");
|
|
|
|
|
|
var swiper,
|
...
|
...
|
@@ -444,6 +445,7 @@ var swiper, |
|
|
$brandList = $('.brand-list'),
|
|
|
$icon = $('.search-icon'),
|
|
|
$genderItem = $('.genderNav li'),
|
|
|
$searchAction = $('.search-action'),
|
|
|
hotBrandsSwiper;
|
|
|
|
|
|
var searchH = $('.newbrand-search').outerHeight(),
|
...
|
...
|
@@ -455,6 +457,8 @@ var brandsData, |
|
|
$keyword,
|
|
|
clearTextHammer;
|
|
|
|
|
|
loading.showLoadingMask();
|
|
|
|
|
|
//热门品牌滑动
|
|
|
hotBrandsSwiper = new Swiper('.brands-swiper', {
|
|
|
grabCursor: true,
|
...
|
...
|
@@ -477,9 +481,14 @@ $('.yoho-header').css({ |
|
|
top: 0
|
|
|
});
|
|
|
|
|
|
if ($('.banner-top').length > 0) {
|
|
|
$('.hot-brands').css('padding-top', '0');
|
|
|
}
|
|
|
(function() {
|
|
|
if ($('.banner-top').length > 0) {
|
|
|
$('.hot-brands').css('padding-top', '0');
|
|
|
}
|
|
|
|
|
|
$('.hide-when-loading').show();
|
|
|
loading.hideLoadingMask();
|
|
|
})();
|
|
|
|
|
|
$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
|
|
|
$fixTitleBar.css({
|
...
|
...
|
@@ -586,20 +595,25 @@ if ($('.brand-search-page').length) { |
|
|
if ($keyword.val().length) {
|
|
|
$icon.css('color', '#000');
|
|
|
$(this).closest('.search-box').css('width', '11.25rem');
|
|
|
$('.search-action').show();
|
|
|
$searchAction.show().find('.clear-text').show();
|
|
|
} else {
|
|
|
$icon.css('color', '#b2b2b2');
|
|
|
$(this).closest('.search-box').css('width', '12.5rem');
|
|
|
$('.search-action').hide();
|
|
|
$searchAction.hide();
|
|
|
}
|
|
|
searchResult();
|
|
|
}).focus();
|
|
|
|
|
|
// 2016.1.13 产品(高扬)要求进入页面默认显示取消按钮
|
|
|
$icon.css('color', '#000');
|
|
|
$keyword.closest('.search-box').css('width', '11.25rem');
|
|
|
$searchAction.show().find('.clear-text').hide();
|
|
|
|
|
|
clearTextHammer = new Hammer($('.clear-text')[0]);
|
|
|
clearTextHammer.on('tap', function(e) {
|
|
|
e.preventDefault();
|
|
|
$('.search-result').html('');
|
|
|
$('#keyword').val('').trigger('input');
|
|
|
e.preventDefault();
|
|
|
e.srcEvent.stopPropagation();
|
|
|
});
|
|
|
|
...
|
...
|
@@ -611,13 +625,72 @@ if ($('.brand-search-page').length) { |
|
|
|
|
|
if ($genderItem.length > 0) {
|
|
|
$genderItem.on('touchstart', function() {
|
|
|
var index = $(this).data('id') + 1;
|
|
|
|
|
|
$('.genderNav ul .active').removeClass('active');
|
|
|
$(this).addClass('active');
|
|
|
window.location.search = 'channel=' + ($(this).data('id') + 1);
|
|
|
$('.hide-when-loading').hide();
|
|
|
loading.showLoadingMask();
|
|
|
function reload() {
|
|
|
window.location.search = 'channel=' + index;
|
|
|
}
|
|
|
setTimeout(reload.bind(this), 100);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
});
|
|
|
define("js/plugin/loading", ["jquery"], function(require, exports, module){
|
|
|
/**
|
|
|
* Loading mask
|
|
|
* @author: xuqi<qi.xu@yoho.cn>
|
|
|
* @date: 2015/10/29
|
|
|
*/
|
|
|
|
|
|
var $ = require("jquery");
|
|
|
|
|
|
var $page = $('.yoho-page');
|
|
|
|
|
|
var $loading,
|
|
|
hasInit = false;
|
|
|
|
|
|
/** modify by liangzhifeng at 2015.11.2 */
|
|
|
|
|
|
// 初始化
|
|
|
function init($container) {
|
|
|
var html = '<div class="loading-mask hide">' +
|
|
|
'<div class="loading">' +
|
|
|
'<div></div><div></div><div></div>' +
|
|
|
'</div>' +
|
|
|
'</div>';
|
|
|
|
|
|
hasInit = true;
|
|
|
if ($container === undefined) {
|
|
|
$container = $page;
|
|
|
}
|
|
|
|
|
|
$container.append(html);
|
|
|
|
|
|
$loading = $container.children('.loading-mask');
|
|
|
}
|
|
|
|
|
|
//显示loading
|
|
|
function showLoadingMask() {
|
|
|
if (!hasInit) {
|
|
|
init();
|
|
|
hasInit = true;
|
|
|
}
|
|
|
$loading.removeClass('hide');
|
|
|
}
|
|
|
|
|
|
//隐藏loading
|
|
|
function hideLoadingMask() {
|
|
|
$loading.addClass('hide');
|
|
|
}
|
|
|
|
|
|
exports.init = init;
|
|
|
exports.showLoadingMask = showLoadingMask;
|
|
|
exports.hideLoadingMask = hideLoadingMask;
|
|
|
});
|
|
|
define("js/guang/entry", ["jquery","lazyload","swiper","hammer","mlellipsis","iscroll-probe","index"], function(require, exports, module){
|
|
|
/**
|
|
|
* 逛打包入口
|
...
|
...
|
@@ -1048,58 +1121,6 @@ function show(con, dur) { |
|
|
|
|
|
exports.show = show;
|
|
|
});
|
|
|
define("js/plugin/loading", ["jquery"], function(require, exports, module){
|
|
|
/**
|
|
|
* Loading mask
|
|
|
* @author: xuqi<qi.xu@yoho.cn>
|
|
|
* @date: 2015/10/29
|
|
|
*/
|
|
|
|
|
|
var $ = require("jquery");
|
|
|
|
|
|
var $page = $('.yoho-page');
|
|
|
|
|
|
var $loading,
|
|
|
hasInit = false;
|
|
|
|
|
|
/** modify by liangzhifeng at 2015.11.2 */
|
|
|
|
|
|
// 初始化
|
|
|
function init($container) {
|
|
|
var html = '<div class="loading-mask hide">' +
|
|
|
'<div class="loading">' +
|
|
|
'<div></div><div></div><div></div>' +
|
|
|
'</div>' +
|
|
|
'</div>';
|
|
|
|
|
|
hasInit = true;
|
|
|
if ($container === undefined) {
|
|
|
$container = $page;
|
|
|
}
|
|
|
|
|
|
$container.append(html);
|
|
|
|
|
|
$loading = $container.children('.loading-mask');
|
|
|
}
|
|
|
|
|
|
//显示loading
|
|
|
function showLoadingMask() {
|
|
|
if (!hasInit) {
|
|
|
init();
|
|
|
hasInit = true;
|
|
|
}
|
|
|
$loading.removeClass('hide');
|
|
|
}
|
|
|
|
|
|
//隐藏loading
|
|
|
function hideLoadingMask() {
|
|
|
$loading.addClass('hide');
|
|
|
}
|
|
|
|
|
|
exports.init = init;
|
|
|
exports.showLoadingMask = showLoadingMask;
|
|
|
exports.hideLoadingMask = hideLoadingMask;
|
|
|
});
|
|
|
define("js/plugin/wx-share", ["jquery"], function(require, exports, module){
|
|
|
/**
|
|
|
* 微信分享
|
...
|
...
|
@@ -2272,7 +2293,7 @@ var $searchBox = $('.search-box'), |
|
|
$box = $('.box'),
|
|
|
$indexSearch = $('.index-search'),
|
|
|
$indexLogo = $('.index-logo'),
|
|
|
$channelLink = $('.index-channel a');
|
|
|
$channelLink = $('.index-channel a:not(#yohood)');
|
|
|
|
|
|
var $search = $searchBox.children('input[type="text"]'),
|
|
|
$cancelSearch = $box.children('.no-search'),
|
...
|
...
|
@@ -5389,6 +5410,8 @@ var $chosePanel = $('#chose-panel'), |
|
|
hasChooseSize,
|
|
|
$curSizeBlock,
|
|
|
$sizeRowList,
|
|
|
$curColorBlock,
|
|
|
$colorRowList,
|
|
|
cbFn,
|
|
|
$allChoseItems,
|
|
|
queryString,
|
...
|
...
|
@@ -5404,7 +5427,10 @@ function init() { |
|
|
$imgsThumb = $('.chose-panel').find('.thumb');
|
|
|
$allChoseItems = $('.chose-items');
|
|
|
$sizeRowList = $('.size-list ul');
|
|
|
$colorRowList = $('.color-list ul');
|
|
|
$leftNum = $('#left-num');
|
|
|
curColorIndex = 0;
|
|
|
curSizeIndex = 0;
|
|
|
}
|
|
|
|
|
|
function checkColorSizeNum() {
|
...
|
...
|
@@ -5470,37 +5496,58 @@ function updateConformButtonClassAndText() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
//重置颜色块的库存为0的样式
|
|
|
function resetColorZeroStock($siblingBlock) {
|
|
|
var numArray,
|
|
|
i;
|
|
|
//显示剩余件数
|
|
|
function displayGoodNum(curGoodNum) {
|
|
|
|
|
|
if (!hasChooseSize) {
|
|
|
$siblingBlock.find('ul>li').each(function() {
|
|
|
if (0 === $(this).data('num')) {
|
|
|
$(this).addClass('zero-stock');
|
|
|
} else {
|
|
|
$(this).removeClass('zero-stock');
|
|
|
}
|
|
|
});
|
|
|
//数量大于0
|
|
|
if (curGoodNum > 0) {
|
|
|
if ($soonSoldOut.length > 0) {
|
|
|
$allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
}
|
|
|
|
|
|
$leftNum.val(curGoodNum);
|
|
|
|
|
|
//数量小于0
|
|
|
} else {
|
|
|
numArray = ($curSizeBlock.data('numstr') + '').split('/');
|
|
|
for (i = 0; i < numArray.length; i++) {
|
|
|
if ('0' === numArray[i]) {
|
|
|
$siblingBlock.find('.block').eq(i).addClass('zero-stock');
|
|
|
} else {
|
|
|
$siblingBlock.find('.block').eq(i).removeClass('zero-stock');
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$leftNum.val(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
function changeSizeChosed(newSizeIndex) {
|
|
|
var sizes,
|
|
|
queryString,
|
|
|
i;
|
|
|
|
|
|
if (curColorIndex && $curSizeBlock && $curSizeBlock.length > 0) {
|
|
|
$curSizeBlock.removeClass('chosed');
|
|
|
sizes = $sizeRowList.eq(newSizeIndex).children();
|
|
|
for (i = 0; i < sizes.length; i++) {
|
|
|
if ($(sizes[i]).data('name') === $curSizeBlock.data('name')) {
|
|
|
$curSizeBlock = $(sizes[i]);
|
|
|
queryString = '#' + $curSizeBlock.data('name');
|
|
|
curColorIndex = $(queryString).data('index');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$curSizeBlock.addClass('chosed');
|
|
|
return $curSizeBlock.data('num');
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
// 选择了颜色切换商品图片
|
|
|
function changeGoodImgWhenClickColor() {
|
|
|
if (hasChooseColor && curColorIndex >= 0) {
|
|
|
$imgsThumb.addClass('hide').eq(curColorIndex).removeClass('hide');
|
|
|
//老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
function changeColorChosed(newColorIndex) {
|
|
|
if (curSizeIndex && $curColorBlock && $curColorBlock.length > 0) {
|
|
|
$curColorBlock.removeClass('chosed');
|
|
|
$curColorBlock = $($colorRowList.eq(newColorIndex).children().get(curSizeIndex - 1));
|
|
|
$curColorBlock.addClass('chosed');
|
|
|
return $curColorBlock.data('num');
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
init();
|
...
|
...
|
@@ -5518,144 +5565,109 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { |
|
|
|
|
|
$yohoPage.on('touchstart', '.color-list .block', function() {
|
|
|
var $this = $(this),
|
|
|
index,
|
|
|
curSizeBlock,
|
|
|
$preSiblingBlock,
|
|
|
$curSizeRow,
|
|
|
numArray,
|
|
|
i,
|
|
|
index = $this.index(),
|
|
|
curGoodNum;
|
|
|
|
|
|
var $siblingBlock = $this.closest('.block-list').siblings(':first');
|
|
|
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
index = $this.index();
|
|
|
|
|
|
$preSiblingBlock = $siblingBlock.find('.chosed');
|
|
|
$curSizeRow = $sizeRowList.eq(index);
|
|
|
|
|
|
// 当前颜色已经是选中状态,再点击时
|
|
|
if ($this.hasClass('chosed')) {
|
|
|
|
|
|
//颜色原来已经是勾选时,要清空剩余件数的提示
|
|
|
//清空剩余件数的提示
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$leftNum.val(0);
|
|
|
hasChooseColor = false;
|
|
|
|
|
|
$this.removeClass('zero-stock');
|
|
|
if ($curSizeBlock) {
|
|
|
numArray = ($curSizeBlock.data('numstr') + '').split('/');
|
|
|
for (i = 0; i < numArray.length; i++) {
|
|
|
if ('0' === numArray[i]) {
|
|
|
$('.color-list .block').eq(i).addClass('zero-stock');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//当前尺码行隐藏
|
|
|
$sizeRowList.eq(curSizeIndex).addClass('hide');
|
|
|
|
|
|
//目标尺码行显示
|
|
|
$sizeRowList.eq(0).removeClass('hide');
|
|
|
|
|
|
curSizeIndex = 0;
|
|
|
|
|
|
//老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
changeSizeChosed(0);
|
|
|
|
|
|
// 当前颜色不是选中状态,选中时
|
|
|
} else {
|
|
|
hasChooseColor = true;
|
|
|
|
|
|
//把当前选中颜色对应的尺码那一行显示出来
|
|
|
$sizeRowList.addClass('hide');
|
|
|
$curSizeRow.removeClass('hide').addClass('show');
|
|
|
// 尺码行当前行隐藏
|
|
|
$sizeRowList.eq(curSizeIndex).addClass('hide');
|
|
|
|
|
|
// 之前选中的尺码去掉勾选样式
|
|
|
if ($preSiblingBlock.length > 0) {
|
|
|
$preSiblingBlock.removeClass('chosed');
|
|
|
curSizeBlock = $curSizeRow.children().get(curSizeIndex);
|
|
|
$curSizeBlock = $(curSizeBlock);
|
|
|
}
|
|
|
//老的选中尺码去掉勾选,新的选中尺码加上勾选
|
|
|
curGoodNum = changeSizeChosed(index + 1);
|
|
|
|
|
|
// 当前选中颜色对应的尺码行,其对应的尺码加上勾选样式 (前提是要判断下这个尺码是否存在)
|
|
|
if (curSizeBlock) {
|
|
|
curGoodNum = $(curSizeBlock).data('num');
|
|
|
$(curSizeBlock).addClass('chosed');
|
|
|
// 显示剩余数量
|
|
|
displayGoodNum(curGoodNum);
|
|
|
|
|
|
//如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式
|
|
|
if (curGoodNum > 0) {
|
|
|
if ($soonSoldOut.length > 0) {
|
|
|
$allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
}
|
|
|
//尺码对应行显示
|
|
|
$sizeRowList.eq(index + 1).removeClass('hide');
|
|
|
|
|
|
$leftNum.val(curGoodNum);
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$leftNum.val(0);
|
|
|
}
|
|
|
}
|
|
|
curSizeIndex = index + 1;
|
|
|
$curColorBlock = $this;
|
|
|
|
|
|
// 修改颜色时修改商品图片
|
|
|
$imgsThumb.addClass('hide').eq(index).removeClass('hide');
|
|
|
}
|
|
|
|
|
|
// 当前颜色块 切换勾选样式
|
|
|
// 颜色块切换勾选样式
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
$this.toggleClass('chosed');
|
|
|
curColorIndex = index;
|
|
|
$('#good-num').val(1);
|
|
|
|
|
|
// 修改颜色时修改商品图片
|
|
|
changeGoodImgWhenClickColor();
|
|
|
|
|
|
// 设置按钮的样式和文字
|
|
|
updateConformButtonClassAndText();
|
|
|
}).on('touchstart', '.size-list .block', function() {
|
|
|
var $this = $(this),
|
|
|
index,
|
|
|
$curSizeRow,
|
|
|
curGoodNum;
|
|
|
|
|
|
var $siblingBlock = $this.closest('.block-list').siblings(':first');
|
|
|
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
index = $this.index();
|
|
|
$curSizeRow = $sizeRowList.eq(index);
|
|
|
|
|
|
// 当前尺码已经是选中状态,再点击时
|
|
|
if ($this.hasClass('chosed')) {
|
|
|
|
|
|
//尺码原来已经是勾选时,要清空剩余件数的提示
|
|
|
//清空剩余件数的提示
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$('#left-num').val(0);
|
|
|
$leftNum.val(0);
|
|
|
hasChooseSize = false;
|
|
|
curSizeIndex = null;
|
|
|
$curSizeBlock = null;
|
|
|
|
|
|
//当前颜色行隐藏
|
|
|
$colorRowList.eq(curColorIndex).addClass('hide');
|
|
|
|
|
|
//目标颜色行显示
|
|
|
$colorRowList.eq(0).removeClass('hide');
|
|
|
|
|
|
curColorIndex = 0;
|
|
|
|
|
|
//老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
changeColorChosed(0);
|
|
|
|
|
|
// 当前尺码不是选中状态,选中时
|
|
|
} else {
|
|
|
hasChooseSize = true;
|
|
|
curGoodNum = $this.data('num');
|
|
|
|
|
|
// 之前选中的尺码去掉勾选样式
|
|
|
if ($curSizeBlock) {
|
|
|
$curSizeBlock.removeClass('chosed');
|
|
|
}
|
|
|
index = $('#' + $this.data('name')).data('index') - 1;
|
|
|
|
|
|
// 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数
|
|
|
if (curGoodNum > 0 && hasChooseColor) {
|
|
|
if ($soonSoldOut.length > 0) {
|
|
|
$allChoseItems.find('.num .left-num').html('即将售罄');
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
|
|
|
}
|
|
|
$('#left-num').val(curGoodNum);
|
|
|
} else {
|
|
|
$allChoseItems.find('.num .left-num').html('');
|
|
|
$('#left-num').val(0);
|
|
|
}
|
|
|
// 颜色当前行隐藏
|
|
|
$colorRowList.eq(curColorIndex).addClass('hide');
|
|
|
|
|
|
if (curGoodNum === 0 && hasChooseColor) {
|
|
|
$this.addClass('zero-stock');
|
|
|
}
|
|
|
curSizeIndex = index;
|
|
|
//老的选中颜色去掉勾选,新的选中颜色加上勾选
|
|
|
curGoodNum = changeColorChosed(index + 1);
|
|
|
|
|
|
// 显示剩余数量
|
|
|
displayGoodNum(curGoodNum);
|
|
|
|
|
|
//颜色对应行显示
|
|
|
$colorRowList.eq(index + 1).removeClass('hide');
|
|
|
|
|
|
curColorIndex = index + 1;
|
|
|
$curSizeBlock = $this;
|
|
|
}
|
|
|
|
|
|
// 颜色块切换勾选样式
|
|
|
$this.siblings('.chosed').removeClass('chosed');
|
|
|
$this.toggleClass('chosed');
|
|
|
$('#good-num').val(1);
|
|
|
|
|
|
// 重置颜色块的样式
|
|
|
resetColorZeroStock($siblingBlock);
|
|
|
|
|
|
// 设置按钮的样式和文字
|
|
|
updateConformButtonClassAndText();
|
|
|
});
|
...
|
...
|
@@ -5779,8 +5791,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
});
|
|
|
|
|
|
exports.init = init;
|
|
|
exports.show = show;
|
|
|
|
|
|
exports.show = show;
|
|
|
});
|
|
|
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -5926,9 +5937,6 @@ var commentsNum,consultsNum; |
|
|
var navtabEle = document.getElementById('nav-tab'),
|
|
|
navtabHammer = navtabEle && new Hammer(navtabEle),
|
|
|
|
|
|
// consultFooterEle = $('.consult-content-footer')[0],
|
|
|
// consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle),
|
|
|
|
|
|
gotoConsultEle = document.getElementById('goto-consult'),
|
|
|
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
|
|
|
|
...
|
...
|
@@ -8945,6 +8953,7 @@ function showChooseGifDialog() { |
|
|
window.location.href = cartContentShow().find('.freebie > a').attr('href');
|
|
|
}, function() {
|
|
|
var info = window.cookie('order-info');
|
|
|
|
|
|
if (info) {
|
|
|
window.setCookie('order-info', '');
|
|
|
}
|
...
|
...
|
@@ -9022,8 +9031,10 @@ if ($('.freebie').length > 0) { |
|
|
}
|
|
|
|
|
|
$('.btn-balance').on('touchend', function() {
|
|
|
lowStockCount = 0;
|
|
|
var info = window.cookie('order-info');
|
|
|
|
|
|
lowStockCount = 0;
|
|
|
|
|
|
if (shouldLowStocks()) {
|
|
|
tip.show('所选商品中有' + lowStockCount + '种库存不足的商品');
|
|
|
return false;
|
...
|
...
|
@@ -9166,7 +9177,6 @@ $('.icon-del').on('touchstart', function(e) { |
|
|
autoHide: true,
|
|
|
fast: true
|
|
|
});
|
|
|
//window.setCookie('order-info', '');
|
|
|
window.setCookie('_yoho-cart-refreshByDelete', true);
|
|
|
window.location.href = '/cart/index/index?cartType=' + $('#cartType').val();
|
|
|
} else {
|
...
|
...
|
@@ -9389,7 +9399,9 @@ if (document.referrer && document.referrer.indexOf('/cart/index/index') !== -1) |
|
|
orderInfo('couponName', null);
|
|
|
}
|
|
|
|
|
|
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
|
|
|
if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) {
|
|
|
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
|
|
|
}
|
|
|
|
|
|
function dispacthTapEvt(e) {
|
|
|
var $cur = $(e.target).closest('li');
|
...
|
...
|
@@ -9420,19 +9432,20 @@ $('.checkbox').on('touchstart', function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.invoice').on('touchend', '.checkbox', function() {
|
|
|
$invoice.on('touchend', '.checkbox', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('icon-cb-checked')) {
|
|
|
$('.invoice').addClass('focus');
|
|
|
$invoice.addClass('focus');
|
|
|
}
|
|
|
if ($this.hasClass('icon-checkbox')) {
|
|
|
$('.invoice').removeClass('focus');
|
|
|
$invoice.removeClass('focus');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
function orderCompute() {
|
|
|
var yohoCoin = orderInfo('yohoCoin');
|
|
|
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/cart/index/orderCompute',
|
...
|
...
|
@@ -9520,7 +9533,7 @@ function submitOrder() { |
|
|
var url;
|
|
|
|
|
|
if (!res) {
|
|
|
tip.show('网络出错');
|
|
|
tip.show('系统繁忙,请稍后再试!');
|
|
|
return;
|
|
|
}
|
|
|
if (res.code === 200) {
|
...
|
...
|
@@ -9537,7 +9550,7 @@ function submitOrder() { |
|
|
tip.show(res.message);
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络出错');
|
|
|
tip.show('系统繁忙,请稍后再试!');
|
|
|
}).always(function() {
|
|
|
isSubmiting = false;
|
|
|
loading.hideLoadingMask();
|
...
|
...
|
@@ -9582,10 +9595,12 @@ $('.coin').on('touchend', function() { |
|
|
orderCompute();
|
|
|
});
|
|
|
|
|
|
$invoice.on('touchend', function() {
|
|
|
$invoice.on('touchend', '.checkbox', function(e) {
|
|
|
var $this = $(this);
|
|
|
|
|
|
orderInfo('invoice', $this.find('.checkbox').hasClass('icon-cb-checked'));
|
|
|
orderInfo('invoice', $this.hasClass('icon-cb-checked'));
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
});
|
|
|
|
|
|
$invoice.find('[name="invoice-title"]').on('blur', function() {
|
...
|
...
|
|