Authored by ccbikai(👎🏻🍜)

临时的自定义频道

  1 +/**
  2 + * 自定义频道, 临时方案,暂时写死
  3 + */
  4 +'use strict';
  5 +
  6 +let index = (req, res) => {
  7 + res.render('custom', {
  8 + module: 'channel',
  9 + page: 'custom',
  10 + content_code: req.params.id, // 这是位置码,后边去调用资源位,渲染页面
  11 + title: req.query.title || 'Yoho!Buy 有货',
  12 + downloadLink: 'http://union.yoho.cn/union/downapp.html?union_type=100000000000081'
  13 + });
  14 +};
  15 +
  16 +module.exports = {
  17 + index
  18 +};
@@ -11,6 +11,7 @@ const cRoot = './controllers'; @@ -11,6 +11,7 @@ const cRoot = './controllers';
11 const channel = require(cRoot); 11 const channel = require(cRoot);
12 const cate = require(cRoot + '/cate'); 12 const cate = require(cRoot + '/cate');
13 const brandController = require(`${cRoot}/brand`); 13 const brandController = require(`${cRoot}/brand`);
  14 +const custom = require(`${cRoot}/custom`);
14 15
15 const router = express.Router(); // eslint-disable-line 16 const router = express.Router(); // eslint-disable-line
16 17
@@ -34,4 +35,8 @@ router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删 @@ -34,4 +35,8 @@ router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删
34 // 5.2新楼层功能 35 // 5.2新楼层功能
35 router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态 36 router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态
36 router.post('/channel/userVip', channel.userVip); 37 router.post('/channel/userVip', channel.userVip);
  38 +
  39 +// 自定义频道
  40 +router.get('/channel/:id.html', custom.index);
  41 +
37 module.exports = router; 42 module.exports = router;
  1 +{{!-- 临时方案 --}}
  2 +
  3 +<style>
  4 + html,body {
  5 + width: 100%;
  6 + height: 100%;
  7 + margin: 0;
  8 + padding: 0;
  9 + }
  10 + div {
  11 + margin: 0;
  12 + padding: 0;
  13 + }
  14 + .wrapper {
  15 + position: relative;
  16 + width: 100%;
  17 +
  18 + }
  19 +
  20 + .container {
  21 + position: relative;
  22 + margin: 0 auto;
  23 + }
  24 +
  25 + img {
  26 + width:100%;
  27 + float: left;
  28 + }
  29 +
  30 + ul {
  31 + list-style: none;
  32 + overflow: hidden;
  33 + margin: 0;
  34 + padding: 0;
  35 + }
  36 +
  37 + ul li {
  38 + position: relative;
  39 + width:100%;
  40 + overflow: hidden;
  41 + }
  42 +
  43 + #btn_download {
  44 + position: absolute;
  45 + width: 73%;
  46 + height: 14%;
  47 + top: 75.5%;
  48 + left: 13%;
  49 + }
  50 +</style>
  51 +<div class="wrapper">
  52 + <div class="container">
  53 + <ul>
  54 + <li>
  55 + <img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/01ff33cffc05e280bd701b90801835ad51.jpg?imageView2/2/q/75/">
  56 + <a id="btn_download" href="{{downloadLink}}" target="_blank"></a>
  57 + </li>
  58 + <li>
  59 + <img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/015d6241108a4db156d4153a5645bd283e.jpg?imageView2/2/q/75/">
  60 + </li>
  61 + <li>
  62 + <img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/01651b926f5f22f4b00b6809925e4388a3.jpg?imageView2/2/q/75/">
  63 + </li>
  64 + <li>
  65 + <img src="http://img01.yohoboys.com/staticimg/2017/01/13/10/0157ad8f797d97f10cc21bd30333c5a7c5.jpg?imageView2/2/q/75/">
  66 + </li>
  67 + </ul>
  68 + </div>
  69 +</div>
  1 +require('../common');