Authored by 姜枫

优化奥莱、潮流优选、明星原创

Showing 37 changed files with 458 additions and 273 deletions
... ... @@ -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); // 逛首页
... ...
<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>
... ...
... ... @@ -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);
};
... ...
<div class="outlet-page goods-page yoho-page">
<div class="outlet-page outlet-activity-page goods-page yoho-page">
{{#activity}}
{{> resources/acivity-outlets}}
{{/activity}}
... ...
<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,
... ...
<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}}
... ...
... ... @@ -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>
... ...
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'
});
}
});
}
... ...
... ... @@ -7,7 +7,9 @@ var search = require('./sale/search');
// var el = $('.cd-lite');
search.start();
require('../../scss/product/outlet/activity.page.css');
search.start({}, {_noLazy: true});
ajaxActivityTime({
sort: 1, // 接口规定传1
... ... @@ -19,4 +21,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();
// }
// });
// });
// 页面(包括图片在内)全部加载完才能设置导航悬浮效果,否则位置结算会不准
... ...
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;
... ...
... ... @@ -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 "../../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,
... ...
... ... @@ -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;
}
}
... ...