Authored by 王水玲

sale 首页

/**
* sale controller
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/5/17
*/
'use strict';
// const mRoot = '../models';
const headerModel = require('../../../doraemon/models/header');
// sale model
// const sale = require(`${mRoot}/sale`);
exports.index = (req, res) => {
res.render('sale', {
devEnv: true,
pageHeader: headerModel.setNavHeader('SALE'),
pageFooter: true
});
};
... ...
... ... @@ -6,13 +6,18 @@
'use strict';
const router = require('express').Router();
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
// 商品详情controller
const detail = require(`${cRoot}/detail`);
// sale controller
const sale = require(`${cRoot}/sale`);
// routers
router.get('/detail/:id/:gid', detail.index);
router.get('/sale', sale.index);
module.exports = router;
... ...
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
</div>
\ No newline at end of file
... ...
{{#if list}}
<div class="banner-top">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper">
{{# list}}
<li class="swiper-slide">
<a href="{{url}}">
<img class="swiper-lazy" data-src="{{img}}">
</a>
<div class="swiper-lazy-preloader"></div>
</li>
{{/ list}}
</ul>
</div>
<div class="swiper-pagination">
<div class="pagination-inner">
</div>
</div>
</div>
{{else}}
<div class="banner-top-single">
<a href={{url}}>
<img class="img" src="{{img}}">
</a>
</div>
{{/if}}
... ...
... ... @@ -42,7 +42,8 @@
"request-promise": "^3.0.0",
"serve-favicon": "^2.3.0",
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.0.1"
"winston-daily-rotate-file": "^1.0.1",
"yoho-handlebars": "0.0.1"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
... ...