Authored by Rock Zhang

Merge branch 'develop' into test

Conflicts:
	yohobuy/m.yohobuy.com/application/controllers/Kids.php
	yohobuy/m.yohobuy.com/application/controllers/Lifestyle.php

Too many changes to show.

To preserve performance only 8 of 8+ files are displayed.

... ... @@ -355,25 +355,15 @@ class AbstractAction extends Controller_Abstract
*
* @return void
*/
protected function setNavFooter()
protected function setNavFooterTab()
{
$footer = array();
// 已登录 @todo
$name = $this->getUname();
if (!empty($name)) {
$footer['user'] = array();
$footer['user']['name'] = $name; // 昵称
$footer['user']['url'] = ''; // 个人中心链接
$footer['user']['signoutUrl'] = '/passport/login/out'; // 登出链接
}
// 未登录
else {
$footer['loginUrl'] = '/signin.html'; // 登录链接
$footer['signupUrl'] = '/reg.html'; // 注册链接
}
$this->_view->assign('pageFooter', $footer);
$this->_view->assign('showFooterTab', array(
'indexUrl' => Helpers::url('/?go=1'), //首页
'categoryUrl' => Helpers::url('/cate'), // 分类
'guangUrl' => Helpers::url('', null, 'guang'), // 逛首页
'shoppingCartUrl' => Helpers::url('/cart/index/index'), // 购物车
'mineUrl' => Helpers::url('/home'), // 个人中心
));
}
/**
... ...
... ... @@ -112,7 +112,7 @@ class NewsaleData
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 600); // 缓存10分钟
return Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟
}
/**
... ...
... ... @@ -201,8 +201,8 @@ class Helpers
$result['product_id'] = $productData['product_id'];
$result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height);
$result['name'] = $productData['product_name'];
$result['price'] = $productData['market_price'];
$result['salePrice'] = $productData['sales_price'];
$result['price'] = $productData['market_price'] . '.00';
$result['salePrice'] = $productData['sales_price'] . '.00';
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_'
. $productData['goods_list'][0]['goods_id']
... ...
... ... @@ -100,6 +100,22 @@ server
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /boys/bottomBanner {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /girls/bottomBanner {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
# 商品相关
location = /cate {
... ...
define("index", ["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"], function(require, exports, module){
var yohobuy;
require("js/common");
require("js/passport/index");
require("js/guang/index");
require("js/home/index");
require("js/product/index");
require("js/index/index");
module.exports = yohobuy;
});
define("js/common", ["zepto"], function(require, exports, module){
/**
* 页面公共逻辑
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/21
*/
var $ = require("zepto");
function cookie(name) {
var cookies = document.cookie,
cookieVal,
offset;
if (document.cookie && document.cookie !== '') {
offset = cookies.indexOf(name + '=');
if (offset > -1) {
offset += name.length + 1;
cookieVal = decodeURIComponent($.trim(cookies.substring(offset, cookies.indexOf(';', offset))));
}
}
return cookieVal;
}
function setCookie(name, value, options) {
var expires = '',
path,
domain,
secure,
date;
if (typeof value !== 'undefined') {
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
if (options.expires &&
(typeof options.expires === 'number' || options.expires.toUTCString)) {
if (typeof options.expires === 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString();
}
path = options.path ? '; path=' + options.path : '';
domain = options.domain ? '; domain=' + options.domain : '';
secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
}
}
function getUser() {
var c = cookie('_UID'),
user;
if (typeof c === 'undefined') {
return 0;
}
user = c.split('::');
if (typeof user === 'undefined' || user.length < 4) {
return 0;
}
return user;
}
function getUid() {
var user = getUser();
if (user === 0) {
return 0;
}
return user[1];
}
function getShoppingKey() {
var c = cookie('_g');
if (typeof c === 'undefined') {
return '';
}
return JSON.parse(c).k;
}
//页面通用底部位置及status设置
(function () {
var $footer = $('#yoho-footer'),
$op = $footer.children('.op-row');
var user = getUser();
if ($('body').height() < $(window).height()) {
$footer.addClass('bottom');
}
if (user === 0) {
//未登录
$op.prepend(
'<a href="http://m.yohobuy.com/signin.html">登录</a>' +
'<span class="sep-line">|</span>' +
'<a href="http://m.yohobuy.com/reg.html">注册</a>'
);
} else {
//已登录
$op.prepend(
'Hi,' +
'<a class="user-name" href="http://m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>'
);
}
$footer.removeClass('hide');
}());
//暴露公共接口
window.cookie = cookie;
window.setCookie = setCookie;
window.getUser = getUser;
window.getUid = getUid;
window.getShoppingKey = getShoppingKey;
});
define("js/passport/index", ["zepto"], function(require, exports, module){
/**
* 注册、登录、密码找回打包入口
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
//注册
require("js/passport/register/register");
require("js/passport/register/code");
require("js/passport/register/password");
//登录
require("js/passport/login/login");
require("js/passport/login/international");
//密码找回
require("js/passport/back/mobile");
require("js/passport/back/code");
require("js/passport/back/email");
require("js/passport/back/email-success");
require("js/passport/back/new-password");
});
define("js/passport/register/register", ["zepto"], function(require, exports, module){
/**
* 注册
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var $phoneNum = $('#phone-num'),
$countrySelect = $('#country-select'),
$areaCode = $('#area-code'),
$btnNext = $('#btn-next');
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
api.selectCssHack($('#country-select'));
api.bindClearEvt();
$phoneNum.bind('input', function() {
if (trim($phoneNum.val()) === '') {
$btnNext.addClass('disable');
} else {
$btnNext.removeClass('disable');
}
});
$countrySelect.change(function() {
$areaCode.text($countrySelect.val());
});
$btnNext.on('tap', function() {
var pn = trim($phoneNum.val()),
areaCode = $countrySelect.val();
if ($btnNext.hasClass('disable')) {
return;
}
if (api.phoneRegx[areaCode].test(pn)) {
$.ajax({
url: '/passport/reg/verifymobile',
type: 'POST',
data: {
areaCode: areaCode.replace('+', ''),
phoneNum: pn
},
success: function(data) {
if (data.code === 200) {
location.href = data.data;
} else {
showErrTip(data.message);
}
}
});
} else {
showErrTip('手机号格式不正确,请重新输入');
}
});
});
define("js/passport/api", ["zepto"], function(require, exports, module){
/**
* 登录注册公用API
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var trim = $.trim;
//邮箱验证规则
var emailRegx = /^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
//手机号码验证规则
var phoneRegx = {
'+86': /^1[35847]{1}[0-9]{9}$/,
'+852': /^[965]{1}[0-9]{7}$/,
'+853': /^[0-9]{8}$/,
'+886': /^[0-9]{10}$/,
'+65': /^[98]{1}[0-9]{7}$/,
'+60': /^1[1234679]{1}[0-9]{8}$/,
'+1': /^[0-9]{10}$/,
'+82': /^01[0-9]{9}$/,
'+44': /^7[789][0-9]{8}$/,
'+81': /^0[9|8|7][0-9]{9}$/,
'+61': /^[0-9]{11}$/
};
/**
* 密码显示隐藏
* @params opt 初始化参数
*/
function bindEyesEvt(opt) {
var $hasEye = $('.has-eye'),
$eye;
if (opt && opt.status === 'open') {
$hasEye.append('<div class="eye"></div>');
} else {
$hasEye.append('<div class="eye close"></div>');
}
$eye = $hasEye.children('.eye');
$eye.on('tap', function(e) {
var $this = $(this),
$pwd = $this.siblings('.pwd');
e.preventDefault();
$this.toggleClass('close');
//切换密码显示和文本显示
if ($this.hasClass('close')) {
$pwd.attr('type', 'password');
} else {
$pwd.attr('type', 'text');
}
$pwd.focus();
});
}
// 清空账号显示
function bindClearEvt() {
var $hasClear = $('.has-clear'),
$clear;
$hasClear.append('<div class="clear-input"></div>');
$clear = $hasClear.children('.clear-input');
$clear.on('tap', function(e) {
var $input = $clear.siblings('.input');
$input.val('').trigger('input').focus();
e.preventDefault();
});
//反向逻辑
$hasClear.children('.input').bind('input', function() {
var $this = $(this),
$thisClear = $this.siblings('.clear-input'),
val = trim($this.val());
if (val === '') {
$thisClear.hide();
} else {
$thisClear.show();
}
});
}
// 密码长度验证
function pwdValidate(pwd) {
if (pwd.length >= 6 && pwd.length <= 20) {
return true;
}
return false;
}
// hack for resolving direction:rtl didn't work in android uc
function selectCssHack($countrySelect) {
var u = navigator.userAgent;
function autoSelectWidth() {
var wordCount = $countrySelect.find('option:selected').text().length;
switch (wordCount) {
//分别有2,3,4个汉字的情况
case 2:
$countrySelect.outerWidth(90);
break;
case 3:
$countrySelect.outerWidth(110);
break;
default:
$countrySelect.outerWidth(130);
}
}
if (u.match(/uc/i) && u.match(/android/i)) {
$countrySelect.change(function() {
autoSelectWidth();
});
} else {
$countrySelect.removeClass('in-android-uc');
}
}
//Exports APIs
module.exports = {
emailRegx: emailRegx,
phoneRegx: phoneRegx,
bindEyesEvt: bindEyesEvt,
bindClearEvt: bindClearEvt,
pwdValidate: pwdValidate,
selectCssHack: selectCssHack
};
});
define("js/plugin/tip", ["zepto"], function(require, exports, module){
/**
* 弹框提示
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var $ = require("zepto");
var $tip, tipItime;
/**
* 初始化提示框
*/
(function() {
var tipHtml = '<div id="yoho-tip" class="yoho-tip"></div>';
//插入提示HTML
$('.yoho-page').append(tipHtml);
$tip = $('#yoho-tip');
$tip.on('tap', function() {
$tip.hide();
//清除Timeout
clearTimeout(tipItime);
});
}());
/**
* 显示提示
*/
function show(con, dur) {
var content, duration;
if (typeof con === 'undefined') {
return;
}
content = con.toString();
duration = (dur && dur > 0) ? dur : 2000;
$tip.text(content).show();
tipItime = setTimeout(function() {
if ($tip.css('display') === 'block') {
$tip.hide();
}
}, duration);
}
exports.show = show;
});
define("js/passport/register/code", ["zepto"], function(require, exports, module){
/**
* 注册-验证码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
require("js/passport/code")(true);
});
define("js/passport/code", ["zepto"], function(require, exports, module){
/**
* 注册/找回密码-验证码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
module.exports = function(useInRegister) {
var $captcha = $('#captcha'),
$btnNext = $('#btn-next'),
$captchaTip = $('#captcha-tip'),
phoneNum = $('#phone-num').val(),
areaCode = $('#area-code').val().replace('+', '');
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
var urlMid = useInRegister ? 'reg' : 'back';
function countDown() {
var count = 59,
itime;
itime = setInterval(function() {
if (count === 0) {
$captchaTip.text('重发验证码').removeClass('disable');
clearInterval(itime);
} else {
$captchaTip.text('重发验证码 (' + count-- + '秒)');
}
}, 1000);
}
api.bindClearEvt();
$captcha.bind('input', function() {
if (trim($captcha.val()) !== '') {
$btnNext.removeClass('disable');
} else {
$btnNext.addClass('disable');
}
});
//重新发送验证码
$captchaTip.on('tap', function() {
if ($captchaTip.hasClass('disable')) {
return;
}
$.ajax({
type: 'POST',
url: '/passport/' + urlMid + '/sendcode',
data: {
phoneNum: phoneNum,
areaCode: areaCode
},
success: function(data) {
if (data.code === 200) {
$captchaTip.text('重发验证码 (60秒)').addClass('disable');
countDown();
} else {
//验证码不正确,显示提示
showErrTip(data.message);
}
}
});
});
$btnNext.on('tap', function() {
if ($btnNext.hasClass('disable')) {
return;
}
$.ajax({
type: 'POST',
url: '/passport/' + urlMid + '/verifycode',
data: {
phoneNum: phoneNum,
areaCode: areaCode,
code: trim($captcha.val()),
token: $('#token').val()
},
success: function(data) {
if (data.code === 200) {
location.href = data.data;
} else {
//验证码不正确,显示提示
showErrTip(data.message);
}
}
});
});
countDown();
};
});
define("js/passport/register/password", ["zepto"], function(require, exports, module){
/**
* 注册-密码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var $pwd = $('#pwd'),
$btnSure = $('#btn-sure');
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
api.bindEyesEvt({
status: 'open' //默认眼睛打开
});
$pwd.bind('input', function() {
if (trim($pwd.val()) === '') {
$btnSure.addClass('disable');
} else {
$btnSure.removeClass('disable');
}
});
$btnSure.on('tap', function() {
var pwd = trim($pwd.val());
if ($btnSure.hasClass('disable')) {
return;
}
if (api.pwdValidate(pwd) === false) {
showErrTip('密码6-20位,请重新输入');
} else {
$.ajax({
type: 'POST',
url: '/passport/reg/setpassword',
data: {
password: pwd,
phoneNum: $('#phone-num').val(),
areaCode: $('#area-code').val(),
token: $('#token').val()
},
success: function(data) {
if (data.code === 200) {
showErrTip('注册成功');
//1000ms后跳转页面
setTimeout(function() {
location.href = data.data;
}, 1000);
} else {
if (data.code === 401 || data.code === 404 || data.code === 505) {
showErrTip(data.message);
} else {
showErrTip(data.message);
setTimeout(function() {
location.href = data.data;
}, 1000);
}
}
}
});
}
});
});
define("js/passport/login/login", ["zepto"], function(require, exports, module){
/**
* 登录
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/9/30
*/
var $ = require("zepto");
var $account = $('#account'),
$pwd = $('#pwd'),
$loginBtn = $('#btn-login'),
$mask = $('#retrive-pwd-mask'),
$ways = $('#retrive-pwd-ways'),
accPass = false,
pwdPass = false;
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
//登录按钮状态切换
function switchLoginBtnStatus() {
if (accPass && pwdPass) {
$loginBtn.removeClass('disable');
} else {
$loginBtn.addClass('disable');
}
}
//显示找回密码面板
function showRetrivePanel() {
$mask.show();
$ways.show();
}
//隐藏找回密码面板
function hideRetrivePanel() {
$mask.hide();
$ways.hide();
}
//密码显示与隐藏
api.bindEyesEvt();
//清空账号输入框
api.bindClearEvt();
$account.bind('input', function() {
if (trim($account.val()) !== '') {
accPass = true;
} else {
accPass = false;
}
switchLoginBtnStatus();
});
$pwd.bind('input', function() {
if (trim($pwd.val()) === '') {
pwdPass = false;
} else {
pwdPass = true;
}
switchLoginBtnStatus();
});
// Login
$loginBtn.on('tap', function() {
var acc = trim($account.val()),
pwd = trim($pwd.val());
if ($loginBtn.hasClass('disable')) {
return;
}
//验证账号(数字或者邮箱)和密码合理性
if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) {
$.ajax({
type: 'POST',
url: '/passport/login/auth',
data: {
account: acc,
password: pwd
},
success: function(data) {
if (data.code === 200) {
showErrTip('登录成功');
//1s后跳转页面
setTimeout(function() {
location.href = data.data;
}, 1000);
} else {
showErrTip(data.message);
}
},
error: function() {
showErrTip('网络断开连接啦~');
}
});
} else {
showErrTip('账号或密码有错误,请重新输入');
}
});
$('#forget-pwd').on('tap', function() {
showRetrivePanel();
});
$mask.on('tap', function() {
hideRetrivePanel();
});
$('#cancel-retrive').on('tap', function(e) {
e.preventDefault();
hideRetrivePanel();
});
//对初始有默认值的情况去初始化登录按钮状态
$account.trigger('input');
$pwd.trigger('input');
});
define("js/passport/login/international", ["zepto"], function(require, exports, module){
/**
* 国际账号登录
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var $phoneNum = $('#phone-num'),
$countrySelect = $('#country-select'),
$areaCode = $('#area-code'),
$pwd = $('#pwd'),
$loginBtn = $('#btn-login'),
pnPass = false,
pwdPass = false;
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
//登录按钮状态切换
function switchLoginBtnStatus() {
if (pnPass && pwdPass) {
$loginBtn.removeClass('disable');
} else {
$loginBtn.addClass('disable');
}
}
//Android-UC下显示select的direction:rtl无效的临时解决办法
api.selectCssHack($countrySelect);
//显示隐藏密码
api.bindEyesEvt();
//清空手机号码
api.bindClearEvt();
$phoneNum.bind('input', function() {
if (trim($phoneNum.val()) === '') {
pnPass = false;
} else {
pnPass = true;
}
switchLoginBtnStatus();
});
$pwd.bind('input', function() {
var pwd = trim($pwd.val());
if (pwd === '') {
pwdPass = false;
} else {
pwdPass = true;
}
switchLoginBtnStatus();
});
$countrySelect.change(function() {
$areaCode.text($countrySelect.val());
});
$loginBtn.on('tap', function() {
var pn = trim($phoneNum.val()),
areaCode = $countrySelect.val(),
pwd = trim($pwd.val());
if ($loginBtn.hasClass('disable')) {
return;
}
if (api.phoneRegx[areaCode].test(pn) && api.pwdValidate(pwd)) {
$.ajax({
type: 'POST',
url: '/passport/login/auth',
data: {
areaCode: areaCode.replace('+', ''),
account: pn,
password: pwd
},
success: function(data) {
if (data.code === 200) {
showErrTip('登录成功');
//1000ms后跳转页面
setTimeout(function() {
location.href = data.data;
}, 1000);
} else {
showErrTip(data.message);
}
},
error: function() {
showErrTip('网络断开连接啦~');
}
});
} else {
showErrTip('账号或密码有错误,请重新输入');
}
});
//对初始有默认值的情况去初始化登录按钮状态
$phoneNum.trigger('input');
$pwd.trigger('input');
});
define("js/passport/back/mobile", ["zepto"], function(require, exports, module){
/**
* 找回密码-手机
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var $phoneNum = $('#phone-num'),
$countrySelect = $('#country-select'),
$areaCode = $('#area-code'),
$btnNext = $('#btn-next');
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
api.selectCssHack($('#country-select'));
api.bindClearEvt();
$phoneNum.bind('input', function() {
if (trim($phoneNum.val()) === '') {
$btnNext.addClass('disable');
} else {
$btnNext.removeClass('disable');
}
});
$countrySelect.change(function() {
$areaCode.text($countrySelect.val());
});
$btnNext.on('tap', function() {
var pn = trim($phoneNum.val()),
area = $countrySelect.val();
if ($btnNext.hasClass('disable')) {
return;
}
if (api.phoneRegx[area].test(pn)) {
$.ajax({
url: '/passport/back/sendcode',
type: 'POST',
data: {
areaCode: area.replace('+', ''),
phoneNum: pn
},
success: function(data) {
if (data.code === 200) {
location.href = data.data;
} else {
showErrTip(data.message);
}
}
});
} else {
showErrTip('手机号格式不正确,请重新输入');
}
});
});
define("js/passport/back/code", ["zepto"], function(require, exports, module){
/**
* 找回密码-验证码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
require("js/passport/code")(false);
});
define("js/passport/back/email", ["zepto"], function(require, exports, module){
/**
* 找回密码-邮箱找回
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var $email = $('#email'),
$btnSure = $('#btn-sure');
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
api.bindClearEvt();
$email.bind('input', function() {
if (trim($email.val()) === '') {
$btnSure.addClass('disable');
} else {
$btnSure.removeClass('disable');
}
});
$btnSure.on('tap', function() {
var email = trim($email.val());
if ($btnSure.hasClass('disable')) {
return;
}
if (api.emailRegx.test(email)) {
$.ajax({
url: '/passport/back/sendemail',
type: 'POST',
data: {
email: email
},
success: function(data) {
if (data.code === 200) {
location.href = data.data;
} else {
showErrTip(data.message);
}
}
});
} else {
showErrTip('邮箱格式不正确,请重新输入');
}
});
});
define("js/passport/back/email-success", ["zepto"], function(require, exports, module){
/**
* 找回密码-邮箱找回成功
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var $resend = $('#resend');
var tip = require("js/plugin/tip"),
showErrTip = tip.show;
$resend.on('tap', function(e) {
e.preventDefault();
$.ajax({
url: $resend.data('url'),
type: 'GET',
success: function(data) {
if (data.code === 200) {
showErrTip(data.message);
} else {
showErrTip(data.message);
}
}
});
});
});
define("js/passport/back/new-password", ["zepto"], function(require, exports, module){
/**
* 密码找回-新密码
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/8
*/
var $ = require("zepto");
var $pwd = $('#pwd'),
$btnOk = $('#btn-ok');
var api = require("js/passport/api");
var tip = require("js/plugin/tip");
var trim = $.trim;
var showErrTip = tip.show;
var $phoneNum = $('#phone-num');
api.bindEyesEvt();
$pwd.bind('input', function() {
if (trim($pwd.val()) === '') {
$btnOk.addClass('disable');
} else {
$btnOk.removeClass('disable');
}
});
$btnOk.on('tap', function() {
var pwd = trim($pwd.val()),
mobileBack = true,
setting,
url;
if ($btnOk.hasClass('disable')) {
return;
}
setting = {
password: pwd
};
if ($phoneNum.length === 0) {
mobileBack = false;
}
if (mobileBack) {
$.extend(setting, {
phoneNum: $phoneNum.val(),
areaCode: $('#areaCode').val(),
token: $('#token').val()
});
url = '/passport/back/passwordByMobile';
} else {
$.extend(setting, {
code: $('#email-code').val()
});
url = '/passport/back/passwordByEmail';
}
if (api.pwdValidate(pwd)) {
$.ajax({
type: 'POST',
url: url,
data: setting,
success: function(data) {
if (data.code === 200) {
showErrTip('密码修改成功');
//1000ms后跳转页面
setTimeout(function() {
location.href = data.data;
}, 1000);
} else {
showErrTip(data.message);
}
}
});
} else {
showErrTip('密码6-20位,请重新输入');
}
});
});
define("js/guang/index", ["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"], function(require, exports, module){
/**
* 逛打包入口
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/9
*/
require("js/guang/plus-star/list");
require("js/guang/plus-star/detail");
require("js/guang/home");
require("js/guang/list");
require("js/guang/detail");
});
define("js/guang/plus-star/list", ["zepto","lazyload","swiper","index"], function(require, exports, module){
/**
* PLUS+STAR列表页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var $ = require("zepto"),
lazyLoad = require("lazyload"),
Swiper = require("swiper");
var $navs = $('#nav-tab > li'),
$contents = $('#ps-content > .content');
var mySwiper;
lazyLoad($('img.lazy'));
mySwiper = new Swiper('.swiper-container', {
lazyLoading: true,
pagination: '.swiper-pagination'
});
$('#nav-tab').delegate('li', 'tap', function() {
if ($(this).hasClass('focus')) {
return;
}
$navs.toggleClass('focus');
$contents.toggleClass('hide');
$(document).trigger('scroll'); //Trigger lazyLoad
});
});
define("js/guang/plus-star/detail", ["zepto","mlellipsis","lazyload"], function(require, exports, module){
/**
* PLUS+STAR详情页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var $ = require("zepto"),
ellipsis = require("mlellipsis"),
lazyLoad = require("lazyload");
var $intro = $('#intro'),
$imt = $('#intro-more-txt'),
$infosContainer = $('#related-infos-container');
var info = require("js/guang/info");
var tip = require("js/plugin/tip");
var brandId = $('#brand-info').data('id');
var mIntro, aIntro;
ellipsis.init();
//Init LazyLoad
lazyLoad($('img.lazy'));
//文字介绍文字截取
$intro[0].mlellipsis(3);
//获取截取文字和完整文字
setTimeout(function() {
mIntro = $intro.text();
aIntro = $intro.attr('title');
});
info.initInfosEvt($infosContainer);
//文字介绍收起与展开
$('#more-intro').bind('tap', function() {
var $this = $(this);
$this.toggleClass('spread');
if ($this.hasClass('spread')) {
//显示
$intro.text(aIntro);
$imt.text('收起');
} else {
//隐藏
$intro.text(mIntro);
$imt.text('more');
}
});
//品牌收藏
$('#brand-like').bind('tap', function(e) {
var opt = 'ok',
$this = $(this);
e.preventDefault();
if ($this.hasClass('like')) {
opt = 'cancel';
}
$.ajax({
type: 'POST',
url: '/product/opt/favoriteBrand',
data: {
id: brandId,
opt: opt
},
success: function(data) {
if (data.code === 200) {
$this.toggleClass('like');
} else if (data.code === 400) {
tip.show('未登录');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
});
});
define("js/guang/info", ["zepto","mlellipsis","lazyload"], function(require, exports, module){
/**
* 资讯相关API
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var $ = require("zepto"),
ellipsis = require("mlellipsis"),
lazyLoad = require("lazyload");
var tip = require("js/plugin/tip");
var $loadMoreInfo = $('#load-more-info');
var $loading = $(''),
$noMore = $('');
var loading = false;
ellipsis.init();
if ($loadMoreInfo.length > 0) {
$loading = $loadMoreInfo.children('.loading');
$noMore = $loadMoreInfo.children('.no-more');
}
/**
* 设置指定资讯项的Lazyload和文字截取
* @params $infos 资讯项
*/
function setLazyLoadAndMellipsis($infos) {
lazyLoad($infos.find('img.lazy'));
$infos.each(function() {
var $this = $(this),
$title = $this.find('.info-title'),
$text = $this.find('.info-text');
$title[0].mlellipsis(2);
$text[0].mlellipsis(2);
});
}
/**
* 初始化资讯列表事件绑定
* @params $container 逛资讯列表容器
*/
function initInfosEvt($container) {
$container.delegate('.like-btn', 'tap', function(e) {
var $likeBtn = $(e.currentTarget),
$info = $likeBtn.closest('.guang-info'),
opt = 'ok';
if ($likeBtn.hasClass('like')) {
opt = 'cancel';
}
$.ajax({
type: 'POST',
url: '/guang/opt/praiseArticle',
data: {
id: $info.data('id'),
opt: opt
},
success: function(data) {
var code = data.code;
if (code === 200) {
$likeBtn.next('.like-count').text(data.data);
//切换点赞状态
$likeBtn.toggleClass('like');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
});
setLazyLoadAndMellipsis($container.find('.guang-info'));
}
/**
* 资讯LoadMore
*/
function loadMore($container, opt) {
if (loading) {
return;
}
if (opt.end) {
return;
}
loading = true;
$.ajax({
type: 'GET',
url: ' /guang/index/page',
data: opt,
success: function(data) {
if (data === ' ') {
opt.end = true;
loading = false;
//
$loading.addClass('hide');
$noMore.removeClass('hide');
return;
}
$container.append(data);
setLazyLoadAndMellipsis($container.find('.guang-info'));
opt.page++;
loading = false;
},
error: function() {
tip.show('网络断开连接了~');
loading = false;
}
});
}
exports.initInfosEvt = initInfosEvt;
exports.setLazyLoadAndMellipsis = setLazyLoadAndMellipsis;
exports.loadMore = loadMore;
});
define("js/guang/home", ["zepto","swiper","mlellipsis","lazyload","index"], function(require, exports, module){
/**
* 逛首页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var $ = require("zepto"),
Swiper = require("swiper");
var info = require("js/guang/info"),
setLazyLoadAndMellipsis = info.setLazyLoadAndMellipsis,
loadMore = info.loadMore;
var $loadMoreInfo = $('#load-more-info');
var $loading = $(''),
$noMore = $('');
var winH = $(window).height(),
loadMoreH = $loadMoreInfo.height();
var $infoList = $('#info-list'),
$infos = $infoList.children('.info-list'),
$nav = $('#guang-nav'),
$curNav = $nav.children('.focus'),
curType = $curNav.data('type');
var state = {};
var mySwiper;
if ($loadMoreInfo.length > 0) {
$loading = $loadMoreInfo.children('.loading');
$noMore = $loadMoreInfo.children('.no-more');
}
mySwiper = new Swiper('.swiper-container', {
lazyLoading: true,
pagination: '.swiper-pagination'
});
info.initInfosEvt($infoList);
//初始化各Nav下资讯加载的状态
(function() {
var gender = $('#gender').val();
$nav.children('.guang-nav-item').each(function() {
var type = $(this).data('type');
state[type] = {
page: 1,
gender: gender,
type: type,
end: false
};
});
}());
$nav.delegate('.guang-nav-item', 'tap', function() {
var $this = $(this),
$content,
index;
if ($this.hasClass('focus')) {
return;
}
index = $this.index();
$this.addClass('focus');
$curNav.removeClass('focus');
$infos.not('.hide').addClass('hide');
$content = $infos.eq(index);
$content.removeClass('hide');
//lazyload & mellipsis
setLazyLoadAndMellipsis($content.children('.guang-info'));
$curNav = $this;
curType = $this.data('type');
//重置当前Tab的load-more
if (state[curType].end) {
$loading.addClass('hide');
$noMore.removeClass('hide');
} else {
$loading.removeClass('hide');
$noMore.addClass('hide');
}
});
$(document).scroll(function() {
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
loadMore($infos, state[curType]);
}
});
});
define("js/guang/list", ["zepto","mlellipsis","lazyload"], function(require, exports, module){
/**
* 列表页,编辑页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/10
*/
var $ = require("zepto");
var info = require("js/guang/info"),
loadMore = info.loadMore;
var winH = $(window).height(),
loadMoreH = $('#load-more').height();
var $author = $('#author-infos');
var $tag = $('#tag');
var setting = {
page: 1,
end: false
};
var $infos = $('#info-list');
info.initInfosEvt($infos);
if ($author.length > 0) {
$.extend(setting, {
authorId: $author.data('id')
});
}
if ($tag.length > 0) {
$.extend(setting, {
tag: $tag.val()
});
}
$(document).scroll(function() {
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
loadMore($infos, setting);
}
});
});
define("js/guang/detail", ["zepto","mlellipsis","lazyload","iscroll-probe"], function(require, exports, module){
/**
* 逛详情页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/13
*/
var $ = require("zepto"),
ellipsis = require("mlellipsis"),
lazyLoad = require("lazyload"),
IScroll = require("iscroll-probe");
var $authorIntro = $('.author .intro');
var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
var hasCollocationBlock = $('.collocation-block').length > 0 ? true : false;
//collocation block variable
var thumbWidth = 0,
$fixedThumbContainer = $(''),
$coBlock, $thumbContainer, $thumbs, $prods,
scrollToEl;
var scrollToEl = document.querySelector('#wrapper .collocation-block');
var winW = $(window).width();
var myScroll;
/**
* 计算搭配的箭头的位置
* @param $curPos 当前focus的搭配项
*/
function posCollocationArrow($curCo) {
var left = $curCo.offset().left,
bgPos = -winW + left + (thumbWidth / 2) + 'px';
$thumbContainer.css({
backgroundPosition: bgPos + ' bottom'
});
if (isIphone) {
$fixedThumbContainer.css({
backgroundPosition: bgPos + ' bottom'
});
}
}
//搭配thumb的touch事件句柄
function thumbTouchEvt(e) {
var $curCo = $(e.currentTarget),
index = $curCo.index(),
$brother, $brotherCo,
$curProds;
if ($curCo.hasClass('focus')) {
return;
}
$thumbs.filter('.focus').removeClass('focus');
if (isIphone) {
if ($curCo.closest('.fixed-thumb-container').length > 0) {
$brother = $thumbContainer;
} else {
$brother = $fixedThumbContainer;
}
$brotherCo = $brother.find('.thumb').eq(index);
$fixedThumbContainer.find('.thumb.focus').removeClass('focus');
$brotherCo.addClass('focus');
}
$curCo.addClass('focus');
//定位arrow
posCollocationArrow($curCo);
$prods.not('.hide').addClass('hide');
$curProds = $prods.eq(index);
$curProds.removeClass('hide');
//
lazyLoad($curProds.find('.lazy'));
if (isIphone) {
if (myScroll) {
myScroll.scrollToElement(scrollToEl, 400);
}
} else {
$('body').animate({
scrollTop: $coBlock.offset().top
}, 400);
}
}
if (isIphone) {
$('#wrapper').addClass('ios');
}
ellipsis.init();
lazyLoad($('.lazy'));
//title mlellipsis
$('.info-list .title, .one-good .reco-name').each(function() {
this.mlellipsis(2);
});
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
if (parseInt($authorIntro.offset().left, 10) === parseInt($authorIntro.css('margin-left'), 10)) {
$authorIntro.css('padding-top', 0);
}
//有搭配模块,iphone使用iscroll初始化滚动并有固定的搭配栏,其他的没有
if (hasCollocationBlock) {
$coBlock = $('.collocation-block');
$thumbContainer = $coBlock.children('.thumb-container');
$thumbs = $thumbContainer.find('li');
$prods = $coBlock.find('.prod');
thumbWidth = $thumbs.width();
if (isIphone) {
$fixedThumbContainer = $('#wrapper')
.after($thumbContainer.clone().addClass('fixed-thumb-container fixed-bottom'))
.next('.thumb-container');
//load img of fixed thumb container
lazyLoad($fixedThumbContainer.find('.lazy'), {
event: 'sporty'
});
}
//Init Arrow Position
posCollocationArrow($thumbs.filter('.focus'));
$thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
if (isIphone) {
$fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
}
}
// 初始化iscroll
window.onload = function() {
var $scroller = $('#scroller');
var winH, tcH, cbH, cbTop, fixedThumbDom;
if (!isIphone) {
return;
}
myScroll = new IScroll('#wrapper', {
probeType: 3,
mouseWheel: true,
click: true
});
document.addEventListener('touchmove', function (e) {
e.preventDefault();
}, false);
if (!hasCollocationBlock) {
myScroll.on('scroll', function() {
$scroller.trigger('scroll');
});
return;
}
winH = $(window).height();
fixedThumbDom = $fixedThumbContainer[0];
tcH = $thumbContainer.height();
cbH = $coBlock.height();
cbTop = $coBlock.offset().top;
myScroll.on('scroll', function() {
var sTop = -this.y;
var classList = fixedThumbDom.className;
if (sTop <= cbTop - winH + tcH) {
if (classList.indexOf('fixed-bottom') === -1) {
$fixedThumbContainer
.addClass('fixed-bottom')
.removeClass('hide');
}
} else if (sTop <= cbTop) {
if (classList.indexOf('hide') === -1) {
$fixedThumbContainer
.addClass('hide')
.removeClass('fixed-bottom fixed-top');
}
} else if (sTop <= cbTop + cbH - tcH) {
if (classList.indexOf('fixed-top') === -1) {
$fixedThumbContainer
.addClass('fixed-top')
.removeClass('hide absolute')
.css('top', '');
}
} else if (sTop <= cbTop + cbH) {
if (classList.indexOf('absolute') === -1) {
$fixedThumbContainer
.addClass('absolute')
.removeClass('fixed-top hide');
}
fixedThumbDom.style.top = cbTop + cbH - tcH - sTop + 'px';
} else if (sTop > cbTop + cbH) {
if (classList.indexOf('hide') === -1) {
$fixedThumbContainer
.addClass('hide')
.removeClass('absolute');
}
}
$scroller.trigger('scroll');
});
};
});
define("js/home/index", ["zepto","swiper","lazyload","index"], function(require, exports, module){
/**
* 首页打包入口
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
require("js/home/home");
require("js/home/maybe-like");
});
define("js/home/home", ["zepto","swiper","lazyload","index"], function(require, exports, module){
/**
* 首页
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
var $ = require("zepto"),
Swiper = require("swiper"),
lazyLoad = require("lazyload"),
bannerSwiper,
recommendSwiper,
hotBrandsSwiper,
trendTopicSwiper,
goodsSwiper;
var requestFrame,
thisFunc,
start = 0,
i,
swiperClass,
supportCss3,
$logotrans = $('.home-header .logo'),
isen = true;
require("js/home/maybe-like");
lazyLoad($('img.lazy'));
//$('img:in-viewport').trigger('appear');
//点击首页汉堡menu图标,滑出侧栏导航
$('.nav-btn').on('tap', function (event) {
if (!$(this).hasClass('menu-open')) {
$('.mobile-wrap').addClass('menu-open');
$('.overlay').addClass('show');
$('.side-nav').addClass('on');
//设置boy高宽,页面不能上下滑动
$('body').css({
height: $(window).height(),
width: '100%',
overflow: 'hidden'
});
}
event.stopPropagation();
});
//点击页面主体,收起侧栏导航及二级导航
$('.mobile-wrap').on('tap', function () {
if ($(this).hasClass('menu-open')) {
$('.mobile-wrap').removeClass('menu-open');
$('.overlay').removeClass('show');
$('.sub-nav').removeClass('show');
$('.side-nav').removeClass('on');
$('body').css({
height: 'auto',
overflow: 'auto'
});
}
});
//点击一级导航,弹出二级导航
$('.side-nav').on('tap', 'li', function () {
if ($(this).find('.sub-nav').size() > 0) {
$('.sub-nav').removeClass('show');
$(this).find('.sub-nav').addClass('show');
}
});
//返回一级导航,收起二级导航
$('.sub-nav').each(function () {
$(this).find('li').eq(0).on('tap', function (e) {
$('.sub-nav').removeClass('show');
e.stopPropagation();
});
});
//二级导航样式控制
$('.sub-nav').on('mouseenter', 'li', function () {
if ($(this).index() !== 0) {
$(this).addClass('current').siblings().removeClass('current');
}
});
//头部banner轮播
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.banner-top .pagination-inner'
});
}
//热门品牌滑动
hotBrandsSwiper = new Swiper('.brands-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'brands-list',
slideElement: 'li'
});
//推荐搭配滑动
recommendSwiper = new Swiper('.recommend-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'recommend-list',
slideElement: 'li'
});
//潮品话题轮播
if ($('.trend-topic-swiper').find('li').size() > 1) {
trendTopicSwiper = new Swiper('.trend-topic-swiper', {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.trend-topic-content .pagination-inner'
});
}
//潮流上装/经典裤装等轮播
$('.category-swiper').each(function (i, index) {
swiperClass = 'category-swiper' + i;
$(this).addClass(swiperClass);
if ($('.' + swiperClass).find('.swiper-slide').size() > 1) {
goodsSwiper = new Swiper('.' + swiperClass, {
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.' + swiperClass + ' .pagination-inner'
});
}
});
//关闭头部下载浮层
$('.header-download').on('tap', '.close-btn', function () {
$(this).parent().remove();
});
//logo动画
requestFrame = (function () {
var tempFunc = null,
prefixList = ['webkit', 'moz', 'ms'];
for (i = 0; i < prefixList.length; i++) {
thisFunc = prefixList[i] + 'RequestAnimationFrame';
if (window[thisFunc]) {
supportCss3 = true;
tempFunc = thisFunc;
}
}
if (supportCss3) {
return function (callback) {
window[tempFunc](callback);
};
}
return function (callback) {
window.setTimeout(callback, 67);
};
})();
function tsAnimate() {
start = start + 10;
$logotrans.css({
transform: 'rotateX(' + start + 'deg)',
'-webkit-transform': 'rotateX(' + start + 'deg)',
'-moz-transform': 'rotateX(' + start + 'deg)'
});
if (start / 90 % 2 === 1) {
if (isen) {
$logotrans.addClass('animate');
isen = false;
} else {
$logotrans.removeClass('animate');
isen = true;
}
}
if (start / 90 % 2 === 0 && start % 360 !== 0) {
window.setTimeout(tsAnimate, 3000);
} else {
if (start % 360 === 0) {
window.setTimeout(tsAnimate, 3 * 60 * 1000);
} else {
requestFrame(function () {
tsAnimate();
});
}
}
}
tsAnimate();
});
define("js/home/maybe-like", ["zepto","lazyload"], function(require, exports, module){
/**
* “你可能喜欢”模块JS
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
var $ = require("zepto"),
tip = require("js/plugin/tip"),
lazyLoad = require("lazyload");
var winH = $(window).height(),
loadMoreH = $('#load-more').height(),
$goodList = $('#goods-list'),
loading = false,
page = 0,
gender = $('.mobile-wrap').hasClass('boys-wrap') ? '1,3' : '2,3',
kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
lifestyleType = $('.mobile-wrap').hasClass('lifestyle-wrap') ? true : false,
num,
url;
var $curNav,
index,
$navList = $('#maybe-like-nav');
//ajax url
if (kidsType) {
url = '/product/recom/maylikekids';
} else if (lifestyleType) {
url = '/product/recom/maylikelife';
} else {
url = '/product/recom/maylike?gender=' + gender;
}
$curNav = $navList.children('.focus');
$('#maybe-like-nav').delegate('li', 'tap', function() {
var $this = $(this),
$goods = $('.goods-list'),
$content;
if ($this.hasClass('focus')) {
return;
}
index = $this.index();
$this.addClass('focus');
$curNav.removeClass('focus');
$goods.not('.hide').addClass('hide');
$content = $goods.eq(index);
$content.removeClass('hide');
$curNav = $this;
$(document).trigger('scroll'); //Trigger lazyLoad
});
//srcoll to load more
$(window).scroll(function () {
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
if (loading) {
return;
}
loading = true;
num = $goodList.children('.good-info').length;
$.ajax({
type: 'GET',
url: url,
data: {
page: page + 1
},
success: function(data) {
if (data === ' ') {
loading = true;
return;
}
$goodList.append(data);
//lazyLoad
//lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
lazyLoad($('.good-info').find('img.lazy'));
loading = false;
page++;
},
error: function() {
tip.show('网络断开连接了~');
loading = false;
}
});
}
});
});
define("js/product/index", ["zepto","swiper","lazyload","index"], function(require, exports, module){
/**
* 产品打包入口
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
require("js/product/newsale/newarrival");
require("js/product/newsale/discount");
require("js/product/list");
require("js/product/detail/detail");
});
define("js/product/newsale/newarrival", ["zepto","swiper","lazyload","index"], function(require, exports, module){
/**
* 新品到着
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/24
*/
var $ = require("zepto"),
Swiper = require("swiper"),
lazyLoad = require("lazyload");
var swiper;
var filter = require("js/plugin/filter");
var $goodsContainer = $('#goods-container'),
$ngc = $($goodsContainer.children().get(0)),
$pgc = $($goodsContainer.children().get(1)),
$dgc = $($goodsContainer.children().get(2));
var winH = $(window).height();
//默认筛选条件
var defaultOpt = {
gender: $('#gender').val(),
brand: $('#brand').val(),
msort: $('#msort').val(),
color: $('#color').val(),
size: $('#size').val(),
price: $('#price').val(),
discount: $('#discount').val(),
limit: $('#limit').val(),
channel: $('#channel').val(),
p_d: $('#p_d').val()
};
var now = new Date(),
month = now.getMonth() + 1,
date = now.getDate();
var $listNav = $('#list-nav'),
//导航数据信息
navInfo = {
today: {
reload: true,
page: 0,
end: false
},
week: {
reload: true,
page: 0,
end: false
},
sale: {
reload: true,
page: 0,
end: false
}
},
$pre, //纪录进入筛选前的active项
searching;
$pgc.addClass('hide');
$dgc.addClass('hide');
$('#today a').text(month + '月' + date + '号');
if ($('.swiper-container .swiper-slide').length > 1) {
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
pagination: '.swiper-pagination'
});
}
/**
* 筛选注册的回调,筛选子项点击后逻辑
* 需要执行search的场景:1.点选筛选项;2.relaod为true时切换导航;3.下拉加载
* @param opt {type, id}
*/
function search(opt) {
var setting = {},
ext,
att,
nav, navType,
dayLimit,
page;
if (opt) {
//筛选项变更则重置reload为true
for (att in navInfo) {
if (navInfo.hasOwnProperty(att)) {
navInfo[att].reload = true;
}
}
//处理active状态
$listNav.children('.active').removeClass('active');
$pre.addClass('active');
switch (opt.type) {
case 'gender':
ext = {
gender: opt.id
};
break;
case 'brand':
ext = {
brand: opt.id
};
break;
case 'msort':
ext = {
msort: opt.id
};
break;
case 'color':
ext = {
color: opt.id
};
break;
case 'size':
ext = {
size: opt.id
};
break;
case 'price':
ext = {
price: opt.id
};
break;
case 'discount':
ext = {
discount: opt.id
};
break;
case 'limit':
ext = {
limit: opt.id
};
break;
case 'channel':
ext = {
channel: opt.id
};
break;
case 'p_d':
ext = {
p_d: opt.id
};
break;
}
$.extend(defaultOpt, ext); //扩展筛选项
}
if (searching) {
return;
}
//导航类别
if ($pre.hasClass('today')) {
navType = 'today';
dayLimit = 1;
} else if ($pre.hasClass('week')) {
navType = 'week';
dayLimit = 2;
} else if ($pre.hasClass('sale')) {
navType = 'sale';
dayLimit = 3;
}
nav = navInfo[navType];
page = nav.page + 1;
if (nav.reload) {
page = 1;
} else if (nav.end) {
//不需要重新加载并且数据请求结束
return;
}
$.extend(setting, defaultOpt, {
dayLimit: dayLimit,
page: page
});
searching = true;
$.ajax({
type: 'GET',
url: '/product/newsale/selectNewSale',
data: setting,
success: function(data) {
var noResult = '<p class="no-result">未找到相关搜索结果</p>',
$container;
switch (navType) {
case 'today':
$container = $ngc;
break;
case 'week':
$container = $pgc;
break;
case 'sale':
$container = $dgc;
break;
}
if (data === ' ') {
nav.end = true;
if (nav.reload) {
$container.html(noResult);
}
} else {
if (nav.reload) {
$container.html(data);
} else {
$container.append(data);
}
lazyLoad($container.find('.lazy'));
}
nav.reload = false;
nav.page = page;
searching = false;
}
});
}
lazyLoad($('.lazy'));
filter.registerCbFn(search);
//导航栏点击逻辑说明:
//1.点击非active项时切换active状态
//2.价格和折扣active状态时继续点击切换排序
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'tap', function() {
var $this = $(this),
nav,
navType,
$active;
if ($this.hasClass('filter')) {
//筛选面板切换状态
if ($this.hasClass('active')) {
filter.hideFilter();
//点击筛选钱的active项回复active
$pre.addClass('active');
$this.removeClass('active');
} else {
$pre = $this.siblings('.active');
$pre.removeClass('active');
$this.addClass('active');
filter.showFilter();
}
} else {
if ($this.hasClass('today')) {
navType = 'today';
} else if ($this.hasClass('week')) {
navType = 'week';
} else if ($this.hasClass('sale')) {
navType = 'sale';
}
nav = navInfo[navType];
if (!($this.hasClass('active'))) {
$active = $this.siblings('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
//若之前active项为筛选,则隐藏筛选面板
filter.hideFilter();
} else {
//切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'today':
$ngc.removeClass('hide');
break;
case 'week':
$pgc.removeClass('hide');
break;
case 'sale':
$dgc.removeClass('hide');
break;
}
}
$active.removeClass('active');
$this.addClass('active');
}
if (nav.reload) {
search();
}
}
});
$(window).scroll(function() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
$(document).height() - 0.25 * $goodsContainer.height()) {
if ($pre !== undefined) {
search();
}
}
});
});
define("js/plugin/filter", ["zepto"], function(require, exports, module){
/**
* 筛选JS
* 暴露三个接口:注册回调、显示filter、隐藏filter
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/19
*/
var $ = require("zepto");
var $filter = $('.filter-mask, .filter-body');
var $classify = $filter.find('.classify'),
$subClassify = $filter.find('.sub-classify');
var cbFn;
//隐藏筛选界面
function hideFilter() {
$filter.addClass('hide');
}
//显示筛选界面
function showFilter() {
$filter.removeClass('hide');
}
//注册sub-classify点击后的回调
function registerCbFn(cb) {
cbFn = cb;
}
//设置完高度后显示sub并设置选中
$classify.children(':first-child').addClass('active'); //T:不在HTML中使用{{#if @first}}active{{/if}}来初始化active为避免sub设置高度时的闪烁
//classify switch
$classify.delegate('.classify-item', 'tap', function() {
var $this = $(this);
if ($this.hasClass('active')) {
return;
}
$this.siblings('.active').removeClass('active');
$this.addClass('active');
});
//点击Mask隐藏筛选界面
$filter.filter('.filter-mask').tap(function() {
hideFilter();
});
$subClassify.delegate('li', 'tap', function(e) {
var $this = $(this),
id = $this.data('id');
var $sub = $this.closest('.sub-classify');
var $shower = $sub.siblings('.shower');
var html, shower;
e.stopPropagation();
if ($this.hasClass('chosed')) {
return;
}
$sub.children('.chosed').removeClass('chosed');
$this.addClass('chosed');
html = $.trim($this.html());
shower = $.trim($shower.html());
$shower.html(
shower.substring(0, shower.indexOf('</span>') + 7) + //拆分出shower的title
html.substring(0, html.indexOf('<i')) //拆分选中筛选值
);
if ($this.index() === 0) {
$shower.addClass('default');
} else {
$shower.removeClass('default');
}
if (cbFn) {
cbFn({
type: $sub.data('type'),
id: id
});
}
hideFilter();
});
exports.showFilter = showFilter;
exports.hideFilter = hideFilter;
exports.registerCbFn = registerCbFn;
});
define("js/product/newsale/discount", ["zepto","swiper","lazyload","index"], function(require, exports, module){
/**
* 商品列表页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/20
*/
var $ = require("zepto"),
Swiper = require("swiper"),
lazyLoad = require("lazyload");
var swiper;
var filter = require("js/plugin/filter");
var $goodsContainer = $('#goods-container'),
$ngc = $($goodsContainer.children().get(0)),
$pgc = $($goodsContainer.children().get(1)),
$dgc = $($goodsContainer.children().get(2));
var winH = $(window).height();
//默认筛选条件
var defaultOpt = {
gender: $('#gender').val(),
brand: $('#brand').val(),
msort: $('#msort').val(),
color: $('#color').val(),
size: $('#size').val(),
price: $('#price').val(),
discount: $('#discount').val()
};
var $listNav = $('#list-nav'),
//导航数据信息
navInfo = {
newest: {
order: 1,
reload: true,
page: 0,
end: false
},
price: {
order: 0,
reload: true,
page: 0,
end: false
},
discount: {
order: 0,
reload: true,
page: 0,
end: false
}
},
$pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项
searching;
if ($('.swiper-container .swiper-slide').length > 1) {
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
pagination: '.swiper-pagination'
});
}
/**
* 筛选注册的回调,筛选子项点击后逻辑
* 需要执行search的场景:1.点选筛选项;2.relaod为true时切换导航;3.下拉加载
* @param opt {type, id}
*/
function search(opt) {
var setting = {},
ext,
att,
nav, navType,
page;
if (opt) {
//筛选项变更则重置reload为true
for (att in navInfo) {
if (navInfo.hasOwnProperty(att)) {
navInfo[att].reload = true;
}
}
//处理active状态
$listNav.children('.active').removeClass('active');
$pre.addClass('active');
switch (opt.type) {
case 'gender':
ext = {
gender: opt.id
};
break;
case 'brand':
ext = {
brand: opt.id
};
break;
case 'msort':
ext = {
msort: opt.id
};
break;
case 'color':
ext = {
color: opt.id
};
break;
case 'size':
ext = {
size: opt.id
};
break;
case 'price':
ext = {
price: opt.id
};
break;
case 'discount':
ext = {
discount: opt.id
};
break;
}
$.extend(defaultOpt, ext); //扩展筛选项
}
if (searching) {
return;
}
//导航类别
if ($pre.hasClass('new')) {
navType = 'newest';
} else if ($pre.hasClass('price')) {
navType = 'price';
} else if ($pre.hasClass('discount')) {
navType = 'discount';
}
nav = navInfo[navType];
page = nav.page + 1;
if (nav.reload) {
page = 1;
} else if (nav.end) {
//不需要重新加载并且数据请求结束
return;
}
$.extend(setting, defaultOpt, {
type: navType,
order: nav.order,
page: page
});
searching = true;
$.ajax({
type: 'GET',
url: '/product/newsale/selectNewSale',
data: setting,
success: function(data) {
var noResult = '<p class="no-result">未找到相关搜索结果</p>',
$container;
switch (navType) {
case 'newest':
$container = $ngc;
break;
case 'price':
$container = $pgc;
break;
case 'discount':
$container = $dgc;
break;
}
if (data === ' ') {
nav.end = true;
if (nav.reload) {
$container.html(noResult);
}
} else {
if (nav.reload) {
$container.html(data);
} else {
$container.append(data);
}
lazyLoad($container.find('.lazy'));
}
nav.reload = false;
nav.page = page;
searching = false;
}
});
}
lazyLoad($('.lazy'));
filter.registerCbFn(search);
//导航栏点击逻辑说明:
//1.点击非active项时切换active状态
//2.价格和折扣active状态时继续点击切换排序
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'tap', function() {
var $this = $(this),
nav,
navType,
$active;
if ($this.hasClass('filter')) {
//筛选面板切换状态
if ($this.hasClass('active')) {
filter.hideFilter();
//点击筛选钱的active项回复active
$pre.addClass('active');
$this.removeClass('active');
} else {
$pre = $this.siblings('.active');
$pre.removeClass('active');
$this.addClass('active');
filter.showFilter();
}
} else {
if ($this.hasClass('new')) {
navType = 'newest';
} else if ($this.hasClass('price')) {
navType = 'price';
} else if ($this.hasClass('discount')) {
navType = 'discount';
}
nav = navInfo[navType];
if ($this.hasClass('active')) {
//最新无排序切换
if ($this.hasClass('new')) {
return;
}
if ($this.hasClass('price') || $this.hasClass('discount')) {
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; //更新pre为当前项
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
}
} else {
$active = $this.siblings('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
//若之前active项为筛选,则隐藏筛选面板
filter.hideFilter();
} else {
//切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
}
}
$active.removeClass('active');
$this.addClass('active');
}
if (nav.reload) {
search();
}
}
});
$(window).scroll(function() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
$(document).height() - 0.25 * $goodsContainer.height()) {
if ($pre !== undefined) {
search();
}
}
});
});
define("js/product/list", ["zepto","lazyload"], function(require, exports, module){
/**
* 商品列表页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/20
*/
var $ = require("zepto"),
lazyLoad = require("lazyload");
//品牌页参数
var $brandHeader = $('#brand-header'),
$introBox = $('#intro-box');
var filter = require("js/plugin/filter");
var tip = require("js/plugin/tip");
var $goodsContainer = $('#goods-container'),
$ngc = $goodsContainer.children('.new-goods'),
$pgc = $goodsContainer.children('.price-goods'),
$dgc = $goodsContainer.children('.discount-goods');
var winH = $(window).height();
//默认筛选条件
var defaultOpt = {
gender: $('#gender').val(),
brand: $('#brand').val(),
msort: $('#msort').val(),
color: $('#color').val(),
size: $('#size').val(),
price: $('#price').val(),
discount: $('#discount').val()
};
var $listNav = $('#list-nav'),
//导航数据信息
navInfo = {
newest: {
order: 1,
reload: true,
page: 0,
end: false
},
price: {
order: 0,
reload: true,
page: 0,
end: false
},
discount: {
order: 0,
reload: true,
page: 0,
end: false
}
},
$pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项
searching;
/**
* 筛选注册的回调,筛选子项点击后逻辑
* 需要执行search的场景:1.点选筛选项;2.relaod为true时切换导航;3.下拉加载
* @param opt {type, id}
*/
function search(opt) {
var setting = {},
ext,
att,
nav, navType,
page;
if (opt) {
//筛选项变更则重置reload为true
for (att in navInfo) {
if (navInfo.hasOwnProperty(att)) {
navInfo[att].reload = true;
}
}
//处理active状态
$listNav.children('.active').removeClass('active');
$pre.addClass('active');
switch (opt.type) {
case 'gender':
ext = {
gender: opt.id
};
break;
case 'brand':
ext = {
brand: opt.id
};
break;
case 'msort':
ext = {
msort: opt.id
};
break;
case 'color':
ext = {
color: opt.id
};
break;
case 'size':
ext = {
size: opt.id
};
break;
case 'price':
ext = {
price: opt.id
};
break;
case 'discount':
ext = {
discount: opt.id
};
break;
}
$.extend(defaultOpt, ext); //扩展筛选项
}
if (searching) {
return;
}
//导航类别
if ($pre.hasClass('new')) {
navType = 'newest';
} else if ($pre.hasClass('price')) {
navType = 'price';
} else if ($pre.hasClass('discount')) {
navType = 'discount';
}
nav = navInfo[navType];
page = nav.page + 1;
if (nav.reload) {
page = 1;
} else if (nav.end) {
//不需要重新加载并且数据请求结束
return;
}
$.extend(setting, defaultOpt, {
type: navType,
order: nav.order,
page: page
});
searching = true;
$.ajax({
type: 'GET',
url: '/index/search/search',
data: setting,
success: function(data) {
var noResult = '<p class="no-result">未找到相关搜索结果</p>',
$container;
switch (navType) {
case 'newest':
$container = $ngc;
break;
case 'price':
$container = $pgc;
break;
case 'discount':
$container = $dgc;
break;
}
if (data === ' ') {
nav.end = true;
if (nav.reload) {
$container.html(noResult);
}
} else {
if (nav.reload) {
$container.html(data);
} else {
$container.append(data);
}
lazyLoad($container.find('.lazy'));
}
nav.reload = false;
nav.page = page;
searching = false;
}
});
}
lazyLoad($('.lazy'));
filter.registerCbFn(search);
//导航栏点击逻辑说明:
//1.点击非active项时切换active状态
//2.价格和折扣active状态时继续点击切换排序
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'tap', function() {
var $this = $(this),
nav,
navType,
$active;
if ($this.hasClass('filter')) {
//筛选面板切换状态
if ($this.hasClass('active')) {
filter.hideFilter();
//点击筛选钱的active项回复active
$pre.addClass('active');
$this.removeClass('active');
} else {
$pre = $this.siblings('.active');
$pre.removeClass('active');
$this.addClass('active');
filter.showFilter();
}
} else {
if ($this.hasClass('new')) {
navType = 'newest';
} else if ($this.hasClass('price')) {
navType = 'price';
} else if ($this.hasClass('discount')) {
navType = 'discount';
}
nav = navInfo[navType];
if ($this.hasClass('active')) {
//最新无排序切换
if ($this.hasClass('new')) {
return;
}
if ($this.hasClass('price') || $this.hasClass('discount')) {
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; //更新pre为当前项
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
}
} else {
$active = $this.siblings('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
//若之前active项为筛选,则隐藏筛选面板
filter.hideFilter();
} else {
//切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
}
}
$active.removeClass('active');
$this.addClass('active');
}
if (nav.reload) {
search();
}
}
});
$(window).scroll(function() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
$(document).height() - 0.25 * $goodsContainer.height()) {
search();
}
});
//品牌介绍
$brandHeader.children('.btn-intro').bind('tap', function() {
$introBox.removeClass('hide');
});
$('.close-intro, .brand-intro-box').tap(function() {
$introBox.addClass('hide');
});
$('#brand-intro').tap(function(e) {
e.stopPropagation();
});
//品牌收藏
$brandHeader.children('.btn-col').bind('tap', function() {
var $this = $(this);
var id = $brandHeader.data('id'),
opt;
if ($this.hasClass('coled')) {
opt = 'cancel';
} else {
opt = 'ok';
}
$.ajax({
type: 'POST',
url: '/product/opt/favoriteBrand',
data: {
id: id,
opt: opt
},
success: function(data) {
if (data.code === 200) {
$this.toggleClass('coled');
} else if (data.code === 400) {
tip.show('未登录');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
});
});
define("js/product/detail/detail", ["zepto","swiper","lazyload","index"], function(require, exports, module){
/**
* 产品打包入口
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/20
*/
var $ = require("zepto"),
Swiper = require("swiper"),
lazyLoad = require("lazyload"),
goodsSwiper;
lazyLoad($('img.lazy'));
goodsSwiper = new Swiper('.banner-swiper', {
loop: true,
pagination: '.banner-top .pagination-inner',
slideElement: 'div',
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev'
});
});
define("js/index/index", ["zepto"], function(require, exports, module){
/**
* Index打包入口
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/19
*/
require("js/index/search");
require("js/index/channel");
require("js/index/footer");
});
define("js/index/search", ["zepto"], function(require, exports, module){
/**
* 搜索JS
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/19
*/
var $ = require("zepto");
var $input = $('#search-input input');
var $clear = $('#search-input .clear-input');
var $history = $('.history');
$('#clear-history').bind('tap', function() {
$.ajax({
type: 'POST',
url: '/search/clearHistory',
success: function(data) {
if (data.code === 200) {
$history.html(''); //clear search history items
}
}
});
});
$input.bind('input', function() {
if ($input.val() === '') {
$clear.addClass('hide');
} else {
$clear.removeClass('hide');
}
});
$clear.bind('tap', function() {
$input.val('').trigger('input');
});
});
define("js/index/channel", [], function(require, exports, module){
/**
* 频道选择
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/12
*/
});
define("js/index/footer", ["zepto"], function(require, exports, module){
/**
* 底部JS
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/26
*/
var $ = require("zepto");
var $searchBox = $('.search-box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo');
function downLoadApp() {
var appUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445';
var clickedAt = new Date();
setTimeout(function () {
if ((new Date()) - clickedAt < 2000) {
window.location = appUrl;
}
}, 500);
}
$('#float-layer-close').bind('tap', function () {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
{
domain: '.yohobuy.com'
});
window.setCookie('_float-layer-app-close', 1,
{
domain: '.yohobuy.com',
expires: 1
});
});
$('#float-layer-btn').tap(function () {
downLoadApp('bottom');
});
if (!window.cookie('_float-layer-app')) {
$('#float-layer-app').show();
} else {
$('#float-layer-app').hide();
}
/**
* 频道选择页面顶部搜索
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/10/28
*/
$searchBox.find('input').on('focus', function () {
$indexLogo.css({
width: 0,
display: 'none'
});
$searchBox.css({
width: '12.8rem'
});
$indexSearch.css({
width: '15.5rem'
});
$('.clear-text, .no-search').show();
}).on('blur', function () {
$indexLogo.css({
width: '5.4rem',
display: 'block'
});
$searchBox.css({
width: '8.8rem'
});
$indexSearch.css({
width: '9.6rem'
});
$('.clear-text, .no-search').hide();
});
$searchBox.find('.clear-text').tap(function () {
$searchBox.find('input').val('').trigger('focus');
});
$searchBox.find('.search-icon').tap(function () {
$indexSearch.submit();
});
});
/*
Error: No files were found in the load path matching "guang/clothes/*.png". Your current load paths are: D:/workspace/yohobuy.git.dev.yoho.cn/static/dist/myohobuy/assets/img
on line 1 of D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/guang/_detail.scss
from line 1 of D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/guang/_index.scss
from line 96 of D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/index.scss
1: @import "compass", "compass/reset";
2: $pxConvertRem: 40;
3:
4: * {
5: -webkit-tap-highlight-color: rgba(0,0,0,0);
6: -moz-tap-highlight-color: rgba(0,0,0,0);
Backtrace:
D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/guang/_detail.scss:1
D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/guang/_index.scss:1
D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/index.scss:96
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/import_node.rb:67:in `rescue in import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/import_node.rb:45:in `import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/import_node.rb:28:in `imported_file'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/import_node.rb:37:in `css_import?'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:311:in `visit_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:79:in `block in with_base'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:115:in `with_frame'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:79:in `with_base'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:326:in `block (2 levels) in visit_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:326:in `map'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:326:in `block in visit_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:88:in `block in with_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:115:in `with_frame'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:88:in `with_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:323:in `visit_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:79:in `block in with_base'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:115:in `with_frame'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:79:in `with_base'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:326:in `block (2 levels) in visit_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:326:in `map'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:326:in `block in visit_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:88:in `block in with_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:115:in `with_frame'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:88:in `with_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:323:in `visit_import'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:79:in `block in with_base'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:115:in `with_frame'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/stack.rb:79:in `with_base'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:52:in `map'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:52:in `visit_children'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `block in visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:186:in `visit_root'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:157:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:8:in `visit'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/root_node.rb:36:in `css_tree'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/tree/root_node.rb:20:in `render'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/engine.rb:278:in `render'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-import-once-1.0.5/lib/compass/import-once/engine.rb:17:in `block in render'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-import-once-1.0.5/lib/compass/import-once/engine.rb:29:in `with_import_scope'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-import-once-1.0.5/lib/compass/import-once/engine.rb:16:in `render'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/plugin/compiler.rb:492:in `update_stylesheet'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/plugin/compiler.rb:209:in `each'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/sass-3.4.19/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/lib/compass/sass_compiler.rb:40:in `compile!'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/lib/compass/commands/update_project.rb:49:in `perform'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/lib/compass/commands/base.rb:18:in `execute'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/lib/compass/commands/project_base.rb:19:in `execute'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/lib/compass/exec/sub_command_ui.rb:15:in `run!'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/bin/compass:30:in `block in <top (required)>'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/bin/compass:44:in `call'
D:/Ruby22/lib/ruby/gems/2.2.0/gems/compass-1.0.3/bin/compass:44:in `<top (required)>'
D:/Ruby22/bin/compass:23:in `load'
D:/Ruby22/bin/compass:23:in `<main>'
*/
body:before {
white-space: pre;
font-family: monospace;
content: "Error: No files were found in the load path matching \"guang/clothes/*.png\". Your current load paths are: D:/workspace/yohobuy.git.dev.yoho.cn/static/dist/myohobuy/assets/img\A on line 1 of D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/guang/_detail.scss\A from line 1 of D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/guang/_index.scss\A from line 96 of D:/workspace/yohobuy.git.dev.yoho.cn/static/sass/index.scss\A \A 1: @import \"compass\", \"compass/reset\";\A 2: $pxConvertRem: 40;\A 3: \A 4: * {\A 5: -webkit-tap-highlight-color: rgba(0,0,0,0);\A 6: -moz-tap-highlight-color: rgba(0,0,0,0);"; }
define("index",["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"],function(e,a,s){var i;e("js/common"),e("js/passport/index"),e("js/guang/index"),e("js/home/index"),e("js/product/index"),e("js/index/index"),s.exports=i}),define("js/common",["zepto"],function(e,a,s){function i(e){var a,s,i=document.cookie;return document.cookie&&""!==document.cookie&&(s=i.indexOf(e+"="),s>-1&&(s+=e.length+1,a=decodeURIComponent(r.trim(i.substring(s,i.indexOf(";",s)))))),a}function t(e,a,s){var i,t,n,o,l="";"undefined"!=typeof a&&(s=s||{},null===a&&(a="",s.expires=-1),s.expires&&("number"==typeof s.expires||s.expires.toUTCString)&&("number"==typeof s.expires?(o=new Date,o.setTime(o.getTime()+24*s.expires*60*60*1e3)):o=s.expires,l="; expires="+o.toUTCString()),i=s.path?"; path="+s.path:"",t=s.domain?"; domain="+s.domain:"",n=s.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(a),l,i,t,n].join(""))}function n(){var e,a=i("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function o(){var e=n();return 0===e?0:e[1]}function l(){var e=i("_g");return"undefined"==typeof e?"":JSON.parse(e).k}var r=e("zepto");!function(){var e=r("#yoho-footer"),a=e.children(".op-row"),s=n();r("body").height()<r(window).height()&&e.addClass("bottom"),0===s?a.prepend('<a href="http://m.yohobuy.com/signin.html">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):a.prepend('Hi,<a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+s[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+s[3]+'">退出</a>'),e.removeClass("hide")}(),window.cookie=i,window.setCookie=t,window.getUser=n,window.getUid=o,window.getShoppingKey=l}),define("js/passport/index",["zepto"],function(e,a,s){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["zepto"],function(e,a,s){var i=e("zepto"),t=i("#phone-num"),n=i("#country-select"),o=i("#area-code"),l=i("#btn-next"),r=e("js/passport/api"),d=e("js/plugin/tip"),c=i.trim,p=d.show;r.selectCssHack(i("#country-select")),r.bindClearEvt(),t.bind("input",function(){""===c(t.val())?l.addClass("disable"):l.removeClass("disable")}),n.change(function(){o.text(n.val())}),l.on("tap",function(){var e=c(t.val()),a=n.val();l.hasClass("disable")||(r.phoneRegx[a].test(e)?i.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["zepto"],function(e,a,s){function i(e){var a,s=l(".has-eye");e&&"open"===e.status?s.append('<div class="eye"></div>'):s.append('<div class="eye close"></div>'),a=s.children(".eye"),a.on("tap",function(e){var a=l(this),s=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?s.attr("type","password"):s.attr("type","text"),s.focus()})}function t(){var e,a=l(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("tap",function(a){var s=e.siblings(".input");s.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=l(this),a=e.siblings(".clear-input"),s=r(e.val());""===s?a.hide():a.show()})}function n(e){return e.length>=6&&e.length<=20?!0:!1}function o(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var s=navigator.userAgent;s.match(/uc/i)&&s.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var l=e("zepto"),r=l.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};s.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:i,bindClearEvt:t,pwdValidate:n,selectCssHack:o}}),define("js/plugin/tip",["zepto"],function(e,a,s){function i(e,a){var s,i;"undefined"!=typeof e&&(s=e.toString(),i=a&&a>0?a:2e3,t.text(s).show(),n=setTimeout(function(){"block"===t.css("display")&&t.hide()},i))}var t,n,o=e("zepto");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(e),t=o("#yoho-tip"),t.on("tap",function(){t.hide(),clearTimeout(n)})}(),a.show=i}),define("js/passport/register/code",["zepto"],function(e,a,s){e("js/passport/code")(!0)}),define("js/passport/code",["zepto"],function(e,a,s){var i=e("zepto");s.exports=function(a){function s(){var e,a=59;e=setInterval(function(){0===a?(o.text("重发验证码").removeClass("disable"),clearInterval(e)):o.text("重发验证码 ("+a--+"秒)")},1e3)}var t=i("#captcha"),n=i("#btn-next"),o=i("#captcha-tip"),l=i("#phone-num").val(),r=i("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),p=i.trim,u=c.show,h=a?"reg":"back";d.bindClearEvt(),t.bind("input",function(){""!==p(t.val())?n.removeClass("disable"):n.addClass("disable")}),o.on("tap",function(){o.hasClass("disable")||i.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:l,areaCode:r},success:function(e){200===e.code?(o.text("重发验证码 (60秒)").addClass("disable"),s()):u(e.message)}})}),n.on("tap",function(){n.hasClass("disable")||i.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:l,areaCode:r,code:p(t.val()),token:i("#token").val()},success:function(e){200===e.code?location.href=e.data:u(e.message)}})}),s()}}),define("js/passport/register/password",["zepto"],function(e,a,s){var i=e("zepto"),t=i("#pwd"),n=i("#btn-sure"),o=e("js/passport/api"),l=e("js/plugin/tip"),r=i.trim,d=l.show;o.bindEyesEvt({status:"open"}),t.bind("input",function(){""===r(t.val())?n.addClass("disable"):n.removeClass("disable")}),n.on("tap",function(){var e=r(t.val());n.hasClass("disable")||(o.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):i.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:i("#phone-num").val(),areaCode:i("#area-code").val(),token:i("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):401===e.code||404===e.code||505===e.code?d(e.message):(d(e.message),setTimeout(function(){location.href=e.data},1e3))}}))})}),define("js/passport/login/login",["zepto"],function(e,a,s){function i(){u&&h?d.removeClass("disable"):d.addClass("disable")}function t(){c.show(),p.show()}function n(){c.hide(),p.hide()}var o=e("zepto"),l=o("#account"),r=o("#pwd"),d=o("#btn-login"),c=o("#retrive-pwd-mask"),p=o("#retrive-pwd-ways"),u=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),v=o.trim,m=g.show;f.bindEyesEvt(),f.bindClearEvt(),l.bind("input",function(){u=""!==v(l.val())?!0:!1,i()}),r.bind("input",function(){h=""===v(r.val())?!1:!0,i()}),d.on("tap",function(){var e=v(l.val()),a=v(r.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?o.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(m("登录成功"),setTimeout(function(){location.href=e.data},1e3)):m(e.message)},error:function(){m("网络断开连接啦~")}}):m("账号或密码有错误,请重新输入"))}),o("#forget-pwd").on("tap",function(){t()}),c.on("tap",function(){n()}),o("#cancel-retrive").on("tap",function(e){e.preventDefault(),n()}),l.trigger("input"),r.trigger("input")}),define("js/passport/login/international",["zepto"],function(e,a,s){function i(){c&&p?d.removeClass("disable"):d.addClass("disable")}var t=e("zepto"),n=t("#phone-num"),o=t("#country-select"),l=t("#area-code"),r=t("#pwd"),d=t("#btn-login"),c=!1,p=!1,u=e("js/passport/api"),h=e("js/plugin/tip"),f=t.trim,g=h.show;u.selectCssHack(o),u.bindEyesEvt(),u.bindClearEvt(),n.bind("input",function(){c=""===f(n.val())?!1:!0,i()}),r.bind("input",function(){var e=f(r.val());p=""===e?!1:!0,i()}),o.change(function(){l.text(o.val())}),d.on("tap",function(){var e=f(n.val()),a=o.val(),s=f(r.val());d.hasClass("disable")||(u.phoneRegx[a].test(e)&&u.pwdValidate(s)?t.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:s},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),n.trigger("input"),r.trigger("input")}),define("js/passport/back/mobile",["zepto"],function(e,a,s){var i=e("zepto"),t=i("#phone-num"),n=i("#country-select"),o=i("#area-code"),l=i("#btn-next"),r=e("js/passport/api"),d=e("js/plugin/tip"),c=i.trim,p=d.show;r.selectCssHack(i("#country-select")),r.bindClearEvt(),t.bind("input",function(){""===c(t.val())?l.addClass("disable"):l.removeClass("disable")}),n.change(function(){o.text(n.val())}),l.on("tap",function(){var e=c(t.val()),a=n.val();l.hasClass("disable")||(r.phoneRegx[a].test(e)?i.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:p(e.message)}}):p("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["zepto"],function(e,a,s){e("js/passport/code")(!1)}),define("js/passport/back/email",["zepto"],function(e,a,s){var i=e("zepto"),t=i("#email"),n=i("#btn-sure"),o=e("js/passport/api"),l=e("js/plugin/tip"),r=i.trim,d=l.show;o.bindClearEvt(),t.bind("input",function(){""===r(t.val())?n.addClass("disable"):n.removeClass("disable")}),n.on("tap",function(){var e=r(t.val());n.hasClass("disable")||(o.emailRegx.test(e)?i.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["zepto"],function(e,a,s){var i=e("zepto"),t=i("#resend"),n=e("js/plugin/tip"),o=n.show;t.on("tap",function(e){e.preventDefault(),i.ajax({url:t.data("url"),type:"GET",success:function(e){o(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["zepto"],function(e,a,s){var i=e("zepto"),t=i("#pwd"),n=i("#btn-ok"),o=e("js/passport/api"),l=e("js/plugin/tip"),r=i.trim,d=l.show,c=i("#phone-num");o.bindEyesEvt(),t.bind("input",function(){""===r(t.val())?n.addClass("disable"):n.removeClass("disable")}),n.on("tap",function(){var e,a,s=r(t.val()),l=!0;n.hasClass("disable")||(e={password:s},0===c.length&&(l=!1),l?(i.extend(e,{phoneNum:c.val(),areaCode:i("#areaCode").val(),token:i("#token").val()}),a="/passport/back/passwordByMobile"):(i.extend(e,{code:i("#email-code").val()}),a="/passport/back/passwordByEmail"),o.pwdValidate(s)?i.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/guang/index",["zepto","lazyload","swiper","mlellipsis","iscroll-probe","index"],function(e,a,s){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list"),e("js/guang/detail")}),define("js/guang/plus-star/list",["zepto","lazyload","swiper","index"],function(e,a,s){var i,t=e("zepto"),n=e("lazyload"),o=e("swiper"),l=t("#nav-tab > li"),r=t("#ps-content > .content");n(t("img.lazy")),i=new o(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),t("#nav-tab").delegate("li","tap",function(){t(this).hasClass("focus")||(l.toggleClass("focus"),r.toggleClass("hide"),t(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["zepto","mlellipsis","lazyload"],function(e,a,s){var i,t,n=e("zepto"),o=e("mlellipsis"),l=e("lazyload"),r=n("#intro"),d=n("#intro-more-txt"),c=n("#related-infos-container"),p=e("js/guang/info"),u=e("js/plugin/tip"),h=n("#brand-info").data("id");o.init(),l(n("img.lazy")),r[0].mlellipsis(3),setTimeout(function(){i=r.text(),t=r.attr("title")}),p.initInfosEvt(c),n("#more-intro").bind("tap",function(){var e=n(this);e.toggleClass("spread"),e.hasClass("spread")?(r.text(t),d.text("收起")):(r.text(i),d.text("more"))}),n("#brand-like").bind("tap",function(e){var a="ok",s=n(this);e.preventDefault(),s.hasClass("like")&&(a="cancel"),n.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:h,opt:a},success:function(e){200===e.code?s.toggleClass("like"):400===e.code&&u.show("未登录")},error:function(){u.show("网络断开连接了~")}})})}),define("js/guang/info",["zepto","mlellipsis","lazyload"],function(e,a,s){function i(e){r(e.find("img.lazy")),e.each(function(){var e=o(this),a=e.find(".info-title"),s=e.find(".info-text");a[0].mlellipsis(2),s[0].mlellipsis(2)})}function t(e){e.delegate(".like-btn","tap",function(e){var a=o(e.currentTarget),s=a.closest(".guang-info"),i="ok";a.hasClass("like")&&(i="cancel"),o.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:s.data("id"),opt:i},success:function(e){var s=e.code;200===s&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){d.show("网络断开连接了~")}})}),i(e.find(".guang-info"))}function n(e,a){h||a.end||(h=!0,o.ajax({type:"GET",url:" /guang/index/page",data:a,success:function(s){return" "===s?(a.end=!0,h=!1,p.addClass("hide"),void u.removeClass("hide")):(e.append(s),i(e.find(".guang-info")),a.page++,void(h=!1))},error:function(){d.show("网络断开连接了~"),h=!1}}))}var o=e("zepto"),l=e("mlellipsis"),r=e("lazyload"),d=e("js/plugin/tip"),c=o("#load-more-info"),p=o(""),u=o(""),h=!1;l.init(),c.length>0&&(p=c.children(".loading"),u=c.children(".no-more")),a.initInfosEvt=t,a.setLazyLoadAndMellipsis=i,a.loadMore=n}),define("js/guang/home",["zepto","swiper","mlellipsis","lazyload","index"],function(e,a,s){var i,t=e("zepto"),n=e("swiper"),o=e("js/guang/info"),l=o.setLazyLoadAndMellipsis,r=o.loadMore,d=t("#load-more-info"),c=t(""),p=t(""),u=t(window).height(),h=d.height(),f=t("#info-list"),g=f.children(".info-list"),v=t("#guang-nav"),m=v.children(".focus"),w=m.data("type"),b={};d.length>0&&(c=d.children(".loading"),p=d.children(".no-more")),i=new n(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),o.initInfosEvt(f),function(){var e=t("#gender").val();v.children(".guang-nav-item").each(function(){var a=t(this).data("type");b[a]={page:1,gender:e,type:a,end:!1}})}(),v.delegate(".guang-nav-item","tap",function(){var e,a,s=t(this);s.hasClass("focus")||(a=s.index(),s.addClass("focus"),m.removeClass("focus"),g.not(".hide").addClass("hide"),e=g.eq(a),e.removeClass("hide"),l(e.children(".guang-info")),m=s,w=s.data("type"),b[w].end?(c.addClass("hide"),p.removeClass("hide")):(c.removeClass("hide"),p.addClass("hide")))}),t(document).scroll(function(){t(window).scrollTop()+u>=t(document).height()-h&&r(g,b[w])})}),define("js/guang/list",["zepto","mlellipsis","lazyload"],function(e,a,s){var i=e("zepto"),t=e("js/guang/info"),n=t.loadMore,o=i(window).height(),l=i("#load-more").height(),r=i("#author-infos"),d=i("#tag"),c={page:1,end:!1},p=i("#info-list");t.initInfosEvt(p),r.length>0&&i.extend(c,{authorId:r.data("id")}),d.length>0&&i.extend(c,{tag:d.val()}),i(document).scroll(function(){i(window).scrollTop()+o>=i(document).height()-l&&n(p,c)})}),define("js/guang/detail",["zepto","mlellipsis","lazyload","iscroll-probe"],function(e,a,s){function i(e){var a=e.offset().left,s=-C+a+w/2+"px";o.css({backgroundPosition:s+" bottom"}),v&&b.css({backgroundPosition:s+" bottom"})}function t(e){var a,s,t,u=p(e.currentTarget),f=u.index();u.hasClass("focus")||(l.filter(".focus").removeClass("focus"),v&&(a=u.closest(".fixed-thumb-container").length>0?o:b,s=a.find(".thumb").eq(f),b.find(".thumb.focus").removeClass("focus"),s.addClass("focus")),u.addClass("focus"),i(u),r.not(".hide").addClass("hide"),t=r.eq(f),t.removeClass("hide"),h(t.find(".lazy")),v?c&&c.scrollToElement(d,400):p("body").animate({scrollTop:n.offset().top},400))}var n,o,l,r,d,c,p=e("zepto"),u=e("mlellipsis"),h=e("lazyload"),f=e("iscroll-probe"),g=p(".author .intro"),v=navigator.userAgent.indexOf("iPhone")>0?!0:!1,m=p(".collocation-block").length>0?!0:!1,w=0,b=p(""),d=document.querySelector("#wrapper .collocation-block"),C=p(window).width();v&&p("#wrapper").addClass("ios"),u.init(),h(p(".lazy")),p(".info-list .title, .one-good .reco-name").each(function(){this.mlellipsis(2)}),parseInt(g.offset().left,10)===parseInt(g.css("margin-left"),10)&&g.css("padding-top",0),m&&(n=p(".collocation-block"),o=n.children(".thumb-container"),l=o.find("li"),r=n.find(".prod"),w=l.width(),v&&(b=p("#wrapper").after(o.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),h(b.find(".lazy"),{event:"sporty"})),i(l.filter(".focus")),o.delegate(".thumb","touchend",t),v&&b.delegate(".thumb","touchend",t)),window.onload=function(){var e,a,s,i,t,l=p("#scroller");if(v){if(c=new f("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),!m)return void c.on("scroll",function(){l.trigger("scroll")});e=p(window).height(),t=b[0],a=o.height(),s=n.height(),i=n.offset().top,c.on("scroll",function(){var n=-this.y,o=t.className;i-e+a>=n?-1===o.indexOf("fixed-bottom")&&b.addClass("fixed-bottom").removeClass("hide"):i>=n?-1===o.indexOf("hide")&&b.addClass("hide").removeClass("fixed-bottom fixed-top"):i+s-a>=n?-1===o.indexOf("fixed-top")&&b.addClass("fixed-top").removeClass("hide absolute").css("top",""):i+s>=n?(-1===o.indexOf("absolute")&&b.addClass("absolute").removeClass("fixed-top hide"),t.style.top=i+s-a-n+"px"):n>i+s&&-1===o.indexOf("hide")&&b.addClass("hide").removeClass("absolute"),l.trigger("scroll")})}}}),define("js/home/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["zepto","swiper","lazyload","index"],function(e,a,s){function i(){m+=10,w.css({transform:"rotateX("+m+"deg)","-webkit-transform":"rotateX("+m+"deg)","-moz-transform":"rotateX("+m+"deg)"}),m/90%2===1&&(b?(w.addClass("animate"),b=!1):(w.removeClass("animate"),b=!0)),m/90%2===0&&m%360!==0?window.setTimeout(i,3e3):m%360===0?window.setTimeout(i,18e4):d(function(){i()})}var t,n,o,l,r,d,c,p,u,h,f=e("zepto"),g=e("swiper"),v=e("lazyload"),m=0,w=f(".home-header .logo"),b=!0;e("js/home/maybe-like"),v(f("img.lazy")),f(".nav-btn").on("tap",function(e){f(this).hasClass("menu-open")||(f(".mobile-wrap").addClass("menu-open"),f(".overlay").addClass("show"),f(".side-nav").addClass("on"),f("body").css({height:f(window).height(),width:"100%",overflow:"hidden"})),e.stopPropagation()}),f(".mobile-wrap").on("tap",function(){f(this).hasClass("menu-open")&&(f(".mobile-wrap").removeClass("menu-open"),f(".overlay").removeClass("show"),f(".sub-nav").removeClass("show"),f(".side-nav").removeClass("on"),f("body").css({height:"auto",overflow:"auto"}))}),f(".side-nav").on("tap","li",function(){f(this).find(".sub-nav").size()>0&&(f(".sub-nav").removeClass("show"),f(this).find(".sub-nav").addClass("show"))}),f(".sub-nav").each(function(){f(this).find("li").eq(0).on("tap",function(e){f(".sub-nav").removeClass("show"),e.stopPropagation()})}),f(".sub-nav").on("mouseenter","li",function(){0!==f(this).index()&&f(this).addClass("current").siblings().removeClass("current")}),f(".banner-swiper").find("li").size()>1&&(t=new g(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),o=new g(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),n=new g(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),f(".trend-topic-swiper").find("li").size()>1&&(l=new g(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),f(".category-swiper").each(function(e,a){u="category-swiper"+e,f(this).addClass(u),f("."+u).find(".swiper-slide").size()>1&&(r=new g("."+u,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+u+" .pagination-inner"}))}),f(".header-download").on("tap",".close-btn",function(){f(this).parent().remove()}),d=function(){var e=null,a=["webkit","moz","ms"];for(p=0;p<a.length;p++)c=a[p]+"RequestAnimationFrame",window[c]&&(h=!0,e=c);return h?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),i()}),define("js/home/maybe-like",["zepto","lazyload"],function(e,a,s){var i,t,n,o,l=e("zepto"),r=e("js/plugin/tip"),d=e("lazyload"),c=l(window).height(),p=l("#load-more").height(),u=l("#goods-list"),h=!1,f=0,g=l(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",v=l(".mobile-wrap").hasClass("kids-wrap")?!0:!1,m=l(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,w=l("#maybe-like-nav");t=v?"/product/recom/maylikekids":m?"/product/recom/maylikelife":"/product/recom/maylike?gender="+g,n=w.children(".focus"),l("#maybe-like-nav").delegate("li","tap",function(){var e,a=l(this),s=l(".goods-list");a.hasClass("focus")||(o=a.index(),a.addClass("focus"),n.removeClass("focus"),s.not(".hide").addClass("hide"),e=s.eq(o),e.removeClass("hide"),n=a,l(document).trigger("scroll"))}),l(window).scroll(function(){if(l(window).scrollTop()+c>=l(document).height()-p){if(h)return;h=!0,i=u.children(".good-info").length,l.ajax({type:"GET",url:t,data:{page:f+1},success:function(e){return" "===e?void(h=!0):(u.append(e),d(l(".good-info").find("img.lazy")),h=!1,void f++)},error:function(){r.show("网络断开连接了~"),h=!1}})}})}),define("js/product/index",["zepto","swiper","lazyload","index"],function(e,a,s){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["zepto","swiper","lazyload","index"],function(e,a,s){function i(e){var a,s,i,t,r,c,p={};if(e){for(s in y)y.hasOwnProperty(s)&&(y[s].reload=!0);switch(C.children(".active").removeClass("active"),n.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"msort":a={msort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id};break;case"limit":a={limit:e.id};break;case"channel":a={channel:e.id};break;case"p_d":a={p_d:e.id}}l.extend(v,a)}if(!o){if(n.hasClass("today")?(t="today",r=1):n.hasClass("week")?(t="week",r=2):n.hasClass("sale")&&(t="sale",r=3),i=y[t],c=i.page+1,i.reload)c=1;else if(i.end)return;l.extend(p,v,{dayLimit:r,page:c}),o=!0,l.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:p,success:function(e){var a,s='<p class="no-result">未找到相关搜索结果</p>';switch(t){case"today":a=u;break;case"week":a=h;break;case"sale":a=f}" "===e?(i.end=!0,i.reload&&a.html(s)):(i.reload?a.html(e):a.append(e),d(a.find(".lazy"))),i.reload=!1,i.page=c,o=!1}})}}var t,n,o,l=e("zepto"),r=e("swiper"),d=e("lazyload"),c=e("js/plugin/filter"),p=l("#goods-container"),u=l(p.children().get(0)),h=l(p.children().get(1)),f=l(p.children().get(2)),g=l(window).height(),v={gender:l("#gender").val(),brand:l("#brand").val(),msort:l("#msort").val(),color:l("#color").val(),size:l("#size").val(),price:l("#price").val(),discount:l("#discount").val(),limit:l("#limit").val(),channel:l("#channel").val(),p_d:l("#p_d").val()},m=new Date,w=m.getMonth()+1,b=m.getDate(),C=l("#list-nav"),y={today:{reload:!0,page:0,end:!1},week:{reload:!0,page:0,end:!1},sale:{reload:!0,page:0,end:!1}};h.addClass("hide"),f.addClass("hide"),l("#today a").text(w+"月"+b+"号"),l(".swiper-container .swiper-slide").length>1&&(t=new r(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,pagination:".swiper-pagination"})),d(l(".lazy")),c.registerCbFn(i),C.delegate("li","tap",function(){var e,a,s,t=l(this);if(t.hasClass("filter"))t.hasClass("active")?(c.hideFilter(),n.addClass("active"),t.removeClass("active")):(n=t.siblings(".active"),n.removeClass("active"),t.addClass("active"),c.showFilter());else{if(t.hasClass("today")?a="today":t.hasClass("week")?a="week":t.hasClass("sale")&&(a="sale"),e=y[a],!t.hasClass("active")){if(s=t.siblings(".active"),n=t,s.hasClass("filter"))c.hideFilter();else switch(p.children(".container:not(.hide)").addClass("hide"),a){case"today":u.removeClass("hide");break;case"week":h.removeClass("hide");break;case"sale":f.removeClass("hide")}s.removeClass("active"),t.addClass("active")}e.reload&&i()}}),l(window).scroll(function(){l(window).scrollTop()+g>l(document).height()-.25*p.height()&&void 0!==n&&i()})}),define("js/plugin/filter",["zepto"],function(e,a,s){function i(){r.addClass("hide")}function t(){r.removeClass("hide")}function n(e){o=e}var o,l=e("zepto"),r=l(".filter-mask, .filter-body"),d=r.find(".classify"),c=r.find(".sub-classify");d.children(":first-child").addClass("active"),d.delegate(".classify-item","tap",function(){var e=l(this);e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}),r.filter(".filter-mask").tap(function(){i()}),c.delegate("li","tap",function(e){var a,s,t=l(this),n=t.data("id"),r=t.closest(".sub-classify"),d=r.siblings(".shower");e.stopPropagation(),t.hasClass("chosed")||(r.children(".chosed").removeClass("chosed"),t.addClass("chosed"),a=l.trim(t.html()),s=l.trim(d.html()),d.html(s.substring(0,s.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===t.index()?d.addClass("default"):d.removeClass("default"),o&&o({type:r.data("type"),id:n}),i())}),a.showFilter=t,a.hideFilter=i,a.registerCbFn=n}),define("js/product/newsale/discount",["zepto","swiper","lazyload","index"],function(e,a,s){function i(e){var a,s,i,t,l,d={};if(e){for(s in m)m.hasOwnProperty(s)&&(m[s].reload=!0);switch(v.children(".active").removeClass("active"),w.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"msort":a={msort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}o.extend(g,a)}if(!n){if(w.hasClass("new")?t="newest":w.hasClass("price")?t="price":w.hasClass("discount")&&(t="discount"),i=m[t],l=i.page+1,i.reload)l=1;else if(i.end)return;o.extend(d,g,{type:t,order:i.order,page:l}),n=!0,o.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:d,success:function(e){var a,s='<p class="no-result">未找到相关搜索结果</p>';switch(t){case"newest":a=p;break;case"price":a=u;break;case"discount":a=h}" "===e?(i.end=!0,i.reload&&a.html(s)):(i.reload?a.html(e):a.append(e),r(a.find(".lazy"))),i.reload=!1,i.page=l,n=!1}})}}var t,n,o=e("zepto"),l=e("swiper"),r=e("lazyload"),d=e("js/plugin/filter"),c=o("#goods-container"),p=o(c.children().get(0)),u=o(c.children().get(1)),h=o(c.children().get(2)),f=o(window).height(),g={gender:o("#gender").val(),brand:o("#brand").val(),msort:o("#msort").val(),color:o("#color").val(),size:o("#size").val(),price:o("#price").val(),discount:o("#discount").val()},v=o("#list-nav"),m={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},w=v.find(".active");o(".swiper-container .swiper-slide").length>1&&(t=new l(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,pagination:".swiper-pagination"})),r(o(".lazy")),d.registerCbFn(i),v.delegate("li","tap",function(){var e,a,s,t=o(this);if(t.hasClass("filter"))t.hasClass("active")?(d.hideFilter(),w.addClass("active"),t.removeClass("active")):(w=t.siblings(".active"),w.removeClass("active"),t.addClass("active"),d.showFilter());else{if(t.hasClass("new")?a="newest":t.hasClass("price")?a="price":t.hasClass("discount")&&(a="discount"),e=m[a],t.hasClass("active")){if(t.hasClass("new"))return;(t.hasClass("price")||t.hasClass("discount"))&&(t.find(".icon > .iconfont").toggleClass("cur"),w=t,e.reload=!0,e.order=0===e.order?1:0)}else{if(s=t.siblings(".active"),w=t,s.hasClass("filter"))d.hideFilter();else switch(c.children(".container:not(.hide)").addClass("hide"),a){case"newest":p.removeClass("hide");break;case"price":u.removeClass("hide");break;case"discount":h.removeClass("hide")}s.removeClass("active"),t.addClass("active")}e.reload&&i()}}),o(window).scroll(function(){o(window).scrollTop()+f>o(document).height()-.25*c.height()&&void 0!==w&&i()})}),define("js/product/list",["zepto","lazyload"],function(e,a,s){function i(e){var a,s,i,l,r,d={};if(e){for(s in w)w.hasOwnProperty(s)&&(w[s].reload=!0);switch(m.children(".active").removeClass("active"),b.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"msort":a={msort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}n.extend(v,a)}if(!t){if(b.hasClass("new")?l="newest":b.hasClass("price")?l="price":b.hasClass("discount")&&(l="discount"),i=w[l],r=i.page+1,i.reload)r=1;else if(i.end)return;n.extend(d,v,{type:l,order:i.order,page:r}),t=!0,n.ajax({type:"GET",url:"/index/search/search",data:d,success:function(e){var a,s='<p class="no-result">未找到相关搜索结果</p>';switch(l){case"newest":a=u;break;case"price":a=h;break;case"discount":a=f}" "===e?(i.end=!0,i.reload&&a.html(s)):(i.reload?a.html(e):a.append(e),o(a.find(".lazy"))),i.reload=!1,i.page=r,t=!1}})}}var t,n=e("zepto"),o=e("lazyload"),l=n("#brand-header"),r=n("#intro-box"),d=e("js/plugin/filter"),c=e("js/plugin/tip"),p=n("#goods-container"),u=p.children(".new-goods"),h=p.children(".price-goods"),f=p.children(".discount-goods"),g=n(window).height(),v={gender:n("#gender").val(),brand:n("#brand").val(),msort:n("#msort").val(),color:n("#color").val(),size:n("#size").val(),price:n("#price").val(),discount:n("#discount").val()},m=n("#list-nav"),w={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},b=m.find(".active");o(n(".lazy")),d.registerCbFn(i),m.delegate("li","tap",function(){var e,a,s,t=n(this);if(t.hasClass("filter"))t.hasClass("active")?(d.hideFilter(),b.addClass("active"),t.removeClass("active")):(b=t.siblings(".active"),b.removeClass("active"),t.addClass("active"),d.showFilter());else{if(t.hasClass("new")?a="newest":t.hasClass("price")?a="price":t.hasClass("discount")&&(a="discount"),e=w[a],t.hasClass("active")){if(t.hasClass("new"))return;(t.hasClass("price")||t.hasClass("discount"))&&(t.find(".icon > .iconfont").toggleClass("cur"),b=t,e.reload=!0,e.order=0===e.order?1:0)}else{if(s=t.siblings(".active"),b=t,s.hasClass("filter"))d.hideFilter();else switch(p.children(".container:not(.hide)").addClass("hide"),a){case"newest":u.removeClass("hide");break;case"price":h.removeClass("hide");break;case"discount":f.removeClass("hide")}s.removeClass("active"),t.addClass("active")}e.reload&&i()}}),n(window).scroll(function(){n(window).scrollTop()+g>n(document).height()-.25*p.height()&&i()}),l.children(".btn-intro").bind("tap",function(){r.removeClass("hide")}),n(".close-intro, .brand-intro-box").tap(function(){r.addClass("hide")}),n("#brand-intro").tap(function(e){e.stopPropagation()}),l.children(".btn-col").bind("tap",function(){var e,a=n(this),s=l.data("id");e=a.hasClass("coled")?"cancel":"ok",n.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:s,opt:e},success:function(e){200===e.code?a.toggleClass("coled"):400===e.code&&c.show("未登录")},error:function(){c.show("网络断开连接了~")}})})}),define("js/product/detail/detail",["zepto","swiper","lazyload","index"],function(e,a,s){var i,t=e("zepto"),n=e("swiper"),o=e("lazyload");o(t("img.lazy")),i=new n(".banner-swiper",{loop:!0,pagination:".banner-top .pagination-inner",slideElement:"div",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})}),define("js/index/index",["zepto"],function(e,a,s){e("js/index/search"),e("js/index/channel"),e("js/index/footer")}),define("js/index/search",["zepto"],function(e,a,s){
var i=e("zepto"),t=i("#search-input input"),n=i("#search-input .clear-input"),o=i(".history");i("#clear-history").bind("tap",function(){i.ajax({type:"POST",url:"/search/clearHistory",success:function(e){200===e.code&&o.html("")}})}),t.bind("input",function(){""===t.val()?n.addClass("hide"):n.removeClass("hide")}),n.bind("tap",function(){t.val("").trigger("input")})}),define("js/index/channel",[],function(e,a,s){}),define("js/index/footer",["zepto"],function(e,a,s){function i(){var e="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445",a=new Date;setTimeout(function(){new Date-a<2e3&&(window.location=e)},500)}var t=e("zepto"),n=t(".search-box"),o=t(".index-search"),l=t(".index-logo");t("#float-layer-close").bind("tap",function(){t("#float-layer-app").hide(),window.setCookie("_float-layer-app","id490655927",{domain:".yohobuy.com"}),window.setCookie("_float-layer-app-close",1,{domain:".yohobuy.com",expires:1})}),t("#float-layer-btn").tap(function(){i("bottom")}),window.cookie("_float-layer-app")?t("#float-layer-app").hide():t("#float-layer-app").show(),n.find("input").on("focus",function(){l.css({width:0,display:"none"}),n.css({width:"12.8rem"}),o.css({width:"15.5rem"}),t(".clear-text, .no-search").show()}).on("blur",function(){l.css({width:"5.4rem",display:"block"}),n.css({width:"8.8rem"}),o.css({width:"9.6rem"}),t(".clear-text, .no-search").hide()}),n.find(".clear-text").tap(function(){n.find("input").val("").trigger("focus")}),n.find(".search-icon").tap(function(){o.submit()})});
\ No newline at end of file
This diff could not be displayed because it is too large.