Authored by biao

Merge branch 'develop' into feature/my-order

@@ -6,97 +6,158 @@ @@ -6,97 +6,158 @@
6 6
7 'use strict'; 7 'use strict';
8 8
  9 +const editorialModel = require('../models/editorial');
  10 +
9 const index = (req, res) => { 11 const index = (req, res) => {
10 var pageNum = req.query.page || 1; 12 var pageNum = req.query.page || 1;
11 13
12 - res.display('index', {  
13 - module: 'editorial',  
14 - page: 'index',  
15 - title: '资讯',  
16 - editorial: {  
17 - nav: [  
18 - {  
19 - link: '/editorial?type=0',  
20 - pathTitle: '首页',  
21 - name: 'MEN首页'  
22 - },  
23 - {  
24 - link: '/editorial?type=1',  
25 - pathTitle: '资讯',  
26 - name: '咨询'  
27 - },  
28 - {  
29 - link: '/',  
30 - pathTitle: '资讯',  
31 - name: '咨询' 14 + editorialModel.getIndexData().then((result) => {
  15 + res.display('index', {
  16 + module: 'editorial',
  17 + page: 'index',
  18 + title: '资讯',
  19 + editorial: {
  20 + nav: [
  21 + {
  22 + link: '/editorial?type=0',
  23 + pathTitle: '首页',
  24 + name: 'MEN首页'
  25 + },
  26 + {
  27 + link: '/editorial?type=1',
  28 + pathTitle: '资讯',
  29 + name: '咨询'
  30 + },
  31 + {
  32 + link: '/',
  33 + pathTitle: '资讯',
  34 + name: '咨询'
  35 + }
  36 + ],
  37 + msgTypes: result,
  38 + msg: [
  39 + {
  40 + id: '1',
  41 + msgLeft: '潮品',
  42 + msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
  43 + img: '',
  44 + msgContent: '鞋款定价回复即可老地方了服务',
  45 + time: '2016/05/25 19:36',
  46 + liked: true,
  47 + like: '8'
  48 + },
  49 + {
  50 + id: '2',
  51 + msgLeft: '潮品',
  52 + msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
  53 + img: '',
  54 + msgContent: '鞋款定价回复即可老地方了服务',
  55 + time: '2016/05/25 19:36',
  56 + liked: true,
  57 + like: '8'
  58 + }
  59 + ],
  60 + paginationOpts: {
  61 + page: pageNum, // current page: http://host/?page=2
  62 + limit: 10, // per_page records' number
  63 + totalRows: 100 // total page number
32 } 64 }
33 - ],  
34 - msgTypes: [  
35 - {  
36 - typeId: '0',  
37 - isActive: true,  
38 - href: '#',  
39 - type: '最新'  
40 - },  
41 - {  
42 - typeId: '1',  
43 - isActive: false,  
44 - href: '#',  
45 - type: '话题'  
46 - },  
47 - {  
48 - typeId: '2',  
49 - isActive: false,  
50 - href: '#',  
51 - type: '搭配'  
52 - },  
53 - {  
54 - typeId: '3',  
55 - isActive: false,  
56 - href: '#',  
57 - type: '潮人'  
58 - },  
59 - {  
60 - typeId: '4',  
61 - isActive: false,  
62 - href: '#',  
63 - type: '潮品'  
64 - }  
65 - ],  
66 - msg: [  
67 - {  
68 - id: '1',  
69 - msgLeft: '潮品',  
70 - msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',  
71 - img: '',  
72 - msgContent: '鞋款定价回复即可老地方了服务',  
73 - time: '2016/05/25 19:36',  
74 - liked: true,  
75 - like: '8'  
76 - },  
77 - {  
78 - id: '2',  
79 - msgLeft: '潮品',  
80 - msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',  
81 - img: '',  
82 - msgContent: '鞋款定价回复即可老地方了服务',  
83 - time: '2016/05/25 19:36',  
84 - liked: true,  
85 - like: '8'  
86 - }  
87 - ],  
88 - paginationOpts: {  
89 - page: pageNum, // current page: http://host/?page=2  
90 - limit: 10, // per_page records' number  
91 - totalRows: 100 // total page number 65 + },
  66 + helpers: {
  67 + // import component, path depends on your project
  68 + pagination: require('../../../doraemon/components/pagination/pagination').createPagination
92 } 69 }
93 - },  
94 - helpers: {  
95 - // import component, path depends on your project  
96 - pagination: require('../../../doraemon/components/pagination/pagination').createPagination  
97 - }  
98 - 70 + });
99 }); 71 });
  72 +
  73 + // res.display('index', {
  74 + // module: 'editorial',
  75 + // page: 'index',
  76 + // title: '资讯',
  77 + // editorial: {
  78 + // nav: [
  79 + // {
  80 + // link: '/editorial?type=0',
  81 + // pathTitle: '首页',
  82 + // name: 'MEN首页'
  83 + // },
  84 + // {
  85 + // link: '/editorial?type=1',
  86 + // pathTitle: '资讯',
  87 + // name: '咨询'
  88 + // },
  89 + // {
  90 + // link: '/',
  91 + // pathTitle: '资讯',
  92 + // name: '咨询'
  93 + // }
  94 + // ],
  95 + // msgTypes: [
  96 + // {
  97 + // typeId: '0',
  98 + // isActive: true,
  99 + // href: '#',
  100 + // type: '最新'
  101 + // },
  102 + // {
  103 + // typeId: '1',
  104 + // isActive: false,
  105 + // href: '#',
  106 + // type: '话题'
  107 + // },
  108 + // {
  109 + // typeId: '2',
  110 + // isActive: false,
  111 + // href: '#',
  112 + // type: '搭配'
  113 + // },
  114 + // {
  115 + // typeId: '3',
  116 + // isActive: false,
  117 + // href: '#',
  118 + // type: '潮人'
  119 + // },
  120 + // {
  121 + // typeId: '4',
  122 + // isActive: false,
  123 + // href: '#',
  124 + // type: '潮品'
  125 + // }
  126 + // ],
  127 + // msg: [
  128 + // {
  129 + // id: '1',
  130 + // msgLeft: '潮品',
  131 + // msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
  132 + // img: '',
  133 + // msgContent: '鞋款定价回复即可老地方了服务',
  134 + // time: '2016/05/25 19:36',
  135 + // liked: true,
  136 + // like: '8'
  137 + // },
  138 + // {
  139 + // id: '2',
  140 + // msgLeft: '潮品',
  141 + // msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
  142 + // img: '',
  143 + // msgContent: '鞋款定价回复即可老地方了服务',
  144 + // time: '2016/05/25 19:36',
  145 + // liked: true,
  146 + // like: '8'
  147 + // }
  148 + // ],
  149 + // paginationOpts: {
  150 + // page: pageNum, // current page: http://host/?page=2
  151 + // limit: 10, // per_page records' number
  152 + // totalRows: 100 // total page number
  153 + // }
  154 + // },
  155 + // helpers: {
  156 + // // import component, path depends on your project
  157 + // pagination: require('../../../doraemon/components/pagination/pagination').createPagination
  158 + // }
  159 +
  160 + // });
100 }; 161 };
101 162
102 const list = (req, res) => { 163 const list = (req, res) => {
1 -// 'use strict'; 1 +'use strict';
  2 +const serviceAPI = global.yoho.ServiceAPI;
  3 +const camelCase = global.yoho.camelCase;
  4 +const _ = require('lodash');
2 5
3 -// const serviceAPI = new ServiceAPI(); 6 +const _processIndexData = (list) => {
  7 + let formatData = [];
4 8
5 -// const _processIndexData = (list) => {  
6 -// const formatData = []; 9 + list = list || [];
  10 + list = camelCase(list);
7 11
8 -// list = list || {};  
9 -// list = camelCase(list); 12 + _.forEach(list, (data, index) => {
  13 + // data.url = `//guang.yohobuy.com/index/index?type=${data.id}`;
  14 + data.url = `//127.0.0.1:6003/editorial?type=${data.id}`;
  15 + if (index === 0) {
  16 + data.isActive = true;
  17 + } else {
  18 + data.isActive = false;
  19 + }
10 20
11 -// if (list.ads) {  
12 -// _.forEach(list.data, (data) => {  
13 -// formatData.ads.push({  
14 -// href:  
15 -// });  
16 -// });  
17 -// } 21 + formatData.push(data);
  22 + });
18 23
19 -// } 24 + return formatData;
  25 +};
20 26
21 -// const getIndexData = () => {  
22 -// return serviceAPI.get('guang/api/v1/category/get', sign.apiSign().then((result) => {  
23 -// if (result && result.code === 200) {  
24 -// return _processIndexData(result.data);  
25 -// } else {  
26 -// logger.error('资讯首页数据返回 code 不是 200');  
27 -// return {};  
28 -// }  
29 -// });  
30 -// }; 27 +const getIndexData = () => {
  28 + return serviceAPI.get('guang/api/v1/category/get', {}).then((result) => {
  29 + if (result && result.code === 200) {
  30 + return _processIndexData(result.data);
  31 + } else {
  32 + logger.error('资讯首页数据返回 code 不是 200');
  33 + return {};
  34 + }
  35 + });
  36 +};
31 37
32 -// module.exports = {  
33 -// getIndexData: getIndexData  
34 -// }; 38 +module.exports = {
  39 + getIndexData
  40 +};
@@ -11,6 +11,6 @@ const cRoot = './controllers'; @@ -11,6 +11,6 @@ const cRoot = './controllers';
11 const editorial = require(cRoot + '/editorial'); 11 const editorial = require(cRoot + '/editorial');
12 12
13 router.get('/', editorial.index); // 咨询首页 13 router.get('/', editorial.index); // 咨询首页
14 -router.get('/list', editorial.list); // 咨询列表页 14 +// router.get('/list', editorial.list); // 咨询列表页
15 15
16 module.exports = router; 16 module.exports = router;
@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 <div class="index-content"> 5 <div class="index-content">
6 <ul class="msg-nav"> 6 <ul class="msg-nav">
7 {{# msgTypes}} 7 {{# msgTypes}}
8 - <li data-type="{{typeId}}" {{#if isActive}}class="active"{{/if}}>  
9 - <a class="pjax-link" href="{{href}}">{{type}}</a> 8 + <li data-type="{{id}}" {{#if isActive}}class="active"{{/if}}>
  9 + <a class="pjax-link" href="{{url}}">{{name}}</a>
10 </li> 10 </li>
11 {{/ msgTypes}} 11 {{/ msgTypes}}
12 </ul> 12 </ul>
@@ -3,89 +3,98 @@ @@ -3,89 +3,98 @@
3 3
4 const _ = require('lodash'); 4 const _ = require('lodash');
5 const Search = require('../models/list'); 5 const Search = require('../models/list');
  6 +const BrandData = require('../models/brand-service');
6 const camelCase = global.yoho.camelCase; 7 const camelCase = global.yoho.camelCase;
  8 +const DateHelper = require('../models/helpers');
7 9
8 -function brandLetters() {  
9 - let letters = []; 10 +function newFilter(key, value, name) {
  11 + return {
  12 + key: key,
  13 + value: value,
  14 + name: name
  15 + };
  16 +}
  17 +
  18 +function filterHandle(filter, q) {
  19 + let priceRange = filter.priceRange;
  20 + let sizeInfo = filter.size;
  21 + let genders = DateHelper.genders();
  22 + let brands = filter.brand;
  23 + let colors = DateHelper.colorConver(filter.color);
  24 + let sorts = filter.groupSort;
  25 + let filters = [];
  26 +
  27 + genders.forEach(g => {
  28 + if (g.value === q.gender) {
  29 + g.checked = true;
  30 + filters.push(newFilter('gender', q.gender, g.name));
  31 + }
  32 + });
  33 +
  34 + priceRange = Object.keys(priceRange).map((k) => {
  35 + let prices = k.split(',');
10 36
11 - letters.push({  
12 - letter: '0-9',  
13 - selected: false 37 + if (k === q.price) {
  38 + filters.push(newFilter('price', q.price, ${prices[0]}-¥${prices[1]}`));
  39 + }
  40 + return {
  41 + lower: prices[0],
  42 + higher: prices[1]
  43 + };
  44 + }).sort((a, b) => {
  45 + return a.lower - b.lower;
14 }); 46 });
15 47
16 - for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {  
17 - letters.push({  
18 - letter: String.fromCharCode(i),  
19 - selected: false 48 + if (!_.isArray(sizeInfo)) {
  49 + sizeInfo.checked = true;
  50 + sizeInfo = [sizeInfo];
  51 + }
  52 +
  53 + if (q.size) {
  54 + sizeInfo.forEach(s => {
  55 + if (s.sizeId === parseInt(q.size, 10)) {
  56 + filters.push(newFilter('size', q.size, s.sizeName));
  57 + }
20 }); 58 });
21 } 59 }
22 60
23 - return letters;  
24 -} 61 + if (q.brand) {
  62 + let brandNames = brands.filter(b => {
  63 + return (',' + q.brand + ',').indexOf(',' + b.id + ',') >= 0;
  64 + }).map(b => {
  65 + return b.brandName;
  66 + }).join('、');
25 67
26 -function peopleChoose() {  
27 - return [  
28 - {  
29 - name: '男士',  
30 - value: '1,3'  
31 - }, {  
32 - name: '女士',  
33 - value: '2,3'  
34 - }];  
35 -} 68 + filters.push(newFilter('brand', q.brand, brandNames));
  69 + }
36 70
37 -function colorConver(colors) {  
38 - return colors.map(c => {  
39 - return {  
40 - id: c.colorId,  
41 - title: c.colorName,  
42 - rgb: c.colorValue || '#' + c.colorCode  
43 - };  
44 - });  
45 -} 71 + if (q.color) {
  72 + colors.forEach(c => {
  73 + if (c.id === parseInt(q.color, 10)) {
  74 + c.cur = true;
46 75
47 -function newFilter(key, value, name) {  
48 - return {  
49 - key: key,  
50 - value: value,  
51 - name: name  
52 - };  
53 -} 76 + let fi = newFilter('color', q.color, c.title);
54 77
55 -function getNav(channel, sort, sorts) {  
56 - let nav = [{  
57 - link: '#',  
58 - pathTitle: '',  
59 - name: 'MEN首页'  
60 - }];  
61 -  
62 - if (sort) {  
63 - sorts.forEach(s => {  
64 - if (s.relationParameter.sort === sort) {  
65 - nav.push({  
66 - link: '#',  
67 - pathTitle: '',  
68 - name: s.categoryName  
69 - });  
70 - } else if (s.sub) {  
71 - s.sub.forEach(m => {  
72 - if (m.relationParameter.sort === sort) {  
73 - nav.push({  
74 - link: '#',  
75 - pathTitle: '',  
76 - name: s.categoryName  
77 - });  
78 - nav.push({  
79 - link: '#',  
80 - pathTitle: '',  
81 - name: m.categoryName  
82 - });  
83 - }  
84 - }); 78 + fi.color = c;
  79 + filters.push(fi);
85 } 80 }
86 }); 81 });
87 } 82 }
88 - return nav; 83 +
  84 + return {
  85 + people: genders,
  86 + sortData: sorts,
  87 + brandData: brands,
  88 + colors: colors,
  89 + size: sizeInfo,
  90 + priceRange: priceRange,
  91 + filters: filters,
  92 + showFilters: filters.length > 0,
  93 + letters: DateHelper.brandLetters(),
  94 + navPath: {
  95 + nav: DateHelper.getNav('', q.sort, sorts)
  96 + }
  97 + };
89 } 98 }
90 99
91 const list = { 100 const list = {
@@ -99,6 +108,18 @@ const list = { @@ -99,6 +108,18 @@ const list = {
99 let color = req.query.color || ''; 108 let color = req.query.color || '';
100 let order = req.query.order || ''; 109 let order = req.query.order || '';
101 110
  111 + let retDate = {
  112 + module: 'product',
  113 + page: 'list',
  114 + title: '列表'
  115 + };
  116 +
  117 + if (brand) {
  118 + BrandData.getBannerInfoAsync(brand).then(brandInfo => {
  119 + console.log(brandInfo);
  120 + });
  121 + }
  122 +
102 Search.queryProduct({ 123 Search.queryProduct({
103 page: page, 124 page: page,
104 brand: brand, 125 brand: brand,
@@ -112,108 +133,21 @@ const list = { @@ -112,108 +133,21 @@ const list = {
112 133
113 if (result && result.code === 200 && result.data) { 134 if (result && result.code === 200 && result.data) {
114 let data = camelCase(result.data); 135 let data = camelCase(result.data);
115 - let ret = {};  
116 136
117 if (data.filter) { 137 if (data.filter) {
118 - let priceRange = data.filter.priceRange;  
119 - let sizeInfo = data.filter.size;  
120 - let genders = peopleChoose(gender);  
121 - let brands = data.filter.brand;  
122 - let colors = colorConver(data.filter.color);  
123 - let sorts = data.filter.groupSort;  
124 - let filters = [];  
125 -  
126 - genders.forEach(g => {  
127 - if (g.value === gender) {  
128 - g.checked = true;  
129 - filters.push(newFilter('gender', gender, g.name));  
130 - }  
131 - });  
132 -  
133 - priceRange = Object.keys(priceRange).map((k) => {  
134 - let prices = k.split(',');  
135 -  
136 - if (k === price) {  
137 - filters.push(newFilter('price', price, ${prices[0]}-¥${prices[1]}`));  
138 - }  
139 - return {  
140 - lower: prices[0],  
141 - higher: prices[1]  
142 - };  
143 - }).sort((a, b) => {  
144 - return a.lower - b.lower;  
145 - });  
146 -  
147 - if (!_.isArray(sizeInfo)) {  
148 - sizeInfo.checked = true;  
149 - sizeInfo = [sizeInfo];  
150 - }  
151 -  
152 - if (size) {  
153 - sizeInfo.forEach(s => {  
154 - if (s.sizeId === parseInt(size)) {  
155 - filters.push(newFilter('size', size, s.sizeName));  
156 - }  
157 - });  
158 - }  
159 -  
160 - if (brand) {  
161 - let brandNames = brands.filter(b => {  
162 - return (',' + brand + ',').indexOf(',' + b.id + ',') >= 0;  
163 - }).map(b => {  
164 - return b.brandName;  
165 - }).join('、');  
166 -  
167 - filters.push(newFilter('brand', brand, brandNames));  
168 - }  
169 -  
170 - if (color) {  
171 - colors.forEach(c => {  
172 - if (c.id === parseInt(color)) {  
173 - c.cur = true;  
174 -  
175 - let fi = newFilter('color', color, c.title);  
176 -  
177 - fi.color = c;  
178 - filters.push(fi);  
179 - }  
180 - });  
181 - }  
182 -  
183 - ret = {  
184 - people: genders,  
185 - sortData: sorts,  
186 - brandData: brands,  
187 - colors: colors,  
188 - size: sizeInfo,  
189 - priceRange: priceRange,  
190 - filters: filters,  
191 - showFilters: filters.length > 0,  
192 - navPath: {  
193 - nav: getNav('', sort, sorts)  
194 - }  
195 - }; 138 + retDate.filter = filterHandle(data.filter, req.query);
196 } 139 }
197 140
198 - let pagination = { 141 + retDate.paginationData = {
199 page: page, 142 page: page,
200 limit: data.limit || 45, 143 limit: data.limit || 45,
201 - total: data.total  
202 - };  
203 -  
204 - console.log(pagination);  
205 -  
206 - res.display('list', _.assign(ret, {  
207 - letters: brandLetters(),  
208 total: data.total, 144 total: data.total,
209 pageTotal: data.pageTotal, 145 pageTotal: data.pageTotal,
210 - pageNo: data.page, 146 + queryParams: req.query
  147 + };
  148 + res.display('list', _.assign(retDate, {
211 products: data.productList, 149 products: data.productList,
212 - pagination: pagination,  
213 - order: order,  
214 - module: 'product',  
215 - page: 'list',  
216 - title: '列表' 150 + order: order
217 })); 151 }));
218 } else { 152 } else {
219 return Promise.reject('query product error'); 153 return Promise.reject('query product error');
  1 +/**
  2 + * @author: jiangfeng<jeff.jiang@yoho.cn>
  3 + */
  4 +
  5 +'use strict';
  6 +
  7 +const api = global.yoho.API;
  8 +
  9 +const getBannerInfoAsync = bid => {
  10 + return api.get('', {
  11 + method: 'web.brand.banner',
  12 + brand_id: bid
  13 + });
  14 +
  15 +};
  16 +
  17 +const getBrandLogoByDomainAsync = domain => {
  18 + return api.get('', {
  19 + domain: domain,
  20 + method: 'web.brand.byDomain'
  21 + });
  22 +};
  23 +
  24 +module.exports = {
  25 + getBannerInfoAsync,
  26 + getBrandLogoByDomainAsync
  27 +};
  1 +/**
  2 + * Created by TaoHuang on 2016/6/14.
  3 + */
  4 +'use strict';
  5 +
  6 +const Promise = require('bluebird');
  7 +const co = Promise.coroutine;
  8 +const api = require('./brand-api');
  9 +const camelCase = global.yoho.camelCase;
  10 +
  11 +const getBrandByDomainAsync = domain => {
  12 + return co(function*() {
  13 + let brandInfo = yield api.getBrandLogoByDomainAsync(domain);
  14 +
  15 + if (!brandInfo.data || brandInfo.code !== 200) {
  16 + return {};
  17 + }
  18 +
  19 + return camelCase(brandInfo.data);
  20 + })();
  21 +};
  22 +
  23 +const getBannerInfoAsync = bid => {
  24 + return co(function*() {
  25 + let brandInfo = yield api.getBannerInfoAsync(bid);
  26 +
  27 + if (!brandInfo.data || brandInfo.code !== 200) {
  28 + return {};
  29 + }
  30 +
  31 + return camelCase(brandInfo.data);
  32 + })();
  33 +};
  34 +
  35 +module.exports = {
  36 + getBrandByDomainAsync,
  37 + getBannerInfoAsync: getBannerInfoAsync
  38 +};
  1 +'use strict';
  2 +
  3 +const helpers = {
  4 + brandLetters() {
  5 + let letters = [];
  6 +
  7 + letters.push({
  8 + letter: '0-9',
  9 + selected: false
  10 + });
  11 +
  12 + for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  13 + letters.push({
  14 + letter: String.fromCharCode(i),
  15 + selected: false
  16 + });
  17 + }
  18 +
  19 + return letters;
  20 + },
  21 +
  22 + genders() {
  23 + return [
  24 + {
  25 + name: '男士',
  26 + value: '1,3'
  27 + }, {
  28 + name: '女士',
  29 + value: '2,3'
  30 + }];
  31 + },
  32 +
  33 + colorConver(colors) {
  34 + return colors.map(c => {
  35 + return {
  36 + id: c.colorId,
  37 + title: c.colorName,
  38 + rgb: c.colorValue || '#' + c.colorCode
  39 + };
  40 + });
  41 + },
  42 +
  43 + getNav(channel, sort, sorts) {
  44 + let nav = [{
  45 + link: '#',
  46 + pathTitle: '',
  47 + name: 'MEN首页'
  48 + }];
  49 +
  50 + if (sort) {
  51 + sorts.forEach(s => {
  52 + if (s.relationParameter.sort === sort) {
  53 + nav.push({
  54 + link: '#',
  55 + pathTitle: '',
  56 + name: s.categoryName
  57 + });
  58 + } else if (s.sub) {
  59 + s.sub.forEach(m => {
  60 + if (m.relationParameter.sort === sort) {
  61 + nav.push({
  62 + link: '#',
  63 + pathTitle: '',
  64 + name: s.categoryName
  65 + });
  66 + nav.push({
  67 + link: '#',
  68 + pathTitle: '',
  69 + name: m.categoryName
  70 + });
  71 + }
  72 + });
  73 + }
  74 + });
  75 + }
  76 + return nav;
  77 + }
  78 +};
  79 +
  80 +module.exports = helpers;
1 <div class="blk-page yoho-product-list"> 1 <div class="blk-page yoho-product-list">
2 <div class="center-content"> 2 <div class="center-content">
3 - {{# navPath}} 3 + {{# filter.navPath}}
4 {{> path-nav}} 4 {{> path-nav}}
5 - {{/ navPath}} 5 + {{/ filter.navPath}}
6 </div> 6 </div>
7 <div class="center-content clearfix"> 7 <div class="center-content clearfix">
8 <div class="left"> 8 <div class="left">
9 {{!-- 筛选区域 --}} 9 {{!-- 筛选区域 --}}
  10 + {{#filter}}
10 {{> list/filter}} 11 {{> list/filter}}
  12 + {{/filter}}
11 </div> 13 </div>
12 <div class="right"> 14 <div class="right">
13 {{!-- 已选中条件 --}} 15 {{!-- 已选中条件 --}}
  16 + {{#filter}}
14 {{> list/filter-area}} 17 {{> list/filter-area}}
  18 + {{/filter}}
15 {{!-- 排序 --}} 19 {{!-- 排序 --}}
16 {{> list/order-area}} 20 {{> list/order-area}}
17 {{!-- 商品列表 --}} 21 {{!-- 商品列表 --}}
18 {{> list/goods-box}} 22 {{> list/goods-box}}
19 {{!-- 分页 --}} 23 {{!-- 分页 --}}
20 - {{{ pagination pagination }}} 24 + {{{ pagination paginationData }}}
21 </div> 25 </div>
22 </div> 26 </div>
23 </div> 27 </div>
@@ -7,20 +7,22 @@ @@ -7,20 +7,22 @@
7 <span class="iconfont down s_p_desc {{#isEqual order 's_p_desc'}}selected{{/isEqual}}">&#xe616;</span> 7 <span class="iconfont down s_p_desc {{#isEqual order 's_p_desc'}}selected{{/isEqual}}">&#xe616;</span>
8 </div> 8 </div>
9 9
  10 + {{#paginationData}}
10 <div class="right"> 11 <div class="right">
11 <label> 12 <label>
12 <span>{{total}}</span>件商品 13 <span>{{total}}</span>件商品
13 </label> 14 </label>
14 - <label class="page-info"><span class="cur-page">{{pageNo}}</span>/<span class="total-page">{{pageTotal}}</span></label>  
15 - {{#isEqual pageNo 1}} 15 + <label class="page-info"><span class="cur-page">{{page}}</span>/<span class="total-page">{{pageTotal}}</span></label>
  16 + {{#isEqual page 1}}
16 <span class="iconfont page disable page-pre">&#xe607;</span> 17 <span class="iconfont page disable page-pre">&#xe607;</span>
17 {{^}} 18 {{^}}
18 <span class="iconfont page page-pre">&#xe607;</span> 19 <span class="iconfont page page-pre">&#xe607;</span>
19 {{/isEqual}} 20 {{/isEqual}}
20 - {{#isEqual pageNo pageTotal}} 21 + {{#isEqual page pageTotal}}
21 <span class="iconfont page disable page-next">&#xe61e;</span> 22 <span class="iconfont page disable page-next">&#xe61e;</span>
22 {{^}} 23 {{^}}
23 <span class="iconfont page page-next">&#xe61e;</span> 24 <span class="iconfont page page-next">&#xe61e;</span>
24 {{/isEqual}} 25 {{/isEqual}}
25 </div> 26 </div>
  27 + {{/paginationData}}
26 </div> 28 </div>
@@ -19,7 +19,7 @@ module.exports = { @@ -19,7 +19,7 @@ module.exports = {
19 }, 19 },
20 cookieDomain: 'yohoblk.com', 20 cookieDomain: 'yohoblk.com',
21 domains: { 21 domains: {
22 - api: 'http://api.yoho.yohoops.org/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078 22 + api: 'http://devapi.yoho.cn:58078/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
23 service: 'http://devservice.yoho.cn:28077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077 23 service: 'http://devservice.yoho.cn:28077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
24 search: 'http://192.168.102.216:8080/yohosearch/' 24 search: 'http://192.168.102.216:8080/yohosearch/'
25 }, 25 },
@@ -15,4 +15,5 @@ module.exports = app => { @@ -15,4 +15,5 @@ module.exports = app => {
15 app.use('/', require('./apps/channel')); // 频道页 15 app.use('/', require('./apps/channel')); // 频道页
16 app.use('/me', require('./apps/me')); // 个人中心 16 app.use('/me', require('./apps/me')); // 个人中心
17 app.use('/editorial', require('./apps/editorial')); // 资讯 17 app.use('/editorial', require('./apps/editorial')); // 资讯
  18 + app.use('/product', require('./apps/product'));
18 }; 19 };
@@ -33,7 +33,7 @@ exports.createPagination = function(pagination, options) { @@ -33,7 +33,7 @@ exports.createPagination = function(pagination, options) {
33 queryParams = '', // paginate with query parameter 33 queryParams = '', // paginate with query parameter
34 page = parseInt(pagination.page, 10), // current page number 34 page = parseInt(pagination.page, 10), // current page number
35 leftText = '<i class="iconfont">&#xe607;</i>', // prev 35 leftText = '<i class="iconfont">&#xe607;</i>', // prev
36 - rightText = '<i class="iconfont">&#xe606;</i>', // next 36 + rightText = '<i class="iconfont">&#xe61e;</i>', // next
37 paginationClass = 'blk-pagination'; // pagination <ul> default class 37 paginationClass = 'blk-pagination'; // pagination <ul> default class
38 38
39 var pageCount, 39 var pageCount,
No preview for this file type
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Thu Jul 7 09:08:20 2016 5 +Created by FontForge 20120731 at Thu Jul 7 17:43:49 2016
6 By admin 6 By admin
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Jul 7 09:08:20 2016 @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Jul 7 09:08:20 2016
19 bbox="0 -224 1303 896.303" 19 bbox="0 -224 1303 896.303"
20 underline-thickness="50" 20 underline-thickness="50"
21 underline-position="-100" 21 underline-position="-100"
22 - unicode-range="U+0078-E632" 22 + unicode-range="U+0078-E638"
23 /> 23 />
24 <missing-glyph horiz-adv-x="374" 24 <missing-glyph horiz-adv-x="374"
25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> 25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
@@ -130,8 +130,6 @@ d="M361 194q45 -63 81 -152h143q42 68 75 152l82 -29q-32 -69 -70 -123h202v-71h-724 @@ -130,8 +130,6 @@ d="M361 194q45 -63 81 -152h143q42 68 75 152l82 -29q-32 -69 -70 -123h202v-71h-724
130 <glyph glyph-name="uniE624" unicode="&#xe624;" 130 <glyph glyph-name="uniE624" unicode="&#xe624;"
131 d="M897 -212h-770q-44 0 -71 34.5t-21 82.5l89 598q3 31 30 52.5t61 21.5h51q4 111 73 173t171.5 62t171 -62t73.5 -173h54q34 0 61 -21.5t30 -52.5l89 -598q6 -48 -21 -82.5t-71 -34.5zM230 406q0 -25 18 -43t43 -18t42.5 18t17.5 43t-17.5 42.5t-42.5 17.5t-43 -17.5 131 d="M897 -212h-770q-44 0 -71 34.5t-21 82.5l89 598q3 31 30 52.5t61 21.5h51q4 111 73 173t171.5 62t171 -62t73.5 -173h54q34 0 61 -21.5t30 -52.5l89 -598q6 -48 -21 -82.5t-71 -34.5zM230 406q0 -25 18 -43t43 -18t42.5 18t17.5 43t-17.5 42.5t-42.5 17.5t-43 -17.5
132 t-18 -42.5zM510 767q-87 0 -144.5 -49t-61.5 -141h412q-4 92 -61.5 141t-144.5 49zM736 466q-25 0 -42.5 -17.5t-17.5 -42.5t17.5 -43t42.5 -18t43 18t18 43t-18 42.5t-43 17.5z" /> 132 t-18 -42.5zM510 767q-87 0 -144.5 -49t-61.5 -141h412q-4 92 -61.5 141t-144.5 49zM736 466q-25 0 -42.5 -17.5t-17.5 -42.5t17.5 -43t42.5 -18t43 18t18 43t-18 42.5t-43 17.5z" />
133 - <glyph glyph-name="uniE625" unicode="&#xe625;"  
134 -d="M519 847l-398 -398h120v-398h159v213h212v-213h159v398h146zM519 847z" />  
135 <glyph glyph-name="uniE626" unicode="&#xe626;" 133 <glyph glyph-name="uniE626" unicode="&#xe626;"
136 d="M139 233q-24 -59 -27.5 -108t15.5 -60q13 -7 32.5 7.5t38.5 45.5q16 -66 72 -116q-29 -11 -45.5 -28.5t-16.5 -37.5q0 -34 43.5 -57.5t105.5 -23.5q56 0 97.5 19.5t50.5 48.5h18q8 -29 50 -48.5t98 -19.5q62 0 105.5 23.5t43.5 57.5q0 20 -16.5 37.5t-45.5 28.5 134 d="M139 233q-24 -59 -27.5 -108t15.5 -60q13 -7 32.5 7.5t38.5 45.5q16 -66 72 -116q-29 -11 -45.5 -28.5t-16.5 -37.5q0 -34 43.5 -57.5t105.5 -23.5q56 0 97.5 19.5t50.5 48.5h18q8 -29 50 -48.5t98 -19.5q62 0 105.5 23.5t43.5 57.5q0 20 -16.5 37.5t-45.5 28.5
137 q56 50 71 116q20 -31 39 -45.5t32 -7.5q19 11 16 60t-27 108q-19 46 -42 78t-43 40q1 7 1 12q0 35 -17 64v4q0 16 -7 30q-5 125 -77.5 207t-190 82t-189.5 -82t-77 -207q-7 -14 -7 -30v-4q-17 -29 -17 -64q0 -5 1 -12q-20 -8 -43.5 -40t-41.5 -78z" /> 135 q56 50 71 116q20 -31 39 -45.5t32 -7.5q19 11 16 60t-27 108q-19 46 -42 78t-43 40q1 7 1 12q0 35 -17 64v4q0 16 -7 30q-5 125 -77.5 207t-190 82t-189.5 -82t-77 -207q-7 -14 -7 -30v-4q-17 -29 -17 -64q0 -5 1 -12q-20 -8 -43.5 -40t-41.5 -78z" />
@@ -166,10 +164,27 @@ t-15.5 36.5t-24.5 22t-28.5 11.5t-26.5 3t-19 -0.5l-8 -1q-9 0 -16 -7t-7 -16t7 -16t @@ -166,10 +164,27 @@ t-15.5 36.5t-24.5 22t-28.5 11.5t-26.5 3t-19 -0.5l-8 -1q-9 0 -16 -7t-7 -16t7 -16t
166 q18 2 30 7q5 0 16.5 1.5t31 -3.5t39 -12.5t40.5 -25t35 -41.5q25 -57 10 -109q-6 -17 -6 -32q0 -14 9 -22t23 -8t21.5 5t10.5 23q17 53 13 96.5t-18.5 75.5t-40.5 55.5t-52 37t-54 20.5z" /> 164 q18 2 30 7q5 0 16.5 1.5t31 -3.5t39 -12.5t40.5 -25t35 -41.5q25 -57 10 -109q-6 -17 -6 -32q0 -14 9 -22t23 -8t21.5 5t10.5 23q17 53 13 96.5t-18.5 75.5t-40.5 55.5t-52 37t-54 20.5z" />
167 <glyph glyph-name="uniE62F" unicode="&#xe62f;" 165 <glyph glyph-name="uniE62F" unicode="&#xe62f;"
168 d="M756 -133h-488q-21 0 -36.5 13t-15.5 32v780q0 19 15.5 32t36.5 13h488q21 0 36.5 -13t15.5 -32v-780q0 -19 -15.5 -32t-36.5 -13zM512 -88q14 0 24.5 9t10.5 21t-10.5 21t-24.5 9t-24.5 -9t-10.5 -21t10.5 -21t24.5 -9zM756 647h-488v-630h488v630z" /> 166 d="M756 -133h-488q-21 0 -36.5 13t-15.5 32v780q0 19 15.5 32t36.5 13h488q21 0 36.5 -13t15.5 -32v-780q0 -19 -15.5 -32t-36.5 -13zM512 -88q14 0 24.5 9t10.5 21t-10.5 21t-24.5 9t-24.5 -9t-10.5 -21t10.5 -21t24.5 -9zM756 647h-488v-630h488v630z" />
  167 + <glyph glyph-name="uniE630" unicode="&#xe630;"
  168 +d="M513 857q98 0 184.5 -37t151 -102t102 -151.5t37.5 -185.5t-37.5 -185t-102 -151t-151 -102t-184.5 -37q-100 0 -186.5 37t-151 102t-102 151t-37.5 185t37.5 185.5t102 151.5t151 102t186.5 37zM784 316q28 0 47.5 20t19.5 48t-19.5 47t-47.5 19h-202v203q0 28 -20 48
  169 +t-48 20t-47.5 -20t-19.5 -48v-203h-203q-28 0 -47.5 -19t-19.5 -47t19.5 -48t47.5 -20h203v-202q0 -28 19.5 -48t47.5 -20t48 20t20 48v202h202z" />
169 <glyph glyph-name="uniE631" unicode="&#xe631;" 170 <glyph glyph-name="uniE631" unicode="&#xe631;"
170 d="M831 612q-2 12 -11 20t-21 8h-160v32q0 66 -47 113t-113 47t-112.5 -47t-46.5 -113v-32h-160q-12 0 -21.5 -8t-10.5 -20l-64 -576q-1 -15 8.5 -25.5t23.5 -10.5h767q14 0 23.5 10.5t7.5 25.5zM351.5 448q-13.5 0 -23 9.5t-9.5 22.5t9.5 22.5t23 9.5t22.5 -9.5t9 -22.5 171 d="M831 612q-2 12 -11 20t-21 8h-160v32q0 66 -47 113t-113 47t-112.5 -47t-46.5 -113v-32h-160q-12 0 -21.5 -8t-10.5 -20l-64 -576q-1 -15 8.5 -25.5t23.5 -10.5h767q14 0 23.5 10.5t7.5 25.5zM351.5 448q-13.5 0 -23 9.5t-9.5 22.5t9.5 22.5t23 9.5t22.5 -9.5t9 -22.5
171 t-9 -22.5t-22.5 -9.5zM575 640h-192v32q0 40 28.5 68t68 28t67.5 -28t28 -68v-32zM607.5 448q-13.5 0 -23 9.5t-9.5 22.5t9.5 22.5t23 9.5t22.5 -9.5t9 -22.5t-9 -22.5t-22.5 -9.5z" /> 172 t-9 -22.5t-22.5 -9.5zM575 640h-192v32q0 40 28.5 68t68 28t67.5 -28t28 -68v-32zM607.5 448q-13.5 0 -23 9.5t-9.5 22.5t9.5 22.5t23 9.5t22.5 -9.5t9 -22.5t-9 -22.5t-22.5 -9.5z" />
172 <glyph glyph-name="uniE632" unicode="&#xe632;" 173 <glyph glyph-name="uniE632" unicode="&#xe632;"
173 d="M684 670q-23 96 -68.5 153t-103.5 57t-103.5 -57t-68.5 -153h-178l-69 -798h838l-69 798h-178zM406 670q18 67 47 107t59 40t59 -40t47 -107h-212z" /> 174 d="M684 670q-23 96 -68.5 153t-103.5 57t-103.5 -57t-68.5 -153h-178l-69 -798h838l-69 798h-178zM406 670q18 67 47 107t59 40t59 -40t47 -107h-212z" />
  175 + <glyph glyph-name="uniE633" unicode="&#xe633;"
  176 +d="M512 764q-94 0 -180 -36.5t-148.5 -99t-99 -148.5t-36.5 -180t36.5 -180t99 -148.5t148.5 -99t180 -36.5t180 36.5t148.5 99t99 148.5t36.5 180t-36.5 180t-99 148.5t-148.5 99t-180 36.5zM724 244h-424q-23 0 -39.5 16.5t-16.5 39.5t16.5 39.5t39.5 16.5h424
  177 +q23 0 39 -16.5t16 -39.5t-16 -39.5t-39 -16.5z" />
  178 + <glyph glyph-name="uniE634" unicode="&#xe634;"
  179 +d="M500 775l-348 -298q-16 -14 -16 -35v-386q0 -25 17.5 -42.5t42.5 -17.5h197v257h238v-257h197q25 0 42.5 17.5t17.5 42.5v386q0 21 -16 35l-348 298q-12 10 -24 0z" />
  180 + <glyph glyph-name="uniE635" unicode="&#xe635;"
  181 +d="M556 -209l-292 507l3 2l-3 2l292 507h211l-293 -509l293 -509h-211z" />
  182 + <glyph glyph-name="uniE636" unicode="&#xe636;"
  183 +d="M468 -209l292 507l-3 2l3 2l-292 507h-211l293 -509l-293 -509h211z" />
  184 + <glyph glyph-name="uniE637" unicode="&#xe637;"
  185 +d="M512 -212q-104 0 -199 40.5t-163.5 109t-109 163.5t-40.5 199t40.5 199t109 163.5t163.5 109t199 40.5t199 -40.5t163.5 -109t109 -163.5t40.5 -199t-40.5 -199t-109 -163.5t-163.5 -109t-199 -40.5zM512 684q-159 0 -271.5 -112.5t-112.5 -271.5t112.5 -271.5
  186 +t271.5 -112.5t271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5z" />
  187 + <glyph glyph-name="uniE638" unicode="&#xe638;"
  188 +d="M511 833q-91 0 -174 -35.5t-143 -95.5t-95.5 -143t-35.5 -174t35.5 -174t95.5 -143t143 -95t174 -35t174 35t143 95t95.5 143t35.5 174t-35.5 174t-95.5 143t-143 95.5t-174 35.5z" />
174 </font> 189 </font>
175 </defs></svg> 190 </defs></svg>
No preview for this file type
No preview for this file type
@@ -45,8 +45,8 @@ var $ = require('yoho-jquery'), @@ -45,8 +45,8 @@ var $ = require('yoho-jquery'),
45 _createOrient: function() { 45 _createOrient: function() {
46 46
47 var orientHtml = '<div class="slide-switch">' + 47 var orientHtml = '<div class="slide-switch">' +
48 - '<a class="prev" href="javascript:;"><span class="iconfont">&#xe607;</span></a>' +  
49 - '<a class="next" href="javascript:;"><span class="iconfont">&#xe606;</span></a>' + 48 + '<a class="prev" href="javascript:;"><span class="iconfont">&#xe635;</span></a>' +
  49 + '<a class="next" href="javascript:;"><span class="iconfont">&#xe636;</span></a>' +
50 '</div>'; 50 '</div>';
51 51
52 if (this.$element.find('.slide-switch').length > 0) { 52 if (this.$element.find('.slide-switch').length > 0) {
1 @import "slider"; 1 @import "slider";
2 @import "tips"; 2 @import "tips";
3 -@import "avatar";  
  3 +@import "avatar";