Authored by 毕凯

Merge branch 'master' into feature/qps

... ... @@ -71,9 +71,9 @@ app.set('json replacer', function(key, value) {
});
// 请求限制中间件
//if (!app.locals.devEnv) {
// app.use(require('./doraemon/middleware/limiter'));
//}
if (!app.locals.devEnv) {
app.use(require('./doraemon/middleware/limiter'));
}
// 指定libray目录
global.utils = path.resolve('./utils');
... ...
... ... @@ -41,9 +41,7 @@ const _getProductBySkns = function(productObj) {
const _getShopGroup = (shopRawData) => {
return api.get('', {
method: 'app.shops.batchGetShops',
shop_ids: shopRawData.defaultShopIds,
order: _.get(shopRawData, 'linkParams.order') || 'pool_id_desc',
filter_poolId: _.get(shopRawData, 'linkParams.filter_poolId', '')
shop_ids: shopRawData.defaultShopIds
}).then(result => {
let renderData = _.get(result, 'data', []);
... ...
... ... @@ -2,6 +2,7 @@
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const _ = require('lodash');
const rp = require('request-promise');
/* 微信相关 */
const wxCode = {
... ... @@ -315,30 +316,30 @@ const getWxUserInfo = (params) => {
params.code + '&grant_type=authorization_code';
let url2 = 'https://api.weixin.qq.com/sns/userinfo?lang=zh_CN';
return api._requestFromAPI({
return rp({
url: url1,
qs: {},
json: true,
gzip: true,
timeout: 3000
})
.then((result) => {
if (_.isEmpty(result.openid)) {
return false;
}
url2 = url2 + '&access_token=' + result.access_token +
}).then((result) => {
if (_.isEmpty(result.openid)) {
return false;
}
url2 = url2 + '&access_token=' + result.access_token +
'&openid=' + result.openid;
return api._requestFromAPI({
url: url2,
qs: {},
json: true,
gzip: true,
timeout: 3000
})
.then((result2) => {
return result2;
});
return rp({
url: url2,
qs: {},
json: true,
gzip: true,
timeout: 3000
}).then((result2) => {
return result2;
});
});
};
/**
... ...
<div class="shop-container{{#isEqualOr numOfOneRow '2'}} shop-two{{^}} shop-three{{/isEqualOr}}">
{{#renderData}}
{{#isEqualOr ../numOfOneRow '2'}}
<div class="pull-left shop-box">
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}}class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon" src="{{image2 ../lefTopImg q=95}}" alt="">
<img src="{{image2 picture w=187 h=275 q=95}}" alt="">
</div>
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=95}})">
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=95}})">
<span class="shop-name">{{shop_name}}</span>
</a>
</div>
</div>
</a>
{{^}}
<div class="pull-left shop-box">
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}}class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon" src="{{image2 ../lefTopImg q=95}}" alt="">
<img src="{{image2 picture w=187 h=275 q=95}}" alt="">
</div>
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=95}});">
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=95}});">
<span class="shop-name">{{shop_name}}</span>
</a>
</div>
</div>
</a>
{{/isEqualOr}}
{{/renderData}}
</div>
\ No newline at end of file
... ...
/**
* guang controller
* @author: lcy<chuanyang.liu@yoho.cn>
* @date: 2016/08/31
*/
'use strict';
const headerModel = require('../../../doraemon/models/header'); // 头部model
const newsService = require('../models/news-service');
/**
* 首页文章列表 类型列表
*/
exports.index = (req, res, next) => {
let channel = req.yoho.channel;
req.ctx(newsService).getIndexList(channel, req.query).then(result => {
if (result.msgs.length <= 0) {
res.set('Cache-Control', 'no-cache');
}
return res.render('news-index', Object.assign({
title: '新闻 | ' + (res.locals.title || ''),
pageHeader: headerModel.setNav({
navTitle: '新闻'
}),
module: 'news',
localCss: true,
page: 'index'
}, result));
}).catch(next);
};
/**
* 文章详情
*/
exports.detail = (req, res, next) => {
let channel = req.yoho.channel;
let id = req.params[0] || 0;
let cid = req.params[1] || 0;
let query = {
channel: channel,
id: id,
cid: cid,
};
if (!id || !cid) {
return next();
}
req.ctx(newsService).detail(channel, query).then(result => {
return res.render('news-detail', Object.assign({
pageHeader: headerModel.setNav({
navTitle: result.header && result.header.title || '新闻详情页'
}),
module: 'news',
localCss: true,
page: 'detail'
}, result));
}).catch(next);
};
/**
* 文章详情
*/
exports.pageData = (req, res, next) => {
let channel = req.yoho.channel;
req.ctx(newsService).pageData(channel, req.query).then(result => {
return res.render('news-page', Object.assign({
layout: false
}, result));
}).catch(next);
};
... ...
/**
* news
* @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
* @date: 2017/10/13
*/
'use strict';
var express = require('express'),
path = require('path'),
hbsEvent = require('../../config/hbsevent');
var app = express();
// set view engin
var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root
app.disable('x-powered-by');
app.on('mount', function(parent) {
delete parent.locals.settings; // 不继承父 App 的设置
Object.assign(app.locals, parent.locals);
});
app.use(global.yoho.hbs({
extname: '.hbs',
defaultLayout: 'layout',
layoutsDir: doraemon,
partialsDir: [path.join(__dirname, 'views/partial')],
views: path.join(__dirname, 'views/action'),
helpers: global.yoho.helpers,
cb: hbsEvent.cb
}));
// router
app.use(require('./router'));
module.exports = app;
... ...
'use strict';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
getPolymerizationList(params) {
return this.get({
url: 'yohonow/api/page/getPolymerizationList',
data: params,
param: {
cache: true
},
api: global.yoho.YohoNowApi
});
}
getContentDetail(params) {
return this.get({
url: 'yohoboyins/v5/channel/getContentDetail',
data: {parameters: JSON.stringify(params)},
param: {
cache: true
},
api: global.yoho.YohoNowApi
});
}
/**
* 推荐文章
*/
getRecoArticles(params) {
return this.get({
url: 'guang/api/v2/article/getArticleByViewsNum',
data: params,
param: {
cache: true
},
api: global.yoho.ServiceAPI
});
}
/**
* 获取广告数据
* @param {String} channelType 传入频道页类型,值可以是: boys, girls, kids, lifestyle
* @return {Object}
*/
getAds(params) {
if (params.isAdDegrade) {
return Promise.resolve({});
}
return this.get({
url: 'operations/api/v5/resource/get',
data: params,
param: {
cache: true
},
api: global.yoho.ServiceAPI
});
}
};
... ...
'use strict';
const _ = require('lodash');
const helpers = global.yoho.helpers;
const NewsAPi = require('./news-api');
const utils = require('./utils');
const moment = require('moment');
const ATYPE = 'yohobuy4008899646,yohogroup,YOHO_GIRL,mars-app';
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
_formatArticle(rdata) {
let list = _.get(rdata, 'data.content', []);
let total = _.get(rdata, 'data.total', 0);
let lresult = {};
let width = 640;
let height = 275;
let result = _.map(list, (articleData) => {
articleData.image += '?imageView2/{mode}/w/{width}/h/{height}';
lresult = {
id: articleData.id,
url: helpers.urlFormat(`/news/${articleData.id}_${articleData.cid}.html`),
img: helpers.image(articleData.image, width, height, 1),
title: articleData.title,
publishTime: articleData.update_time && moment(articleData.update_time * 1000).format('MM月DD HH:mm'),
text: articleData.summary,
isVideo: articleData.videoUrl ? true : false
};
return lresult;
});
return {msgs: {info: result}, totalCount: total};
}
getIndexList(channel, param) {
let newsAPi = new NewsAPi(this.ctx);
let params = {
type: 'wechat',
limit: 20,
page: param.page || 1
};
return newsAPi.getPolymerizationList(Object.assign({}, params, {id: param.atype || ATYPE})).then(result => {
let responseData = {};
// 列表数据
Object.assign(responseData, this._formatArticle(result));
return responseData;
});
}
pageData(channel, param) {
let newsAPi = new NewsAPi(this.ctx);
let params = {
type: 'wechat',
limit: 20,
page: param.page || 1
};
return newsAPi.getPolymerizationList(Object.assign({}, params, {id: param.atype || ATYPE})).then(result => {
let responseData = {};
// 列表数据
Object.assign(responseData, this._formatArticle(result));
return responseData;
});
}
_formatDetail(rdata) {
let contents = _.get(rdata, 'data.contents', {});
let header = {
title: contents.title,
summary: contents.summary,
tag: contents.tag,
publishTime: contents.update_time && moment(contents.update_time * 1000).format('MM月DD HH:mm'),
};
let content = utils.filterPhtml(contents.content, [
'阅读原文',
'点击这里',
'点这里'
]);
return {header: header, content: utils.filterAhtml(content)};
}
detail(channel, param) {
let params = {
id: param.id,
cid: param.cid
};
let newsAPi = new NewsAPi(this.ctx);
return newsAPi.getContentDetail(params).then(result => {
let responseData = {};
// 详情页数据
Object.assign(responseData, this._formatDetail(result, params));
// seo
let title = _.get(responseData, 'header.title', '新闻详情页');
let keywords = [];
let tags = _.compact(_.get(responseData, 'header.tag', []).map(el => {
return el.tag_name;
}));
keywords.push(title, tags.slice(0, 3).join('、'), 'YOHO!BUY有货');
Object.assign(responseData, {
title: `${title} | YOHO!BUY有货`,
keywords: keywords.join('、'),
description: _.get(responseData, 'header.summary', _.get(this.ctx, 'res.locals.description'))
});
return responseData;
});
}
};
... ...
'use strict';
const _ = require('lodash');
const cheerio = require('cheerio');
const util = {
// 过滤指定字符的p标签
filterPhtml: (html, filters) => {
if (!html) {
return html;
}
let $ = cheerio.load(html, {decodeEntities: false});
_.each($('p'), (item) => {
let ele = $(item);
let phtml = ele.html();
_.each(filters, ft => {
if (phtml.indexOf(ft) >= 0) {
ele.remove();
}
});
});
return $.html();
},
// 过滤 a标签连接和删除html标签中的script和link脚本
filterAhtml: (html) => {
if (!html) {
return html;
}
let $ = cheerio.load(html, {decodeEntities: false});
$('a').attr('href', 'javascript:void(0);').css({cursor: 'text'});// eslint-disable-line
$('script,link').remove();
return $.html();
}
};
module.exports = util;
... ...
/**
* news
* @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
* @date: 2017/10/13
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const newsController = require(`${cRoot}/index`);
router.get(['/', '/index/index'], newsController.index);
router.get(/\/([\d]+)_([\d]+).html/, newsController.detail);
// ajax
router.get(['/', '/index/page'], newsController.pageData);
module.exports = router;
... ...
<div class="news-detail-page news-page yoho-page">
<div class="detail" data-id="{{id}}">
{{# header}}
<div class="post-title">
<p class="title">{{title}}</p>
{{> news-index/tvls}}
</div>
{{/header}}
<div class="post-content">
{{{content}}}
</div>
</div>
</div>
... ...
<div class="news-list-page news-page yoho-page">
{{# msgs}}
<div id="info-list" class="info-list-container">
<div class="info-list">
{{# info}}
{{> news-index/info}}
{{/ info}}
</div>
</div>
<div id="load-more-info" class="load-more-info">
<div class="loading status hide">
正在加载...
</div>
<span class="no-more status">没有更多啦</span>
</div>
{{/ msgs}}
</div>
{{> footer-tab}}
... ...
{{# msgs.info}}
{{> news-index/info}}
{{/ msgs.info}}
... ...
<div class="news-info" data-id="{{id}}">
{{# author}}
<a class="info-author clearfix"{{#if url}} href="{{url}}"{{/if}}>
<img class="lazy avatar" data-original="{{image2 avatar mode=2 q=60}}">
<span class="name">{{name}}</span>
{{#if minCategory}}
<span class="min-tag">#{{minCategory}}</span>
{{/if}}
</a>
{{/ author}}
<div class="info-img">
{{#if showTags}}
<a href="javascript:;" class="info-match hide">
{{# isTip}}
小贴士
<div class="info-tag tip"></div>
{{/ isTip}}
{{# isCollocation}}
搭配
<div class="info-tag collocation"></div>
{{/ isCollocation}}
{{# isFashionMan}}
潮人
<div class="info-tag fashion-man"></div>
{{/ isFashionMan}}
{{# isFashionGood}}
潮品
<div class="info-tag fashion-good"></div>
{{/ isFashionGood}}
{{# isTopic}}
话题
<div class="info-tag topic"></div>
{{/ isTopic}}
{{# isSpecialTopic}}
专题
<div class="info-tag special-topic"></div>
{{/ isSpecialTopic}}
{{# isVideo}}
视频
<div class="info-tag video"></div>
{{/ isVideo}}
{{# isShow}}
SHOW
<div class="info-tag show"></div>
{{/ isShow}}
</a>
{{/if}}
<a class="img-box"{{#unless isShow}} href="{{url}}"{{/unless}}>
{{#if @first}}
<img src="{{image2 img q=60}}" alt="{{alt}}">
{{^}}
<img class="lazy" data-original="{{image2 img q=60}}" alt="{{alt}}">
{{/if}}
{{#if isVideo}}
<div class="play"></div>
{{/if}}
</a>
</div>
<div class="info-deps">
<a class="info-title-container"{{#unless isShow}} href="{{url}}"{{/unless}}>
<div class="info-title">{{#if top}}<span class="top-tag">置顶</span>{{/if}}{{title}}</div>
</a>
<p class="info-text">{{text}}</p>
{{> news-index/tvls}}
</div>
{{#unless @root.isApp}}
{{#if productList}}
<div class="product-list-box">
<ul class="product-list">
{{#productList}}
{{> news-index/product-list}}
{{/productList}}
</ul>
</div>
{{/if}}
{{/unless}}
</div>
... ...
<li class="goods-box">
<div class="goods-img">
<a href="{{href}}">
<img class="lazy" data-original="{{image2 pic_url w=106 h=138}}" />
</a>
</div>
<div class="goods-info">
<a href="{{href}}">
<p class="title">{{product_name}}</p>
<p class="price">¥{{price}}</p>
</a>
</div>
</li>
\ No newline at end of file
... ...
<div class="time-view-like-share clearfix">
<i class="iconfont">&#xe603;</i>
{{publishTime}}&nbsp;&nbsp;&nbsp;&nbsp;
{{#if pageView}}
<i class="iconfont">&#xe602;</i>
<span class="page-view">{{pageView}}</span>
{{/if}}
<div class="like-share-container">
{{#like}}
<i class="iconfont like-btn{{#isLiked}} like{{/isLiked}}">&#xe601;</i>
<span class="like-count">{{count}}</span>
{{/ like}}
{{# collect}}
<i class="iconfont collect-btn{{#isCollected}} collected{{/isCollected}}">&#xe605;</i>
{{/ collect}}
{{# share}}
<a href="{{.}}" class="iconfont share-btn">&#xe600;</a>
{{/ share}}
</div>
</div>
... ...
... ... @@ -241,9 +241,13 @@ let filter = (req, res, next) => {
* @return {[type]}
*/
let search = (req, res, next) => {
let params = req.query; // tar modified 161121 safe
let params = req.query;
let uid = req.user.uid || 0;
if (params.from === 'seckill') {
uid = 0; // 秒杀无须用户信息
}
// 断码区域必须传尺码
if (params.saleType === '1' && (!params.breakSort || !params.breakSize)) {
return res.render('sale/product', {
... ...
... ... @@ -20,7 +20,8 @@ const domains = {
platformApi: 'http://192.168.102.48:8088/',
store: 'http://192.168.102.47:8080/portal-gateway/wechat/',
extstore: 'http://extstore-test1.yohops.com',
family: 'http://192.168.103.73:8096/uic/'
family: 'http://192.168.103.73:8096/uic/',
yohoNowApi: 'http://yohonow-test.yohops.com:9999/'
};
module.exports = {
... ... @@ -73,7 +74,7 @@ module.exports = {
maxFiles: 7
},
console: {
level: 'error',
level: 'info',
colorize: 'all',
prettyPrint: true
}
... ... @@ -108,7 +109,7 @@ module.exports = {
maxQps: 1200,
maxQps10m: 2500,
geetestJs: '//static.geetest.com/static/tools/gt.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.2.3/jssdk.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.2.4/jssdk.js',
redis: {
connect: {
host: '192.168.104.32',
... ... @@ -145,7 +146,8 @@ if (isProduction) {
imCs: 'https://imhttp.yohobuy.com/api',
platformApi: 'http://api.platform.yohoops.org',
extstore: 'http://extstore.yohobuy.com',
family: 'http://uic.yoho.cn/uic/'
family: 'http://uic.yoho.cn/uic/',
yohoNowApi: 'http://new.yohoboys.com/'
},
memcache: {
master: [
... ... @@ -231,7 +233,8 @@ if (isProduction) {
imCs: process.env.TEST_IM_CS || 'http://im.yohobuy.com/api',
platformApi: 'http://192.168.102.48:8088/',
extstore: 'http://extstore-test1.yohops.com',
family: 'http://192.168.103.73:8096/uic/'
family: 'http://192.168.103.73:8096/uic/',
yohoNowApi: process.env.YOHO_NOW_API || 'http://yohonow-test.yohops.com:9999/'
},
memcache: {
master: ['192.168.104.15:12111', '192.168.104.29:12111', '192.168.104.32:12111'],
... ...
... ... @@ -16,6 +16,7 @@ module.exports = app => {
// 业务模块
app.use('/product', require('./apps/product'));
app.use('/guang', require('./apps/guang'));
app.use('/news', require('./apps/news'));
app.use('/activity', require('./apps/activity'));
app.use('/cart', require('./apps/cart'));
... ...
... ... @@ -4,6 +4,7 @@ const _ = require('lodash');
const cookie = global.yoho.cookie;
const authcode = require('../../utils/authcode');
const config = global.yoho.config;
const logger = global.yoho.logger;
module.exports = () => {
return (req, res, next) => {
... ... @@ -69,6 +70,10 @@ module.exports = () => {
let appVersion = req.query.app_version || req.cookies.app_version || config.appVersion;
let appSessionType = req.query.client_type || req.cookies.app_client_type;
if (req.query.app_version && req.query.client_type) {
logger.warn(`app session from querystring, url:${req.originalUrl}`);
}
req.query.uid = {
toString: () => {
return _.parseInt(appUid);
... ... @@ -76,9 +81,11 @@ module.exports = () => {
appVersion: appVersion,
appSessionType: appSessionType
};
res.cookie('app_uid', appUid.toString());
res.cookie('app_version', appVersion);
res.cookie('app_client_type', appSessionType);
// 此处 cookie 为了 pagecache 放到前端去写
// res.cookie('app_uid', appUid.toString());
// res.cookie('app_version', appVersion);
// res.cookie('app_client_type', appSessionType);
}
}
... ...
... ... @@ -27,7 +27,7 @@
window._timeStart = new Date().getTime();
window._yohoAppName = 'yohobuywap-node';
!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=r(13),i=r(14);n.init(),i.init()},function(e,t){e.exports=function(e,t,r){if("undefined"==typeof t){var n=null;if(document.cookie)for(var i=document.cookie.split(";"),o=0;o<i.length;o++){var a=(i[o]||"").trim();if(a.substring(0,e.length+1)==e+"="){n=decodeURIComponent(a.substring(e.length+1));break}}return n}r=r||{},null===t&&(t="",r.expires=-1);var d="";if(r.expires&&("number"==typeof r.expires||r.expires.toUTCString)){var u;"number"==typeof r.expires?(u=new Date,u.setTime(u.getTime()+24*r.expires*60*60*1e3)):u=r.expires,d="; expires="+u.toUTCString()}var s=r.path?"; path="+r.path:"",p=r.domain?"; domain="+r.domain:"",c=r.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),d,s,p,c].join("")}},,function(e,t,r){var n=r(1),i=window._yohoAppName||"unknown",o={config:{reportUrl:"//badjs.yoho.cn/apm/yas.gif"},stringify:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],i=[];for(var o in n)n.hasOwnProperty(o)&&i.push(o+"::"+n[o]);t.push(i.join("$$"))}return t.join("**")},report:function(e,t){if(e){var r=new Image;r.src=this.config.reportUrl+"?s="+i+"&l="+e+"&t="+(new Date).getTime(),t&&t()}},getUdid:function(){var e=(n("yohobuy_session")||"").slice(2).split(".")[0];return e||0},getUid:function(){var e=(n("_UID")||"").split("::")[1];return e||0},getReqId:function(){return n("docreqid")||0}};e.exports=o},,,,,,,,,,function(e,t,r){var n=r(1),i=r(3),o="_errLog",a={writeError:function(e,t,r,a,d){var u=JSON.parse(n(o)||"[]");u.push({tp:"err",msg:e,sc:t,ln:r,cn:a,pt:location.href,u:i.getUid(),ud:i.getUdid(),rid:i.getReqId(),st:JSON.stringify(d&&d.stack)}),n(o,JSON.stringify(u)),u.length>=5&&this.reportError()},clearError:function(){n(o,"[]")},reportError:function(){var e=this,t=JSON.parse(n(o)||"[]"),r=i.stringify(t);i.report(r,function(){e.clearError()})},init:function(){var e=this;window.onerror=function(t,r,n,i,o){e.writeError(t,r,n,i,o)},this.reportError()}};e.exports=a},function(e,t,r){function n(e){var t=e.offsetTop;return null!==e.offsetParent&&(t+=n(e.offsetParent)),t}var i=r(3),o=window.screen.height,a=[],d=!1,u=!1,s=0,p=setInterval(function(){var e,t;if(d){if(a.length)for(e=0;e<a.length;e++){if(t=a[e],!t.complete){u=!1;break}u=!0}else u=!0;u&&(s=(new Date).getTime()-_timeStart,clearInterval(p))}else{var r=document.body&&document.body.querySelectorAll("img")||[];for(e=0;e<r.length;e++){t=r[e];var i=n(t);if(i>o){d=!0;break}i<=o&&!t.hasPushed&&(t.hasPushed=1,a.push(t))}}},0),c={reportTime:function(e){var t=i.stringify(e);i.report(t)},addEvent:function(){var e=this,t=[],r=location.href,n=i.getUid(),o=i.getUdid(),a=i.getReqId(),c=window.performance&&window.performance.timing.navigationStart||0;_timeStart=window._timeStart||0,document.addEventListener&&document.addEventListener("DOMContentLoaded",function(e){t.push({tp:"dcl",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:o,rid:a});var i=document.body&&document.body.querySelectorAll("img")||[];i.length||(d=!0)},!1),window.addEventListener&&window.addEventListener("load",function(i){t.push({tp:"ld",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:o,rid:a}),u=!0,d=!0,p&&clearInterval(p),s&&t.push({tp:"fs",t:s,pt:r,u:n,ud:o,rid:a}),t.push({tp:"pf",dcl:(window.performance&&window.performance.timing.domComplete||0)-c,ld:(window.performance&&window.performance.timing.loadEventStart||0)-c,pt:r,u:n,ud:o,rid:a}),e.reportTime(t)},!1)},init:function(){this.addEvent()}};e.exports=c}]);
!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=r(13),o=r(14);n.init(),o.init()},function(e,t){e.exports=function(e,t,r){if("undefined"==typeof t){var n=null;if(document.cookie)for(var o=document.cookie.split(";"),i=0;i<o.length;i++){var a=(o[i]||"").trim();if(a.substring(0,e.length+1)==e+"="){n=decodeURIComponent(a.substring(e.length+1));break}}return n}r=r||{},null===t&&(t="",r.expires=-1);var d="";if(r.expires&&("number"==typeof r.expires||r.expires.toUTCString)){var u;"number"==typeof r.expires?(u=new Date,u.setTime(u.getTime()+24*r.expires*60*60*1e3)):u=r.expires,d="; expires="+u.toUTCString()}var s=r.path?"; path="+r.path:"",p=r.domain?"; domain="+r.domain:"",c=r.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),d,s,p,c].join("")}},,function(e,t,r){var n=r(1),o=window._yohoAppName||"unknown",i={config:{reportUrl:"//badjs.yoho.cn/apm/yas.gif"},stringify:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],o=[];for(var i in n)n.hasOwnProperty(i)&&o.push(i+"::"+n[i]);t.push(o.join("$$"))}return t.join("**")},report:function(e,t){if(e){var r=new Image;r.src=this.config.reportUrl+"?s="+o+"&l="+e+"&t="+(new Date).getTime(),t&&t()}},getUdid:function(){var e=(n("yohobuy_session")||"").slice(2).split(".")[0];return e||0},getUid:function(){var e=(n("_UID")||"").split("::")[1];return e||0},getReqId:function(){return n("docreqid")||0}};e.exports=i},,,,,,,,,,function(e,t,r){var n=r(1),o=r(3),i="_errLog",a={writeError:function(e,t,r,a,d){var u=JSON.parse(n(i)||"[]");u.push({tp:"err",msg:e,sc:t,ln:r,cn:a,pt:encodeURIComponent(location.href),u:o.getUid(),ud:o.getUdid(),rid:o.getReqId(),st:JSON.stringify(d&&d.stack)}),n(i,JSON.stringify(u)),u.length>=5&&this.reportError()},clearError:function(){n(i,"[]")},reportError:function(){var e=this,t=JSON.parse(n(i)||"[]"),r=o.stringify(t);o.report(r,function(){e.clearError()})},init:function(){var e=this;window.onerror=function(t,r,n,o,i){e.writeError(t,r,n,o,i)},this.reportError()}};e.exports=a},function(e,t,r){function n(e){var t=e.offsetTop;return null!==e.offsetParent&&(t+=n(e.offsetParent)),t}var o=r(3),i=window.screen.height,a=[],d=!1,u=!1,s=0,p=setInterval(function(){var e,t;if(d){if(a.length)for(e=0;e<a.length;e++){if(t=a[e],!t.complete){u=!1;break}u=!0}else u=!0;u&&(s=(new Date).getTime()-_timeStart,clearInterval(p))}else{var r=document.body&&document.body.querySelectorAll("img")||[];for(e=0;e<r.length;e++){t=r[e];var o=n(t);if(o>i){d=!0;break}o<=i&&!t.hasPushed&&(t.hasPushed=1,a.push(t))}}},0),c={reportTime:function(e){var t=o.stringify(e);o.report(t)},addEvent:function(){var e=this,t=[],r=encodeURIComponent(location.href),n=o.getUid(),i=o.getUdid(),a=o.getReqId(),c=window.performance&&window.performance.timing.navigationStart||0;_timeStart=window._timeStart||0,document.addEventListener&&document.addEventListener("DOMContentLoaded",function(e){t.push({tp:"dcl",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:i,rid:a});var o=document.body&&document.body.querySelectorAll("img")||[];o.length||(d=!0)},!1),window.addEventListener&&window.addEventListener("load",function(o){t.push({tp:"ld",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:i,rid:a}),u=!0,d=!0,p&&clearInterval(p),s&&t.push({tp:"fs",t:s,pt:r,u:n,ud:i,rid:a}),t.push({tp:"pf",dcl:(window.performance&&window.performance.timing.domComplete||0)-c,ld:(window.performance&&window.performance.timing.loadEventStart||0)-c,pt:r,u:n,ud:i,rid:a}),e.reportTime(t)},!1)},init:function(){this.addEvent()}};e.exports=c}]);
{{/ifand}}
</script>
... ...
{
"name": "m-yohobuy-node",
"version": "6.0.24",
"version": "6.2.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
... ...
{
"name": "m-yohobuy-node",
"version": "6.2.0",
"version": "6.2.3",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -73,7 +73,7 @@
"xml2js": "^0.4.19",
"yoho-express-session": "^2.0.0",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "=0.5.11",
"yoho-node-lib": "=0.5.12",
"yoho-zookeeper": "^1.0.8"
},
"devDependencies": {
... ...
... ... @@ -5,10 +5,31 @@
*/
const $ = require('yoho-jquery');
const cookie = require('yoho-cookie');
const qs = require('yoho-qs');
const tip = require('plugin/tip');
const yoho = require('./yoho-app');
// 初始化
// 如果不是 App,就把这个 cookie 清理掉,解决之前缓存错误的问题 20171020
const isApp = qs.app_version || /YohoBuy/i.test(navigator.userAgent || '');
if (!isApp) {
cookie.remove('app_uid', 'app_version', 'app_client_type');
}
// App 的信息需要存下来
if (yoho.isApp && qs.uid && qs.app_version && qs.client_type) {
const options = {
path: '/'
};
// 如果 App 没有写 UID,或者写的不对,H5 写一下
if (!cookie.get('app_uid') || cookie.get('app_uid') === '0') {
qs.uid && cookie.set('app_uid', qs.uid, options);
qs.app_version && cookie.set('app_version', qs.app_version, options);
qs.client_type && cookie.set('app_client_type', qs.client_type, options);
qs.session_key && cookie.set('app_session_key', qs.session_key, options);
}
}
// 注册ajaxError处理服务端401状态
$(document).ajaxError((event, xhr) => {
... ...
/**
* 新闻列表
* @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
* @date: 2017/10/18
*/
require('news/detail.page.css');
require('common');
... ...
/**
* 新闻列表
* @author: xiaoxiao<xiaoxiao.hao@yoho.cn>
* @date: 2017/10/20
*/
require('news/index.page.css');
const NewsIndexController = require('./news-index/controller');
new NewsIndexController();
... ...
'use strict';
import {
Controller
} from 'yoho-mvc';
import {
IndexView
} from './view';
class IndexController extends Controller {
constructor() {
super();
this.init();
}
init() {
new IndexView().init();
}
}
module.exports = IndexController;
... ...
let tip = require('plugin/tip');
let mvc = require('yoho-mvc');
export class IndexModel {
loadMoreAjax(option) {
return mvc.http(option).catch(() => {
tip.show('网络断开了~~');
});
}
}
... ...
import {
View
} from 'yoho-mvc';
import {
IndexModel
} from './model';
let lazyLoad = require('yoho-jquery-lazyload');
let ellipsis = require('yoho-mlellipsis');
export class IndexView extends View {
constructor() {
super();
}
init() {
let that = this;
let $loadMoreInfo = $('#load-more-info');
ellipsis.init();
this.indexModel = new IndexModel();
this.selector = {
searching: false,
$win: $(window),
$infoList: $('#info-list'),
$loading: $loadMoreInfo.children('.loading'),
$noMore: $loadMoreInfo.children('.no-more'),
$infos: $('#info-list').children('.info-list'),
};
this.navState = [{
page: 2,
end: false
}];
// srcoll to load more
$(document).scroll(function() {
window.requestAnimationFrame(function() {
that.scrollHandler.apply(that, []);
});
});
this.setLazyLoadAndMellipsis(this.selector.$infoList.children('.info-list').not('.hide').find('.news-info'));
}
scrollHandler() {
let $c = this.selector.$infos.not('.hide');
if (this.selector.$win.scrollTop() + this.selector.$win.height() >= $(document).height() - 0.25 * $c.height()) {
this.loadMore($c, 0);
}
}
loadMore($container, index) {
let that = this;
if (that.selector.searching || that.navState[index].end) {
return;
}
that.selector.searching = true;
that.selector.$noMore.addClass('hide');
that.selector.$loading.removeClass('hide');
this.indexModel.loadMoreAjax({
type: 'GET',
url: '/news/index/page',
dataType: 'html',
data: that.navState[index]
}).then(rdata => {
that.selector.$loading.addClass('hide');
if (rdata === '') {
that.navState[index].end = true;
that.selector.searching = false;
that.selector.$noMore.removeClass('hide');
return;
}
let $dataHtml = $(rdata);
$container.append($dataHtml);
that.setLazyLoadAndMellipsis($dataHtml.siblings('.news-info'));
that.navState[index].page++;
that.selector.searching = false;
}).catch(() => {
that.selector.searching = false;
});
}
setLazyLoadAndMellipsis($infos) {
lazyLoad($infos.find('img.lazy'));
$infos.each(function() {
let $this = $(this),
$title = $this.find('.info-title'),
$text = $this.find('.info-text');
$title[0].mlellipsis(2);
$text[0].mlellipsis(2);
});
}
}
... ...
... ... @@ -2,7 +2,6 @@
* @Author: Targaryen
* @Date: 2017-04-21 13:36:34
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-21 14:17:40
*/
const $ = require('yoho-jquery');
... ... @@ -42,7 +41,8 @@ const loadGoodsList = () => {
data: {
yh_channel: channel,
page: page++,
isApp: yoho.isApp
isApp: yoho.isApp,
from: 'seckill'
},
complete: function() {
onSearching = false;
... ...
... ... @@ -208,9 +208,12 @@
.new-brand-name {
position: absolute;
bottom: 10px;
bottom: 0;
left: 0;
right: 0;
background-color: #272829;
padding-top: 5px;
padding-bottom: 5px;
.brand-name {
display: -webkit-box;
... ... @@ -220,7 +223,7 @@
line-height: 30px;
overflow: hidden;
font-size: 26px;
color: #444;
color: #fff;
}
}
... ... @@ -240,7 +243,7 @@
> .market-price {
margin-left: 10px;
font-size: 18px;
font-size: 24px;
font-weight: 400;
color: #fff;
}
... ...
... ... @@ -14,8 +14,9 @@ $shop-width-3: 187px;
float: left;
}
.shop-box > a {
> a {
display: block;
text-decoration: none;
}
.shop-img {
... ... @@ -31,6 +32,16 @@ $shop-width-3: 187px;
}
}
.shop-name {
font-size: 24px;
margin-left: 5px;
white-space: nowrap;
width: 73%;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}
&.shop-two {
padding-left: $margin-left-2;
margin-top: $margin-top;
... ... @@ -39,6 +50,7 @@ $shop-width-3: 187px;
width: $shop-width-2;
height: $floor-height-2;
margin-right: $margin-left-2;
margin-bottom: 40px;
display: inline-block;
.shop-img {
... ... @@ -65,6 +77,7 @@ $shop-width-3: 187px;
width: $shop-width-3;
height: $floor-height-3;
margin-right: $margin-left-3;
margin-bottom: 40px;
display: inline-block;
.shop-img {
... ...
@define-mixin relatedTitle {
background: #fff;
line-height: 104px;
font-size: 28px;
color: #444;
text-align: center;
}
$focus-size: 42px;
.news-detail-page {
.news-wrap {
position: relative;
}
#wrapper {
background: #f0f0f0;
}
#wrapper.ios {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
&.has-head {
top: 90px;
+ .fixed-top {
top: 90px;
}
}
}
.author {
border-bottom: 1px solid #e0e0e0;
background: #fff;
> a {
display: block;
height: 100%;
}
.avatar {
float: left;
margin-top: 20px;
margin-left: 30px;
width: 50px;
height: 50px;
border-radius: 50%;
}
.name {
float: left;
font-size: 14PX;
color: #000;
padding: 30px 0;
margin-left: 30px;
}
.intro {
float: left;
font-size: 14PX;
color: #b0b0b0;
padding: 30px 0;
margin-left: 30px;
}
}
.post-title {
padding: 16px 0 26px 30px;
background: #fff;
.title {
line-height: 30PX;
font-size: 20PX;
color: #000;
font-weight: bold;
}
}
.post-content {
padding: 0 30px;
background-color: #fff;
img {
height: auto;
}
}
.text-block {
padding: 20px 0;
line-height: 23PX;
font-size: 14PX;
background: #fff;
color: #444;
word-break: break-word;
word-wrap: break-word;
}
.big-img-block {
padding-bottom: 5px;
background: #fff;
position: relative;
img {
width: 100%;
}
}
.big-img-block > .tag-list-box {
left: 0;
bottom: 0;
position: absolute;
padding: 20px;
.label-box {
font-size: 20px;
overflow: hidden;
margin-bottom: 10px;
.lable-focus {
float: left;
display: flex;
align-items: center;
line-height: 46px;
height: 46px;
margin-right: 32px;
.focus-big {
display: flex;
align-items: center;
width: $focus-size;
height: $focus-size;
border-radius: $focus-size;
border: 6px solid rgba(253, 157, 43, 0.5);
justify-content: center;
}
.focus-small {
width: $focus-size;
height: $focus-size;
border-radius: $focus-size;
background: rgba(253, 157, 43, 1);
transform: scale(0.5, 0.5);
margin: -$focus-size;
}
}
.lable-info-box {
background-color: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 0 20px;
border-top-left-radius: 40px;
border-bottom-left-radius: 40px;
float: left;
line-height: 46px;
width: 250px;
height: 46px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.lable-infobox-borderadius {
width: 336px;
border-top-right-radius: 40px;
border-bottom-right-radius: 40px;
}
.lable-info-box > a {
color: #fff;
}
.lable-btn {
background-color: #000;
color: #fff;
padding: 0 20px;
border-top-right-radius: 40px;
border-bottom-right-radius: 40px;
float: left;
line-height: 46px;
height: 46px;
}
.lable-btn > .plus {
font-size: 16px;
}
}
}
.small-img-block {
padding-bottom: 8px;
background: #fff;
img {
float: right;
width: 50%;
&:first-child {
float: left;
}
}
}
.collocation-block {
background: #fff;
.good-info {
width: 260px;
height: 477px;
}
}
.thumb-container {
padding-top: 30px;
padding-left: 20px;
background: transparent resolve("guang/thumb-container-bg.png") no-repeat;
background-size: 200% 100%;
&.fixed-top {
position: fixed;
left: 0;
right: 0;
top: 0;
}
&.fixed-bottom {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.9);
}
&.absolute {
position: absolute;
left: 0;
right: 0;
}
&.static {
position: static;
}
&.hide {
display: none;
}
}
.clothe-type {
position: absolute;
right: 6px;
bottom: 34px;
width: 20px;
height: 20px;
border-radius: 50%;
&.bag {
background: url("/guang/clothes/bag.png");
background-color: #fff;
background-size: 100%;
}
&.cloth {
background: url("/guang/clothes/cloth.png");
background-color: #fff;
background-size: 100%;
}
&.dress {
background: url("/guang/clothes/dress.png");
background-color: #fff;
background-size: 100%;
}
&.headset {
background: url("/guang/clothes/headset.png");
background-color: #fff;
background-size: 100%;
}
&.lamp {
background: url("/guang/clothes/lamp.png");
background-color: #fff;
background-size: 100%;
}
&.pants {
background: url("/guang/clothes/pants.png");
background-color: #fff;
background-size: 100%;
}
&.shoe {
background: url("/guang/clothes/shoe.png");
background-color: #fff;
background-size: 100%;
}
&.swim-suit {
background: url("/guang/clothes/swim-suit.png");
background-color: #fff;
background-size: 100%;
}
&.under {
background: url("/guang/clothes/under.png");
background-color: #fff;
background-size: 100%;
}
&.watch {
background: url("/guang/clothes/watch.png");
background-color: #fff;
background-size: 100%;
}
}
.thumb {
display: inline-block;
position: relative;
margin-right: 22px;
padding-bottom: 30px;
&:last-child {
margin-right: 0;
}
&.focus .thumb-img {
border-color: #000;
}
.thumb-img {
height: 134px;
width: 96px;
border: 1px solid transparent;
}
}
.related-reco-block {
background: #fff;
.one-good {
background-color: #f0f0f0;
margin-bottom: 10px;
border: solid 1px #e0e0e0;
&:last-child {
margin-bottom: 0;
}
.thumb {
float: left;
height: 204px;
width: 152px;
margin: 0;
padding: 0;
}
.content-container {
width: 404px;
float: left;
font-size: 22px;
margin-left: 20px;
padding-right: 30px;
height: 206px;
position: relative;
span {
display: inline-block;
line-height: 24px;
}
.price {
line-height: 53px;
}
.go-detail {
color: #444;
position: absolute;
bottom: 20px;
right: 30px;
}
.detail-arr {
vertical-align: baseline;
}
.iconfont {
font-size: 18px;
}
}
.reco-name {
margin-top: 35px;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
height: 60px;
span {
line-height: 30px;
height: 60px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.sale-price {
color: #d0021b;
line-height: 1.5;
}
.sale-price.no-price {
color: #000;
}
.market-price {
margin-left: 5px;
color: #b0b0b0;
text-decoration: line-through;
line-height: 1.5;
}
.check-detail {
display: block;
background-color: #444;
color: #fff;
border-radius: 20px;
height: 40px !important;
line-height: 40px !important;
text-align: center;
float: right;
width: 70px;
font-size: 28px;
span {
vertical-align: middle;
}
}
.check-detail > .plus {
font-size: 12px;
}
}
}
.related-reco-hide {
max-height: 860px;
overflow: hidden;
}
.related-reco {
padding-bottom: 10px;
}
.related-reco > .related-reco-more {
display: block;
width: 250px;
height: 40px;
line-height: 40px;
margin: 20px auto 0;
text-align: center;
font-size: 22px;
color: #fff;
background-color: #b0b0b0;
padding-left: 15px;
}
.link-block {
display: block;
height: 80px;
line-height: 80px;
padding: 0 30px;
font-size: 28px;
background: #fff;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
.iconfont {
float: right;
color: #ccc;
}
}
.related-brand {
margin-top: 30px;
h2 {
@mixin relatedTitle ;
}
.brand-list {
padding: 30px 0;
background: #fff;
}
.brand {
float: left;
width: 158px;
height: 128px;
margin-bottom: 10px;
a {
display: block;
}
&:nth-child(4n) {
border-right: none;
}
}
.brand-logo {
display: table-cell;
width: 158px;
height: 94px;
vertical-align: middle;
img {
display: block;
max-width: 158px;
max-height: 94px;
vertical-align: middle;
margin: 0 auto;
}
}
.brand-name {
margin: 10px 0 0;
line-height: 24px;
font-size: 12PX;
color: #babac2;
text-align: center;
text-decoration: none;
border-bottom: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.related-tag {
position: relative;
padding-bottom: 30px;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
background: #fff;
.tag-bg {
position: absolute;
height: 20PX;
width: 20PX;
background: resolve("guang/tag.png") no-repeat;
background-size: 100% 100%;
top: 35px;
left: 20px;
}
li {
float: left;
margin-top: 30px;
margin-left: 30px;
background-color: #444;
padding: 5px 11px;
}
a {
height: 40px;
font-size: 18px;
white-space: nowrap;
color: #fff;
}
}
.related-info {
margin-top: 30px;
h2 {
@mixin relatedTitle ;
}
.info-list {
background: #fff;
padding-bottom: 30px;
border-top: 1px solid #e0e0e0;
}
li {
padding-top: 30px;
margin-bottom: 10px;
a {
display: block;
}
img {
float: left;
margin-left: 30px;
width: 182px;
height: 114px;
&.square {
height: 182px;
}
}
}
.title,
.publish-time {
float: left;
width: 360px;
margin-left: 30px;
line-height: 20PX;
color: #444;
font-size: 14PX;
}
.title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
word-break: break-all;
overflow: hidden;
}
.publish-time {
font-size: 12PX;
margin-top: 0;
color: #b0b0b0;
.iconfont {
font-size: 12PX;
}
}
}
.down-bottom {
height: 44PX;
background: #fff;
}
.weixin {
margin: 20px 0;
text-align: center;
padding: 0 20px;
.ems-cnpl {
width: 47.3%;
display: inline-block;
background: #ededed;
position: relative;
overflow: hidden;
.weixin-img {
width: 100%;
height: 100%;
}
}
a:nth-child(1) {
margin-right: 20px;
}
}
.float-layer-left {
p {
line-height: 22PX;
font-size: 24px;
span {
font-size: 32px;
}
}
}
.news-header {
height: 90px;
line-height: 90px;
background-image: linear-gradient(#323232, #414141);
overflow: hidden;
position: relative;
.iconfont {
color: #fff;
}
.nav-btn {
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 2;
width: 40px;
margin: 0 30px;
text-align: center;
max-height: 90px;
}
.logo {
display: block;
margin: 0 auto;
width: 208px;
height: 87px;
background: resolve("channel/yohologo02.png") no-repeat center center;
background-size: 100%;
}
}
.girls .news-header {
background: rgb(255, 136, 174);
}
.kids .news-header {
background: rgb(122, 217, 249);
}
.lifestyle .news-header {
background: rgb(79, 65, 56);
}
.kids .logo {
font-style: italic;
font-family: "helvetica", "Arial", "榛戜綋";
font-weight: bold;
color: #fff;
}
.overlay {
display: none;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #000;
z-index: 3;
transition: opacity 1s;
}
.share-code {
width: 100%;
background: #fff;
.share-word {
margin-top: 10px;
height: 154px;
line-height: 44px;
text-align: center;
color: #b3b3b3;
}
}
.recommend-products-box {
height: 264px;
margin: 30px 0;
overflow-x: scroll;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
}
.recommend-products-box > .recommend-products-content {
height: 264px;
overflow-y: hidden;
display: inline-flex;
background-color: #fff;
padding: 30px;
padding-right: 0;
.recommend-goods {
width: 152px;
height: 204px;
margin-right: 30px;
float: left;
position: relative;
overflow: hidden;
}
.recommend-goods > img {
width: 152px;
height: 204px;
}
.recommend-goods > .recommend-goods-cover {
width: 152px;
height: 30px;
line-height: 18px;
font-size: 18px;
color: #fff;
background-color: rgba(0, 0, 0, 0.6);
text-align: center;
position: absolute;
bottom: 0;
padding: 6px;
}
}
video {
width: 100%;
}
.related-reco.change-display {
.one-good {
width: 275px;
float: left;
margin-right: 30px;
margin-bottom: 25px;
&:nth-last-child(1) {
margin-bottom: 0;
}
&:nth-last-child(2) {
margin-bottom: 0;
}
.thumb {
width: 275px;
height: 365px;
}
&:nth-child(even) {
margin-right: 0;
}
.content-container {
position: relative;
width: 275px;
margin-left: 0;
height: 130px;
padding: 0 15px;
.price {
height: 50px;
}
.go-detail {
right: 15px;
bottom: 0;
line-height: 50px;
}
}
.reco-name {
margin-top: 20px;
height: 60px;
white-space: normal;
span {
line-height: 30px;
height: 60px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.content-container > p {
position: absolute;
right: 15px;
bottom: 10px;
}
}
.related-reco-more {
display: none;
}
.related-reco-hide {
max-height: auto;
overflow: visible;
}
}
}
.news-detail-page.menu-open {
transform: translateX(540px);
}
... ...
.news-list-page {
.editor-header {
margin-bottom: 15PX;
padding-top: 18PX;
padding-bottom: 20PX;
background: #fff;
border-bottom: 1px solid #e0e0e0;
}
.avatar {
float: left;
margin-left: 30px;
img {
width: 50PX;
height: 50PX;
border-radius: 50%;
}
}
.text {
float: left;
margin-left: 32px;
width: 475px;
.name {
font-size: 16PX;
line-height: 20PX;
}
.info {
margin-top: 6px;
color: #bdbdbf;
font-size: 12PX;
line-height: 16PX;
}
}
.swiper-container {
width: 100%;
height: 310px;
img {
height: 100%;
width: 100%;
}
.swiper-pagination {
bottom: 0;
left: 0;
width: 100%;
}
.swiper-pagination-bullet-active {
background: #fff;
}
}
.news-nav {
background-color: #fff;
overflow: hidden;
width: 640px;
height: 80px;
display: flex;
justify-content: space-around;
}
.news-nav-item {
width: 20%;
color: #ccc;
font-size: 14PX;
text-align: center;
line-height: 80px;
&.focus {
color: #000;
}
}
.bytouch {
background: #eee;
}
.info-list-container {
overflow-x: hidden;
background: #f0f0f0;
}
.info-list.hide {
display: none;
}
.search-divide {
float: left;
height: 50px;
width: 100%;
padding: 10px 0;
color: #ccc;
text-align: center;
margin-bottom: 40px;
}
.load-more-info {
margin-bottom: 90px;
}
}
... ...
.news-info {
margin-bottom: 30px;
padding: 0 0 24px;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
background: #fff;
.info-author {
display: block;
width: 100%;
.avatar {
float: left;
margin-top: 20px;
width: 50px;
height: 50px;
margin-left: 30px;
border-radius: 50%;
}
.name {
float: left;
margin-left: 30px;
padding: 30px 0;
font-size: 14PX;
color: #000;
}
.min-tag {
float: right;
min-width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
background-color: #f0f0f0;
font-size: 20px;
color: #b0b0b0;
margin-right: 30px;
margin-top: 25px;
padding: 0 10px;
}
}
&:last-child {
margin-bottom: 0;
}
.info-img {
position: relative;
width: 100%;
img {
display: block;
}
.play {
position: absolute;
width: 140px;
height: 140px;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-image: url("/guang/play-btn.png");
}
}
.info-match {
position: absolute;
top: 0;
left: 0;
width: 130px;
height: 50px;
line-height: 50px;
font-size: 14PX;
color: #fff;
background: #000;
text-align: center;
text-decoration: none;
z-index: 1;
}
.info-tag {
position: absolute;
top: 0;
left: 105px;
height: 50px;
width: 50px;
&.collocation {
background-image: url("/guang/info/collocation.png");
}
&.fashion-good {
background-image: url("/guang/info/fashion-good.png");
}
&.fashion-man {
background-image: url("/guang/info/fashion-man.png");
}
&.tip,
&.special-topic {
background-image: url("/guang/info/tip.png");
}
&.topic {
background-image: url("/guang/info/topic.png");
}
&.video {
background-image: url("/guang/info/video.png");
}
&.show {
background-image: url("/guang/info/show.png");
}
}
.info-deps {
margin: 32px 0 0;
padding: 0 40px 0 30px;
.info-title-container {
text-decoration: none;
color: #000;
}
.info-title {
line-height: 44px;
color: #000;
font-size: 20PX;
font-weight: bold;
.top-tag {
font-size: 18px;
color: #d0021b;
padding: 4px 16px;
border: 1px solid #d0021b;
border-radius: 4px;
margin-right: 20px;
}
}
.info-text {
margin: 16px 0 0;
line-height: 46px;
font-size: 14PX;
color: #444;
}
.time-view-like-share {
margin-top: 16px;
}
}
}
... ...
.time-view-like-share {
color: #b0b0b0;
line-height: 38px;
height: 38px;
font-size: 12PX;
.iconfont {
margin-right: 4px;
font-size: 12PX;
color: #ccc;
}
.like-share-container {
display: inline-block;
float: right;
> * {
float: left;
}
.iconfont {
position: relative;
height: 60px;
line-height: 60px;
display: inline-block;
color: #b0b0b0;
width: 60px;
top: -14px;
font-size: 17PX;
text-align: center;
margin-right: 0;
outline: none;
}
.share-btn {
margin-left: 20px;
}
.like-btn.like {
color: #444;
}
.collect-btn {
margin-left: 20px;
&.collected {
color: #d62927;
}
}
}
}
... ...
@import "common/loading";
@import "detail";
@import "tvls";
... ...
@import "common/loading";
@import "info-list";
@import "info";
@import "tvls";
... ...
<<<<<<< HEAD
!function(e){"use strict";function t(e,t){if("undefined"==typeof document)return t;e=e||"";var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");return n.type="text/css",i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t}function i(){}function n(e){s=[e]}function o(e,t,i){return e&&e.apply&&e.apply(t.context||t,i)}function a(e){return/\?/.test(e)?"&":"?"}function r(t){function r(e){Y++||(H(),$&&(A[W]={s:[e]}),z&&(e=z.apply(t,[e])),o(B,t,[e,_,t]),o(R,t,[t,_]))}function c(e){Y++||(H(),$&&e!=S&&(A[W]=e),o(L,t,[t,e]),o(R,t,[t,e]))}t=e.extend({},O,t);var d,U,q,j,M,B=t.success,L=t.error,R=t.complete,z=t.dataFilter,P=t.callbackParameter,Q=t.callback,J=t.cache,$=t.pageCache,G=t.charset,W=t.url,F=t.data,X=t.timeout,Y=0,H=i;return I&&I(function(e){e.done(B).fail(L),B=e.resolve,L=e.reject}).promise(t),t.abort=function(){!Y++&&H()},!1===o(t.beforeSend,t,[t])||Y?t:(W=W||l,F=F?"string"==typeof F?F:e.param(F,t.traditional):l,W+=F?a(W)+F:l,P&&(W+=a(W)+encodeURIComponent(P)+"=?"),!J&&!$&&(W+=a(W)+"_"+(new Date).getTime()+"="),W=W.replace(/=\?(&|$)/,"="+Q+"$1"),$&&(d=A[W])?d.s?r(d.s[0]):c(d):(C[Q]=n,q=e(k)[0],q.id=m+N++,G&&(q[p]=G),E&&E.version()<11.6?(j=e(k)[0]).text="document.getElementById('"+q.id+"')."+y+"()":q[u]=u,D&&(q.htmlFor=q.id,q.event=g),q[v]=q[y]=q[b]=function(e){if(!q[w]||!/i/.test(q[w])){try{q[g]&&q[g]()}catch(e){}e=s,s=0,e?r(e[0]):c(f)}},q.src=W,H=function(e){M&&clearTimeout(M),q[b]=q[v]=q[y]=null,T[x](q),j&&T[x](j)},T[h](q,U=T.firstChild),j&&T[h](j,U),M=X>0&&setTimeout(function(){c(S)},X)),t)}function c(e){return new RegExp(e+"=([^;$]*)","i").test(decodeURIComponent(document.cookie))?RegExp.$1:""}function d(e,t,i){var n,o,a,r,c="";void 0!==t&&(i=i||{},null===t&&(t="",i.expires=-1),i.expires&&("number"==typeof i.expires||i.expires.toUTCString)&&("number"==typeof i.expires?(r=new Date,r.setTime(r.getTime()+24*i.expires*60*60*1e3)):r=i.expires,c="; expires="+r.toUTCString()),n=i.path?"; path="+i.path:"",o=i.domain?"; domain="+i.domain:"",a=i.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),c,n,o,a].join(""))}e="default"in e?e.default:e;var s,u="async",p="charset",l="",f="error",h="insertBefore",m="_jqjsp",g="onclick",y="on"+f,v="onload",b="onreadystatechange",w="readyState",x="removeChild",k="<script>",_="success",S="timeout",C=window,I=e.Deferred,T=e("head")[0]||document.documentElement,A={},N=0,O={callback:m,url:location.href},E=C.opera,D=!!e("<div>").html("\x3c!--[if IE]><i><![endif]--\x3e").find("i").length;r.setup=function(t){e.extend(O,t)},e.jsonp=r,t(".featuretip.tip-wrap{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;background:rgba(0,0,0,.5)}.featuretip .tip{position:fixed;left:50%;top:50%;margin-left:-140px;margin-top:-140px;width:280px;background:#fff;border-top:40px solid #000;text-align:center;line-height:1.25}.featuretip .tip .title{margin:20px auto;font-size:24px;font-weight:700;text-align:center}.featuretip .tip .highlight{font-size:18px}.featuretip .tip .content{font-size:16px;color:#444;text-align:center}.featuretip .tip .button{display:block;margin:20px auto;width:150px;height:30px;font-size:14px;line-height:30px;text-align:center;color:#fff;background:#000;text-decoration:none}",void 0),t(".feature-coin.tip-wrap{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;background:rgba(0,0,0,.5)}.feature-coin .tip{position:fixed;left:50%;top:50%;margin-left:-140px;margin-top:-140px;width:280px;background:#fff;text-align:center;line-height:1.25;background-repeat:no-repeat}.feature-coin .tip .tip-close{position:absolute;right:0;top:0;width:25px;height:25px;line-height:25px;text-align:center;font-size:16px;color:#fff;background:#000;cursor:pointer}.feature-coin .tip .title{margin:21px auto;font-size:22px;font-weight:700;text-align:center}.feature-coin .tip .highlight{font-size:18px}.feature-coin .tip .content{padding:4px;font-size:16px;color:#444;text-align:center;height:48px;overflow:hidden}.feature-coin .bottom-button{text-align:center}.feature-coin .tip .button,.feature-coin .tip .coin{display:inline-block;margin:20px auto;width:116px;height:26px;font-size:14px;line-height:26px;text-align:center;color:#fff;background:#000;text-decoration:none;border:2px solid #000}.feature-coin .tip .coin{color:#000;background:#fff}",void 0);var U={Android:function(){return!!navigator.userAgent.match(/Android/i)},BlackBerry:function(){return!!navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)},Windows:function(){return!!navigator.userAgent.match(/IEMobile/i)},any:function(){return U.Android()||U.BlackBerry()||U.iOS()||U.Windows()}},q=U.any()?"//m.yohobuy.com/home/mycurrency":"//www.yohobuy.com/home/currency",j=e('<div class="featuretip tip-wrap"><div class="tip"><div class="title"></div><div class="content"></div><a class="button" href="">返回</a></div></div>'),M=e('<div class="feature-coin tip-wrap"><div class="tip"><div class="tip-close">&times;</div><div class="title"></div><div class="content"></div><div class="bottom-button"><a class="button" href="">去逛逛</a><a class="coin" href=\''+q+'?openby:yohobuy={"action":"go.mine"}\'>查看有货币</a></div></div></div>'),B=function(){if(!window._jssdkQS){var e={},t=void 0,i=void 0,n=window.location.search.slice(1).split("&");for(i=0;i<n.length;i++)t=n[i].split("="),e[t[0]]=t[1];window._jssdkQS=e}return window._jssdkQS},L=function(){var t=window.location.search;-1===t.indexOf("&expires=")&&(t=t?t+"&":"?",t+="expires=604800000"),e('<iframe style="display:none;" src="//m.yohobuy.com/activity/wechat/1111'+t+'"></iframe>').prependTo("body")},R=function(){var t=e("body");t.on("click",".feature-coin .close,.feature-coin .tip-close",function(e){M.fadeOut(),e.preventDefault()}),t.on("click",".feature-coin.tip-wrap",function(e){"feature-coin tip-wrap"===e.target.className&&(M.fadeOut(),e.preventDefault())}),t.on("click",".featuretip .close",function(e){j.fadeOut(),e.preventDefault()}),t.on("click",".featuretip .refresh",function(){location.reload()}),t.on("click",".featuretip.tip-wrap",function(e){"featuretip tip-wrap"===e.target.className&&(j.fadeOut(),e.preventDefault())})},z={queryString:B,init:function(){L(),R()},isApp:function(){var e=B();return!(!e.app_version&&("app"!==e.openrefer||!e.uid))},image:function(e,t,i,n,o){return n=isNaN(Number(n))?2:n,e=e||"",e=e.replace(/{width}/g,t).replace(/{height}/g,i).replace(/{mode}/g,n),e.indexOf("imageView2")>0&&(o=o||90,e+="/q/"+o),e.replace("quality/80","quality/60").replace("http:","")},sParamByIframe:function(t){e('<iframe style="display:none;" src="//m.yohobuy.com/activity/wechat/1111?'+t+'"></iframe>').prependTo("body")},showTip:function(t){t=t||{title:"",content:"",close:!0},j.find(".title").html(t.title),j.find(".content").html(t.content),t.close?j.find(".button").addClass("close"):j.find(".button").addClass("refresh").html("刷新"),e("body").append(j),j.show()},showCoinTip:function(t){t=t||{title:"",content:"",close:!0},M.find(".title").html(t.title),M.find(".content").html(t.content),t.close&&M.find(".button").addClass("close"),t.coin?M.find(".coin").css("display","inline-block"):M.find(".coin").hide(),t.img&&M.find(".tip").css("background-image","url("+t.img+")"),e("body").append(M),M.show()}},P=function(){var e=location.href.split("?")[0];return"//m.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href)+'&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"'+e.replace(/\//g,"\\/")+'","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}'},Q={uid:"",noLoginUrl:P,init:function(){var t=this;return r({url:"//m.yohobuy.com/passport/login/user?callback=?"}).then(function(i){return 200===i.code&&(t.uid=Number(i.data)||0),!t.uid&&z.isApp()&&(t.uid=Number(z.queryString().uid)||0),e.Deferred().resolve(t.uid)},function(){return z.isApp()&&(t.uid=Number(z.queryString().uid)||0),e.Deferred().resolve(t.uid)})},auth:function(){if(!this.uid){var t=P();e("a.auth").attr("href",t)}},favout:function(e){e&&this.uid&&r({url:"//service.yoho.cn/activity/favorite/addFavorite?productSkn="+e+"&uid="+this.uid+"&callback=?"}).then(function(e){200===e.code?z.showTip({content:"恭喜您,收藏成功",close:!0}):z.showTip({content:e.message,close:!0})},function(){z.showTip({title:"收藏失败<br>请刷新重新领取",content:"如多次收藏失败,请联系客服人员<br>带来不便敬请谅解",close:!1})})},getMktCode:function(){return this.uid?Number(this.uid)%1024>=512?0x5af3107a40c3:0x5af3107a40c1:0x5af3107a40c5}},J=["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","onMenuShareQZone"],$={title:document.title,link:location.href,desc:"YOHO!BUY",imgUrl:"http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png"},G=function(){var t=z.queryString().share_id;if(t)return r({url:"//m.yohobuy.com/activity/share?callback=?",data:{shareId:t}}).then(function(t){return t&&200===t.code&&t.data&&($.title=t.data.title,$.link=t.data.link||location.href,$.desc=t.data.content||t.data.title,$.imgUrl=t.data.pic),e.Deferred().resolve()},function(){return e.Deferred().resolve()});var i=e("#shareTitle").val(),n=e("#shareImg").val(),o=e("#shareDesc").val(),a=e("#shareLink").val();return $.title=i||$.title,$.imgUrl=n||$.imgUrl,$.desc=o||$.desc,$.link=a||$.link,e.Deferred().resolve()},W={init:function(){/QQ/i.test(navigator.userAgent)&&e.ajax({url:"//qzonestyle.gtimg.cn/qzone/qzact/common/share/share.js",dataType:"script",cache:!0,success:function(){G().then(function(){window.setShareInfo&&window.setShareInfo({title:$.title,summary:$.desc,pic:$.imgUrl,url:$.link})})}}),/MicroMessenger/i.test(navigator.userAgent)&&e.ajax({url:"//res.wx.qq.com/open/js/jweixin-1.1.0.js",dataType:"script",cache:!0,success:function(){r({url:"//m.yohobuy.com/activity/wechat/share?callback=?",data:{url:location.href}}).then(function(e){window.wx&&(window.wx.config({debug:!1,appId:e.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:J}),G().then(function(){window.wx.ready(function(){window.wx.onMenuShareAppMessage($),window.wx.onMenuShareTimeline($),window.wx.onMenuShareQQ($),window.wx.onMenuShareWeibo($),window.wx.onMenuShareQZone($)})}))})}})}},F={"baidu.com":0x5af3107a4037,"so.com":0x5af3107a4031,"sogou.com":0x5af3107a4035,"bing.com":0x5af3107a4039,"m.sm.cn":0x5af3107a403b,"google.com":0x5af3107a403d},X=function(){var e,t=document.referrer;for(var i in F)if(t.indexOf(i)>-1){e=F[i];break}return e},Y=function(){var e=z.queryString(),t=e.mkt_code||e.union_type||X()||"100000000000349";return delete e.openapp,"yohobuy://yohobuy.com/goapp?ct="+t+'&openby:yohobuy={"action":"go.h5",'+(e.share_id?'"share":"/operations/api/v5/webshare/getShare","shareparam":{"share_id":"'+e.share_id+'"},':"")+'"params":{"islogin":"N","url":"http://feature.yoho.cn'+location.pathname+'","param":'+JSON.stringify(e)+"}}"},H={init:function(){if(z.queryString().openapp){var e=navigator.userAgent.toLowerCase(),t=e.indexOf("os")>-1||e.indexOf("iphone")>-1||e.indexOf("mac")>-1||e.indexOf("ipad")>-1,i=Y();if(t)window.location.href=i;else{var n=document.createElement("iframe");n.src=i,n.style.display="none",document.body.appendChild(n)}}}},Z={cookie:c,setCookie:d},V=function(e){e.app=z.queryString(),e.app.uid=e.uid,r({url:"//m.yohobuy.com/activity/coin/sendCoin?callback=?",data:e}).then(function(e){200===e.code&&e.data?200===e.data.code?z.showCoinTip({title:"恭喜您,成功领取有货币!",content:"特殊情况下到账有延时<br>请耐心等待",close:!0,coin:!0,img:e.data.popupImg}):501===e.data.code?z.showCoinTip({title:"领取失败",content:"哎呀,你来的有点早,活动还没开始呢<br/>稍后再来哦",close:!0,img:e.data.popupImg}):502===e.data.code?z.showCoinTip({title:"领取失败",content:"抱歉,活动已结束了,下次要快哟~~",close:!0,img:e.data.popupImg}):503===e.data.code?z.showCoinTip({title:"已经领取",content:"贪心会长胖,你已经领取过了啦~~",close:!0,img:e.data.popupImg}):504===e.data.code?z.showCoinTip({title:"领取失败",content:"哎呀,你来晚了,有货币已经领完了,<br/>下次早点来哦",close:!0,img:e.data.popupImg}):e.data.msg&&z.showCoinTip({title:"领取失败",content:"抱歉,系统错误,有货君正奋力解决中...请稍后再来",close:!0,img:e.data.popupImg}):e.message&&z.showCoinTip({title:"领取失败",content:"抱歉,系统错误,有货君正奋力解决中...请稍后再来",close:!0,img:e.data&&e.data.popupImg})},function(){z.showCoinTip({title:"领取失败",content:"抱歉,系统错误,有货君正奋力解决中...请稍后再来",close:!0})})},K=function(e){e.app=z.queryString(),e.app.uid=e.uid,r({url:"//m.yohobuy.com/coupon/couponSend?callback=?",data:e}).then(function(e){200===e.code?z.showTip({title:"领取成功",content:"恭喜您,领取成功",close:!0}):401===e.code?z.showTip({title:"已经领取",content:'快去分享给更多<br>喜爱<span class="highlight">潮流</span>的小伙伴吧!',close:!0}):e.message&&z.showTip({title:"领取失败<br>请刷新重新领取",content:e.message+"<br>如多次领取失败,请联系客服人员<br>带来不便敬请谅解",close:!1})},function(){z.showTip({title:"领取失败<br>请刷新重新领取",content:"如多次领取失败,请联系客服人员<br>带来不便敬请谅解",close:!1})})},ee=function(t){if(t){var i=Z.cookie("yoho-coin-token");i&&(V({token:i,uid:t}),Z.setCookie("yoho-coin-token",""))}e("body").on("click",".yoho-coin",function(){var t=e(this).data("token");if(!Q.uid)return Z.setCookie("yoho-coin-token",t),e("#intimacy-link").length<=0&&e("body").append("<a href='"+Q.noLoginUrl()+'\' style="display:none;" id="intimacy-link"><span class="intimacy-link"></span></a>'),void e(".intimacy-link").click();V({token:t,uid:Q.uid})})},te=function(t){if(t){var i=Z.cookie("yoho-conpon-token");i&&(K({token:i,uid:t}),Z.setCookie("yoho-conpon-token",""))}e("body").on("click",".yoho-conpon",function(){var t=e(this).data("token");if(!Q.uid)return Z.setCookie("yoho-conpon-token",t),e("#intimacy-link").length<=0&&e("body").append("<a href='"+Q.noLoginUrl()+'\' style="display:none;" id="intimacy-link"><span class="intimacy-link"></span></a>'),void e(".intimacy-link").click();K({token:t,uid:Q.uid})})},ie={init:function(e){ee(e),te(e)}},ne=!1,oe=function(e,t,i,n,o){if(i){e.find(".brand-name").html(i.brand_name),e.find(".product-detail").attr("href","//m.yohobuy.com/product/pro_"+i.product_id+"_"+i.goods_id+"/"+i.cn_alphabet+'.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":'+i.product_skn+"}}"),e.find(".product-detail-img").attr("src",z.image(i.default_images,n.w,n.h,2,75)),e.find(".product-name").html(i.product_name),e.find(".vip-price-val").html("¥"+i.vip_price),e.find(".sale-price").html("¥"+i.sales_price),i.sales_price===i.market_price?e.find(".market-price").hide():e.find(".market-price").html("¥"+i.market_price).show();var a=e.find(".product-brand");a&&(i.shop_id?a.attr("href","//m.yohobuy.com/product/index/brand?domain="+i.brand_domain+'&openby:yohobuy={"action":"go.shop","params":{"shop_id":'+i.shop_id+',"shop_template_type":'+(i.shop_template_type||"1")+',"is_red_shop":'+(i.is_red_shop||1)+"}}"):a.attr("href","//m.yohobuy.com/product/index/brand?domain="+i.brand_domain+'&openby:yohobuy={"action":"go.brand","params":{"brand_id":'+i.brand_id+"}}")),o&&(o.I_INDEX||(o.I_INDEX=0),o.I_INDEX++,e.find(".product-detail").attr("fp",JSON.stringify(o)),a&&(o.I_INDEX++,a.attr("fp",JSON.stringify(o))));var r=e.find(".list-product");if(r){var c="",d=t.gender?t.gender:"1,3",s="//list.m.yohobuy.com?gender="+d;r.data("sort")&&(c+=',"sort":'+i.small_sort_id,s+="&sort="+i.small_sort_id),r.data("misort")&&(c+=',"misort":'+i.middle_sort_id,s+="&misort="+i.middle_sort_id),r.data("msort")&&(c+=',"msort":'+i.max_sort_id,s+="&msort="+i.max_sort_id),s+='&openby:yohobuy={"action":"go.list","params":{"actiontype":1,"gender":'+d+c+"}}",r.attr("href",s)}return e.html(e.html()),e}},ae=function e(t){if(t.length){var i=t.shift();return i&&i.default_images?i:e(t)}},re=function(t,i,n){var o=t.attr("cloneitem"),a=t.find(".loading"),c=t.find(".feature-product-info");if(c.length){if(n.abtest&&(!i.uid||Number(i.uid)%1024>=512))return void(o?e(c[0]).remove():(c.removeClass("novisible"),a.hide()));var d=t.find(".imgwh").val()||"";d=d.split("x")||[];var s={w:d[0]||300,h:d[1]||400},u=t.attr("fp");u=u?JSON.parse(u):"",r({url:"//m.yohobuy.com/activity/individuation?callback=?",data:e.extend({},i,n)}).then(function(i){if(!i||!i.length)return void(o?e(c[0]).remove():(c.removeClass("novisible"),a.hide()));if(o)for(var r=isNaN(Number(o))?i.length:Number(o),d=0;d<r;d++){var p=ae(i);if(0===d){var l=e(c[0]),f=oe(l,n,p,s,u);f?f.removeClass("novisible"):l.remove()}else{var h=oe(e(c[0]).clone(),n,p,s,u);h&&(h.removeClass("novisible"),h.appendTo(t))}}else{for(var m=1;m<i.length;m++)c.last().after(c.clone());var g=t.find(".feature-product-info");g.each(function(t,o){var a=e(o);oe(a,n,ae(i),s,u)}),g.removeClass("novisible"),a.hide()}},function(){o?e(c[0]).remove():(c.removeClass("novisible"),a.hide())})}},ce=function(){var t=Q.getMktCode();z.sParamByIframe("cover=1&mkt_code="+t+"&expires=604800000");var i=[];e("a").each(function(){var t=e(this).attr("href");!t||/^#.*$/.test(t)||/^javascript.*$/i.test(t)||i.push(t)});var n=0,o=setInterval(function(){if(++n>3)return void clearInterval(o);window._yas&&window._yas.sendAppLogs&&window.appBaseLogs&&(clearInterval(o),window._yas.sendAppLogs({appop:"YB_H5_PAGE_AB_OPEN_L",param:JSON.stringify({C_ID:z.queryString().yh_channel||1,PAGE_URL:window.originUrl,PAGE_NAME:decodeURI(window.qs.title||document.title),ACTION_URL:i,CROWD_CODE:t+""})},!0),e("a").click(function(){var i=e(this).attr("href");!i||/^#.*$/.test(i)||/^javascript.*$/i.test(i)||window._yas.sendAppLogs({appop:"YB_H5_PAGE_AB_FLR_C",param:JSON.stringify({C_ID:z.queryString().yh_channel||1,PAGE_URL:window.originUrl,PAGE_NAME:decodeURI(window.qs.title||document.title),F_URL:i,CROWD_CODE:t+""})},!0)}))},1e3)},de=function(t){e(".product-source").each(function(i,n){n=e(n);var o=n.attr("condition");if(o){o=JSON.parse(o);var a=z.queryString().yh_channel;o.abtest&&(ne=!0),a&&(o.yh_channel=a),i>3?setTimeout(function(){re(n,t,o)},300):re(n,t,o)}}),ne&&ce()},se={init:function(e){!e&&z.isApp()?document.addEventListener("deviceready",function(){window.yohoInterface.triggerEvent(function(e){Q.uid=e.uid,de({uid:e.uid,udid:e.udid})},function(){},{method:"get.analyticAppData"})},!1):de({uid:e,udid:Z.cookie("_yasvd")})}};e(function(){H.init(),Q.init().then(function(e){se.init(e),ie.init(e),Q.auth(),W.init(),z.init()})});var ue={auth:Q.auth,favout:Q.favout,getMktCode:function(){return Q.getMktCode()},getUid:function(){return Q.uid}},pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){"object"===("undefined"==typeof module?"undefined":pe(module))&&"object"===pe(module.exports)?module.exports=e():"function"==typeof define&&define.amd?define([],e):window._jssdk=e()}(function(){return ue})}(jQuery);
=======
!function(e){"use strict";function t(e,t){if("undefined"==typeof document)return t;e=e||"";var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");return n.type="text/css",i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t}function i(){}function n(e){s=[e]}function o(e,t,i){return e&&e.apply&&e.apply(t.context||t,i)}function a(e){return/\?/.test(e)?"&":"?"}function r(t){function r(e){Y++||(H(),$&&(A[W]={s:[e]}),z&&(e=z.apply(t,[e])),o(B,t,[e,_,t]),o(R,t,[t,_]))}function c(e){Y++||(H(),$&&e!=S&&(A[W]=e),o(L,t,[t,e]),o(R,t,[t,e]))}t=e.extend({},O,t);var d,U,j,q,M,B=t.success,L=t.error,R=t.complete,z=t.dataFilter,P=t.callbackParameter,Q=t.callback,J=t.cache,$=t.pageCache,G=t.charset,W=t.url,F=t.data,X=t.timeout,Y=0,H=i;return I&&I(function(e){e.done(B).fail(L),B=e.resolve,L=e.reject}).promise(t),t.abort=function(){!Y++&&H()},!1===o(t.beforeSend,t,[t])||Y?t:(W=W||l,F=F?"string"==typeof F?F:e.param(F,t.traditional):l,W+=F?a(W)+F:l,P&&(W+=a(W)+encodeURIComponent(P)+"=?"),!J&&!$&&(W+=a(W)+"_"+(new Date).getTime()+"="),W=W.replace(/=\?(&|$)/,"="+Q+"$1"),$&&(d=A[W])?d.s?r(d.s[0]):c(d):(C[Q]=n,j=e(k)[0],j.id=m+N++,G&&(j[p]=G),E&&E.version()<11.6?(q=e(k)[0]).text="document.getElementById('"+j.id+"')."+y+"()":j[u]=u,D&&(j.htmlFor=j.id,j.event=g),j[v]=j[y]=j[b]=function(e){if(!j[w]||!/i/.test(j[w])){try{j[g]&&j[g]()}catch(e){}e=s,s=0,e?r(e[0]):c(f)}},j.src=W,H=function(e){M&&clearTimeout(M),j[b]=j[v]=j[y]=null,T[x](j),q&&T[x](q)},T[h](j,U=T.firstChild),q&&T[h](q,U),M=X>0&&setTimeout(function(){c(S)},X)),t)}function c(e){return new RegExp(e+"=([^;$]*)","i").test(decodeURIComponent(document.cookie))?RegExp.$1:""}function d(e,t,i){var n,o,a,r,c="";void 0!==t&&(i=i||{},null===t&&(t="",i.expires=-1),i.expires&&("number"==typeof i.expires||i.expires.toUTCString)&&("number"==typeof i.expires?(r=new Date,r.setTime(r.getTime()+24*i.expires*60*60*1e3)):r=i.expires,c="; expires="+r.toUTCString()),n=i.path?"; path="+i.path:"",o=i.domain?"; domain="+i.domain:"",a=i.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),c,n,o,a].join(""))}e="default"in e?e.default:e;var s,u="async",p="charset",l="",f="error",h="insertBefore",m="_jqjsp",g="onclick",y="on"+f,v="onload",b="onreadystatechange",w="readyState",x="removeChild",k="<script>",_="success",S="timeout",C=window,I=e.Deferred,T=e("head")[0]||document.documentElement,A={},N=0,O={callback:m,url:location.href},E=C.opera,D=!!e("<div>").html("\x3c!--[if IE]><i><![endif]--\x3e").find("i").length;r.setup=function(t){e.extend(O,t)},e.jsonp=r,t(".featuretip.tip-wrap{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;background:rgba(0,0,0,.5)}.featuretip .tip{position:fixed;left:50%;top:50%;margin-left:-140px;margin-top:-140px;width:280px;background:#fff;border-top:40px solid #000;text-align:center;line-height:1.25}.featuretip .tip .title{margin:20px auto;font-size:24px;font-weight:700;text-align:center}.featuretip .tip .highlight{font-size:18px}.featuretip .tip .content{font-size:16px;color:#444;text-align:center}.featuretip .tip .button{display:block;margin:20px auto;width:150px;height:30px;font-size:14px;line-height:30px;text-align:center;color:#fff;background:#000;text-decoration:none}",void 0),t(".feature-coin.tip-wrap{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;background:rgba(0,0,0,.5)}.feature-coin .tip{position:fixed;left:50%;top:50%;margin-left:-140px;margin-top:-140px;width:280px;background:#fff;text-align:center;line-height:1.25;background-repeat:no-repeat}.feature-coin .tip .tip-close{position:absolute;right:0;top:0;width:25px;height:25px;line-height:25px;text-align:center;font-size:16px;color:#fff;background:#000;cursor:pointer}.feature-coin .tip .title{margin:21px auto;font-size:22px;font-weight:700;text-align:center}.feature-coin .tip .highlight{font-size:18px}.feature-coin .tip .content{padding:4px;font-size:16px;color:#444;text-align:center;height:48px;overflow:hidden}.feature-coin .bottom-button{text-align:center}.feature-coin .tip .button,.feature-coin .tip .coin{display:inline-block;margin:20px auto;width:116px;height:26px;font-size:14px;line-height:26px;text-align:center;color:#fff;background:#000;text-decoration:none;border:2px solid #000}.feature-coin .tip .coin{color:#000;background:#fff}",void 0);var U={Android:function(){return!!navigator.userAgent.match(/Android/i)},BlackBerry:function(){return!!navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)},Windows:function(){return!!navigator.userAgent.match(/IEMobile/i)},any:function(){return U.Android()||U.BlackBerry()||U.iOS()||U.Windows()}},j=U.any()?"//m.yohobuy.com/home/mycurrency":"//www.yohobuy.com/home/currency",q=e('<div class="featuretip tip-wrap"><div class="tip"><div class="title"></div><div class="content"></div><a class="button" href="">返回</a></div></div>'),M=e('<div class="feature-coin tip-wrap"><div class="tip"><div class="tip-close">&times;</div><div class="title"></div><div class="content"></div><div class="bottom-button"><a class="button" href="">去逛逛</a><a class="coin" href=\''+j+'?openby:yohobuy={"action":"go.mine"}\'>查看有货币</a></div></div></div>'),B=function(){if(!window._jssdkQS){var e={},t=void 0,i=void 0,n=window.location.search.slice(1).split("&");for(i=0;i<n.length;i++)t=n[i].split("="),e[t[0]]=t[1];window._jssdkQS=e}return window._jssdkQS},L=function(){var t=B(),i=[],n="?";delete t.uid,delete t.app_version,delete t.client_type,delete t.session_key,delete t.client_secret;for(var o in t)i.push(o+"="+t[o]);t.expires||i.push("expires="+6048e5),n+=i.join("&"),e('<iframe style="display:none;" src="//m.yohobuy.com/activity/wechat/1111'+n+'"></iframe>').prependTo("body")},R=function(){var t=e("body");t.on("click",".feature-coin .close,.feature-coin .tip-close",function(e){M.fadeOut(),e.preventDefault()}),t.on("click",".feature-coin.tip-wrap",function(e){"feature-coin tip-wrap"===e.target.className&&(M.fadeOut(),e.preventDefault())}),t.on("click",".featuretip .close",function(e){q.fadeOut(),e.preventDefault()}),t.on("click",".featuretip .refresh",function(){location.reload()}),t.on("click",".featuretip.tip-wrap",function(e){"featuretip tip-wrap"===e.target.className&&(q.fadeOut(),e.preventDefault())})},z={queryString:B,init:function(){L(),R()},isApp:function(){var e=B();return!(!e.app_version&&("app"!==e.openrefer||!e.uid))},image:function(e,t,i,n,o){return n=isNaN(Number(n))?2:n,e=e||"",e=e.replace(/{width}/g,t).replace(/{height}/g,i).replace(/{mode}/g,n),e.indexOf("imageView2")>0&&(o=o||90,e+="/q/"+o),e.replace("quality/80","quality/60").replace("http:","")},sParamByIframe:function(t){e('<iframe style="display:none;" src="//m.yohobuy.com/activity/wechat/1111?'+t+'"></iframe>').prependTo("body")},showTip:function(t){t=t||{title:"",content:"",close:!0},q.find(".title").html(t.title),q.find(".content").html(t.content),t.close?q.find(".button").addClass("close"):q.find(".button").addClass("refresh").html("刷新"),e("body").append(q),q.show()},showCoinTip:function(t){t=t||{title:"",content:"",close:!0},M.find(".title").html(t.title),M.find(".content").html(t.content),t.close&&M.find(".button").addClass("close"),t.coin?M.find(".coin").css("display","inline-block"):M.find(".coin").hide(),t.img&&M.find(".tip").css("background-image","url("+t.img+")"),e("body").append(M),M.show()}},P=function(){var e=location.href.split("?")[0];return"//m.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href)+'&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"'+e.replace(/\//g,"\\/")+'","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}'},Q={uid:"",noLoginUrl:P,init:function(){var t=this;return r({url:"//m.yohobuy.com/passport/login/user?callback=?"}).then(function(i){return 200===i.code&&(t.uid=Number(i.data)||0),!t.uid&&z.isApp()&&(t.uid=Number(z.queryString().uid)||0),e.Deferred().resolve(t.uid)},function(){return z.isApp()&&(t.uid=Number(z.queryString().uid)||0),e.Deferred().resolve(t.uid)})},auth:function(){if(!this.uid){var t=P();e("a.auth").attr("href",t)}},favout:function(e){e&&this.uid&&r({url:"//service.yoho.cn/activity/favorite/addFavorite?productSkn="+e+"&uid="+this.uid+"&callback=?"}).then(function(e){200===e.code?z.showTip({content:"恭喜您,收藏成功",close:!0}):z.showTip({content:e.message,close:!0})},function(){z.showTip({title:"收藏失败<br>请刷新重新领取",content:"如多次收藏失败,请联系客服人员<br>带来不便敬请谅解",close:!1})})},getMktCode:function(){return this.uid?Number(this.uid)%1024>=512?0x5af3107a40c3:0x5af3107a40c1:0x5af3107a40c5}},J=["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","onMenuShareQZone"],$={title:document.title,link:location.href,desc:"YOHO!BUY",imgUrl:"http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png"},G=function(){var t=z.queryString().share_id;if(t)return r({url:"//m.yohobuy.com/activity/share?callback=?",data:{shareId:t}}).then(function(t){return t&&200===t.code&&t.data&&($.title=t.data.title,$.link=t.data.link||location.href,$.desc=t.data.content||t.data.title,$.imgUrl=t.data.pic),e.Deferred().resolve()},function(){return e.Deferred().resolve()});var i=e("#shareTitle").val(),n=e("#shareImg").val(),o=e("#shareDesc").val(),a=e("#shareLink").val();return $.title=i||$.title,$.imgUrl=n||$.imgUrl,$.desc=o||$.desc,$.link=a||$.link,e.Deferred().resolve()},W={init:function(){/QQ/i.test(navigator.userAgent)&&e.ajax({url:"//qzonestyle.gtimg.cn/qzone/qzact/common/share/share.js",dataType:"script",cache:!0,success:function(){G().then(function(){window.setShareInfo&&window.setShareInfo({title:$.title,summary:$.desc,pic:$.imgUrl,url:$.link})})}}),/MicroMessenger/i.test(navigator.userAgent)&&e.ajax({url:"//res.wx.qq.com/open/js/jweixin-1.1.0.js",dataType:"script",cache:!0,success:function(){r({url:"//m.yohobuy.com/activity/wechat/share?callback=?",data:{url:location.href}}).then(function(e){window.wx&&(window.wx.config({debug:!1,appId:e.appId,timestamp:e.timestamp,nonceStr:e.nonceStr,signature:e.signature,jsApiList:J}),G().then(function(){window.wx.ready(function(){window.wx.onMenuShareAppMessage($),window.wx.onMenuShareTimeline($),window.wx.onMenuShareQQ($),window.wx.onMenuShareWeibo($),window.wx.onMenuShareQZone($)})}))})}})}},F={"baidu.com":0x5af3107a4037,"so.com":0x5af3107a4031,"sogou.com":0x5af3107a4035,"bing.com":0x5af3107a4039,"m.sm.cn":0x5af3107a403b,"google.com":0x5af3107a403d},X=function(){var e,t=document.referrer;for(var i in F)if(t.indexOf(i)>-1){e=F[i];break}return e},Y=function(){var e=z.queryString(),t=e.mkt_code||e.union_type||X()||"100000000000349";return delete e.openapp,"yohobuy://yohobuy.com/goapp?ct="+t+'&openby:yohobuy={"action":"go.h5",'+(e.share_id?'"share":"/operations/api/v5/webshare/getShare","shareparam":{"share_id":"'+e.share_id+'"},':"")+'"params":{"islogin":"N","url":"http://feature.yoho.cn'+location.pathname+'","param":'+JSON.stringify(e)+"}}"},H={init:function(){if(z.queryString().openapp){var e=navigator.userAgent.toLowerCase(),t=e.indexOf("os")>-1||e.indexOf("iphone")>-1||e.indexOf("mac")>-1||e.indexOf("ipad")>-1,i=Y();if(t)window.location.href=i;else{var n=document.createElement("iframe");n.src=i,n.style.display="none",document.body.appendChild(n)}}}},Z={cookie:c,setCookie:d},V=function(e){e.app=z.queryString(),e.app.uid=e.uid,r({url:"//m.yohobuy.com/activity/coin/sendCoin?callback=?",data:e}).then(function(e){200===e.code&&e.data?200===e.data.code?z.showCoinTip({title:"恭喜您,成功领取有货币!",content:"特殊情况下到账有延时<br>请耐心等待",close:!0,coin:!0,img:e.data.popupImg}):501===e.data.code?z.showCoinTip({title:"领取失败",content:"哎呀,你来的有点早,活动还没开始呢<br/>稍后再来哦",close:!0,img:e.data.popupImg}):502===e.data.code?z.showCoinTip({title:"领取失败",content:"抱歉,活动已结束了,下次要快哟~~",close:!0,img:e.data.popupImg}):503===e.data.code?z.showCoinTip({title:"已经领取",content:"贪心会长胖,你已经领取过了啦~~",close:!0,img:e.data.popupImg}):504===e.data.code?z.showCoinTip({title:"领取失败",content:"哎呀,你来晚了,有货币已经领完了,<br/>下次早点来哦",close:!0,img:e.data.popupImg}):e.data.msg&&z.showCoinTip({title:"领取失败",content:"抱歉,系统错误,有货君正奋力解决中...请稍后再来",close:!0,img:e.data.popupImg}):e.message&&z.showCoinTip({title:"领取失败",content:"抱歉,系统错误,有货君正奋力解决中...请稍后再来",close:!0,img:e.data&&e.data.popupImg})},function(){z.showCoinTip({title:"领取失败",content:"抱歉,系统错误,有货君正奋力解决中...请稍后再来",close:!0})})},K=function(e){e.app=z.queryString(),e.app.uid=e.uid,r({url:"//m.yohobuy.com/coupon/couponSend?callback=?",data:e}).then(function(e){200===e.code?z.showTip({title:"领取成功",content:"恭喜您,领取成功",close:!0}):401===e.code?z.showTip({title:"已经领取",content:'快去分享给更多<br>喜爱<span class="highlight">潮流</span>的小伙伴吧!',close:!0}):e.message&&z.showTip({title:"领取失败<br>请刷新重新领取",content:e.message+"<br>如多次领取失败,请联系客服人员<br>带来不便敬请谅解",close:!1})},function(){z.showTip({title:"领取失败<br>请刷新重新领取",content:"如多次领取失败,请联系客服人员<br>带来不便敬请谅解",close:!1})})},ee=function(t){if(t){var i=Z.cookie("yoho-coin-token");i&&(V({token:i,uid:t}),Z.setCookie("yoho-coin-token",""))}e("body").on("click",".yoho-coin",function(){var t=e(this).data("token");if(!Q.uid)return Z.setCookie("yoho-coin-token",t),e("#intimacy-link").length<=0&&e("body").append("<a href='"+Q.noLoginUrl()+'\' style="display:none;" id="intimacy-link"><span class="intimacy-link"></span></a>'),void e(".intimacy-link").click();V({token:t,uid:Q.uid})})},te=function(t){if(t){var i=Z.cookie("yoho-conpon-token");i&&(K({token:i,uid:t}),Z.setCookie("yoho-conpon-token",""))}e("body").on("click",".yoho-conpon",function(){var t=e(this).data("token");if(!Q.uid)return Z.setCookie("yoho-conpon-token",t),e("#intimacy-link").length<=0&&e("body").append("<a href='"+Q.noLoginUrl()+'\' style="display:none;" id="intimacy-link"><span class="intimacy-link"></span></a>'),void e(".intimacy-link").click();K({token:t,uid:Q.uid})})},ie={init:function(e){ee(e),te(e)}},ne=!1,oe=function(e,t,i,n,o){if(i){e.find(".brand-name").html(i.brand_name),e.find(".product-detail").attr("href","//m.yohobuy.com/product/pro_"+i.product_id+"_"+i.goods_id+"/"+i.cn_alphabet+'.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":'+i.product_skn+"}}"),e.find(".product-detail-img").attr("src",z.image(i.default_images,n.w,n.h,2,75)),e.find(".product-name").html(i.product_name),e.find(".vip-price-val").html("¥"+i.vip_price),e.find(".sale-price").html("¥"+i.sales_price),i.sales_price===i.market_price?e.find(".market-price").hide():e.find(".market-price").html("¥"+i.market_price).show();var a=e.find(".product-brand");a&&(i.shop_id?a.attr("href","//m.yohobuy.com/product/index/brand?domain="+i.brand_domain+'&openby:yohobuy={"action":"go.shop","params":{"shop_id":'+i.shop_id+',"shop_template_type":'+(i.shop_template_type||"1")+',"is_red_shop":'+(i.is_red_shop||1)+"}}"):a.attr("href","//m.yohobuy.com/product/index/brand?domain="+i.brand_domain+'&openby:yohobuy={"action":"go.brand","params":{"brand_id":'+i.brand_id+"}}")),o&&(o.I_INDEX||(o.I_INDEX=0),o.I_INDEX++,e.find(".product-detail").attr("fp",JSON.stringify(o)),a&&(o.I_INDEX++,a.attr("fp",JSON.stringify(o))));var r=e.find(".list-product");if(r){var c="",d=t.gender?t.gender:"1,3",s="//list.m.yohobuy.com?gender="+d;r.data("sort")&&(c+=',"sort":'+i.small_sort_id,s+="&sort="+i.small_sort_id),r.data("misort")&&(c+=',"misort":'+i.middle_sort_id,s+="&misort="+i.middle_sort_id),r.data("msort")&&(c+=',"msort":'+i.max_sort_id,s+="&msort="+i.max_sort_id),s+='&openby:yohobuy={"action":"go.list","params":{"actiontype":1,"gender":'+d+c+"}}",r.attr("href",s)}return e.html(e.html()),e}},ae=function e(t){if(t.length){var i=t.shift();return i&&i.default_images?i:e(t)}},re=function(t,i,n){var o=t.attr("cloneitem"),a=t.find(".loading"),c=t.find(".feature-product-info");if(c.length){if(n.abtest&&(!i.uid||Number(i.uid)%1024>=512))return void(o?e(c[0]).remove():(c.removeClass("novisible"),a.hide()));var d=t.find(".imgwh").val()||"";d=d.split("x")||[];var s={w:d[0]||300,h:d[1]||400},u=t.attr("fp");u=u?JSON.parse(u):"",r({url:"//m.yohobuy.com/activity/individuation?callback=?",data:e.extend({},i,n)}).then(function(i){if(!i||!i.length)return void(o?e(c[0]).remove():(c.removeClass("novisible"),a.hide()));if(o)for(var r=isNaN(Number(o))?i.length:Number(o),d=0;d<r;d++){var p=ae(i);if(0===d){var l=e(c[0]),f=oe(l,n,p,s,u);f?f.removeClass("novisible"):l.remove()}else{var h=oe(e(c[0]).clone(),n,p,s,u);h&&(h.removeClass("novisible"),h.appendTo(t))}}else{for(var m=1;m<i.length;m++)c.last().after(c.clone());var g=t.find(".feature-product-info");g.each(function(t,o){var a=e(o);oe(a,n,ae(i),s,u)}),g.removeClass("novisible"),a.hide()}},function(){o?e(c[0]).remove():(c.removeClass("novisible"),a.hide())})}},ce=function(){var t=Q.getMktCode();z.sParamByIframe("cover=1&mkt_code="+t+"&expires=604800000");var i=[];e("a").each(function(){var t=e(this).attr("href");!t||/^#.*$/.test(t)||/^javascript.*$/i.test(t)||i.push(t)});var n=0,o=setInterval(function(){if(++n>3)return void clearInterval(o);window._yas&&window._yas.sendAppLogs&&window.appBaseLogs&&(clearInterval(o),window._yas.sendAppLogs({appop:"YB_H5_PAGE_AB_OPEN_L",param:JSON.stringify({C_ID:z.queryString().yh_channel||1,PAGE_URL:window.originUrl,PAGE_NAME:decodeURI(window.qs.title||document.title),ACTION_URL:i,CROWD_CODE:t+""})},!0),e("a").click(function(){var i=e(this).attr("href");!i||/^#.*$/.test(i)||/^javascript.*$/i.test(i)||window._yas.sendAppLogs({appop:"YB_H5_PAGE_AB_FLR_C",param:JSON.stringify({C_ID:z.queryString().yh_channel||1,PAGE_URL:window.originUrl,PAGE_NAME:decodeURI(window.qs.title||document.title),F_URL:i,CROWD_CODE:t+""})},!0)}))},1e3)},de=function(t){e(".product-source").each(function(i,n){n=e(n);var o=n.attr("condition");if(o){o=JSON.parse(o);var a=z.queryString().yh_channel;o.abtest&&(ne=!0),a&&(o.yh_channel=a),i>3?setTimeout(function(){re(n,t,o)},300):re(n,t,o)}}),ne&&ce()},se={init:function(e){!e&&z.isApp()?document.addEventListener("deviceready",function(){window.yohoInterface.triggerEvent(function(e){Q.uid=e.uid,de({uid:e.uid,udid:e.udid})},function(){},{method:"get.analyticAppData"})},!1):de({uid:e,udid:Z.cookie("_yasvd")})}};e(function(){H.init(),Q.init().then(function(e){se.init(e),ie.init(e),Q.auth(),W.init(),z.init()})});var ue={auth:Q.auth,favout:Q.favout,getMktCode:function(){return Q.getMktCode()},getUid:function(){return Q.uid}},pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){"object"===("undefined"==typeof module?"undefined":pe(module))&&"object"===pe(module.exports)?module.exports=e():"function"==typeof define&&define.amd?define([],e):window._jssdk=e()}(function(){return ue})}(jQuery);
>>>>>>> master
... ...