...
|
...
|
@@ -1689,6 +1689,7 @@ define("js/home/home", ["jquery","swiper","lazyload","hammer","index"], function |
|
|
var $ = require("jquery"),
|
|
|
Swiper = require("swiper"),
|
|
|
lazyLoad = require("lazyload"),
|
|
|
noticeScroll = require("js/plugin/notice-scroll"),
|
|
|
$mobileWrap = $('.mobile-wrap'),
|
|
|
$overlay = $('.overlay'),
|
|
|
$sideNav = $('.side-nav'),
|
...
|
...
|
@@ -1707,6 +1708,7 @@ var start = 0, |
|
|
isen = true;
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
noticeScroll('.notice', $('.notice').data('time') * 1000);
|
|
|
|
|
|
$('.nav-btn').on('touchstart', function() {
|
|
|
$sideNav.css('pointer-events', 'none');
|
...
|
...
|
@@ -1836,7 +1838,8 @@ if ($('.fresh-list-swiper').find('li').size() > 1) { |
|
|
lazyLoadingInPrevNext: true,
|
|
|
grabCursor: true,
|
|
|
slidesPerView: 'auto',
|
|
|
slideElement: 'li'
|
|
|
slideElement: 'li',
|
|
|
watchSlidesVisibility: true
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1906,6 +1909,38 @@ exports.set = function(c) { |
|
|
require("js/home/maybe-like")();
|
|
|
|
|
|
});
|
|
|
define("js/plugin/notice-scroll", ["jquery"], function(require, exports, module){
|
|
|
/**
|
|
|
* 公告栏目滚动
|
|
|
* bikai kai.bi@yoho.cn
|
|
|
*/
|
|
|
|
|
|
var $ = require("jquery");
|
|
|
|
|
|
function noticeScroll(selecter, time) {
|
|
|
var $notice = $(selecter),
|
|
|
$noticeItem = $notice.find('.notice-item'),
|
|
|
count = $noticeItem.length,
|
|
|
i = 1;
|
|
|
|
|
|
selecter = selecter || '.notice';
|
|
|
time = time || 3000;
|
|
|
|
|
|
if (count > 1) {
|
|
|
setInterval(function() {
|
|
|
if (i >= count) {
|
|
|
i = 0;
|
|
|
}
|
|
|
$noticeItem.fadeOut();
|
|
|
$notice.find('.item-' + i).fadeIn();
|
|
|
i++;
|
|
|
}, time);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
module.exports = noticeScroll;
|
|
|
|
|
|
});
|
|
|
define("js/home/maybe-like", ["jquery","hammer","lazyload"], function(require, exports, module){
|
|
|
/**
|
|
|
* “你可能喜欢”模块JS
|
...
|
...
|
@@ -5467,7 +5502,7 @@ $('#likeBtn').on('touchstart', function() { |
|
|
|
|
|
$('#addtoCart').on('touchstart', function() {
|
|
|
$('.cart-bar').hide();
|
|
|
chosePanel.setLimitGoodModeWithSknId(productCode, skn);
|
|
|
productCode && chosePanel.setLimitGoodModeWithSknId(productCode, skn);
|
|
|
chosePanel.show();
|
|
|
|
|
|
//统计代码:用于统计用户加入购物车的动作
|
...
|
...
|
@@ -5579,7 +5614,7 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) { |
|
|
* @return {undefined}
|
|
|
*/
|
|
|
function setLimitGoodModeWithSknId(code, sknId) {
|
|
|
$('#chose-btn-sure').html('结算');
|
|
|
$('#chose-btn-sure').html('立即购买');
|
|
|
limitProductCode = code;
|
|
|
skn = sknId;
|
|
|
}
|
...
|
...
|
@@ -5657,7 +5692,7 @@ function updateConformButtonClassAndText() { |
|
|
if (2 === $chosed.closest('.zero-stock').length) {
|
|
|
$('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄');
|
|
|
} else if (limitProductCode) {
|
|
|
$('#chose-btn-sure').css('background-color', '#eb0313').html('结算');
|
|
|
$('#chose-btn-sure').css('background-color', '#eb0313').html('立即购买');
|
|
|
} else {
|
|
|
$('#chose-btn-sure').css('background-color', '#eb0313').html(isEdit ? '确认' : '加入购物车');
|
|
|
}
|
...
|
...
|
@@ -5958,8 +5993,8 @@ $yohoPage.on('touchstart', '.btn-minus', function() { |
|
|
} else if (limitProductCode) {
|
|
|
|
|
|
// 当前面板选择的是限购商品
|
|
|
url = 'http://m.yohobuy.com/cart/index/orderEnsure?code=' + limitProductCode + '&&sku=' +
|
|
|
productSku + '&&skn=' + skn + '&&buy_num=' + buyNumber;
|
|
|
url = $('#limitProductPay').val() + '?limitproductcode=' + limitProductCode + '&sku=' +
|
|
|
productSku + '&skn=' + skn + '&buy_number=' + buyNumber;
|
|
|
|
|
|
//打开结算页面,结束函数执行。
|
|
|
window.location.href = url;
|
...
|
...
|
@@ -7048,6 +7083,8 @@ var $ = require("jquery"), |
|
|
|
|
|
var diaLog = require("js/me/dialog");
|
|
|
|
|
|
var tip = require("js/plugin/tip");
|
|
|
|
|
|
var $navLi = $('#fav-tab > li'),
|
|
|
$favContainer = $('.fav-content > .fav-type'),
|
|
|
swiperObj = {},
|
...
|
...
|
@@ -7129,11 +7166,13 @@ function loadData($parent, url, page) { |
|
|
if (data === ' ') {
|
|
|
$loadingMask.addClass('hide');
|
|
|
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
|
|
|
window.rePosFooter();
|
|
|
} else if (data === 'end') {
|
|
|
|
|
|
//处理data等于end时如果loadingMask存在且没有hide样式的情况
|
|
|
if ($loadingMask && !$loadingMask.hasClass('hide')) {
|
|
|
$loadingMask.addClass('hide');
|
|
|
|
|
|
//$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -7296,7 +7335,7 @@ $(document).on('touchend', '.swiper-header', function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.invalidGoods').on('touchstart touchend', function() {
|
|
|
$('.invalidGoods').on('touchstart touchend', function(e) {
|
|
|
var $this = $(e.target).closest('span');
|
|
|
|
|
|
if ($this.hasClass('del-fav')) {
|
...
|
...
|
@@ -7305,6 +7344,7 @@ $('.invalidGoods').on('touchstart touchend', function() { |
|
|
tip.show('商品已下架');
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
});
|
|
|
define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -8375,7 +8415,9 @@ define("js/me/index", ["jquery","swiper","index"], function(require, exports, mo |
|
|
* @author: bikai<kai.bi@yoho.cn>
|
|
|
* @date: 2015/11/12
|
|
|
*/
|
|
|
var $ = require("jquery");
|
|
|
var $ = require("jquery"),
|
|
|
noticeScroll = require("js/plugin/notice-scroll");
|
|
|
|
|
|
var $userAvatar = $('.user-avatar'),
|
|
|
$listItem = $('.list-item');
|
|
|
var myImage = new Image(),
|
...
|
...
|
@@ -8391,6 +8433,8 @@ myImage.onload = function() { |
|
|
$userAvatar.css('background-image', 'url(' + avatar + ')');
|
|
|
};
|
|
|
|
|
|
noticeScroll('.notice', $('.notice').data('time') * 1000);
|
|
|
|
|
|
$('.yoho-page').on('touchstart', '.list-item, .type-item, .order-title', function() {
|
|
|
$listItem.removeClass('highlight');
|
|
|
$(this).addClass('highlight');
|
...
|
...
|
@@ -9903,6 +9947,26 @@ require("js/common"); |
|
|
|
|
|
lazyLoad();
|
|
|
|
|
|
function getQueryParam() {
|
|
|
var queryArray = location.search.substr(1).split('&'),
|
|
|
i,
|
|
|
subArr = [],
|
|
|
obj = {};
|
|
|
|
|
|
for (i = 0; i < queryArray.length; i++) {
|
|
|
subArr = queryArray[i].split('=');
|
|
|
obj[subArr[0]] = subArr[1];
|
|
|
subArr = [];
|
|
|
}
|
|
|
|
|
|
return obj;
|
|
|
}
|
|
|
|
|
|
function isLimitGood() {
|
|
|
return getQueryParam().limitproductcode;
|
|
|
}
|
|
|
|
|
|
|
|
|
if (window.getUid() !== orderInfo('uid')) {
|
|
|
order.init();
|
|
|
window.location.reload();
|
...
|
...
|
@@ -9919,6 +9983,18 @@ if (document.referrer && document.referrer.indexOf('/cart/index/index') !== -1) |
|
|
orderInfo('couponName', null);
|
|
|
}
|
|
|
|
|
|
isLimitGood() && (function() {
|
|
|
var a = [];
|
|
|
|
|
|
var data = getQueryParam();
|
|
|
|
|
|
data['type'] = 'limitcode';
|
|
|
|
|
|
a.push(data);
|
|
|
orderInfo('skuList', JSON.stringify(a));
|
|
|
orderInfo('limitUrlSufix', location.search);
|
|
|
})();
|
|
|
|
|
|
if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) {
|
|
|
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
|
|
|
}
|
...
|
...
|
@@ -9975,7 +10051,8 @@ function orderCompute() { |
|
|
deliveryId: orderInfo('deliveryId'),
|
|
|
paymentTypeId: orderInfo('paymentTypeId'),
|
|
|
couponCode: orderInfo('couponCode'),
|
|
|
yohoCoin: yohoCoin
|
|
|
yohoCoin: yohoCoin,
|
|
|
skuList: isLimitGood() ? orderInfo('skuList') : undefined
|
|
|
}
|
|
|
}).then(function(res) {
|
|
|
var priceHtml;
|
...
|
...
|
@@ -10050,7 +10127,9 @@ function submitOrder() { |
|
|
paymentTypeId: orderInfo('paymentTypeId'),
|
|
|
paymentType: orderInfo('paymentType'), //支付方式
|
|
|
couponCode: orderInfo('couponCode'),
|
|
|
yohoCoin: orderInfo('yohoCoin')
|
|
|
yohoCoin: orderInfo('yohoCoin'),
|
|
|
skuList: isLimitGood() ? orderInfo('skuList') : undefined
|
|
|
|
|
|
}
|
|
|
}).then(function(res) {
|
|
|
var url;
|
...
|
...
|
@@ -10455,7 +10534,7 @@ $('.address-item').on('touchend', function() { |
|
|
orderInfo('addressId', addressId);
|
|
|
orderInfo('address', address);
|
|
|
|
|
|
window.location.href = $this.data('href');
|
|
|
window.location.href = $this.data('href') + (orderInfo('limitUrlSufix') || '');
|
|
|
}).on('touchend', '.edit', function() {
|
|
|
window.location.href = $(this).data('href');
|
|
|
return false;
|
...
|
...
|
|