Showing
15 changed files
with
374 additions
and
0 deletions
apps/guang/controllers/star.js
0 → 100644
1 | +/** | ||
2 | + * 频道页面 | ||
3 | + * @author: Bi Kai<kai.bi@yoho.cn> | ||
4 | + * @date: 2016/05/09 | ||
5 | + */ | ||
6 | +'use strict'; | ||
7 | + | ||
8 | +// const library = '../../../library'; | ||
9 | +// const channelModel = require('../models/channel'); | ||
10 | +// const _ = require('lodash'); | ||
11 | +// const helpers = require(`${library}/helpers`); | ||
12 | +// const log = require(`${library}/logger`); | ||
13 | + | ||
14 | +/** | ||
15 | + * 星潮教室首页 | ||
16 | + * @param {[object]} req | ||
17 | + * @param {[object]} res | ||
18 | + * @return {[type]} | ||
19 | + */ | ||
20 | +exports.index = (req, res) => { | ||
21 | + res.send('star'); | ||
22 | +}; |
apps/guang/index.js
0 → 100644
1 | +/** | ||
2 | + * sub app guang | ||
3 | + * @author: Bi Kai<kai.bi@yoho.cn> | ||
4 | + * @date: 2016/05/09 | ||
5 | + */ | ||
6 | + | ||
7 | +var express = require('express'), | ||
8 | + path = require('path'), | ||
9 | + hbs = require('express-handlebars'); | ||
10 | + | ||
11 | +var app = express(); | ||
12 | + | ||
13 | +// set view engin | ||
14 | +var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root | ||
15 | + | ||
16 | +app.on('mount', function(parent) { | ||
17 | + delete parent.locals.settings; // 不继承父 App 的设置 | ||
18 | + Object.assign(app.locals, parent.locals); | ||
19 | +}); | ||
20 | + | ||
21 | +app.set('views', path.join(__dirname, 'views/action')); | ||
22 | +app.engine('.hbs', hbs({ | ||
23 | + extname: '.hbs', | ||
24 | + defaultLayout: 'layout', | ||
25 | + layoutsDir: doraemon, | ||
26 | + partialsDir: [path.join(__dirname, 'views/partial'), `${doraemon}/partial`], | ||
27 | + helpers: require(`${global.library}/helpers`) | ||
28 | +})); | ||
29 | + | ||
30 | +// router | ||
31 | +app.use(require('./router')); | ||
32 | + | ||
33 | +module.exports = app; |
apps/guang/router.js
0 → 100644
1 | +/** | ||
2 | + * router of sub app channel | ||
3 | + * @author: Bi Kai<kai.bi@yoho.cn> | ||
4 | + * @date: 2016/05/09 | ||
5 | + */ | ||
6 | + | ||
7 | +'use strict'; | ||
8 | + | ||
9 | +const express = require('express'); | ||
10 | +const cRoot = './controllers'; | ||
11 | +const star = require(cRoot + '/star'); | ||
12 | + | ||
13 | +const router = express.Router(); // eslint-disable-line | ||
14 | + | ||
15 | +router.get('/star', star.index); // 星潮教室首页 | ||
16 | + | ||
17 | +module.exports = router; |
apps/guang/views/action/channel.hbs
0 → 100644
1 | +<div class="mobile-container"> | ||
2 | + <div class="mobile-wrap {{#if boysHomePage}}boys-wrap{{/if}} {{#if girlsHomePage}}girls-wrap{{/if}} {{#if kidsHomePage}}kids-wrap{{/if}} {{#if lifestyleHomePage}}lifestyle-wrap{{/if}} yoho-page"> | ||
3 | + {{! 首页header}} | ||
4 | + {{#homeHeader}} | ||
5 | + {{> channel/home-header}} | ||
6 | + {{/homeHeader}} | ||
7 | + | ||
8 | + {{! 资源位}} | ||
9 | + {{> channel/content}} | ||
10 | + | ||
11 | + {{! 商品列表}} | ||
12 | + {{#if twoColumnGoods}} | ||
13 | + {{> channel/two-column-goods}} | ||
14 | + {{/if}} | ||
15 | + | ||
16 | + {{! 你可能喜欢}} | ||
17 | + {{#if lifestyleHomePage}} | ||
18 | + {{> channel/maybe-like-lifestyle}} | ||
19 | + {{else}} | ||
20 | + {{> channel/maybe-like}} | ||
21 | + {{/if}} | ||
22 | + | ||
23 | + {{! 底部banner}} | ||
24 | + {{#bannerBottom}} | ||
25 | + {{> channel/banner-bottom}} | ||
26 | + {{/bannerBottom}} | ||
27 | + | ||
28 | + {{> channel/footer-tab}} | ||
29 | + | ||
30 | + <div class="overlay"></div> | ||
31 | + </div> | ||
32 | + {{> channel/side-nav}} | ||
33 | +</div> |
apps/guang/views/action/index.hbs
0 → 100644
1 | +<div class="index-page yoho-page"> | ||
2 | + <div class="index-container"> | ||
3 | + <div class="index-header clearfix"> | ||
4 | + <div class="index-logo"> | ||
5 | + </div> | ||
6 | + <div class="box"> | ||
7 | + <a href="javascript:void(0);" class="no-search">取消</a> | ||
8 | + <form action="{{searchUrl}}" class="index-search"> | ||
9 | + <div class="search-box"> | ||
10 | + <input type="hidden" name="from" value="search"> | ||
11 | + <input type="text" name="query" placeholder="搜索" autocomplete="off"> | ||
12 | + <span class="iconfont clear-text"></span> | ||
13 | + <span class="iconfont search-icon empty"></span> | ||
14 | + </div> | ||
15 | + </form> | ||
16 | + </div> | ||
17 | + </div> | ||
18 | + <div class="index-channel"> | ||
19 | + <img class="img" src="{{image background.src 640 800}}"> | ||
20 | + <div class="index-channel-list"> | ||
21 | + {{#each channelList}} | ||
22 | + <a href="{{href}}" class="list-item"> | ||
23 | + {{title}} <span class="lighter">{{entitle}}</span> | ||
24 | + <span class="iconfont right-icon"></span> | ||
25 | + </a> | ||
26 | + {{/each}} | ||
27 | + {{#showYohood}} | ||
28 | + <a href="{{yohoodHref}}" id="yohood" class="list-item"> <span class="iconfont right-icon"></span></a> | ||
29 | + {{/showYohood}} | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | +</div> |
1 | +{{# content}} | ||
2 | + {{! 头部banner}} | ||
3 | + {{#if focus}} | ||
4 | + {{> resources/banner-top}} | ||
5 | + {{/if}} | ||
6 | + {{! 图标入口}} | ||
7 | + {{#if appIconList}} | ||
8 | + {{> resources/icons-enter}} | ||
9 | + {{/if}} | ||
10 | + {{! 中间banner}} | ||
11 | + {{#if singleImage}} | ||
12 | + {{> resources/banner}} | ||
13 | + {{/if}} | ||
14 | + {{! 两个小图}} | ||
15 | + {{#if smallPic}} | ||
16 | + {{> resources/thumb-row}} | ||
17 | + {{/if}} | ||
18 | + {{! 热门品类}} | ||
19 | + {{#if recommendContentFive}} | ||
20 | + {{> resources/hot-category}} | ||
21 | + {{/if}} | ||
22 | + {{! 热门品牌}} | ||
23 | + {{#if appHotBrands}} | ||
24 | + {{> resources/hot-brands-list}} | ||
25 | + {{/if}} | ||
26 | + {{! 热门品牌可滑动}} | ||
27 | + {{#if customBrands}} | ||
28 | + {{> resources/hot-brands-swipe}} | ||
29 | + {{/if}} | ||
30 | + {{! 潮人搭配}} | ||
31 | + {{#if trendsetterCollocation}} | ||
32 | + {{> resources/trendsetter-collocation}} | ||
33 | + {{/if}} | ||
34 | + {{! 潮流话题}} | ||
35 | + {{#if trendgoodsTopic}} | ||
36 | + {{> resources/trend-topics}} | ||
37 | + {{/if}} | ||
38 | + {{! 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装}} | ||
39 | + {{#if recommendContentOne}} | ||
40 | + {{> resources/goods-category}} | ||
41 | + {{/if}} | ||
42 | + {{! 新入住品牌/品味生活/创意生活}} | ||
43 | + {{#if recommendContentTwo}} | ||
44 | + {{> resources/creative-life}} | ||
45 | + {{/if}} | ||
46 | + {{! PLUS}} | ||
47 | + {{#if singleNameImage}} | ||
48 | + {{> resources/plus-star}} | ||
49 | + {{/if}} | ||
50 | + {{! 新人专享}} | ||
51 | + {{#if newUserFloor}} | ||
52 | + {{> resources/fresh-only}} | ||
53 | + {{/if}} | ||
54 | +{{/ content}} |
apps/guang/views/partial/channel/content.hbs
0 → 100644
1 | +{{#content}} | ||
2 | + {{! 头部banner}} | ||
3 | + {{#if focus}} | ||
4 | + {{> resources/banner-top}} | ||
5 | + {{/if}} | ||
6 | + {{! 图标入口}} | ||
7 | + {{#if appIconList}} | ||
8 | + {{> resources/icons-enter}} | ||
9 | + {{/if}} | ||
10 | + {{! 首页公告}} | ||
11 | + {{!-- {{#announcement}} | ||
12 | + {{> resources/notice}} | ||
13 | + {{/announcement}} --}} | ||
14 | + {{! 中间banner}} | ||
15 | + {{#if singleImage}} | ||
16 | + {{> resources/banner}} | ||
17 | + {{/if}} | ||
18 | + {{! 两个小图}} | ||
19 | + {{#if smallPic}} | ||
20 | + {{> resources/thumb-row}} | ||
21 | + {{/if}} | ||
22 | + {{! 热门品类}} | ||
23 | + {{#if recommendContentFive}} | ||
24 | + {{> resources/hot-category}} | ||
25 | + {{/if}} | ||
26 | + {{! 热门品牌}} | ||
27 | + {{#if appHotBrands}} | ||
28 | + {{> resources/hot-brands-list}} | ||
29 | + {{/if}} | ||
30 | + {{! 热门品牌可滑动}} | ||
31 | + {{#if customBrands}} | ||
32 | + {{> resources/hot-brands-swipe}} | ||
33 | + {{/if}} | ||
34 | + {{! 潮人搭配}} | ||
35 | + {{#if trendsetterCollocation}} | ||
36 | + {{> resources/trendsetter-collocation}} | ||
37 | + {{/if}} | ||
38 | + {{! 潮流话题}} | ||
39 | + {{#if trendgoodsTopic}} | ||
40 | + {{> resources/trend-topics}} | ||
41 | + {{/if}} | ||
42 | + {{! 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装}} | ||
43 | + {{#if recommendContentOne}} | ||
44 | + {{> resources/goods-category}} | ||
45 | + {{/if}} | ||
46 | + {{! 新入住品牌/品味生活/创意生活}} | ||
47 | + {{#if recommendContentTwo}} | ||
48 | + {{> resources/creative-life}} | ||
49 | + {{/if}} | ||
50 | + {{! PLUS}} | ||
51 | + {{#if singleNameImage}} | ||
52 | + {{> resources/plus-star}} | ||
53 | + {{/if}} | ||
54 | + {{! 新人专享}} | ||
55 | + {{#if newUserFloor}} | ||
56 | + {{> resources/fresh-only}} | ||
57 | + {{/if}} | ||
58 | +{{/content}} |
1 | +{{#showFooterTab}} | ||
2 | +<div class="footer-tab"> | ||
3 | + <a class="tab-item {{#if grilsHomePage}}current{{/if}}{{#if boysHomePage}}current{{/if}}{{#if kidsHomePage}}current{{/if}}{{#if lifestyleHomePage}}current{{/if}}" href="{{indexUrl}}"> | ||
4 | + <p class="iconfont tab-icon"></p> | ||
5 | + <p class="tab-name">首页</p> | ||
6 | + </a> | ||
7 | + <a class="tab-item {{#if categoryPage}}current{{/if}}" href="{{categoryUrl}}"> | ||
8 | + <p class="iconfont tab-icon"></p> | ||
9 | + <p class="tab-name">分类</p> | ||
10 | + </a> | ||
11 | + <a class="tab-item {{#if guangHome}}current{{/if}}" href="{{guangUrl}}"> | ||
12 | + <p class="iconfont tab-icon"></p> | ||
13 | + <p class="tab-name">逛</p> | ||
14 | + </a> | ||
15 | + <a class="tab-item {{#if shoppingCartPage}}current{{/if}}" href="{{shoppingCartUrl}}"> | ||
16 | + <p class="iconfont tab-icon"></p> | ||
17 | + <p class="tab-name">购物车</p> | ||
18 | + </a> | ||
19 | + <a class="tab-item {{#if minePage}}current{{/if}}" href="{{mineUrl}}"> | ||
20 | + <p class="iconfont tab-icon"></p> | ||
21 | + <p class="tab-name">我的</p> | ||
22 | + </a> | ||
23 | +</div> | ||
24 | +{{/showFooterTab}} |
1 | +<div class="maybe-like"> | ||
2 | + <ul id="maybe-like-nav" class="maybe-like-nav clearfix"> | ||
3 | + <li class="maybe-like-nav-item focus">新品到着</li> | ||
4 | + <li class="maybe-like-nav-item">人气单品</li> | ||
5 | + </ul> | ||
6 | + | ||
7 | + <div id="goods-list"> | ||
8 | + {{# goodsContainer}} | ||
9 | + <div class="goods-list {{^show}}hide{{/show}}"> | ||
10 | + {{# goods}} | ||
11 | + {{> good}} | ||
12 | + {{/ goods}} | ||
13 | + </div> | ||
14 | + {{/ goodsContainer}} | ||
15 | + </div> | ||
16 | + | ||
17 | + <div id="load-more-info" class="load-more-info"> | ||
18 | + <div class="loading status hide"> | ||
19 | + 正在加载... | ||
20 | + </div> | ||
21 | + <span class="no-more status hide">没有更多啦</span> | ||
22 | + </div> | ||
23 | +</div> |
apps/guang/views/partial/channel/search.hbs
0 → 100644
1 | +<div class="side-nav"> | ||
2 | + {{#sideNav}} | ||
3 | + <ul {{#if @first}}class="first"{{/if}}> | ||
4 | + {{#this}} | ||
5 | + <li class="{{lowerCase sortNameEn}}"> | ||
6 | + {{#if sortUrl}} | ||
7 | + <a href="{{sortUrl}}" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | ||
8 | + {{else}} | ||
9 | + <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | ||
10 | + {{/if}} | ||
11 | + {{# sortIco}} | ||
12 | + <span class="nav-img" style="background-image: url({{image . 60 60}})"></span> | ||
13 | + {{/ sortIco}} | ||
14 | + {{^ sortIco}} | ||
15 | + <i class="nav-icon"></i> | ||
16 | + {{/ sortIco}} | ||
17 | + <em>{{sortName}}</em> | ||
18 | + <span class="title">{{sortNameEn}}</span> | ||
19 | + {{# sub}} | ||
20 | + <span class="enter-subnav iconfont"></span> | ||
21 | + {{/ sub}} | ||
22 | + </a> | ||
23 | + {{#if sub}} | ||
24 | + <ul class="sub-nav"> | ||
25 | + {{# sub}} | ||
26 | + <li class="{{# isSelect}}current{{/ isSelect}}" style="background-color:{{bgColor}};"> | ||
27 | + {{#if sortUrl}} | ||
28 | + <a href="{{sortUrl}}" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | ||
29 | + {{else}} | ||
30 | + <a href="javascript:;" style="{{#if sortNameColor}}color:{{sortNameColor}};{{/if}}"> | ||
31 | + {{/if}} | ||
32 | + {{# back}} | ||
33 | + <i class="nav-back iconfont"></i> | ||
34 | + {{/ back}} | ||
35 | + <em>{{sortName}}</em> | ||
36 | + <span class="title">{{sortNameEn}}</span> | ||
37 | + </a> | ||
38 | + </li> | ||
39 | + {{/ sub}} | ||
40 | + </ul> | ||
41 | + {{/if}} | ||
42 | + </li> | ||
43 | + {{/this}} | ||
44 | + </ul> | ||
45 | + {{/sideNav}} | ||
46 | +</div> |
-
Please register or login to post a comment