Authored by 姜枫

Merge branch 'release/optim-3' into release/optim-wap

Showing 65 changed files with 954 additions and 859 deletions
... ... @@ -64,7 +64,7 @@ app.use(global.yoho.hbs({
app.use(global.yoho.middleware());
app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
app.use(favicon(path.join(__dirname, '/favicon.ico')));
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
... ...
... ... @@ -36,6 +36,7 @@ exports.index = (req, res, next) => {
}),
content: result,
noLoginUrl: result.noLoginUrl,
localCss: true,
appPath: 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.couponCenter", "params":{"share":"/operations/api/v5/webshare/getShare","share_id":"1037","title":"领券中心"}}' //eslint-disable-line
});
}).catch(next);
... ...
... ... @@ -2,7 +2,7 @@
{{# content}}
{{#if isSingleImage}}
<div data-id="{{templateId}}" data-floor-name="{{templateName}}" class="floor">
<a href="{{url}}"><img src="{{image src 0 0}}" class="just-img"/></a>
<a href="{{url}}"><img src="{{image2 src w=0 h=0 q=60}}" class="just-img"/></a>
</div>
{{/if}}
{{#if isCarouselBanner}}
... ...
... ... @@ -21,23 +21,28 @@ let index = (req, res, next) => {
let responseData = {
module: 'channel',
page: 'brand',
localCss: true,
// title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停',
showFooterTab: footerModel.getUrlData('category')
};
let param = {
channel: req.query.channel || '1',
gender: req.query.gender || '1,3'
};
indexModel.getBrandByChannel(param.channel).then(result => {
res.render('brand/index', Object.assign(responseData, result));
}).catch(next);
};
let brandList = (req, res, next) => {
var channel = req.query.channel || '1';
indexModel.getBrandListByChannel(channel).then(result => {
res.json(result);
}).catch(next);
};
/**
... ... @@ -47,7 +52,6 @@ let index = (req, res, next) => {
* @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
*/
let search = (req, res, next) => {
let headerData = headerModel.setNav({
navTitle: '品牌一览'
});
... ... @@ -56,6 +60,7 @@ let search = (req, res, next) => {
pageHeader: headerData,
module: 'channel',
page: 'brand',
localCss: true,
isWechat: req.yoho.isWechat,
title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停',
pageFooter: true
... ... @@ -144,6 +149,7 @@ let searchAsync = (req, res, next) => {
module.exports = {
index,
search,
brandList,
delBrandHistory,
addBrandSearch,
searchAsync
... ...
... ... @@ -30,7 +30,6 @@ let CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75';
*/
const _packageAd = (params) => {
return service.get('/operations/api/v5/resource/get', {
content_code: params.contentCode,
gender: 1,
... ... @@ -38,71 +37,48 @@ const _packageAd = (params) => {
page: 1
}, {
cache: true
}).then(result => {
return result;
});
};
const _packageList = (params) => {
const _packageList = (channel) => {
return api.get('', {
method: 'app.brand.newBrandList',
yh_channel: params.channel
yh_channel: channel
}, {
cache: true,
code: 200
}).then(result => {
return result;
});
};
const getBrandByChannel = (channel) => {
let params = {};
/* 根据频道调用接口 */
switch (channel) {
case '1': // 男生
params = {
contentCode: CODE_TOPPOS_BOYS,
channel: 1
contentCode: CODE_TOPPOS_BOYS
};
break;
case '2': // 女生
params = {
contentCode: CODE_TOPPOS_GIRLS,
channel: 2
contentCode: CODE_TOPPOS_GIRLS
};
break;
case '3': // 潮童
params = {
contentCode: CODE_TOPPOS_KIDS,
channel: 3
contentCode: CODE_TOPPOS_KIDS
};
break;
case '4': // 创意生活
params = {
contentCode: CODE_TOPPOS_LIFESTYLE,
channel: 4
contentCode: CODE_TOPPOS_LIFESTYLE
};
break;
default:
}
return api.all([
_packageAd(params),
_packageList(params)
]).then(result => {
return _packageAd(params).then(result => {
let resu = {
channel: {
channels: [{
... ... @@ -120,24 +96,17 @@ const getBrandByChannel = (channel) => {
},
searchUrl: helpers.urlFormat('/brands/search', null),
brandPage: true,
brandType: '全部品牌',
secondBrandType: '新入驻品牌',
thirdBrandType: '热门品牌',
brandList: [],
newBrandWall: [],
recommandBrandWall: []
thirdBrandType: '热门品牌'
}
};
resu.channel.channels[channel - 1].active = true;
if (result && result[0] && result[0].data) {
if (result[0].data[0] && result[0].data[0].data) {
if (result && result.data) {
if (result.data[0] && result.data[0].data) {
// 轮播图资源位
let adList = result[0].data[0].data;
let adList = result.data[0].data;
let build = [];
adList.forEach(ad => {
... ... @@ -146,15 +115,12 @@ const getBrandByChannel = (channel) => {
url: ad.url
});
});
resu.channel.topData.bannerTop.list = build;
}
if (result[0].data[1] && result[0].data[1].data) {
if (result.data[1] && result.data[1].data) {
// 推荐品牌资源位
let brandList = result[0].data[1].data.list;
let brandList = result.data[1].data.list || [];
let brand = [];
brandList.forEach(ad => {
... ... @@ -165,106 +131,76 @@ const getBrandByChannel = (channel) => {
});
});
resu.channel.topData.hotBrandsScroll.name = result[0].data[1].data.title.title;
resu.channel.topData.hotBrandsScroll.name = result.data[1].data.title.title;
resu.channel.topData.hotBrandsScroll.list = brand;
}
}
return resu;
});
};
/* 按字母'A-Z'分组的品牌列表 */
if (result && result[1] && result[1].data) {
let allList = result[1].data.all_list;
for (let key in allList) {
let obj = {};
obj = Object.assign(obj, {
title: key
});
let list = [];
allList[key].forEach(row => {
const getBrandListByChannel = (channel) => {
return _packageList(channel).then(result => {
let resu = {
brandList: [],
newBrandWall: [],
recommandBrandWall: []
};
list.push({
name: row.brand_name,
isHot: row.is_hot === 'Y' ? true : false,
isNew: row.is_show_new === 'Y' ? true : false,
url: helpers.urlFormat('/product/index/brand?domain=' + row.brand_domain)
});
if (!result || !result.data) {
return resu;
}
});
/* 按字母'A-Z'分组的品牌列表 */
let allList = result.data.all_list;
for (let key in allList) {
let obj = {
title: key,
list: []
};
obj = Object.assign(obj, {
list
allList[key].forEach(row => {
obj.list.push({
name: row.brand_name,
isHot: row.is_hot === 'Y' ? true : false,
isNew: row.is_show_new === 'Y' ? true : false,
url: helpers.urlFormat('/product/index/brand?domain=' + row.brand_domain)
});
resu.channel.brandList.push(obj);
}
});
resu.brandList.push(obj);
}
// 新入驻品牌
if (result && result[1] && result[1].data) {
let newList = result[1].data.new_list;
for (let key in newList) {
let obj = {};
let list = [];
list.push({
brandName: newList[key].brand_name,
url: helpers.urlFormat('/product/index/brand?domain=' + newList[key].brand_domain),
img: helpers.image(newList[key].brand_ico, 186, 115),
});
obj = Object.assign(obj, {
list
});
resu.channel.newBrandWall.push(obj);
}
let newList = result.data.new_list;
for (let key in newList) {
let obj = {
list: []
};
obj.list.push({
brandName: newList[key].brand_name,
url: helpers.urlFormat('/product/index/brand?domain=' + newList[key].brand_domain),
img: helpers.image(newList[key].brand_ico, 186, 115),
});
resu.newBrandWall.push(obj);
}
// 推荐品牌
if (result && result[1] && result[1].data) {
let hotList = result[1].data.hot_list;
for (let key in hotList) {
let obj = {};
let list = [];
list.push({
brandName: hotList[key].brand_name,
url: helpers.urlFormat('/product/index/brand?domain=' + hotList[key].brand_domain),
img: helpers.image(hotList[key].brand_ico, 186, 115),
});
obj = Object.assign(obj, {
list
});
resu.channel.recommandBrandWall.push(obj);
}
let hotList = result.data.hot_list;
for (let key in hotList) {
let obj = {
list: []
};
obj.list.push({
brandName: hotList[key].brand_name,
url: helpers.urlFormat('/product/index/brand?domain=' + hotList[key].brand_domain),
img: helpers.image(hotList[key].brand_ico, 186, 115),
});
resu.recommandBrandWall.push(obj);
}
return resu;
});
};
... ... @@ -602,6 +538,7 @@ const branchSearchHistoryAsync = (uid) => {
module.exports = {
getBrandByChannel,
getBrandListByChannel,
branchSearch,
delBrandSearchHistory,
addSearchHistory,
... ...
... ... @@ -26,6 +26,7 @@ router.get('/(:channel)/bottomBanner', channel.bottomBanner);
router.get('/cate', cate.index);
router.get('/brands', brandController.index); // 品牌首页
router.get('/brands/search', brandController.search); // 品牌搜索页
router.get('/brands/getBrandList', brandController.brandList); // 获取品牌列表
router.post('/brands/searchAsync', brandController.searchAsync); // 品牌搜索异步数据
router.post('/brands/addBrandSearch', brandController.addBrandSearch); // 添加品牌搜索记录
router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删除品牌搜索记录
... ...
... ... @@ -20,7 +20,7 @@
</a>
</div>
</div>
<div class="hide-when-loading">
<div>
{{# topData}}
{{! 头部banner}}
{{# bannerTop}}
... ... @@ -49,56 +49,11 @@
</li>
</ul>
</div>
<div class="second-level-brand">
{{# brandList}}
<div class="brand-list bar-{{@index}}">
<div class="title-bar">
<h2 style="position: static;">{{title}}</h2>
</div>
{{# list}}
<p>
<a href="{{url}}">{{name}}
{{# isHot}}
<i class="icon-hot">HOT</i>
{{/ isHot}}
{{# isNew}}
<i class="icon-new">NEW</i>
{{/ isNew}}
</a>
</p>
{{/ list}}
</div>
{{/ brandList}}
{{# newBrandWall}}
<div class="new-brand-wall branding-wall hide">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}"></img>
<div class="brand-name">{{brandName}}</div>
</a>
</div>
{{/ list}}
</div>
{{/ newBrandWall}}
{{# recommandBrandWall}}
<div class="recommand-brand-wall branding-wall hide">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}"></img>
<div class="brand-name">{{brandName}}</div>
</a>
</div>
{{/ list}}
</div>
{{/ recommandBrandWall}}
{{!--占位: 品牌列表部分--}}
<div id="placeholder-brandlist">
</div>
</div>
{{/channel}}
</div>
{{> footer-tab}}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,6 @@
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{image2 img q=60}}">
</a>
<div class="swiper-lazy-preloader"></div>
</li>
{{/if}}
{{/each}}
... ...
... ... @@ -6,8 +6,8 @@
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{image2 img q=60}}" alt="">
<span class="brands-title">{{textCn}}</span>
</a>
<span class="brands-title">{{textCn}}</span>
</li>
{{/ list}}
</ul>
... ...
... ... @@ -8,6 +8,7 @@
const mRoot = '../models';
const plusstarModel = require(`${mRoot}/plusstar`);
const headerModel = require('../../../doraemon/models/header'); // 头部model
const _ = require('lodash');
let channels = {
boys: 1,
girl: 2,
... ... @@ -33,16 +34,66 @@ exports.index = (req, res, next) => {
};
}
plusstarModel.getAllChannels({gender: gender, app_type: 0}).then(result => {
let result = {};
plusstarModel.getAllChannels({
gender: gender,
app_type: 0
}).then(data => {
result = Object.assign(result, data);
let focus = _.find(result.channel, d => d.focus) || {};
let code = focus.code || '';
return plusstarModel.getResourcesData({
content_code: code,
yh_channel: 1
}, {
isApp: isApp
});
}).then(data => {
result = Object.assign(result, data);
res.render('plusstar/index', Object.assign({
page: 'plusstar-index',
result: result,
isApp: isApp,
title: title
title: title,
localCss: true
}, parameter));
}).catch(next);
};
exports.userSkn = (req, res, next) => {
let isApp = req.body.app_version || req.body.appVersion || false;
let uid = '';
let param = {};
let skns = req.body.skns || '';
skns = skns.split(',') || [];
if (req.yoho.isApp) {
uid = req.body.uid;
} else {
uid = req.user.uid;
}
if (uid) {
param.uid = uid;
param.content_code = req.body.code || '';
param.yh_channel = req.body.yh_channel || 1;
plusstarModel.getFashionPrefer(param, {
isApp: isApp
}).then(result => {
let preferSkns = result.data || [];
skns = _.uniq(skns.concat(preferSkns));
res.json(skns);
}).catch(next);
} else {
res.json(skns);
}
};
/**
* 潮流优选首页-资源位
*/
... ... @@ -94,7 +145,8 @@ exports.resourcesGoodsList = (req, res, next) => {
res.render('plusstar/resources-goodsList', {
layout: false,
result: result,
title: '潮流优选'
title: '潮流优选',
_noLazy: true
});
}).catch(next);
};
... ...
... ... @@ -12,6 +12,8 @@ const plustarModel = require(`${mRoot}/plustar`);
const htmlProcess = require(`${global.utils}/html-process`);
const headerModel = require('../../../doraemon/models/header'); // 头部model
const crypto = global.yoho.crypto;
const _ = require('lodash');
let channels = {
boys: '1,3',
girl: '2,3',
... ... @@ -36,6 +38,14 @@ const getListData = (req, res, next) => {
if (type === '2') {
plustarModel.getBrandsData(gender, starBrand, originalBrand, channel, isRecommend).then((result) => {
_.forEach(result, r => {
let list = r.list || [];
let head3 = _.take(list, 3);
_.forEach(head3, d => d._noLazy = true);
});
res.render('plustar/list', {
module: 'guang',
page: 'plustar-list',
... ... @@ -44,12 +54,17 @@ const getListData = (req, res, next) => {
navTitle: '明星原创'
}),
pageFooter: true,
ps: result
ps: result,
localCss: true
});
}).catch(next);
} else {
plustarModel.getListData(gender, recom, all).then((result) => {
_.forEach(result, r => {
let list = r.list || [];
let head3 = _.take(list, 3);
_.forEach(head3, d => d._noLazy = true);
});
res.render('plustar/list', {
module: 'guang',
page: 'plustar-list',
... ... @@ -58,7 +73,8 @@ const getListData = (req, res, next) => {
navTitle: '国际优选'
}),
pageFooter: true,
ps: result
ps: result,
localCss: true
});
}).catch(next);
}
... ... @@ -102,7 +118,8 @@ const getDetailData = (req, res, next) => {
pageHeader: headerModel.setNav({
navTitle: result.brand_name
}),
ps: result
ps: result,
localCss: true
});
} else {
res.render('plustar/detail', {
... ... @@ -111,7 +128,8 @@ const getDetailData = (req, res, next) => {
title: result.brand_name,
ps: result,
uid: uid,
isApp: isApp ? true : false
isApp: isApp ? true : false,
localCss: true
});
}
... ...
... ... @@ -93,7 +93,6 @@ const getResources = (params, options) => {
if (options.isApp) {
params.platform = 'iphone';
}
return serviceAPI.get('operations/api/v5/resource/get', params, {
cache: true
}).then(result => {
... ...
... ... @@ -69,7 +69,7 @@ const getContentData = (gender, type, channel, isRecommend) => {
param.is_recommend = isRecommend;
}
return serviceAPI.get('guang/api/v3/plustar/getlist', param).then((result) => {
return serviceAPI.get('guang/api/v3/plustar/getlist', param, {cache: true}).then((result) => {
if (result && result.code === 200) {
return formaData(result.data.data.list[0].data, gender);
} else {
... ... @@ -133,7 +133,7 @@ const getNewProduct = (brandId, gender, url, isApp) => {
limit: 6,
order: 's_t_desc',
page: 1
}).then((result) => {
}, {cache: true}).then((result) => {
if (result && result.code === 200) {
... ... @@ -301,7 +301,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
return serviceAPI.get('guang/api/v1/plustar/getbrandinfo', {
id: id,
client_type: clientType
}).then((result) => {
}, {cache: true}).then((result) => {
if (result && result.code === 200) {
let list = result.data || [];
let jumpToApp;
... ... @@ -325,12 +325,12 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
list.brand_ico = imageProcess.getSourceUrl(list.brand_ico, 'brandLogo');
return Promise.all([isCollection(brandId, clientType, uid), getRelatedEditorial(brandId, uid, udid, clientType, isApp), getNewProduct(brandId, gender, url, isApp)]).then((result) => {
return Promise.all([getRelatedEditorial(brandId, uid, udid, clientType, isApp), getNewProduct(brandId, gender, url, isApp)]).then((result) => {
list = _.assign(list, {
isLike: result[0],
infos: result[1],
newArrival: result[2],
isLike: false,
infos: result[0],
newArrival: result[1],
jumpToApp: jumpToApp,
shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id,
shareTitle: list.brand_name,
... ...
... ... @@ -32,6 +32,7 @@ router.post('/star/setFavorite', star.setFavorite); // 收藏文章
router.get('/', homeController.index); // 逛首页
router.get('/plusstar', plusstar.index); // 潮流优选
router.post('/plusstar/userSkn', plusstar.userSkn); // 用户推荐skn
router.get('/plusstar/resources-template', plusstar.resourcesTemplate); // 潮流优选首页-资源位
router.post('/plusstar/resources-goodsList', plusstar.resourcesGoodsList); // 潮流优选首页-资源位-商品列表
router.get('/', index.index); // 逛首页
... ...
... ... @@ -20,9 +20,9 @@
<div class="swiper-slide">
<a href="{{url}}">
{{#if @first}}
<img src="{{image2 img width=200 height=100 q=60}}">
<img src="{{image2 img q=60}}">
{{^}}
<img class="swiper-lazy" data-src="{{image2 img width=200 height=100 q=60}}">
<img class="swiper-lazy" data-src="{{image2 img q=60}}">
{{/if}}
</a>
</div>
... ...
<div class="guang-info" data-id="{{id}}">
{{# author}}
<a class="info-author clearfix" href={{url}}>
<img class="lazy avatar" data-original={{avatar}}>
<span class="name">{{name}}</span>
</a>
{{/ author}}
<div class="info-img">
{{#if showTags}}
<a href="javascript:;" class="info-match">
{{# 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}}
</a>
{{/if}}
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="{{alt}}">
</a>
</div>
<div class="info-deps">
<a class="info-title-container" href="{{url}}">
<h2 class="info-title">{{title}}</h2>
</a>
<p class="info-text">{{text}}</p>
{{> guang/tvls}}
</div>
</div>
\ No newline at end of file
<div class='yoho-page plusstar-page'>
{{#if result.channel}}
<div class="tab-nav">
<ul>
{{#each result.channel}}
<li class='{{#if focus}} focus {{/if}}' data-code='{{code}}'>
<span>{{mame}}</span>
</li>
{{/each}}
</ul>
</div>
{{/if}}
<!--/tab-nav-->
{{#if result.channel}}
<div class="tab-nav {{#if isApp}}isApp{{/if}}">
<ul>
{{#each result.channel}}
<li class='{{#if focus}} focus {{/if}}' data-code='{{code}}'>
<span>{{mame}}</span>
</li>
{{/each}}
</ul>
</div>
{{/if}}
<!--/tab-nav-->
<div class="plusstar-resources">
<!--资源位数据模板-->
</div><!--/plusstar-resources-->
{{> common/suspend-home}}
</div><!--/plusstar-page-->
\ No newline at end of file
<!--资源位数据模板-->
{{> plusstar/resources}}
</div>
<!--/plusstar-resources-->
{{> common/suspend-home}}
</div>
<!--/plusstar-page-->
... ...
<div class="resources">
<!--banner-->
{{#if result.focus1}}
<div class="banner-top">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper" data-id={{result.focus1.id}}>
{{#each result.focus1.data}}
{{#if @first}}
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{image src 750 364}}">
</a>
</li>
{{^}}
<li class="swiper-slide">
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{image src 750 364}}">
</a>
</li>
{{/if}}
{{/each}}
</ul>
</div>
<div class="swiper-pagination">
<div class="pagination-inner">
</div>
</div>
</div>
{{/if}}
{{#each result.title_image}}
<div class='speck-title-image' data-fid='{{id}}' data-name='{{title}}'>
<div class="header-title">
{{title}}
{{#if moreName}}
<a class="more" href="{{moreUrl}}">{{moreName}}</a>
{{/if}}
</div>
<div class="title-image">
<a class="image" href="{{image.url}}">
<img class="lazy" data-original="{{image image.src 750 364}}">
</a>
</div>
</div>
{{/each}}
{{#if result.focus2.data}}
<div class="focus-left-right speck-title-image" data-fid='{{result.focus2.id}}' data-name='焦点图'>
{{#each result.focus2.data}}
<a href="{{url}}" title="{{title}}">
<img src="{{image src 250 250}}">
</a>
{{/each}}
</div>
{{/if}}
<!--/focus-left-right-->
{{#if result.recommend}}
<div class='speck-title-image' data-fid='{{result.recommend.id}}' data-name='{{result.recommend.title.name}}'>
{{#if result.recommend.title}}
<div class="header-title">
{{result.recommend.title.name}}
{{#if result.recommend.title.moreName}}
<a class="more" href="{{result.recommend.title.moreUrl}}">
{{result.recommend.title.moreName}}
</a>
{{/if}}
</div>
{{/if}}
{{#if result.recommend.data}}
<div class="recommend-content-five">
{{#each result.recommend.data}}
<a href="{{url}}">
<img class="lazy" data-original="{{image src 375 375}}">
</a>
{{/each}}
</div>
{{/if}}
</div>
{{/if}}
{{#if result.goods.title}}
<div class="header-title">
{{result.goods.title.name}}
{{#if result.goods.title.moreName}}
<a class="more" href="{{result.goods.title.moreUrl}}">
{{result.goods.title.moreName}}
</a>
{{/if}}
<input type='hidden' value='{{result.goods.productSkns}}' class='product-skns' />
</div>
<div class="goods clearfix">
<!--商品--->
</div><!--/goods-->
{{/if}}
</div><!--/resources-->
{{> plusstar/resources}}
... ...
<div class="ps-detail-page ps-page yoho-page">
{{# ps}}
<div id="brand-info" class="header brand-info ps-block" data-id="{{brand_id}}">
<img class="banner lazy" data-original="{{image cover_img 640 309}}">
<img class="logo lazy" src="{{brand_ico}}">
<img class="banner" src="{{image2 cover_img w=640 h=309 q=60}}">
<img class="logo" src="{{image2 brand_ico q=60}}">
<div class="header-content clearfix">
<p class="name-islike-container">
<span class="name">{{brand_name}}</span>
... ... @@ -114,4 +114,4 @@
<input type="hidden" name="uid" value="{{uid}}">
<input type="hidden" name="isApp" value="{{isApp}}">
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -25,7 +25,7 @@
</div>
<div class="good-detail-img">
<a class="good-thumb buriedpoint" href="{{url}}" data-bp-id="shop_good_{{thumb}}_0">
<img class="lazy" data-original="{{thumb}}">
<img src="{{thumb}}">
</a>
{{# is_soon_sold_out}}
<p class="few-tag">即将售罄</p>
... ... @@ -55,4 +55,4 @@
</div>
</div>
</div>
{{/if}}
\ No newline at end of file
{{/if}}
... ...
<div class="resources">
<!--banner-->
{{#if result.focus1}}
<div class="banner-top">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper" data-id={{result.focus1.id}}>
{{#each result.focus1.data}}
{{#if @first}}
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{image2 src w=750 h=364 q=60}}">
</a>
</li>
{{^}}
<li class="swiper-slide">
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{image2 src w=750 h=364 q=60}}">
</a>
</li>
{{/if}}
{{/each}}
</ul>
</div>
<div class="swiper-pagination">
<div class="pagination-inner">
</div>
</div>
</div>
{{/if}}
{{#each result.title_image}}
<div class='speck-title-image' data-fid='{{id}}' data-name='{{title}}'>
<div class="header-title">
{{title}}
{{#if moreName}}
<a class="more" href="{{moreUrl}}">{{moreName}}</a>
{{/if}}
</div>
<div class="title-image">
<a class="image" href="{{image.url}}">
<img src="{{image2 image.src w=750 h=364 q=60}}">
</a>
</div>
</div>
{{/each}}
{{#if result.focus2.data}}
<div class="focus-left-right speck-title-image" data-fid='{{result.focus2.id}}' data-name='焦点图'>
{{#each result.focus2.data}}
<a href="{{url}}" title="{{title}}">
<img src="{{image2 src w=250 h=250 q=60}}">
</a>
{{/each}}
</div>
{{/if}}
<!--/focus-left-right-->
{{#if result.recommend}}
<div class='speck-title-image' data-fid='{{result.recommend.id}}' data-name='{{result.recommend.title.name}}'>
{{#if result.recommend.title}}
<div class="header-title">
{{result.recommend.title.name}}
{{#if result.recommend.title.moreName}}
<a class="more" href="{{result.recommend.title.moreUrl}}">
{{result.recommend.title.moreName}}
</a>
{{/if}}
</div>
{{/if}}
{{#if result.recommend.data}}
<div class="recommend-content-five">
{{#each result.recommend.data}}
<a href="{{url}}">
<img class="lazy" data-original="{{image2 src w=375 h=375 q=60}}">
</a>
{{/each}}
</div>
{{/if}}
</div>
{{/if}}
{{#if result.goods.title}}
<div class="header-title">
{{result.goods.title.name}}
{{#if result.goods.title.moreName}}
<a class="more" href="{{result.goods.title.moreUrl}}">
{{result.goods.title.moreName}}
</a>
{{/if}}
<input type='hidden' value='{{result.goods.productSkns}}' class='product-skns' />
</div>
<div class="goods clearfix">
<!--商品--->
</div><!--/goods-->
{{/if}}
</div><!--/resources-->
... ...
... ... @@ -5,7 +5,11 @@
{{# imgs}}
<div class="swiper-slide">
<a href={{url}}>
<img class="swiper-lazy" data-src={{image img 640 310 2}}>
{{#if @first}}
<img src={{image2 img w=640 h=310 mode=2 q=60}}>
{{^}}
<img class="swiper-lazy" data-src={{image2 img w=640 h=310 mode=2 q=60}}>
{{/if}}
</a>
</div>
{{/ imgs}}
... ... @@ -17,10 +21,14 @@
</div>
{{^}}
<a href={{url}}>
<img class="lazy" data-original={{image img 640 310 2}}>
{{#if _noLazy}}
<img src={{image2 img w=640 h=310 mode=2 q=60}}>
{{^}}
<img class="lazy" data-original={{image2 img w=640 h=310 mode=2 q=60}}>
{{/if}}
</a>
{{/if}}
{{# deps}}
<p class="brand-deps">{{.}}</p>
{{/ deps}}
</li>
\ No newline at end of file
</li>
... ...
... ... @@ -31,7 +31,6 @@
<b>{{price}}</b>
</div>
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ productList}}
</ul>
... ...
... ... @@ -35,6 +35,7 @@ exports.index = (req, res, next) => {
outletModel.getContent(categoryId, yhChannel, contentcode).then(result => {
res.render('outlet', Object.assign({
localCss: true,
pageHeader: headerData,
title: '奥莱 | Yoho!Buy有货 | 潮流购物逛不停',
}, result));
... ... @@ -43,6 +44,7 @@ exports.index = (req, res, next) => {
// 奥莱活动详情页
exports.activityDetail = (req, res, next) => {
outletModel.getActivity(req.query.id).then(result => {
let headerData = headerModel.setNav({
navTitle: result.activityTitle,
... ... @@ -50,9 +52,11 @@ exports.activityDetail = (req, res, next) => {
});
res.render('outlet/activity', Object.assign({
localCss: true,
page: 'outlet-detail',
pageHeader: headerData,
pageFooter: true
pageFooter: true,
_noLazy: true
}, result));
}).catch(next);
};
... ...
... ... @@ -226,7 +226,8 @@ let search = (req, res, next) => {
res.render('sale/product', Object.assign({
layout: false,
params: params,
goods: result[0]
goods: result[0],
_noLazy: params._noLazy || false
}, vipObj));
}).catch(next);
};
... ...
... ... @@ -100,6 +100,6 @@
<input id="brand-id" type="hidden" value="{{brandId}}">
<input id="product-limit" type="hidden" value="{{isLimitBuy}}">
<input id="product-coupon-switch" type="hidden" value="{{showCoupon}}">
{{> common/suspend-home}}
</div>
{{/ result}}
... ...
... ... @@ -11,7 +11,6 @@
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}<span class="old-price">&yen;{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</a>
{{/ recommendList}}
</div>
... ...
<div class="outlet-page goods-page yoho-page">
<div class="outlet-page outlet-activity-page goods-page yoho-page">
{{#activity}}
{{> resources/acivity-outlets}}
{{/activity}}
... ...
... ... @@ -7,7 +7,6 @@
<a href="{{#if url}}{{url}}{{else}}javascript:;{{/if}}">
<img class="swiper-lazy" data-src="{{image img 640 240}}">
</a>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ list}}
</ul>
... ...
<nav class="outlet-nav outlet-category-nav">
<ul>
{{!
<li class='cartegory'><a href="?gender=1,3">全部</a></li>
}}
{{#data}}
<li class='category'>
<a href="{{url}}" {{#if @first}}class="active"{{/if}}>{{categoryName}}</a>
{{#unless @last}}
<span>|</span>
{{/unless}}
</li>
{{/data}}
</ul>
<div class="nav-main">
<ul>
{{!
<li class='cartegory'><a href="?gender=1,3">全部</a></li>
}}
{{#data}}
<li class='category'>
<a href="{{url}}" {{#if @first}}class="active"{{/if}}>{{categoryName}}</a>
{{#unless @last}}
<span>|</span>
{{/unless}}
</li>
{{/data}}
</ul>
</div>
</nav>
{{> sale/common}}
... ...
... ... @@ -38,6 +38,9 @@ const cachePage = {
'/guang/author/index': 1 * MINUTE,
'/guang/tags/index': 1 * MINUTE,
'/guang/plustar': 1 * MINUTE,
'/guang/plustar/brandinfo': 1 * MINUTE,
'/guang/plusstar': 1 * MINUTE,
'/guang/plusstar/resources-goodsList': 1 * MINUTE,
'/guang/index/page': 1 * MINUTE,
// '/guang/plustar/brandinfo': 1 * MINUTE,
... ...
... ... @@ -11,7 +11,6 @@
<span class="sale-price {{^price}}no-price{{/price}}">{{salePrice}}</span>
{{#price}}<span class="old-price">{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</a>
{{/recommendList}}
</div>
... ...
<div class="active-list">
<a class="back-ground-white {{#if hide}} hidden {{/if}}" href="{{activityUrl}}" >
<img class="back-image" src="{{image coverUrl 640 300}}">
{{#if @root._noLazy}}
<img class="back-image" src="{{image2 coverUrl w=640 h=300 q=60}}">
{{^}}
<img class="back-image lazy" data-original="{{image2 coverUrl w=640 h=300 q=60}}">
{{/if}}
<div class="center-square">
<div class="title">{{title}}</div>
<div class="num"><span class="discount-num">{{discountNum}}</span> {{discountText}}</div>
... ...
... ... @@ -13,7 +13,6 @@
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{image2 src w=640 h=240 q=60}}">
</a>
<div class="swiper-lazy-preloader"></div>
</li>
{{/if}}
{{/each}}
... ...
... ... @@ -31,7 +31,6 @@
<b>{{price}}</b>
</div>
</div>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ productList}}
</ul>
... ...
... ... @@ -16,7 +16,6 @@
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{image2 default_images w=235 h=314 q=60}}" alt="">
</a>
<div class="swiper-lazy-preloader"></div>
</div>
<div class="fresh-info">
<p class="fresh-name"><a href="{{url}}">{{product_name}}</a></p>
... ...
... ... @@ -3,14 +3,14 @@
<div class="left-container">
{{# left}}
<a href="{{url}}">
<div class="thumb-row-box left-thumb-row-box" style="background-image:url({{image src 276 296}})"></div>
<div class="thumb-row-box left-thumb-row-box" style="background-image:url({{image2 src w=276 h=296 q=60}})"></div>
</a>
{{/ left}}
</div>
<div class="right-container">
{{# right}}
<a href="{{url}}">
<div class="thumb-row-box right-thumb-row-box {{#if @first}}first{{/if}}" style="background-image:url({{image src 276 134}})"></div>
<div class="thumb-row-box right-thumb-row-box {{#if @first}}first{{/if}}" style="background-image:url({{image2 src w=276 h=134 q=60}})"></div>
</a>
{{/ right}}
</div>
... ...
<div class="thumb-row">
{{# data}}
<a href="{{url}}">
<div class="thumb-row-box" style="background-image:url({{image src 275 160}})"></div>
<div class="thumb-row-box" style="background-image:url({{image2 src w=275 h=160 q=60}})"></div>
</a>
{{/ data}}
</div>
... ...
... ... @@ -4,7 +4,7 @@
<div class="trend-coll-content clearfix">
{{# article}}
<div class="lspan">
<a href="{{url}}"><img class="lazy rspanimg" data-original="{{image src 400 400}}" ></a>
<a href="{{url}}"><img class="lazy rspanimg" data-original="{{image2 src w=400 h=400 q=60}}" ></a>
</div>
{{/ article}}
</div>
... ... @@ -13,7 +13,7 @@
<div class="recommend-swiper">
<ul class="recommend-list swiper-wrapper clearfix">
{{# recommend_collocation}}
<li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{image src 140 140}}" alt="" /></a></li>
<li class="recommend-item swiper-slide"><a href="{{url}}"><img class="img" src="{{image2 src w=140 h=140 q=60}}" alt="" /></a></li>
{{/ recommend_collocation}}
</ul>
</div>
... ...
<div class="second-level-brand">
{{# brandList}}
<div class="brand-list bar-{{@index}}">
<div class="title-bar">
<h2 style="position: static;">{{title}}</h2>
</div>
{{# list}}
<p>
<a href="{{url}}">{{name}}
{{# isHot}}
<i class="icon-hot">HOT</i>
{{/ isHot}}
{{# isNew}}
<i class="icon-new">NEW</i>
{{/ isNew}}
</a>
</p>
{{/ list}}
</div>
{{/ brandList}}
{{# newBrandWall}}
<div class="new-brand-wall branding-wall hide">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}"></img>
<div class="brand-name">{{brandName}}</div>
</a>
</div>
{{/ list}}
</div>
{{/ newBrandWall}}
{{# recommandBrandWall}}
<div class="recommand-brand-wall branding-wall hide">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}"></img>
<div class="brand-name">{{brandName}}</div>
</a>
</div>
{{/ list}}
</div>
{{/ recommandBrandWall}}
</div>
\ No newline at end of file
... ...
/**
* Created by Acgpiano on 2016/9/19.
*/
require('../../scss/activity/_coupon-floor.css');
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
Swiper = require('yoho-swiper2'),
$receive = $('.main-right-receive'),
$mask = $('.floor-mask'),
$message = $('.floor-message'),
$tooltip = $('.floor-tooltip'),
tip = require('../plugin/tip');
require('../common');
// 获取url中的参数
function getUrlParam(name) {
// 构造一个含有目标参数的正则表达式对象
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
// 匹配目标参数
var r = window.location.search.substr(1).match(reg);
// 返回参数值
if (r !== null) {
return r[2];
}
return null;
return window.queryString[name];
}
require('../common');
// 获取领券状态
function getCouponStatus() {
setTimeout(function() {
var req = '',
code = getUrlParam('code'),
version = getUrlParam('app_version'),
... ... @@ -55,7 +45,7 @@ function getCouponStatus() {
cates.forEach(function(obj) {
var e = document.getElementById(obj.couponID);
if (!e) {
return;
}
... ... @@ -79,9 +69,7 @@ function getCouponStatus() {
}
}
});
}
getCouponStatus();
}, 300);
$receive.on('click', function() {
var $curDom = $(this);
... ...
... ... @@ -3,64 +3,77 @@
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/23
*/
require('../../scss/channel/_brand.css');
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
Hammer = require('../common/toy-hammer'),
Swiper = require('yoho-swiper'),
loading = require('../plugin/loading'),
lazyLoad = require('yoho-jquery-lazyload');
var ranToken = ' ??++ ';
var ranToken2 = ' ???--- ';
var swiper,
$fixTitleBar,
$brandList = $('.brand-list'),
var $brandList,
$newBrandWall,
$recommandBrandWall,
$icon = $('.search-icon'),
$genderItem = $('.genderNav li'),
$brandItem = $('.brandNav li'),
$newBrandWall = $('.new-brand-wall'),
$recommandBrandWall = $('.recommand-brand-wall'),
$searchAction = $('.search-action'),
$homebuttom = $('.homebuttom'),
$genderNav = $('.genderNav'),
$newSearch = $('.newbrand-search'),
$netHistory = $('.net-history'),
$navBtn = $('.nav-home'),
hotBrandsSwiper;
var searchH = $('.newbrand-search').outerHeight(),
headerH = $('.yoho-header').outerHeight(),
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1,
minBrandListTop;
$searchResult = $('.search-result'),
$navBtn = $('.nav-home');
var brandsData,
$keyword = $('#keyword'),
clearTextHammer;
$keyword = $('#keyword');
var $history = $('.local-history');
var $searchPage = $('.search-brand-page');
var $historySearch = $('.history-search');
var $hotSearch = $('.hot-search');
var $clearHistory = $('#clear-history');
var chHammer;
var isSearchPage = $('.brand-search-page').length > 0;
require('../common');
require('../footer');
function getBrandList() {
var listHbs = require('channel/brandlist.hbs');
$.ajax({
url: '/brands/getBrandList',
data: {
channel: window.queryString.channel
},
success: function(data) {
$('#placeholder-brandlist').replaceWith(listHbs(data));
lazyLoad($('img.lazy'));
// 改变背景色
changeBackground();
$brandList = $('.brand-list');
$newBrandWall = $('.new-brand-wall');
$recommandBrandWall = $('.recommand-brand-wall');
},
error: function() {
}
});
}
function changeBackground() {
var $brandList = $('.brand-list').find('p');
var brandList = $('.brand-list').find('p');
$brandList.on('touchstart', function() {
$brandList.css('background', '#fff');
brandList.on('touchstart', function() {
brandList.css('background', '#fff');
$(this).css('background', '#eee');
}).on('touchend touchcancel', function() {
$(this).css('background', '#fff');
});
}
changeBackground();
/**
* 增加单条记录
... ... @@ -70,7 +83,7 @@ function addHistory(brandName) {
type: 'POST',
url: '/brands/addBrandSearch',
data: 'brandName=' + encodeURIComponent(brandName),
success: function(data) {
success: function() {
},
error: function() {
}
... ... @@ -91,15 +104,16 @@ function sequence(a, b) {
function searchInput() {
if ($keyword.val().length) {
$icon.css('color', '#444');
$searchResult.css('margin-bottom', '6rem');
// $(this).closest('.search-box').css('width', '11.25rem');
$searchAction.show().find('.clear-text').show();
} else {
$icon.css('color', '#b2b2b2');
$searchResult.css('margin-bottom', '0');
// $(this).closest('.search-box').css('width', '12.5rem');
$searchAction.find('.clear-text').hide();
}
searchResult();
}
... ... @@ -241,47 +255,20 @@ function searchResult() {
}
// 插入 dom,绑定事件
$('.search-result').html(html);
$searchResult.html(html);
changeBackground();
bindWriteLocal($('.brand-list'), true);
}
loading.showLoadingMask();
lazyLoad($('img.lazy'));
$('.yoho-header').css({
'z-index': 2,
position: 'fixed',
top: 0
});
$homebuttom.css('top', '47px');
$homebuttom.css('position', 'fixed');
$navBtn.on('touchstart', function() {
if ($homebuttom.hasClass('hide')) {
$genderNav.css('top', '47px');
$newSearch.css('margin-top', '0px');
$searchPage.css('margin-top', '0px');
$('.banner-top').css('margin-top', '0px');
} else {
$genderNav.css('top', '97px');
$newSearch.css('margin-top', '47px');
$searchPage.css('margin-top', '47px');
$('.banner-top').css('margin-top', '47px');
}
});
(function() {
if ($('.banner-top').length > 0) {
$('.hot-brands').css('padding-top', '0');
if ($('.banner-top').length === 0) {
var h1 = $('.genderNav').height();
var h2 = $('.newbrand-search').height();
$('.hot-brands').css('padding-top', (h1 + h2) + 'px');
}
$('.hide-when-loading').show();
loading.hideLoadingMask();
// banner滑动
swiper = new Swiper('.swiper-container', {
new Swiper('.swiper-container', {
lazyLoading: true,
loop: true,
autoplay: 3000,
... ... @@ -289,60 +276,67 @@ $navBtn.on('touchstart', function() {
});
// 热门品牌滑动
hotBrandsSwiper = new Swiper('.brands-swiper', {
new Swiper('.brands-swiper', {
grabCursor: true,
slidesPerView: 'auto',
wrapperClass: 'brands-list',
slideElement: 'li'
});
}());
$fixTitleBar = $('<div class="title-bar fixed-title-bar"><h2></h2></div>');
$fixTitleBar.css({
position: 'fixed',
top: brandSwipe
}).hide();
minBrandListTop = brandSwipe + $('.hot-brands').outerHeight() + $('.banner-top').outerHeight();
$brandList.last().append($fixTitleBar);
$genderItem.on('touchstart', function() {
var index = $(this).data('id') + 1;
window.location.search = 'channel=' + index;
});
function scrollHandler() {
var scrTop = $(window).scrollTop();
$brandItem.on('click', function() {
var index = $(this).data('id');
$('.brandNav ul .active').removeClass('active');
$(this).addClass('active');
if (index === 0) {
$recommandBrandWall.not('.hide').addClass('hide');
$newBrandWall.not('.hide').addClass('hide');
$brandList.removeClass('hide');
} else if (index === 1) {
$newBrandWall.removeClass('hide');
$brandList.not('.hide').addClass('hide');
$recommandBrandWall.not('.hide').addClass('hide');
} else {
$recommandBrandWall.removeClass('hide');
$brandList.not('.hide').addClass('hide');
$newBrandWall.not('.hide').addClass('hide');
}
});
if ($brandList.eq(0).offset().top < minBrandListTop) {
$fixTitleBar.hide();
if (!isSearchPage) {
setTimeout(getBrandList, 50);
}
}());
$brandList.each(function() {
var offTop = $(this).offset().top - brandSwipe;
if (scrTop >= offTop) {
$fixTitleBar.css({
display: 'block'
}).find('h2').html($(this).find('.title-bar').text());
}
// 搜索页面
if (isSearchPage) {
$('.yoho-header').css({
'z-index': 2,
position: 'fixed',
top: 0
});
}
if ($('.brand-index-page').length > 0) {
/**
* srcoll to load more
*/
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
$homebuttom.css('top', '45px');
$homebuttom.css('position', 'fixed');
$navBtn.on('touchstart', function() {
if ($homebuttom.hasClass('hide')) {
$searchResult.css('margin-top', '0px');
$newSearch.css('margin-top', '0px');
$searchPage.css('margin-top', '0px');
} else {
$searchResult.css('margin-top', '45px');
$newSearch.css('margin-top', '45px');
$searchPage.css('margin-top', '45px');
}
});
}
if ($('.history-search').length > 0) {
bindWriteLocal($('.history-search'), false);
}
if ($('.hot-search').length > 0) {
bindWriteLocal($('.hot-search'), false);
}
bindWriteLocal($historySearch, false);
bindWriteLocal($hotSearch, false);
if ($('.brand-search-page').length > 0) {
brandsData = $.parseJSON($('#brands-data').html());
$keyword.on('input', function() {
... ... @@ -354,86 +348,35 @@ if ($('.brand-search-page').length > 0) {
$keyword.closest('.search-box').css('width', '13rem');
$searchAction.show().find('.clear-text').hide();
clearTextHammer = new Hammer($('.clear-text')[0]);
var clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
$('.search-result').html('');
$searchResult.html('');
$('#keyword').val('').trigger('input');
e.preventDefault();
e.srcEvent.preventDefault();
e.srcEvent.stopPropagation();
});
$('form.search-box').on('submit', function() {
return false;
});
}
if ($genderItem.length > 0) {
$genderItem.on('touchstart', function() {
var index = $(this).data('id') + 1;
$('.genderNav ul .active').removeClass('active');
$(this).addClass('active');
$('.hide-when-loading').hide();
loading.showLoadingMask();
function reload() {
window.location.search = 'channel=' + index;
}
setTimeout(reload.bind(this), 100);
});
}
if ($brandItem.length > 0) {
$brandItem.on('click', function() {
var index = $(this).data('id');
$('.brandNav ul .active').removeClass('active');
$(this).addClass('active');
if (index === 0) {
$recommandBrandWall.not('.hide').addClass('hide');
$newBrandWall.not('.hide').addClass('hide');
$brandList.removeClass('hide');
} else if (index === 1) {
$newBrandWall.removeClass('hide');
$brandList.not('.hide').addClass('hide');
$recommandBrandWall.not('.hide').addClass('hide');
} else {
$recommandBrandWall.removeClass('hide');
$brandList.not('.hide').addClass('hide');
$newBrandWall.not('.hide').addClass('hide');
}
});
}
/**
* 清除记录
*/
function removeHistory() {
$.ajax({
type: 'GET',
url: '/brands/delBrandHistory',
data: '',
success: function(data) {
},
error: function() {
// 初始化历史搜索的内容
if (isSearchPage) {
require('./brand-render')(function() {
// 清除记录
function removeHistory() {
$.ajax({
type: 'GET',
url: '/brands/delBrandHistory',
data: '',
success: function() {},
error: function() {}
});
}
});
}
// 初始化历史搜索的内容
require('./brand-render')(function() {
$netHistory = $('.net-history');
if ($('.brand-search-page').length > 0) {
chHammer = new Hammer($clearHistory[0]);
$netHistory = $('.net-history');
var chHammer = new Hammer($clearHistory[0]);
chHammer.on('tap', function() {
if (isLocalStorageSupported()) {
localStorage.removeItem('historys-brand');
... ... @@ -450,7 +393,6 @@ require('./brand-render')(function() {
});
// 搜索页面
(function() {
var html = '',
history,
... ... @@ -465,7 +407,6 @@ require('./brand-render')(function() {
netArr = [];
$netHistory.find('li').each(function() {
brand = $(this).find('a').attr('brandName');
time = $(this).find('a').attr('collectTime');
dict = {
... ... @@ -568,9 +509,6 @@ require('./brand-render')(function() {
} else {
$history.addClass('hide');
}
}());
}
});
});
}
... ...
var $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
Swiper = require('yoho-swiper'),
Swiper = require('yoho-swiper2'),
loading = require('../plugin/loading'),
debounce = require('lodash/debounce');
... ... @@ -15,6 +15,8 @@ var scrollFn,
resourcesTp = {},
CID;
require('guang/plusstar/index.page.css');
require('yoho-jquery-lazyload');
require('../common');
... ... @@ -87,8 +89,8 @@ plusstar = {
$tabUlDom.find('li').removeClass('focus');
$liDom.addClass('focus');
that.ParentLiDom = $liDom;// 保留当前tab先中的对象
that.tabNav($liDom.data('code'));
// that.tabNav($liDom.data('code'));
that.resInit();
// ent -- 默认选中
setTimeout(function() {
that._yas();
... ... @@ -175,7 +177,6 @@ plusstar = {
searching = false;// 初始化翻页
function execResData(data) {
var productSkns = '';
$('.plusstar-resources').html(data);
... ... @@ -192,14 +193,6 @@ plusstar = {
that.resInit();
$('.plusstar-resources').find('img.lazy').lazyload();
productSkns = $(data).find('.product-skns').val();
if (productSkns) {
that.common.productSkns = productSkns.split(',');
}
that.common.pageTotal = Math.ceil(that.common.productSkns.length / that.common.pagesize);
}
if (resourcesTp[tabId]) {
... ... @@ -218,7 +211,6 @@ plusstar = {
success: function(data) {
resourcesTp[tabId] = data;
execResData(data);
// 页面中下拉曝光
setTimeout(function() {
if (window._yas && window._yas.sendAppLogs) {
... ... @@ -273,6 +265,40 @@ plusstar = {
pagination: '.banner-top .pagination-inner'
});
}
$('.plusstar-resources').find('img.lazy').lazyload();
var productSkns = '';
productSkns = $('.product-skns').val();
if (productSkns) {
this.common.productSkns = productSkns.split(',');
}
this.common.pageTotal = Math.ceil(this.common.productSkns.length / this.common.pagesize);
var that = this;
var tabId = that.ParentLiDom.index() + 1;
setTimeout(function() {
$.ajax({
type: 'POST',
url: '/guang/plusstar/userSkn',
data: {
skns: productSkns,
uid: window.queryString.uid,
app_version: isApp,
yh_channel: tabId
},
dataType: 'json',
success: function(data) {
if (data) {
that.common.productSkns = data;
}
that.common.pageTotal = Math.ceil(that.common.productSkns.length / that.common.pagesize);
},
error: function() {
tip.show('网络断开连接了~');
}
});
}, 300);
},
goodsList: function() {
var that = this,
... ... @@ -353,13 +379,13 @@ scrollFn = debounce(function() {
$(function() {
isApp = window.queryString.app_version || window.queryString.appVersion;
if (isApp) {
$('.plusstar-resources').css({'margin-top': $('.tab-nav').height()});
} else {
$('.tab-nav').css({
position: 'relative'
});
}
// if (isApp) {
// $('.plusstar-resources').css({'margin-top': $('.tab-nav').height()});
// } else {
// $('.tab-nav').css({
// position: 'relative'
// });
// }
// 男:1,女:2,潮童:3,创意生活:4
CID = window.queryString.yh_channel || window._ChannelVary[window.cookie('_Channel')] || 1;
... ...
... ... @@ -27,6 +27,7 @@ var mIntro, aIntro, logoImg;
var moreHammer, likeHammer, $goodName, $title;
require('guang/plustar-detail.page.css');
require('../plugin/wx-share');
require('../common');
require('./plustar-detail-render')(function() {
... ... @@ -49,11 +50,11 @@ if ($('.good-detail-text .name').length > 0) {
});
}
// 文字介绍文字截取
$intro[0].mlellipsis(3);
// 获取截取文字和完整文字
setTimeout(function() {
$intro.css('height', 'auto');
// 文字介绍文字截取
$intro[0].mlellipsis(3);
mIntro = $intro.text();
aIntro = $intro.attr('title');
});
... ...
... ... @@ -5,10 +5,9 @@ var $ = require('yoho-jquery'),
var $navs = $('#nav-tab > li'),
$contents = $('#ps-content > .content');
require('guang/plustar-list.page.css');
require('../common');
var mySwiper;
lazyLoad($('img.lazy'));
$('#nav-tab').bind('contextmenu', function(e) {
... ... @@ -31,10 +30,13 @@ $('#nav-tab').on('touchend touchcancel', function(e) {
$this.swiper = false;
$contents.find('li').each(function(key, item) {
$(item).find('.swiper-container').addClass('swiper-' + key);
mySwiper = new Swiper('.swiper-' + key, {
lazyLoading: true,
pagination: '.swiper-' + key + ' .pagination-inner'
});
if (!$(item).swiper) {
$(item).swiper = true;
new Swiper('.swiper-' + key, {
lazyLoading: true,
pagination: '.swiper-' + key + ' .pagination-inner'
});
}
});
}
... ...
... ... @@ -123,7 +123,8 @@ function subClassifyTapEvt($this) {
hCbFn();
}
hideFilter();
// 防止点击穿透,延迟100 隐藏
setTimeout(hideFilter, 100)
}
// 初始化筛选
... ... @@ -152,7 +153,6 @@ function initFilter(opt) {
if ($this.closest('.filter-body').length > 0) {
$cur = $this.closest('.sub-item');
if ($cur.length > 0) {
// tap subclassify
$cur = $this.closest('li');
... ...
var $ = require('yoho-jquery'),
// Countdown = require('./outlet/countdown'),
ajaxActivityTime = require('./outlet/ajaxActivityTime');
require('../../scss/product/outlet/activity.page.css');
var ajaxActivityTime = require('./outlet/ajaxActivityTime');
var search = require('./sale/search');
// var el = $('.cd-lite');
search.start();
search.start({}, {_noLazy: true});
ajaxActivityTime({
sort: 1, // 接口规定传1
... ... @@ -19,4 +14,4 @@ ajaxActivityTime({
// el: el
// });
$('.back-ground-white').css('padding', '0');
// $('.back-ground-white').css('padding', '0');
... ...
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
Swiper = require('yoho-swiper2'),
lazyLoad = require('yoho-jquery-lazyload'),
ajaxActivityTime = require('./outlet/ajaxActivityTime');
... ... @@ -8,9 +8,12 @@ var $categoryNavItem = $('.outlet-category-nav a');
var $categoryNav = $('.outlet-category-nav');
var search = require('./sale/search');
var iscroll = require('./outlet/nav');
require('../../scss/product/outlet/_index.css');
require('./outlet/nav');
require('./outlet/fix-nav');
require('./outlet/set-backurl');
... ... @@ -39,10 +42,12 @@ function searchInitParam(dom) {
}
if ($el.length > 0) {
ajaxActivityTime({
type: 0, // 获取全部奥莱活动列表, 不区分是否将开始或结束
yh_channel: window.queryString.yh_channel
});
setTimeout(function(){
ajaxActivityTime({
type: 0, // 获取全部奥莱活动列表, 不区分是否将开始或结束
yh_channel: window.queryString.yh_channel
});
}, 500);
}
... ... @@ -76,43 +81,44 @@ $categoryNavItem.on('click', function(e) {
// 触发第一个search
if ($categoryNavItem.length > 0) {
// $categoryNavItem.eq(0).trigger('click');
search.start({
type: 'category'
}, searchInitParam($categoryNavItem.eq(0)));
setTimeout(function(){
search.start({
type: 'category'
}, searchInitParam($categoryNavItem.eq(0)));
}, 500);
}
// 导航滚动
if ($('#index_nav').length > 0) {
iscroll({
el: '#index_nav'
}).goto($('#index_nav').find('.active').index());
}
if ($('.outlet-category-nav').length > 0) {
iscroll({
el: '.outlet-category-nav'
}).goto(0);
}
// if ($('#index_nav').length > 0) {
// iscroll({
// el: '#index_nav'
// }).goto($('#index_nav').find('.active').index());
// }
// if ($('.outlet-category-nav').length > 0) {
// iscroll({
// el: '.outlet-category-nav'
// }).goto(0);
// }
// 更多活动按钮
if ($('.back-ground-white').length > 10) {
$('.more-activity').show();
$('.back-ground-white').each(function(index, e) {
if (index > 9) {
$(e).hide();
}
});
}
$('.more-activity').click(function() {
$('.more-activity').hide();
$('.back-ground-white').each(function(index, e) {
if (index > 9) {
$(e).show();
}
});
});
// if ($('.back-ground-white').length > 10) {
// $('.more-activity').show();
// $('.back-ground-white').each(function(index, e) {
// if (index > 9) {
// $(e).hide();
// }
// });
// }
// $('.more-activity').click(function() {
// $('.more-activity').hide();
// $('.back-ground-white').each(function(index, e) {
// if (index > 9) {
// $(e).show();
// }
// });
// });
// 页面(包括图片在内)全部加载完才能设置导航悬浮效果,否则位置结算会不准
... ...
... ... @@ -39,12 +39,17 @@ var $ = require('yoho-jquery');
};
var utils = {
lock: false,
rollTo: function(el, toWhere) {
$(el).click(function() {
if ($(this).css('position') === 'fixed') {
utils.lock = true;
$('body').animate({
scrollTop: toWhere
}, 100);
setTimeout(function(){
utils.lock = false;
}, 500);
}
});
}
... ... @@ -62,6 +67,7 @@ var $ = require('yoho-jquery');
this.preStyle = this.$el.attr('style');
this.preTop = originTop;
utils.lock = true;
this.$el.css({
position: 'fixed',
top: 0,
... ... @@ -69,7 +75,9 @@ var $ = require('yoho-jquery');
});
this.isSet = true;
setTimeout(function(){
utils.lock = false;
}, 500);
if (settings.autoRollTop) {
utils.rollTo(this.$el.get(0), originTop);
}
... ... @@ -97,6 +105,9 @@ var $ = require('yoho-jquery');
var originPoistion = $(el).offset().top;
$(window).scroll(function() {
if (utils.lock) {
return;
}
var elementTop = originPoistion - $(window).scrollTop();
if (scrollDirection.isDown() && elementTop <= 0) {
... ...
var $ = require('yoho-jquery'),
IScroll = require('yoho-iscroll');
var $ = require('yoho-jquery');
var WILL_BEGIN = '即将开始';
var WILL_END = '即将结束';
var ONLINE_FORECAST = '上线预告';
// nav 滚动
function initNavScroll(opt) {
var $navBox,
iScroll,
_default = {
el: '.outlet-nav'
},
options;
options = $.extend({}, _default, opt);
$navBox = $(options.el);
function scroll(index) {
var $ele;
$ele = $navBox.find('li').eq(index);
if ($ele.length > 0) {
setTimeout(function() {
iScroll.scrollToElement($ele[0], 400);
}, 1);
}
}
iScroll = new IScroll($navBox[0], {
scrollX: true,
scrollY: false,
tap: true,
eventPassthrough: true,
preventDefault: true
});
return {
goto: scroll
};
}
// function initNavScroll(opt) {
// var $navBox,
// iScroll,
// _default = {
// el: '.outlet-nav'
// },
// options;
// options = $.extend({}, _default, opt);
// $navBox = $(options.el);
// function scroll(index) {
// var $ele;
// $ele = $navBox.find('li').eq(index);
// if ($ele.length > 0) {
// setTimeout(function() {
// iScroll.scrollToElement($ele[0], 400);
// }, 1);
// }
// }
// iScroll = new IScroll($navBox[0], {
// scrollX: true,
// scrollY: false,
// tap: true,
// eventPassthrough: true,
// preventDefault: true
// });
// return {
// goto: scroll
// };
// }
// 获取url中的参数
function getUrlParam(name, url) {
... ... @@ -118,5 +117,5 @@ function activeNav() {
activeNav();
module.exports = initNavScroll;
// module.exports = initNavScroll;
... ...
.coupon-area-page {
max-width: 640px;
overflow: hidden;
@import "../layout/_swiper.css";
.swiper-slide {
img {
max-width: 640px;
max-height: 310.303px;
.coupon-area-page {
max-width: 640px;
overflow: hidden;
.banner-top {
position: relative;
margin-bottom: -2PX;
.swiper-pagination {
position: absolute;
left: 0;
right: 0;
bottom: 20px;
text-align: center;
z-index: 1;
.pagination-inner {
display: inline-block;
padding: 0 8px 4px;
background: rgba(0, 0, 0, 0.2);
border-radius: 50px;
line-height: 1.2;
span {
display: inline-block;
width: 14px;
height: 14px;
background: #fff;
opacity: 0.5;
margin: 0 9px;
border-radius: 50%;
&.swiper-pagination-bullet-active {
background: #fff;
opacity: 1;
}
}
}
}
}
.swiper-slide {
img {
max-width: 640px;
max-height: 310.303px;
}
}
}
.just-img{
width: 100%;
float: left;
margin:0;
.just-img {
width: 100%;
float: left;
margin: 0;
}
.coupon-floor {
float: left;
float: left;
width: 100%;
.floor-title {
background-color: #fff;
text-align: center;
height: 96px;
line-height: 96px;
font-size: 30px;
}
.floor-main {
height: 180px;
width: 100%;
background-size: 100%;
background-repeat: no-repeat;
padding: 10px 30px;
box-sizing: border-box;
float: left;
.floor-title {
background-color: #fff;
text-align: center;
height: 96px;
line-height: 96px;
font-size: 30px;
.main-left {
float: left;
width: 78%;
height: 160px;
}
.floor-main {
height: 180px;
width: 100%;
background-size: 100%;
.main-right-receive,
.main-right-use,
.main-right-go {
float: right;
width: 18%;
height: 160px;
position: relative;
&.hidden {
display: none;
}
span {
background-repeat: no-repeat;
padding: 10px 30px;
box-sizing: border-box;
float: left;
.main-left {
float: left;
width: 78%;
height: 160px;
background-size: contain;
&.on-receive {
position: absolute;
left: 50%;
top: 50px;
margin-left: -26px;
display: inline-block;
width: 52px;
height: 54px;
background-image: resolve("activity/click-txt.png");
}
&.received {
width: 100%;
height: 132px;
background-image: resolve("activity/received.png");
position: absolute;
top: 0;
right: 0;
}
.main-right-receive, .main-right-use, .main-right-go {
float: right;
width: 18%;
height: 160px;
position: relative;
&.hidden {
display: none;
}
span {
background-repeat: no-repeat;
background-size: contain;
&.on-receive {
position: absolute;
left: 50%;
top: 50px;
margin-left: -26px;
display: inline-block;
width: 52px;
height: 54px;
background-image: resolve('activity/click-txt.png');
}
&.received {
width: 100%;
height: 132px;
background-image: resolve('activity/received.png');
position: absolute;
top: 0;
right: 0;
}
&.zero {
width: 100%;
height: 132px;
background-image: resolve('activity/zero.png');
position: absolute;
top: 0;
right: 0;
}
}
&.zero {
width: 100%;
height: 132px;
background-image: resolve("activity/zero.png");
position: absolute;
top: 0;
right: 0;
}
}
}
}
}
.floor-mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .5);
display: none;
z-index: 9;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .5);
display: none;
z-index: 9;
}
.floor-message {
position: fixed;
top: 50%;
left: 50%;
width: 550px;
height: 250px;
margin-left: -275px;
margin-top: -125px;
z-index: 10;
background-color: rgba(250, 250, 250, .92);
display: none;
border-radius: 10px;
.coupon-message-content {
border-bottom: 1px solid rgb(197, 197, 197);
height: 160px;
text-align: center;
line-height: 160px;
font-size: 28px;
}
.coupon-message-op {
height: 90px;
text-align: center;
line-height: 90px;
font-size: 32px;
color: rgb(223, 98, 112);
}
position: fixed;
top: 50%;
left: 50%;
width: 550px;
height: 250px;
margin-left: -275px;
margin-top: -125px;
z-index: 10;
background-color: rgba(250, 250, 250, .92);
display: none;
border-radius: 10px;
.coupon-message-content {
border-bottom: 1px solid rgb(197, 197, 197);
height: 160px;
text-align: center;
line-height: 160px;
font-size: 28px;
}
.coupon-message-op {
height: 90px;
text-align: center;
line-height: 90px;
font-size: 32px;
color: rgb(223, 98, 112);
}
}
.floor-tooltip{
position: fixed;
top: 50%;
left: 50%;
width: 220px;
height: 140px;
margin-left: -110px;
margin-top: -70px;
z-index: 11;
background-color: rgba(60, 60, 60, .7);
display: none;
border-radius: 8px;
color: #fff;
.icon-box{
height: 84px;
line-height: 84px;
text-align: center;
}
.icon-msg{
height: 56px;
text-align: center;
}
.floor-tooltip {
position: fixed;
top: 50%;
left: 50%;
width: 220px;
height: 140px;
margin-left: -110px;
margin-top: -70px;
z-index: 11;
background-color: rgba(60, 60, 60, .7);
display: none;
border-radius: 8px;
color: #fff;
.icon-box {
height: 84px;
line-height: 84px;
text-align: center;
}
.icon-msg {
height: 56px;
text-align: center;
}
}
\ No newline at end of file
... ...
@import "search";
@import "floor-header";
@import "footer-tab";
@import "hot-brands";
@import "../layout/_swiper.css";
.brand-page {
.re-pos-search {
top: 80px !important;
}
.hide-when-loading {
display: none;
.banner-top {
position: relative;
margin-bottom: -2PX;
.swiper-pagination {
position: absolute;
left: 0;
right: 0;
bottom: 20px;
text-align: center;
z-index: 1;
.pagination-inner {
display: inline-block;
padding: 0 8px 4px;
background: rgba(0, 0, 0, 0.2);
border-radius: 50px;
line-height: 1.2;
span {
display: inline-block;
width: 14px;
height: 14px;
background: #fff;
opacity: 0.5;
margin: 0 9px;
border-radius: 50%;
&.swiper-pagination-bullet-active {
background: #fff;
opacity: 1;
}
}
}
}
}
.genderNav {
... ... @@ -212,13 +249,17 @@
}
}
.second-level-brand {
overflow: hidden;
margin-bottom: 100px;
}
.banner-top {
padding-top: 168px;
background-color: #f8f8f8;
}
.hot-brands {
padding-top: 178px;
border-top: 30px solid #f4f4f4;
.floor-header {
... ... @@ -371,7 +412,7 @@
padding-top: 178px;
&.wechat {
padding-top: 88px;
padding-top: 88px;
}
}
}
... ...
... ... @@ -97,8 +97,10 @@
li {
float: left;
padding-left: 5%;
padding-bottom: 5%;
width: 21.875%;
height: 140px;
position: relative;
a {
position: relative;
... ... @@ -113,14 +115,13 @@
display: inline-block;
max-width: 100%;
max-height: 100%;
vertical-align: middle;
}
.brands-title {
position: absolute;
left: 8px;
left: 40px;
right: 8px;
bottom: 8px;
bottom: -5px;
height: 28px;
line-height: 28px;
text-align: center;
... ...
... ... @@ -10,4 +10,5 @@
@import "common/dialog";
@import "common/data-bind";
@import "common/suspend-cart";
@import "common/suspend-home";
... ...
... ... @@ -121,7 +121,6 @@
text-align: center;
font-size: 18px;
line-height: 32px;
z-index: 1;
}
.no-storage {
... ...
... ... @@ -157,6 +157,8 @@
font-size: 24px;
color: #444;
line-height: 150%;
height: 108px;
overflow: hidden;
}
.more-intro {
... ...
... ... @@ -15,11 +15,15 @@
height: 80px;
font-size: 26px;
text-align: center;
position: fixed;
position: relative;
z-index: 10;
background-color: #fff;
top: 0;
&.isApp {
position: fixed;
}
li {
display: block;
float: left;
... ...
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../common/_good.css";
@import './index';
... ...
@import "../common/_good.css";
@import '../channel/floor-header';
@import './info';
@import './tvls';
@import './plus-star';
... ...
@import "../layout/_swiper.css";
@import './plus-star';
... ...
... ... @@ -37,10 +37,10 @@
position: relative;
padding: 20px 0;
width: 100%;
height: 300px;
.back-image {
width: 100%;
height: auto;
}
.center-square {
... ... @@ -78,6 +78,7 @@
.time {
text-align: center;
font-size: 22px;
height: 32px;
}
}
... ...
@import "nav";
@import "left-right";
@import "activity";
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../channel/_hot-category.css";
@import "../../channel/_icons-enter.css";
@import "../../channel/_banner-center.css";
@import "../../channel/_thumb-row.css";
@import "../../channel/_left-right.css";
@import "../../channel/_hot-brands.css";
@import "../../channel/_trendsetter-collocation.css";
@import "../../channel/_goods-category.css";
@import "../../channel/_creative-life.css";
@import "../../channel/_plus-star.css";
@import "../../channel/_floor-header.css";
@import "../../common/_good.css";
.outlet-page {
.good-tag,
.suspend-cart {
display: none !important;
}
.goods-container{
margin-bottom: 10px;
}
}
... ...
... ... @@ -5,8 +5,16 @@
border-bottom: 1px solid #e0e0e0;
white-space: nowrap;
position: relative;
overflow: hidden;
background: #fff;
overflow: hidden;
.nav-main {
width: 100%;
height: 98px;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
}
ul {
padding: 0 20px;
... ...
@import "activity";
@import "../../common/_good.css";
@import "../../common/_filter.css";
@import "../sale/_goods-list.css";
.outlet-activity-page {
.back-ground-white {
padding: 0;
}
}
... ...