Authored by 姜枫

merge from develop

... ... @@ -86,7 +86,7 @@ try {
const seo = require(`${global.middleware}/seo`);
const setYohoData = require(`${global.middleware}/set-yoho-data`);
// const errorHanlder = require(`${global.middleware}/error-handler`);
const errorHanlder = require(`${global.middleware}/error-handler`);
const setPageInfo = require(`${global.middleware}/set-pageinfo`);
const display = require(`${global.middleware}/display`);
... ... @@ -100,10 +100,10 @@ try {
require('./dispatch')(app);
// app.all('*', errorHanlder.notFound()); // 404
app.all('*', errorHanlder.notFound()); // 404
// YOHO 后置中间件
// app.use(errorHanlder.serverError());
app.use(errorHanlder.serverError());
} catch (err) {
logger.error(err);
}
... ...
... ... @@ -5,11 +5,19 @@ const getContent = () => {
{
slider: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/28/11/015a86ade17dc6213bab85b2162adebcd6.jpg?imageView2/2/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: '/'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/28/11/015a86ade17dc6213bab85b2162adebcd6.jpg?imageView2/2/w/1150/h/450',
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/28/11/015a86ade17dc6213bab85b2162adebcd6.jpg?imageView2/2/w/1920/h/650',
link: '/'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
link: '/'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
link: '/'
},
{
... ... @@ -17,6 +25,14 @@ const getContent = () => {
link: '/'
},
{
img: '//placehold.it/{width}x{height}',
link: '/'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/28/11/015a86ade17dc6213bab85b2162adebcd6.jpg?imageView2/2/w/1150/h/450',
link: '/'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/28/11/015a86ade17dc6213bab85b2162adebcd6.jpg?imageView2/2/w/1150/h/450',
link: '/'
},
... ... @@ -33,13 +49,13 @@ const getContent = () => {
{
brandsAd: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'GINZA',
des: '藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场',
btnText: 'shop now'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'STUSSY',
des: '藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场藤原浩于银座停车场',
btnText: 'shop now'
... ... @@ -51,24 +67,24 @@ const getContent = () => {
floorEn: 'NEW ARRIVALS',
newArrivals: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'STUSSY',
link: '/',
smallImg: true
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'DAILY PAPER',
link: '/',
even: true
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'BAPE',
link: '/'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'SUPREME',
link: '/',
even: true,
... ... @@ -83,7 +99,7 @@ const getContent = () => {
{
big: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
],
... ... @@ -102,17 +118,17 @@ const getContent = () => {
{
big: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
],
small: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
],
... ... @@ -122,17 +138,17 @@ const getContent = () => {
{
big: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
],
small: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
]
... ... @@ -140,17 +156,17 @@ const getContent = () => {
{
big: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
],
small: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
],
... ... @@ -163,28 +179,28 @@ const getContent = () => {
floorEn: 'STYLE ICON',
styleIcon: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'COTE&CIEL',
des: '这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生',
link: '/ ',
btnText: '去看看'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'COTE&CIEL',
des: '这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生',
link: '/ ',
btnText: '去看看'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'COTE&CIEL',
des: '这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生',
link: '/ ',
btnText: '去看看'
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
name: 'COTE&CIEL',
des: '这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生这都什么时代了?短发女生',
link: '/ ',
... ... @@ -194,7 +210,7 @@ const getContent = () => {
},
{
adBanner: {
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
},
... ... @@ -203,28 +219,28 @@ const getContent = () => {
floorEn: 'EDITORIAL',
editorial: {
big: {
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
},
small: [
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: '/',
bottomSpace: true,
rightSpace: true
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: '/',
bottomSpace: true
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: '/',
rightSpace: true
},
{
img: '//img10.static.yhbimg.com/yhb-img01/2016/06/23/13/01ebff30179db84975c42a4f3c8b1f4d44.jpg?imageView2/1/w/1150/h/450',
img: '//placehold.it/{width}x{height}',
link: ''
}
]
... ...
<div class="home-page">
<div class="home-page blk-page">
<div class="top-slider-container">
{{# content}}
{{#if slider}}
{{> slider}}
{{/if}}
{{/ content}}
<div class="main-container">
</div>
<div class="main-container center-content clearfix">
{{# content}}
{{#if brandsAd}}
{{> ad}}
... ...
<div class="ad-banner">
{{#adBanner}}
<img src="{{image img 864 120}}" alt="">
<a href="{{link}}">
<img class="lazy-img" data-original="{{image img 1150 160}}" alt="">
</a>
{{/adBanner}}
</div>
... ...
<div class="ad-container">
<div class="ad-container clearfix">
{{# brandsAd}}
<div class="ad {{#if @first}}first{{/if}}">
<img src="{{image img 165 165}}" alt="">
<img class="lazy-img" data-original="{{image img 240 240}}" alt="">
{{> brand-text-box}}
</div>
</div>
{{/ brandsAd}}
</div>
... ...
{{# classicBrands}}
<div class="brand-img-box {{#if right}}right{{/if}} {{#if bottomSpace}}mb10{{/if}}">
<a href="{{link}}">
{{# big}}
<img class="big-img" src="{{image img 426 250}}" alt="big-img">
<img class="big-img lazy-img" data-original="{{image img 556 333}}" alt="big-img">
{{/ big}}
{{# small}}
<img class="small-img {{#if @first}}first{{/if}}" src="{{image img 213 213}}" alt="big-img">
<img class="small-img lazy-img {{#if @first}}first{{/if}}" data-original="{{image img 283 283}}" alt="big-img">
{{/ small}}
</a>
</div>
{{/ classicBrands}}
... ...
<div class="classic-brands-container">
{{> floor-header}}
{{> floor}}
{{#if classicBrands}}
{{> brand-img-box}}
{{/if}}
... ...
<div class="editorial-container">
{{> floor-header}}
{{> floor}}
<div class="news-container">
{{# editorial}}
<div class="news left">
{{# big}}
<img src="{{image img 288 375}}" alt="">
<a href="{{link}}">
<img class="lazy-img" data-original="{{image img 395 495}}" alt="">
</a>
{{/ big}}
</div>
<div class="news right">
{{# small}}
<img class="{{#if bottomSpace}}bottom-space{{/if}} {{#if rightSpace}}right-space{{/if}}" src="{{image img 260 176}}" alt="">
<a href="{{link}}">
<img class="lazy-img {{#if bottomSpace}}bottom-space{{/if}} {{#if rightSpace}}right-space{{/if}}" data-original="{{image img 360 240}}" alt="">
</a>
{{/ small}}
</div>
{{/ editorial}}
... ...
<div class="new-arrival">
{{> floor-header}}
{{> floor}}
<div class="arrival-item-box">
{{# newArrivals}}
<div class="arrival-item {{#if smallImg}}small-img{{/if}} {{#if @last}}last{{^}}normal{{/if}}">
{{#if even}}
<img src="{{image img 245 370}}" alt="">
<a href="{{link}}">
<img class="lazy-img" data-original="{{#if smallImg}}{{image img 223 490}}{{^}}{{image img 325 490}}{{/if}}" alt="">
</a>
<div class="brand-name">
<span class="bottom">{{name}}</span>
<a href="{{link}}">
<span class="bottom">{{name}}</span>
</a>
</div>
{{^}}
<div class="brand-name">
<span class="top">{{name}}</span>
<a href="{{link}}">
<span class="top">{{name}}</span>
</a>
</div>
<img src="{{image img 245 370}}" alt="">
<a href="{{link}}">
<img class="lazy-img" data-original="{{#if smallImg}}{{image img 223 490}}{{^}}{{image img 325 490}}{{/if}}" alt="">
</a>
{{/if}}
</div>
{{/ newArrivals}}
... ...
... ... @@ -4,11 +4,7 @@
{{# slider}}
<li style="{{#if bgColor}}background:{{bgColor}}{{/if}}">
<a href="{{url}}" target= "_blank">
{{#if @first}}
<img src="{{image img 1150 450}}">
{{^}}
<img class="lazy" data-original="{{image img 1150 450}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image img 1920 645}}" alt="">
</a>
{{# tips}}
<div class="slide-tips">
... ...
<div class="style-icon-container">
{{> floor-header}}
{{> floor}}
<div class="smooth-card-container">
{{# styleIcon}}
<div class="card {{#if @first}}active{{/if}} {{#if @last}}last{{/if}}">
<div class="img" style="background-image: url('{{image img 160 240}}')"></div>
<img class="img lazy-img" data-original="{{image img 221 320}}" />
{{> brand-text-box}}
</div>
{{/ styleIcon}}
... ...
... ... @@ -36,21 +36,25 @@ const index = (req, res) => {
{
typeId: '0',
isActive: true,
href: '#',
type: '最新'
},
{
typeId: '1',
isActive: false,
href: '#',
type: '话题'
},
{
typeId: '2',
isActive: false,
href: '#',
type: '搭配'
},
{
typeId: '3',
isActive: false,
href: '#',
type: '潮人'
},
{
... ... @@ -61,6 +65,7 @@ const index = (req, res) => {
],
msg: [
{
id: '1',
msgLeft: '潮品',
msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
img: '',
... ... @@ -70,6 +75,7 @@ const index = (req, res) => {
like: '8'
},
{
id: '2',
msgLeft: '潮品',
msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
img: '',
... ... @@ -93,6 +99,70 @@ const index = (req, res) => {
});
};
const list = (req, res) => {
var pageNum = req.query.page || 1;
res.display('list', {
module: 'editorial',
page: 'list',
title: '资讯列表',
editorialList: {
nav: [
{
link: '//guang.yohobuy.com/index/index?type=0',
pathTitle: '首页',
name: 'MEN首页'
},
{
link: '/',
pathTitle: '资讯',
name: '咨询'
},
{
link: '/',
pathTitle: '资讯',
name: '咨询'
}
],
pathTitle: '户外',
msg: [
{
id: '1',
msgLeft: '潮品',
msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
img: '',
msgContent: '鞋款定价回复即可老地方了服务',
time: '2016/05/25 19:36',
liked: true,
like: '8'
},
{
id: '2',
msgLeft: '潮品',
msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
img: '',
msgContent: '鞋款定价回复即可老地方了服务',
time: '2016/05/25 19:36',
liked: true,
like: '8'
}
],
paginationOpts: {
page: pageNum, // current page: http://host/?page=2
limit: 10, // per_page records' number
totalRows: 100 // total page number
}
},
helpers: {
// import component, path depends on your project
pagination: require('../../../doraemon/components/pagination/pagination').createPagination
}
});
};
module.exports = {
index // 组件demo页
index, // 组件demo页
list
};
... ...
... ... @@ -11,6 +11,6 @@ const cRoot = './controllers';
const editorial = require(cRoot + '/editorial');
router.get('/', editorial.index); // 咨询首页
// router.get('/list', editorial.list); // 咨询列表页
router.get('/list', editorial.list); // 咨询列表页
module.exports = router;
... ...
<div class="editorial-index-page">
<div class="editorial-index-page center-content">
{{# editorial}}
{{> path-nav}}
... ... @@ -6,7 +6,7 @@
<ul class="msg-nav">
{{# msgTypes}}
<li data-type="{{typeId}}" {{#if isActive}}class="active"{{/if}}>
<a class="pjax-link" href="{{navUrl}}">{{type}}</a>
<a class="pjax-link" href="{{href}}">{{type}}</a>
</li>
{{/ msgTypes}}
</ul>
... ...
<div class="editorial-list-page center-content">
{{# editorialList}}
{{> path-nav}}
<div class="list-content">
<span class="nav-title inline-block"><b>{{pathTitle}}</b>关联的文章</span>
<div id="msg-list" class="msg-list">
{{# msg}}
{{> msg}}
{{/ msg}}
</div>
<div class="paging">
{{{ pagination paginationOpts }}}
</div>
</div>
{{/ editorialList}}
</div>
\ No newline at end of file
... ...
<div class="content-msg clearfix" data-id="{{id}}">
<div class="msg-left">{{msgLeft}}</div>
<div class="msg-right">
<a class="msg-title">{{msgTitle}}</a>
<img class="lazy" data-original="{{img}}">
<a class="msg-title" href="{{url}}" target="_blank">{{msgTitle}}</a>
<a href="{{url}}" target="_blank">
<img class="lazy" data-original="{{img}}">
</a>
<div class="content">{{msgContent}}</div>
<div class="msg-app">
<span class="time">
<i class="iconfont">&#xe61b;</i>
<i class="iconfont">&#xe606;</i>
<b class="time-word">{{time}}</b>
</span>
<span class="like-comment">
... ...
... ... @@ -46,17 +46,17 @@ const index = (req, res) => {
navPath: {
nav: [
{
link: '',
link: '#',
pathTitle: '',
name: 'MEN首页'
},
{
link: '',
link: '#',
pathTitle: '',
name: '咨询'
},
{
link: '',
link: '#',
pathTitle: '',
name: '咨询'
}
... ...
... ... @@ -35,7 +35,8 @@ module.exports = {
infoFile: {
name: 'info',
level: 'info',
filename: 'logs/info.log'
filename: 'logs/info.log',
maxFiles: 7
},
errorFile: {
name: 'error',
... ... @@ -45,7 +46,7 @@ module.exports = {
},
udp: { // send by udp
level: 'debug', // logger level
host: '192.168.102.162', // influxdb host
host: 'influxdb.yohoops.org', // influxdb host
port: '4444' // influxdb port
},
console: {
... ...
... ... @@ -15,7 +15,5 @@ module.exports = app => {
app.use('/', require('./apps/channel')); // 频道页
app.use('/me', require('./apps/me')); // 个人中心
// 资讯
app.use('/editorial', require('./apps/editorial'));
app.use('/editorial', require('./apps/editorial')); // 资讯
};
... ...
... ... @@ -33,7 +33,7 @@ exports.createPagination = function(pagination, options) {
queryParams = '', // paginate with query parameter
page = parseInt(pagination.page, 10), // current page number
leftText = '<i class="iconfont">&#xe607;</i>', // prev
rightText = '<i class="iconfont">&#xe606;</i>', // next
rightText = '<i class="iconfont">&#xe61e;</i>', // next
paginationClass = 'blk-pagination'; // pagination <ul> default class
var pageCount,
... ...
<span class="iconfont">&#xe61b;</span>
\ No newline at end of file
<span class="iconfont">&#xe606;</span>
\ No newline at end of file
... ...
... ... @@ -3,10 +3,14 @@
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
<<<<<<< HEAD
<<<<<<< HEAD
Created by FontForge 20120731 at Tue Jul 5 16:22:47 2016
=======
Created by FontForge 20120731 at Mon Jul 4 15:42:03 2016
>>>>>>> develop
=======
Created by FontForge 20120731 at Wed Jul 6 11:07:02 2016
>>>>>>> develop
By admin
</metadata>
<defs>
... ... @@ -115,7 +119,11 @@ d="M0 -128v1024h1024v-1024h-1024zM512 704q-133 0 -226.5 -93.5t-93.5 -226.5t93.5
d="M1092 225v171q0 101 -39.5 193.5t-106.5 159.5t-160 107t-194 40h-92q-101 0 -193.5 -40t-159.5 -107t-107 -159.5t-40 -193.5v-173v-317q0 -14 10 -24t24 -10h175q15 0 24.5 10t9.5 24v317q0 15 -9.5 24.5t-24.5 9.5h-128v116q0 88 34 168t92 137.5t138 92t168 34.5h67
q87 0 167 -34.5t138 -92t92 -137.5t34 -168v-113h-129q-15 0 -24.5 -10t-9.5 -25v-317q0 -14 9.5 -24t24.5 -10h175q14 0 24 10t10 24z" />
<glyph glyph-name="uniE61D" unicode="&#xe61d;"
<<<<<<< HEAD
d="M649 543l-137 -136l-137 136l-22 -22l136 -137l-136 -137l22 -22l137 136l137 -136l22 22l-136 137l136 137z" />
=======
d="M783 526l-45 45l-226 -226l-226 226l-45 -45l226 -226l-226 -226l45 -46l226 227l226 -227l45 46l-226 226z" />
>>>>>>> develop
<glyph glyph-name="uniE61E" unicode="&#xe61e;"
d="M384 570l48 50l338 -335l-338 -335l-48 49l284 286z" />
<glyph glyph-name="uniE620" unicode="&#xe620;"
... ...
/**
* 频道页
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2016/6/24
*/
var lazyLoad = require('yoho-jquery-lazyload');
require('../common/header');
require('../common/return-top');
require('../plugins/slider');
lazyLoad($('img.lazy-img'));
$('.slide-container').slider();
$('.card').mouseenter(function() {
... ...
... ... @@ -4,7 +4,27 @@
* @date: 2016/07/05
*/
// var $ = require('yoho-jquery'),
// lazyLoad = require('yoho-jquery-lazyload');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
// lazyLoad($('#msg-list img.lazy'));
lazyLoad($('#msg-list img.lazy'));
$('.msg-nav li').on('click', function() {
var activeTab = $(this).attr('data-type'),
href = $(this).find('a').attr('href');
$('.msg-nav li').removeClass('active');
$(this).addClass('active');
console.log(activeTab);
console.log(href);
});
$('.editorial-index-page').on('click', '.like-icon', function() {
var $this = $(this);
$this.toggleClass('liked');
});
require('../common/header');
require('../common/return-top');
... ...
... ... @@ -45,8 +45,8 @@ var $ = require('yoho-jquery'),
_createOrient: function() {
var orientHtml = '<div class="slide-switch">' +
'<a class="prev" href="javascript:;"><span class="iconfont">&#xe609;</span></a>' +
'<a class="next" href="javascript:;"><span class="iconfont">&#xe608;</span></a>' +
'<a class="prev" href="javascript:;"><span class="iconfont">&#xe607;</span></a>' +
'<a class="next" href="javascript:;"><span class="iconfont">&#xe606;</span></a>' +
'</div>';
if (this.$element.find('.slide-switch').length > 0) {
... ...
.ad-banner {
height: 120px;
height: 160px;
margin-top: 15px;
img {
... ...
.ad-container {
height: 225px;
height: 300px;
margin: 0 auto;
box-sizing: border-box;
border: 1PX solid $grayBorder;
border: 1pX solid $grayBorder;
background-color: #fff;
.ad {
... ... @@ -13,7 +13,7 @@
}
.ad.first {
border-right: 1PX solid $grayBorder;
border-right: 1pX solid $grayBorder;
}
img {
... ...
.brand-img-box {
width: 426px;
width: 566px;
box-sizing: border-box;
display: inline-block;
... ... @@ -17,12 +17,12 @@
.big-img {
width: 100%;
height: 250px;
height: 333px;
}
.small-img {
width: 50%;
height: 213px;
height: 283px;
display: inline-block;
box-sizing: border-box;
border: 1px solid $grayBorder;
... ...
.brand-text-box {
$size: 14px;
$size: 18px;
$line-height: 1.8;
$lines-to-show: 3;
... ... @@ -11,7 +11,7 @@
position: relative;
h4 {
font-size: 12px;
font-size: 16px;
font-weight: bold;
}
... ... @@ -29,14 +29,14 @@
}
button {
width: 105px;
height: 26px;
width: 140px;
height: 35px;
position: absolute;
bottom: 29px;
background-color: white;
outline: none;
border: 1PX solid black;
font-size: 12px;
border: 1pX solid black;
font-size: 16px;
cursor: pointer;
}
}
... ...
.editorial-container {
$bigImgWidth: 290px;
$smallImgWidth: 268px;
$smallImgHeight: 176px;
$bigImgWidth: 395px;
$smallImgWidth: 360px;
$smallImgHeight: 240px;
$space: 10px;
@extend .resource-container;
... ...
.home-page {
width: 1150px;
$sliderHeight: 645px;
margin: 10px auto 0;
.top-slider-container {
height: $sliderHeight;
}
.slide-container {
position: absolute;
left: 0;
right: 0;
height: 450px;
height: $sliderHeight;
}
.slide-thumb-container {
... ... @@ -15,7 +20,7 @@
.slide-wrapper {
position: relative;
height: 450px;
height: $sliderHeight;
overflow: hidden;
ul {
... ... @@ -46,15 +51,24 @@
display: block;
}
/* center the image. refer to http://stackoverflow.com/questions/24650218/image-in-full-screen-with-img-tag */
img {
width: 100%;
height: 100%;
min-height: 100%;
min-width: 1920px;
height: auto;
width: auto;
position: absolute;
top: -100%;
bottom: -100%;
left: -100%;
right: -100%;
margin: auto;
}
}
}
.slide-container-placeholder {
height: 450px;
height: $sliderHeight;
width: 100%;
}
... ... @@ -70,9 +84,9 @@
position: absolute;
top: 50%;
margin: -30px 0 0;
width: 30px;
height: 60px;
line-height: 56px;
width: 40px;
height: 70px;
line-height: 70px;
text-align: center;
z-index: 2;
background: #000;
... ... @@ -80,12 +94,12 @@
&.prev {
left: 50%;
margin-left: -545px;
margin-left: -615px;
}
&.next {
right: 50%;
margin-right: -545px;
margin-right: -615px;
}
&:hover {
... ... @@ -93,8 +107,8 @@
}
.iconfont {
font-size: 32px;
color: #59585a;
font-size: 34px;
color: #fff;
}
}
}
... ... @@ -152,17 +166,17 @@
position: relative;
display: inline-block;
margin: 0 3px;
width: 7px;
height: 7px;
width: 9px;
height: 9px;
background: #ccc;
cursor: pointer;
z-index: 2;
&.focus {
width: 12px;
height: 12px;
width: 16px;
height: 16px;
position: relative;
top: 2px;
top: 3px;
background: #fff;
}
}
... ... @@ -257,236 +271,15 @@
}
}
.new-report {
img {
display: block;
width: 100%;
height: 100%;
}
.report-list {
float: left;
width: 868px;
li {
float: left;
margin: 0 8px 8px 0;
width: 185px;
height: 248px;
overflow: hidden;
&:first-child {
margin-right: 7px;
width: 282px;
height: 504px;
}
}
}
.last-item {
float: left;
width: 282px;
height: 504px;
overflow: hidden;
}
}
/* 优选品牌 */
.preference-brand {
overflow: hidden;
}
.preference-brand-list {
margin-top: 8px;
width: 1158px;
}
.preference-brand-item {
float: left;
margin-right: 8px;
margin-bottom: 8px;
a {
display: table-cell;
width: 185px;
height: 86px;
text-align: center;
vertical-align: middle;
}
img {
display: block;
max-width: 100%;
max-height: 100%;
margin: 0 auto;
}
}
.preference-more {
float: left;
width: 185px;
height: 86px;
line-height: 100px;
text-align: center;
color: black;
font-size: 16px;
}
.img-slider-wrapper {
position: relative;
width: 100%;
height: 558px;
background: #8ae6e0;
overflow: hidden;
.img-brand-switch {
display: block;
a {
position: absolute;
top: 50%;
font-size: 36px;
color: #fff;
&.next {
right: 30px;
}
&.prev {
left: 30px;
}
}
}
}
.img-container-landscape {
box-sizing: border-box;
margin: 86px auto 0;
width: 982px;
height: 433px;
overflow: hidden;
.img-list {
width: 1000px;
height: 100%;
}
.img-item {
float: left;
box-sizing: border-box;
width: 320px !important;
height: 100%;
margin-right: 10px;
img {
width: 100%;
height: 100%;
}
}
}
.img-brand {
position: relative;
width: 100%;
height: 175px;
overflow: hidden;
&:hover {
.img-brand-switch {
display: block;
}
}
ul {
width: 1158px;
}
li {
float: left;
margin-right: 8px;
width: 378px !important;
height: 175px;
line-height: 175px;
overflow: hidden;
font-size: 0;
text-align: center;
img {
max-width: 100%;
max-height: 100%;
vertical-align: middle;
}
}
.img-brand-switch {
display: none;
a {
position: absolute;
top: 50%;
margin: -20px 0 0;
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
z-index: 2;
background: #fff;
opacity: 0.55;
&.prev {
left: 0;
}
&.next {
right: 0;
}
&:hover {
opacity: 0.9;
}
}
}
}
.categorys-list {
ul {
width: 1158px;
}
li {
float: left;
margin: 0 8px 8px 0;
width: 185px;
height: 248px;
&.cate-item0 {
width: 185px;
height: 504px;
}
&.cate-item1 {
width: 377px;
height: 504px;
}
img {
display: block;
width: 100%;
height: 100%;
}
}
}
.floor-header {
text-align: center;
height: 60px;
height: 90px;
line-height: 1.4;
font-weight: bold;
font-size: 16px;
.zh-title {
font-size: 14px;
}
}
.main-container {
position: relative;
top: 390px;
width: 864px;
top: -60px;
margin: 0 auto;
box-sizing: border-box;
}
... ...
$grayBorder: #f0f0f0;
.resource-container {
margin-top: 60px;
margin-top: 80px;
}
.cursor-pointer {
... ...
.new-arrival {
$textHeight: 35px;
$imgHeight: 370px;
$textHeight: 47px;
$imgHeight: 490px;
@extend .resource-container;
... ... @@ -12,13 +12,14 @@
}
.arrival-item {
width: 245px;
width: 325px;
display: inline-block;
.brand-name {
height: $textHeight;
text-align: center;
font-size: 12px;
font-size: 16px;
font-weight: normal;
span {
@extend .cursor-pointer;
... ... @@ -27,11 +28,11 @@
border-bottom: 1px solid #000;
&.top {
line-height: 20px;
line-height: 30px;
}
&.bottom {
line-height: 40px;
line-height: 56px;
}
}
}
... ... @@ -53,7 +54,7 @@
}
&.small-img {
width: 160px;
width: 223px;
}
}
}
... ...
.style-icon-container {
$width: 164px;
$height: 240px;
$width: 221px;
$height: 320px;
$space: 15px;
$buttonWidth: 105px;
$buttonWidth: 140px;
@extend .resource-container;
.smooth-card-container {
width: 880px;
width: 1170px;
height: $height;
margin: 0 auto;
overflow: hidden;
... ... @@ -35,7 +35,7 @@
}
.brand-text-box {
$size: 12px;
$size: 16px;
$line-height: 1.2;
$lines-to-show: 3;
... ...
... ... @@ -2,15 +2,16 @@
font-size: 14px;
height: 50px;
line-height: 50px;
color: #666;
a {
color: #666;
text-decoration: none;
}
}
.last {
font-weight: 700;
color: #1b1b1b;
}
.icon {
... ...
.editorial-index-page {
width: 1150px;
margin: 0 auto;
.index-content {
width: 1150px;
margin: 0 auto;
}
.msg-nav {
height: 35px;
height: 40px;
border-bottom: 1px solid #eee;
padding-left: 300px;
padding-bottom: 5px;
... ... @@ -17,7 +10,7 @@
float: left;
height: 30px;
width: 120px;
line-height: 35px;
line-height: 40px;
text-align: center;
font-size: 14px;
display: list-item;
... ... @@ -48,3 +41,4 @@
}
@import "msg";
@import "list";
... ...
.editorial-list-page {
.list-content {
margin-top: 30px;
}
.nav-title {
font-size: 14px;
font-weight: 700;
border-bottom: 1px solid #eee;
width: 100%;
height: 30px;
b {
font-size: 18px;
margin-right: 5px;
}
}
.paging {
margin: 20px auto;
width: 300px;
height: 40px;
}
}
... ...
.content-msg {
margin-top: 40px;
margin-left: 110px;
}
.msg-left {
position: relative;
float: left;
width: 200px;
height: 30px;
margin-right: 80px;
line-height: 30px;
text-align: center;
border-bottom: 1px solid #bbb;
}
.msg-left {
position: relative;
float: left;
width: 200px;
height: 30px;
margin-right: 80px;
line-height: 30px;
text-align: center;
border-bottom: 1px solid #bbb;
}
.msg-right {
float: left;
width: 643px;
border-bottom: 1px solid #eee;
margin-top: 2px;
padding-bottom: 5px;
}
.msg-right {
float: left;
width: 643px;
border-bottom: 1px solid #eee;
margin-top: 2px;
padding-bottom: 5px;
}
.msg-title {
font-size: 20px;
color: #333;
line-height: 30px;
max-height: 64px;
word-wrap: break-word;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.msg-title {
font-size: 20px;
color: #333;
line-height: 30px;
max-height: 64px;
word-wrap: break-word;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.lazy {
width: 640px;
height: 430px;
margin-top: 15px;
}
.msg-title:hover {
color: #ff1414;
}
.content {
display: block;
font-size: 14px;
line-height: 24px;
word-wrap: break-word;
margin-top: 10px;
overflow: hidden;
word-wrap: break-word;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.lazy {
width: 640px;
height: 430px;
margin-top: 15px;
}
.msg-app {
height: 45px;
line-height: 45px;
font-size: 14px;
}
.content {
display: block;
font-size: 14px;
line-height: 24px;
word-wrap: break-word;
margin-top: 10px;
overflow: hidden;
word-wrap: break-word;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.time {
color: #a6a6a6;
margin-left: 3px;
}
.msg-app {
height: 45px;
line-height: 45px;
font-size: 14px;
}
.iconfont {
font-size: 14px;
margin-top: 0;
}
.time {
color: #a6a6a6;
margin-left: 3px;
}
.time-word {
font-weight: normal;
}
.iconfont {
font-size: 14px;
margin-top: 0;
}
.like-comment {
margin-left: 40px;
color: #a6a6a6;
cursor: pointer;
font-size: 14px;
.time-word {
font-weight: normal;
}
.like-icon {
.like-comment {
margin-left: 40px;
color: #a6a6a6;
cursor: pointer;
font-size: 14px;
.like-icon {
cursor: pointer;
&.liked {
color: #000;
&.liked {
color: #000;
}
}
}
}
.like-num {
font-weight: normal;
.like-num {
font-weight: normal;
}
}
... ...
... ... @@ -4,10 +4,6 @@
width: 100%;
overflow: hidden;
img {
max-width: 100%;
max-height: 100%;
}
}
.slide-pagination {
... ... @@ -33,22 +29,6 @@
bottom: 0;
}
/*
.slide-pagination-last span {
display: block;
float: left;
position: relative;
margin: 0 3px;
width: 6px;
height: 6px;
background: #fff;
cursor: pointer;
opacity: 0.6;
z-index: 2;
}
*/
.slide-switch {
display: none;
... ...