Authored by yyq

outlets index

... ... @@ -18,29 +18,32 @@ const outletsSimulation = require('../models/simulation');
* @return {[type]} [description]
*/
exports.index = (req, res) => {
let data = {};
let resData = {};
data.module = 'product';
data.page = 'outlets';
data.footerTop = true;
data.devEnv = true;
resData.module = 'product';
resData.page = 'outlets';
resData.devEnv = true;
data.banner = [
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}
];
resData.mainBanner = {
list: [
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}',
bgColor: '#f00'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}',
bgColor: '#ff0'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
}
]
};
data.column = [
resData.column = [
{
href: '#',
img: 'http://img10.static.yhbimg.com/yhb-img01/2016/05/25/09/01ee927cf2bec307e50dbc437141665090.jpg?imageView2/1/w/{width}/h/{height}'
... ... @@ -55,7 +58,7 @@ exports.index = (req, res) => {
}
];
data.limitedBuy = {
resData.limitedBuy = {
name: '限时嗨购',
topic: [
{
... ... @@ -145,7 +148,7 @@ exports.index = (req, res) => {
}
};
data.nearOver = {
resData.nearOver = {
name: '即将结束',
topic: [
{
... ... @@ -183,7 +186,7 @@ exports.index = (req, res) => {
]
};
data.goodsBoard = {
resData.goodsBoard = {
goodsMenu: {
title: '最新折扣',
menuList: [
... ... @@ -236,7 +239,20 @@ exports.index = (req, res) => {
}
]
};
res.render('outlets/index', data);
headerModel.requestHeaderData().then(headerData => {
resData = Object.assign(resData, headerModel.setHeaderData(headerData.data, 'outlets'));
res.render('outlets/index', resData);
// outlets.getOutletsSpecialData(params).then(result => {
// res.render('outlets/special', resData);
// });
}).catch(() => {
resData.pageErr = true;
res.render('error', resData);
});
};
/**
... ...
<div class="outlets-page yoho-page">
{{> common/main-banner}}
<div class="center-content">
<ul class="column-img-tab">
{{# column}}
... ...
{{# mainBanner}}
<div class="main-banner"{{#unless list}} style="background:url({{image img 1920 450}}) no-repeat top center;"{{/unless}}>
<div class="main-banner slide-container"{{#unless list}} style="background:url({{image img 1920 450}}) no-repeat top center;"{{/unless}}>
{{#if list}}
<ul>
{{# list}}
<li class="banner-img" style="background:url({{image img 1920 450}}) no-repeat top center;">
<div class="slide-wrapper">
<ul>
{{# list}}
<li class="banner-img" style="background: {{bgColor}} url({{image img 1920 450}}) no-repeat top center;">
{{#if href}}
<a href="{{href}}"></a>
<a href="{{href}}" target= "_blank"></a>
{{/if}}
</li>
{{/ list}}
</ul>
{{/ list}}
</ul>
</div>
{{^}}
{{#if href}}
<a href="{{href}}"></a>
... ...
/**
* 首页
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/05/31
*/
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload'),
homePage = $('.home-page').data('page'),
brandUrl = $('.logo-brand').data('url');
lazyLoad = require('yoho-jquery-lazyload');
lazyLoad($('img.lazy'));
// require('../header');
// require('../common');
// require('../outlets/channel');
require('../common/slider');
require('../common/slider2');
require('../common/logo-brand');
lazyLoad($('img.lazy'));
if (homePage === 'boys') {
$('.slide-container').slider({
pagination: '.thumb-pagination'
});
} else {
$('.center-col').slider({
orient: false // 左右切换箭头的显示
});
$('.slide-container').slider();
}
if (homePage === 'boys') {
$('.logo-brand').logoBrand({
url: brandUrl
});
$('.img-brand').slider2();
} else {
$('.logo-brand').logoBrand({
showNum: 10,
url: brandUrl
});
$('.img-slider-wrapper').slider2();
}
$('.slide-container').slider({
orient: true
});
... ...
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
var homePage = $('.home-page').data('page'),
brandUrl = $('.logo-brand').data('url');
lazyLoad($('img.lazy'));
// require('../header');
require('../common/slider');
require('../common/slider2');
require('../common/logo-brand');
if (homePage === 'boys') {
$('.slide-container').slider({
pagination: '.thumb-pagination'
});
} else {
$('.center-col').slider({
orient: false // 左右切换箭头的显示
});
$('.slide-container').slider();
}
if (homePage === 'boys') {
$('.logo-brand').logoBrand({
url: brandUrl
});
$('.img-brand').slider2();
} else {
$('.logo-brand').logoBrand({
showNum: 10,
url: brandUrl
});
$('.img-slider-wrapper').slider2();
}
... ...
.outlets-page {
.column-img-tab {
height: 178px;
margin-top: 15px;
li {
width: 380px;
... ... @@ -284,6 +285,10 @@
.main-banner {
height: 360px;
.slide-wrapper {
height: 100%;
}
ul {
width: 100%;
height: 100%;
... ...