Authored by ccbikai(👎🏻🍜)

临时的自定义频道

/**
* 自定义频道, 临时方案,暂时写死
*/
'use strict';
let index = (req, res) => {
res.render('custom', {
module: 'channel',
page: 'custom',
content_code: req.params.id, // 这是位置码,后边去调用资源位,渲染页面
title: req.query.title || 'Yoho!Buy 有货',
downloadLink: 'http://union.yoho.cn/union/downapp.html?union_type=100000000000081'
});
};
module.exports = {
index
};
... ...
... ... @@ -11,6 +11,7 @@ const cRoot = './controllers';
const channel = require(cRoot);
const cate = require(cRoot + '/cate');
const brandController = require(`${cRoot}/brand`);
const custom = require(`${cRoot}/custom`);
const router = express.Router(); // eslint-disable-line
... ... @@ -34,4 +35,8 @@ router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删
// 5.2新楼层功能
router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态
router.post('/channel/userVip', channel.userVip);
// 自定义频道
router.get('/channel/:id.html', custom.index);
module.exports = router;
... ...
{{!-- 临时方案 --}}
<style>
html,body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
div {
margin: 0;
padding: 0;
}
.wrapper {
position: relative;
width: 100%;
}
.container {
position: relative;
margin: 0 auto;
}
img {
width:100%;
float: left;
}
ul {
list-style: none;
overflow: hidden;
margin: 0;
padding: 0;
}
ul li {
position: relative;
width:100%;
overflow: hidden;
}
#btn_download {
position: absolute;
width: 73%;
height: 14%;
top: 75.5%;
left: 13%;
}
</style>
<div class="wrapper">
<div class="container">
<ul>
<li>
<img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/01ff33cffc05e280bd701b90801835ad51.jpg?imageView2/2/q/75/">
<a id="btn_download" href="{{downloadLink}}" target="_blank"></a>
</li>
<li>
<img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/015d6241108a4db156d4153a5645bd283e.jpg?imageView2/2/q/75/">
</li>
<li>
<img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/01651b926f5f22f4b00b6809925e4388a3.jpg?imageView2/2/q/75/">
</li>
<li>
<img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/0157ad8f797d97f10cc21bd30333c5a7c5.jpg?imageView2/2/q/75/">
</li>
</ul>
</div>
</div>
... ...
require('../common');
... ...