Authored by Rock Zhang

打包最新的静态资源

... ... @@ -4547,7 +4547,6 @@ var goodsSwiper;
require("js/product/detail/desc");
require("js/product/detail/comments-consults");
require("js/product/detail/like");
require("js/product/recommend-for-you");
lazyLoad($('img.lazy'));
... ... @@ -4586,9 +4585,6 @@ $('.goodsDiscount .dropdown').on('click', function() {
$('.goodsDiscount .discount-folder').slideUp();
}
});
});
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
/**
... ... @@ -4640,15 +4636,6 @@ function search() {
slidesPerView: 'auto'
});
//优选
// recommendSwiper = new Swiper('#swiper-recommend', {
// slidesPerView: 'auto',
// grabCursor: true,
// slideElement: 'li',
// lazyLoading: true,
// watchSlidesVisibility: true
// });
searching = false;
end = true;
loading.hideLoadingMask();
... ... @@ -4694,7 +4681,7 @@ $.get('/home/preference').then(function(html) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
... ... @@ -4763,11 +4750,12 @@ var $ = require("jquery"),
Hammer = require("hammer"),
tip = require("js/plugin/tip");
var likeHammer = new Hammer('#likeBtn');
var likeHammer = new Hammer(document.getElementById('likeBtn'));
likeHammer.on('tap', function(e) {
var productId = $('#productId').val(),
opt;
var $this = $(this);
if ($this.hasClass('liked')) {
... ... @@ -4796,7 +4784,12 @@ likeHammer.on('tap', function(e) {
tip.show('网络断开连接了~');
}
});
});
// $('#likeBtn').on('click', function(e) {
// return false;
// });
});
define("js/me/entry", ["jquery","hammer","lazyload","swiper","handlebars","source-map","index"], function(require, exports, module){
/**
... ... @@ -4811,6 +4804,7 @@ require("js/me/fav");
require("js/me/index");
require("js/me/coupons");
require("js/me/online-service");
require("js/me/address");
});
define("js/me/order", ["jquery","hammer","lazyload"], function(require, exports, module){
/**
... ... @@ -5240,12 +5234,17 @@ define("js/me/index", ["jquery","swiper","index"], function(require, exports, mo
var $ = require("jquery");
var $userAvatar = $('.user-avatar'),
$listItem = $('.list-item');
var myImage = new Image();
var myImage = new Image(),
avatar;
require("js/product/recommend-for-you");
myImage.src = $userAvatar.attr('src');
myImage.onerror = function() {
$userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
require("js/product/suspend-cart");
// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
$('.yoho-page').on('touchstart', '.list-item, .type-item', function() {
... ... @@ -5292,3 +5291,161 @@ $questionTab.on('touchend', function() {
});
});
define("js/me/address", ["jquery"], function(require, exports, module){
/**
* 地址管理
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/17
*/
var $ = require("jquery"),
tip = require("js/plugin/tip");
var $action = $('.action'),
$addressForm = $('.edit-address'),
$submit = $('.submit'),
$addAddress = $('.add-address'),
$editAddressPage = $('.my-edit-address-page'),
$addressListPage = $('.my-address-list-page'),
$area = $('.area'),
$footer = $('#yoho-footer'),
$confim = $('.confim-mask'),
isSubmiting,
deleteId,
newArea = [];
function editAddress(data) {
data = data || {};
$addressForm.find('[name="id"]').val(data.id || '');
$addressForm.find('[name="consignee"]').val(data.consignee || '');
$addressForm.find('[name="mobile"]').val(data.mobile || '');
$addressForm.find('[name="area_code"]').val(data.areaCode || '');
$addressForm.find('[name="area"]').val(data.area || '');
$addressForm.find('[name="address"]').val(data.address || '');
$editAddressPage.show();
// $addressForm.find('[name="address"]').blur();
// $addressForm.find('[name="consignee"]').focus();
}
$confim.on('touchend', '.cancel', function() {
deleteId = null;
$confim.hide();
}).on('touchend', '.confim', function() {
$.ajax({
method: 'POST',
url: '/home/deladdress',
data: {
id: deleteId
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
} else {
window.location.reload();
}
}).fail(function() {
tip.show('网络出了点问题~');
}).always(function() {
deleteId = null;
$confim.hide();
});
});
// 添加地址
$addAddress.on('touchend', function() {
editAddress();
});
// 编辑或删除
$action.on('touchend', '.edit', function() {
editAddress($(this).data());
}).on('touchend', '.del', function() {
deleteId = $(this).data('id');
$confim.show();
});
$submit.on('touchend', function() {
$addressForm.submit();
return false;
});
$addressForm.on('submit', function() {
if (isSubmiting) {
return false;
}
// 简单的表单校验
if (!$(this).find('[name="consignee"]').val()) {
tip.show('收件人不能为空');
$(this).find('[name="consignee"]').focus();
return false;
}
if (!$(this).find('[name="mobile"]').val()) {
tip.show('手机号不能为空');
$(this).find('[name="mobile"]').focus();
return false;
}
if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val()) {
tip.show('省市区不能为空');
return false;
}
if (!$(this).find('[name="address"]').val()) {
tip.show('地址不能为空');
$(this).find('[name="address"]').focus();
return false;
}
isSubmiting = true;
$.ajax({
method: 'POST',
url: '/home/saveaddress',
data: $(this).serialize()
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
} else {
window.location.reload();
}
}).fail(function() {
tip.show('网络出了点问题~');
}).always(function() {
isSubmiting = false;
});
return false;
});
// 省市区
$area.on('touchend', function() {
$footer.hide();
$addressListPage.show();
});
$addressListPage.on('touchend', '.address', function() {
newArea.push($(this).children('.caption').text());
$(this).siblings().hide();
$(this).children('ul').show();
return false;
}).on('touchend', '.address-last', function() {
// 填结果到 html
newArea.push($(this).children('.caption').text());
$('[name="area"]').val(newArea.join(' '));
$('[name="area_code"]').val($(this).data('id'));
// 恢复默认的三级选择
$addressListPage.hide();
$addressListPage.find('ul').hide();
$addressListPage.children('ul').show().children('li').show();
$footer.show();
newArea = [];
return false;
});
});
... ...
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.