Authored by 王水玲

星潮教室

/**
* 频道页面
* @author: Bi Kai<kai.bi@yoho.cn>
* @date: 2016/05/09
* 新潮教室
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/05/30
*/
'use strict';
// const library = '../../../library';
// const channelModel = require('../models/channel');
// const _ = require('lodash');
const mRoot = '../models';
const _ = require('lodash');
// const helpers = require(`${library}/helpers`);
// const log = require(`${library}/logger`);
const headerModel = require('../../../doraemon/models/header');
const starModel = require(`${mRoot}/star`);
/**
* 星潮教室首页
... ... @@ -18,5 +21,35 @@
* @return {[type]}
*/
exports.index = (req, res) => {
res.send('star');
let headerData = headerModel.setNavHeader('新潮教室');
let renderData = {
// module: 'product',
// page: 'sale',
title: '新潮教室',
pageHeader: headerData,
pageFooter: true
};
starModel.getIndexData().then((result) => {
res.render('star/index', _.assign(headerData, renderData, {
content: '',
headTab: [
{
cur: true,
url: '',
name: '全部'
},
{
cur: false,
url: '',
name: '星专题'
},
{
cur: false,
url: '',
name: '星搭配'
}
]
}));
});
};
... ...
/**
* 新潮教室
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/05/30
*/
'use strict';
const library = '../../../library';
const utils = '../../../utils';
const resourcesProcess = require(`${utils}/resources-process`);
const ServiceAPI = require(`${library}/api`).ServiceAPI;
const sign = require(`${library}/sign`);
const logger = require(`${library}/logger`);
/**
* 获取资源位数据
* @param {[string]} page
* @return {[array]}
*/
const getResources = (page) => {
const contentCode = {
sale: '7c2b77093421efa8ae9302c91460db73',
breakCode: '7c2b77093421efa8ae9302c91460db73',
vip: '7c2b77093421efa8ae9302c91460db73'
};
return serviceAPI.get('operations/api/v5/resource/get', sign.apiSign({
content_code: contentCode[page]
})).then((result) => {
if (result && result.code === 200) {
return resourcesProcess(result.data);
} else {
logger.error('SALE 页面资源位返回 code 不是 200');
return [];
}
});
};
/**
* 星潮首页
*/
exports.getIndexData = () => {
};
\ No newline at end of file
... ...
<div class="yoho-page">
</div>
<div class="star-page yoho-page">
{{> star/head-tab}}
{{#if focus}}
{{> resources/banner-top}}
{{/if}}
</div>
... ...
<ul class="head-tab">
{{#each headTab}}
<li {{#if cur}} class="cur" {{/if}} ><a href="{{ url }}" data-bp-id="guang_tab_{{name}}_false">{{ name }}</a></li>
{{/each}}
</ul>
\ No newline at end of file
... ...
<ul class="head-tab">
{{#each headTab}}
<li {{#if cur}} class="cur" {{/if}} ><a href="{{ url }}" data-bp-id="guang_tab_{{name}}_false">{{ name }}</a></li>
{{/each}}
</ul>
\ No newline at end of file
... ...
@import "star/index";
\ No newline at end of file
... ...
@import "star";
\ No newline at end of file
... ...
.star-page {
background: #333;
a {
text-decoration: none;
outline: none;
color: #000;
&:link,
&:visited,
&:hover,
&:actived {
color: #000;
}
}
*:focus {
outline: none;
}
.font-bold {
font-weight: bold;
}
.head-tab {
width: 100%;
height: 88px;
background: #000;
li {
width: 33.3%;
text-align: center;
float: left;
line-height: 88px;
font-size: 30px;
a {
color: #b0b0b0;
display: inline-block;
}
&.cur a{
color: #fff;
}
}
}
.banner-top {
width: 100%;
height: 310px;
margin-top: 30px;
position: relative;
.banner-swiper {
width: 100%;
height: 310px;
overflow: hidden;
position: relative;
ul {
position: relative;
height: 310px;
li {
float: left;
width: 100%;
height: 310px;
}
img {
width: 100%;
height: 100%;
}
}
}
.swiper-pagination {
position: absolute;
left: 0;
right: 0;
bottom: 20px;
text-align: center;
z-index: 1;
.pagination-inner {
display: inline-block;
}
span {
display: inline-block;
width: 14px;
height: 14px;
background: #fff;
opacity: 0.5;
margin: 0 10px;
border-radius: 50%;
}
.swiper-pagination-bullet-active {
background: #fff;
opacity: 1;
}
}
}
}
/*.yoho-header .nav-title {
font-weight: normal;
}
.star-class-body {
background: #333;
width: 100%;
font: 12px/1.5 Arial,'黑体';
float: left;
}*/
... ...
... ... @@ -9,3 +9,4 @@
@import "product/index";
@import "common/index";
@import "cart/chose-panel";
@import "guang/index";
... ...