Authored by 黄涛

ok

@@ -15,42 +15,42 @@ const moment = require('moment'); @@ -15,42 +15,42 @@ const moment = require('moment');
15 /* COOKIE标识访问的是男生频道 */ 15 /* COOKIE标识访问的是男生频道 */
16 const COOKIE_NAME_BOYS = 'boys'; 16 const COOKIE_NAME_BOYS = 'boys';
17 17
18 -//TODO  
19 -const COOKIE_DOMAIN = ""; 18 +// TODO
  19 +const COOKIE_DOMAIN = '';
20 20
21 -function setSwitchToCookie(req) {  
22 - req.cookie('_Channel', COOKIE_NAME_BOYS, { 21 +function setSwitchToCookie(res) {
  22 + res.cookie('_Channel', COOKIE_NAME_BOYS, {
23 domain: COOKIE_DOMAIN, 23 domain: COOKIE_DOMAIN,
24 - expires: moment().add("days", 300).valueOf() 24 + maxAge: moment.duration(300, 'days').seconds()
25 }); 25 });
26 } 26 }
27 27
28 function getGenderByCookie(req) { 28 function getGenderByCookie(req) {
29 let gender = null; 29 let gender = null;
30 30
31 - let channel = req.cookies._Channel || "boys"; 31 + let channel = req.cookies._Channel || 'boys';
32 32
33 switch (channel) { 33 switch (channel) {
34 case 'boys': 34 case 'boys':
35 - {  
36 - gender = '1,3';  
37 - break;  
38 - } 35 + {
  36 + gender = '1,3';
  37 + break;
  38 + }
39 case 'girls': 39 case 'girls':
40 - {  
41 - gender = '2,3';  
42 - break;  
43 - } 40 + {
  41 + gender = '2,3';
  42 + break;
  43 + }
44 default: 44 default:
45 - {  
46 - gender = "1,2,3";  
47 - } 45 + {
  46 + gender = '1,2,3';
  47 + }
48 } 48 }
49 49
50 - return channel; 50 + return gender;
51 } 51 }
52 52
53 -exports.index = (req, res, next) => { 53 +exports.index = (req,res, next) => {
54 // var uid = null, // 需要修改为正式取 UID 的方式 54 // var uid = null, // 需要修改为正式取 UID 的方式
55 // vipLevel = 0; // 用户等级 55 // vipLevel = 0; // 用户等级
56 56
@@ -61,7 +61,7 @@ exports.index = (req, res, next) => { @@ -61,7 +61,7 @@ exports.index = (req, res, next) => {
61 if (req.cookies._Channel) { 61 if (req.cookies._Channel) {
62 channel = req.cookies._Channel; 62 channel = req.cookies._Channel;
63 } else { 63 } else {
64 - setSwitchToCookie(req); 64 + setSwitchToCookie(res);
65 } 65 }
66 66
67 let gender = getGenderByCookie(req); 67 let gender = getGenderByCookie(req);
@@ -10,22 +10,22 @@ var express = require('express'), @@ -10,22 +10,22 @@ var express = require('express'),
10 10
11 var app = express(); 11 var app = express();
12 12
13 -// set view engin  
14 var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root 13 var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root
  14 +var partials = path.join(__dirname, './views');
15 15
16 -app.set('views', path.join(__dirname, 'views/action'));  
17 -  
18 -app.on('mount', function(parent) { 16 +app.on('mount', function (parent) {
19 delete parent.locals.settings; // 不继承父 App 的设置 17 delete parent.locals.settings; // 不继承父 App 的设置
20 Object.assign(app.locals, parent.locals); 18 Object.assign(app.locals, parent.locals);
21 }); 19 });
22 20
  21 +// set view engin
  22 +app.set('views', path.join(__dirname, 'views/action'));
23 app.engine('.hbs', hbs({ 23 app.engine('.hbs', hbs({
24 extname: '.hbs', 24 extname: '.hbs',
25 defaultLayout: 'layout', 25 defaultLayout: 'layout',
26 layoutsDir: doraemon, 26 layoutsDir: doraemon,
27 - partialsDir: ['./views/partial', `${doraemon}/partial`],  
28 - helpers: 'helpers' 27 + partialsDir: [`${partials}/partials`, `${doraemon}/partial`],
  28 + helpers: require('../../library/helpers')
29 })); 29 }));
30 30
31 // router 31 // router
@@ -12,40 +12,40 @@ const co = Promise.coroutine; @@ -12,40 +12,40 @@ const co = Promise.coroutine;
12 */ 12 */
13 // TODO 13 // TODO
14 // index home 14 // index home
15 -module.exports.getHomeChannelNav = function (channel) { 15 +module.exports.getHomeChannelNav = function(channel) {
16 let home = null; 16 let home = null;
17 17
18 switch (channel) { 18 switch (channel) {
19 case 'boys': 19 case 'boys':
20 - {  
21 - home = helpers.urlFormat('', '', "default");  
22 - break;  
23 - } 20 + {
  21 + home = helpers.urlFormat('', '', 'default');
  22 + break;
  23 + }
24 case 'girls': 24 case 'girls':
25 - {  
26 - home = helpers.urlFormat('/woman', '', "new");  
27 - break;  
28 - } 25 + {
  26 + home = helpers.urlFormat('/woman', '', 'new');
  27 + break;
  28 + }
29 case 'lifestyle': 29 case 'lifestyle':
30 - {  
31 - home = helpers.urlFormat('/lifestyle', '', "new");  
32 - break;  
33 - } 30 + {
  31 + home = helpers.urlFormat('/lifestyle', '', 'new');
  32 + break;
  33 + }
34 case 'kids': 34 case 'kids':
35 - {  
36 - home = helpers.urlFormat('/kids', '', "new");  
37 - break;  
38 - } 35 + {
  36 + home = helpers.urlFormat('/kids', '', 'new');
  37 + break;
  38 + }
39 default: 39 default:
40 - {  
41 - home = helpers.urlFormat('', '', "default");  
42 - } 40 + {
  41 + home = helpers.urlFormat('', '', 'default');
  42 + }
43 43
44 } 44 }
45 45
46 return { 46 return {
47 - href : home,  
48 - name : `${channel.toUpperCase()}首页`,  
49 - pathTitle:'YOHO!有货'  
50 - }  
51 -} 47 + href: home,
  48 + name: `${channel.toUpperCase()}首页`,
  49 + pathTitle: 'YOHO!有货'
  50 + };
  51 +};
@@ -22,6 +22,7 @@ const FavoriteData = require('./FavoriteData'); @@ -22,6 +22,7 @@ const FavoriteData = require('./FavoriteData');
22 const ShopModel = require('./Shop'); 22 const ShopModel = require('./Shop');
23 const SearchData = require('./SearchData'); 23 const SearchData = require('./SearchData');
24 const HomeModel = require('./HomeModel'); 24 const HomeModel = require('./HomeModel');
  25 +const HeaderModel = require('../../../doraemon/models/header');
25 26
26 const BLANK_STR = ' '; 27 const BLANK_STR = ' ';
27 28
@@ -1000,7 +1001,7 @@ function getSizeDataBySizeInfo(sizeInfo) { @@ -1000,7 +1001,7 @@ function getSizeDataBySizeInfo(sizeInfo) {
1000 // 参考尺码为空 1001 // 参考尺码为空
1001 if (_.isEmpty(size.thead[1]) && showReference) { 1002 if (_.isEmpty(size.thead[1]) && showReference) {
1002 // 移除这个值 1003 // 移除这个值
1003 - size.thead.slice(1, 1); 1004 + size.thead.splice(1, 1);
1004 } 1005 }
1005 } 1006 }
1006 } 1007 }
@@ -1327,6 +1328,7 @@ const getSizeInfoAsync = (productSkn, maxSortId)=> { @@ -1327,6 +1328,7 @@ const getSizeInfoAsync = (productSkn, maxSortId)=> {
1327 }; 1328 };
1328 1329
1329 module.exports = (data) => { 1330 module.exports = (data) => {
  1331 +
1330 return co(function * () { 1332 return co(function * () {
1331 1333
1332 // 获取商品信息 1334 // 获取商品信息
@@ -1337,21 +1339,24 @@ module.exports = (data) => { @@ -1337,21 +1339,24 @@ module.exports = (data) => {
1337 1339
1338 productInfo = yield detailDataPkg(productInfo, data.uid, data.vipLevel, data.ua); 1340 productInfo = yield detailDataPkg(productInfo, data.uid, data.vipLevel, data.ua);
1339 1341
1340 - //获取商品尺寸相关 1342 + // 获取商品尺寸相关
1341 let sizeInfo = yield getSizeInfoAsync(productInfo.goodsInfo, productInfo.goodsInfo.maxSortId); 1343 let sizeInfo = yield getSizeInfoAsync(productInfo.goodsInfo, productInfo.goodsInfo.maxSortId);
1342 1344
1343 let navs = yield getSortNavAsync(productInfo.goodsInfo.smallSortId, data.gender); 1345 let navs = yield getSortNavAsync(productInfo.goodsInfo.smallSortId, data.gender);
1344 1346
1345 - let data = { 1347 + let result = {
1346 productDetailPage: true, 1348 productDetailPage: true,
1347 detail: Object.assign(productInfo, sizeInfo), 1349 detail: Object.assign(productInfo, sizeInfo),
1348 statGoodsInfo: Object.assign({fullSortName: navs.map(x => x.name).join('-')}, productInfo.statGoodsInfo) 1350 statGoodsInfo: Object.assign({fullSortName: navs.map(x => x.name).join('-')}, productInfo.statGoodsInfo)
1349 }; 1351 };
1350 1352
1351 - //导航  
1352 - data.detail.pathNav = _.concat(HomeModel.getHomeChannelNav(data.channel), navs, [{name: productInfo.goodsInfo.name}]);  
1353 - data.detail.lastWalk = 5; 1353 + // 导航
  1354 + result.detail.pathNav = _.concat(HomeModel.getHomeChannelNav(data.channel), navs, [{name: productInfo.goodsInfo.name}]);
  1355 + result.detail.lastWalk = 5;
1354 1356
1355 - return data; 1357 + result.headerData = yield HeaderModel.requestHeaderData();
  1358 + console.log(result.headerData);
  1359 +
  1360 + return result;
1356 })(); 1361 })();
1357 }; 1362 };
@@ -13,6 +13,6 @@ const helpers = require(`${library}/helpers`); @@ -13,6 +13,6 @@ const helpers = require(`${library}/helpers`);
13 const api = new API(); 13 const api = new API();
14 14
15 module.exports.getSortByConditionAsync = function(conddition) { 15 module.exports.getSortByConditionAsync = function(conddition) {
16 - return api.get('/sortgroup.json', conddition); 16 + return api.get('sortgroup.json', conddition);
17 }; 17 };
18 18
1 -/**  
2 - * 商品详情models  
3 - * @author: xuqi<qi.xu@yoho.cn>  
4 - * @date: 2016/5/6  
5 - */  
6 -  
7 -'use strict';  
8 -  
9 -const library = '../../../library';  
10 -const API = require(`${library}/api`);  
11 -const sign = require(`${library}/sign`);  
12 -const _ = require('lodash');  
13 -const HELPERS = require(`${library}/helpers`);  
14 -  
15 -var api = new API();  
16 -var helpers = new HELPERS();  
17 -  
18 -/**  
19 - * 处理品牌关联店铺信息  
20 - * @param {array}  
21 - * @return {array}  
22 - */  
23 -const getShopsInfo = (data) => {  
24 - var enterStore = {};  
25 -  
26 - _.forEach(data, function(value, key) {  
27 - enterStore[key] = {};  
28 - enterStore[key].img = helpers.getImageUrl(value.brand_ico, 47, 47);  
29 - enterStore[key].storeName = value.brand_name;  
30 -  
31 - if (value.shop_id !== null && value.shop_id !== undefined) {  
32 - let params = {};  
33 -  
34 - params.shop_id = value.shop_id;  
35 - enterStore[key].url =  
36 - helpers.url('/product/index/brand', params);  
37 - } else {  
38 - enterStore[key].url =  
39 - helpers.url('', null, value.brand_domain);  
40 - }  
41 - });  
42 - return enterStore;  
43 -};  
44 -  
45 -/**  
46 - * 处理限购商品的有关按钮状态(或取现购买以及底部商品购买按钮)  
47 - * @param {array} 需要处理的数据  
48 - * @param {int} 限购商品的关联状态  
49 - * @param {Boolean} 限购商品是否已开售  
50 - * @return {array}  
51 - */  
52 -const procShowStatus = (data, showStatus, isBeginSale) => {  
53 - switch (showStatus) {  
54 - case 1:// 开售前/后,立即分享获得限购码(用户未领取限购码)  
55 - // 显示获取限购码按钮  
56 - data.canGetLimitCode = true;  
57 -  
58 - if (isBeginSale) { // 开售后  
59 - data.cartInfo.noLimitCode = true;  
60 - } else {  
61 - data.cartInfo.limitNotForSale = true;  
62 - }  
63 - break;  
64 - case 2: // 开售后,限购码已抢光(用户未领取限购码)  
65 - data.codeEmpty = true;  
66 - data.cartInfo.noLimitCode = true;  
67 - break;  
68 - case 3: // 开售后,商品已经售罄  
69 - data.noLimitGoodsBtn = true;  
70 - data.cartInfo.soldOut = true;  
71 - break;  
72 - case 4: // 开售后,立即购买(用户已领取限购码)  
73 - data.gotCode = true;  
74 - data.cartInfo.canBuyLimit = true;  
75 - break;  
76 - case 5: // 开售前,限购码已被抢光(用户未领取限购码)  
77 - data.codeEmpty = true;  
78 - data.cartInfo.limitNotForSale = true;  
79 - break;  
80 - case 6: // 开售前,即将开售(用户已领取限购码)  
81 - data.gotCode = true;  
82 - data.cartInfo.limitNotForSale = true;  
83 - break;  
84 - case 7: // 开售后,用户已经用获得的限购码购买过商品  
85 - data.gotCode = true;  
86 - data.cartInfo.noLimitCode = true;  
87 - break;  
88 - default:  
89 - break;  
90 - }  
91 -  
92 - return data;  
93 -};  
94 -  
95 -/**  
96 - * 根据设备类型获得限购商品跳转app的url 待处理  
97 - * @param {[string]} productCode 限购商品码  
98 - * @param {[string]} skn 限购商品skn  
99 - * @return {[string]} 限购商品跳转url  
100 - */  
101 -const getLimitCodeUrl = (productCode, skn, ua) => {  
102 - var url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode +  
103 - '&product_skn=' + skn;  
104 -  
105 - let isIphone = String(ua).indexOf('iPhone') >= 0;  
106 - let isIpad = ua.indexOf('iPad') >= 0;  
107 -  
108 - if (isIphone || isIpad) {  
109 - let params = {};  
110 -  
111 - params.lp = productCode;  
112 - url = 'yohobuy://' + helpers.url('/limitpurchase', params);  
113 - }  
114 - return url;  
115 -};  
116 -  
117 -/**  
118 - * 详情页数据格式化  
119 - * @param origin Object 原始数据  
120 - * @return dest Object 格式化数据  
121 - */  
122 -const detailDataPkg = (origin, uid, vipLevel, ua) => {  
123 - var dest = {}, // 结果输出  
124 - colorGroup = {},  
125 - thumbImageList = {},  
126 - sizeGroup = {},  
127 - totalStorageNum = 0;  
128 -  
129 - // 商品名称  
130 - if (origin.productName === null || origin.productName === undefined) {  
131 - return dest;  
132 - }  
133 -  
134 - dest.goodsName = origin.productName;  
135 -  
136 - // 用户未登录时 待处理  
137 - if (uid === null || uid === undefined) {  
138 - let params = {};  
139 -  
140 - params.refer = helpers.url('/product/show_' + origin.erpProductId + '.html');  
141 - dest.loginUrl = helpers.url('/signin.html', params);  
142 - }  
143 -  
144 - // 商品促销短语  
145 - if (origin.salesPhrase !== null && origin.salesPhrase !== undefined) {  
146 - dest.goodsSubtitle = origin.salesPhrase;  
147 - }  
148 -  
149 - // 商品标签  
150 - if (origin.productTagBoList !== null && origin.productTagBoList !== undefined) {  
151 - _.forEach(origin.productTagBoList, function(value) {  
152 - switch (value.tagLabel) {  
153 - case 'is_soon_sold_out':  
154 - dest.tags.is_soon_sold_out = true;  
155 - break;  
156 - case 'is_new':  
157 - dest.tags.is_new = true;  
158 - break;  
159 - case 'is_discount':  
160 - dest.tags.is_discount = true;  
161 - break;  
162 - case 'is_limited':  
163 - dest.tags.is_limited = true;  
164 - break;  
165 - case 'is_yohood':  
166 - dest.tags.is_yohood = true;  
167 - break;  
168 - case 'is_advance':  
169 - dest.tags.is_advance = true;  
170 - break;  
171 - default:  
172 - break;  
173 - }  
174 - });  
175 - }  
176 -  
177 - // 商品价格  
178 - dest.goodsPrice = {};  
179 -  
180 - if (origin.productPriceBo !== null && origin.productPriceBo !== undefined) {  
181 - dest.goodsPrice.currentPrice = origin.productPriceBo.formatSalesPrice;  
182 - if (origin.productPriceBo.formatMarketPrice !== origin.productPriceBo.formatSalesPrice) {  
183 - dest.goodsPrice.previousPrice = origin.productPriceBo.formatMarketPrice;  
184 - }  
185 -  
186 - // 商品返回 YOHO 币  
187 - if (origin.productPriceBo.yohoCoinNum !== null && origin.productPriceBo.yohoCoinNum !== 0) {  
188 - dest.commodityReturn = dest.productPriceBo.yohoCoinNum;  
189 - }  
190 - }  
191 -  
192 - // VIP 商品价格  
193 - dest.vipLevel = {};  
194 - dest.vipLevel.list = {};  
195 -  
196 - if (origin.productPriceBo.vipPrices !== null && origin.productPriceBo.vipPrices !== undefined) {  
197 - _.forEach(origin.productPriceBo.vipPrices, function(value, key) {  
198 - dest.vipLevel.list[key] = {};  
199 - dest.vipLevel.list[key].level = value.vipLevel;  
200 - dest.vipLevel.list[key].text = value.vipPrice;  
201 - dest.vipLevel.list[key].currentLevel = (value.vipLevel === vipLevel) ? true : false;  
202 - });  
203 - }  
204 -  
205 - // 上市期  
206 - if (origin.expectArrivalTime !== null && origin.expectArrivalTime !== undefined) {  
207 - dest.periodOfMarket = origin.expectArrivalTime + '月';  
208 - }  
209 -  
210 - // 促销信息  
211 - dest.goodsDiscount = {};  
212 - dest.goodsDiscount.list = {};  
213 -  
214 - if (origin.promotionBoList !== null && origin.promotionBoList !== undefined) {  
215 - _.forEach(origin.promotionBoList, function(value, key) {  
216 - dest.goodsDiscount.list[key] = {};  
217 - dest.goodsDiscount.list[key].text = '【' + value.promotionType + '】' +  
218 - value.promotionTitle;  
219 - });  
220 - }  
221 -  
222 - // 商品咨询  
223 - dest.feedbacks = {};  
224 - dest.feedbacks.consults = {};  
225 - dest.feedbacks.consultsNum = 0;  
226 -  
227 - if (origin.consultBoWrapper !== null && origin.consultBoWrapper !== undefined) {  
228 - dest.feedbacks.consultsNum = origin.consultBoWrapper.consultTotal;  
229 - _.forEach(origin.consultBoWrapper.consultBoList, function(value, key) {  
230 - dest.feedbacks.consults[key] = {};  
231 - dest.feedbacks.consults[key].question = value.ask;  
232 - dest.feedbacks.consults[key].time = value.askTime;  
233 - dest.feedbacks.consults[key].answer = value.answer;  
234 - });  
235 -  
236 - let params = {};  
237 -  
238 - params.product_id = origin.id;  
239 - params.total = dest.feedbacks.consultsNum;  
240 -  
241 - dest.feedbacks.consultsUrl = helpers.url('/product/detail/consults', params);  
242 -  
243 - } else { // 暂无咨询  
244 -  
245 - let params = {};  
246 -  
247 - params.product_id = origin.id;  
248 -  
249 - dest.feedbacks.consultsUrl = helpers.url('/product/detail/consultform', params);  
250 - }  
251 -  
252 - // 商品评价  
253 - dest.feedbacks.commentsNum = 0;  
254 - if (origin.commentBoWrapper !== null && origin.commentBoWrapper !== undefined) {  
255 - dest.feedbacks.commentsNum = origin.commentBoWrapper.commentTotal;  
256 - dest.feedbacks.comments = {};  
257 -  
258 - _.forEach(origin.commentBoWrapper.commentBoList, function(value, key) {  
259 - dest.feedbacks.comments[key] = {};  
260 - dest.feedbacks.comments[key].userName = value.nickName;  
261 - dest.feedbacks.comments[key].desc = value.colorName +  
262 - '/' + value.sizeName;  
263 - dest.feedbacks.comments[key].content = (value.content !== null &&  
264 - value.content !== undefined) ? value.content : '';  
265 - dest.feedbacks.comments[key].time = value.createTime;  
266 - });  
267 -  
268 - let params = {};  
269 -  
270 - params.product_id = origin.id;  
271 - params.total = dest.feedbacks.commentsNum;  
272 -  
273 - dest.feedbacks.commentsUrl = helpers.url('/product/detail/comments', params);  
274 - }  
275 -  
276 - // 品牌信息  
277 - if (origin.brand !== null && origin.brand !== undefined) {  
278 -  
279 - // dest.enterStore[0] = {};  
280 - // dest.enterStore[0].img =  
281 - // helpers.getImageUrl(origin.brand.brandIco, 47, 47);  
282 - // dest.enterStore[0].storeName = origin.brand.brandName;  
283 - // dest.enterStore[0].url = helpers.url('', null, origin.brand.brandDomain);  
284 -  
285 - // 为你优选的链接  
286 - let params = {};  
287 -  
288 - params.productSkn = origin.erpProductId;  
289 - params.brandId = origin.brand.id;  
290 - dest.preferenceUrl = helpers.url('/product/detail/preference', params, '');  
291 - }  
292 -  
293 - dest.productSkn = origin.erpProductId;  
294 -  
295 - // 商品信息  
296 - if (origin.goodsList !== null && origin.goodsList !== undefined) {  
297 - let goodsGroup = {},  
298 - sizeName = '',  
299 - colorList = {},  
300 - sizeList = {},  
301 - allSizeList = {},  
302 - colorStorageGroup = {},  
303 - colorStorageNum = 0;  
304 -  
305 - _.forEach(origin.goodsList, function(value, key) {  
306 - if (value.status === 0) {  
307 - return true;  
308 - }  
309 -  
310 - colorStorageNum = 0;  
311 -  
312 - // 商品分组  
313 - if (value.goodsImagesList !== null && value.goodsImagesList !== undefined) {  
314 - _.forEach(value.goodsImagesList, function(good, keyForGood) {  
315 - goodsGroup[keyForGood] = {};  
316 - goodsGroup[keyForGood].goodsId = good.goodsId;  
317 - goodsGroup[keyForGood].img = good.imageUrl;  
318 - });  
319 - }  
320 -  
321 - // 商品的尺码列表  
322 - colorStorageGroup[value.productSkc] = {};  
323 - if (value.goodsSizeBoList !== null && value.goodsSizeBoList !== undefined) {  
324 -  
325 - _.forEach(value.goodsSizeBoList, function(size, keyForSize) {  
326 - sizeList[value.productSkc] = {};  
327 - sizeList[value.productSkc][keyForSize] = {};  
328 - sizeList[value.productSkc][keyForSize].id = size.id;  
329 - sizeList[value.productSkc][keyForSize].skuId = size.goodsSizeSkuId;  
330 - sizeList[value.productSkc][keyForSize].goodsId = size.goodsId;  
331 - sizeList[value.productSkc][keyForSize].colorId = size.colorId;  
332 - sizeList[value.productSkc][keyForSize].name = size.sizeName;  
333 - sizeList[value.productSkc][keyForSize].sizeNum = size.goodsSizeStorageNum;  
334 -  
335 - sizeName = size.sizeName;  
336 -  
337 - // 所有尺码列表,赋值用于前端展示默认尺码的时候  
338 - // 判断出没有库存则显示灰色  
339 - let build = {};  
340 -  
341 - build.storage = size.goodsSizeStorageNum;  
342 - build.id = size.id;  
343 - allSizeList[sizeName] = (allSizeList[sizeName] === null ||  
344 - allSizeList[sizeName] === undefined) ? build :  
345 - allSizeList[sizeName];  
346 -  
347 - colorStorageNum += parseInt(size.goodsSizeStorageNum);  
348 - colorStorageGroup[value.productSkc][sizeName] = parseInt(size.goodsSizeStorageNum);  
349 - });  
350 -  
351 - // 颜色分组  
352 - colorList[key] = {};  
353 - colorList[key].id = value.colorId;  
354 - colorList[key].skcId = value.productSkc;  
355 - colorList[key].name = value.colorName;  
356 - colorList[key].goodsName = value.goodsName;  
357 - colorList[key].colorNum = colorStorageNum;  
358 - }  
359 -  
360 - // 缩略图  
361 - let params = {};  
362 -  
363 - params.img = helpers.getImageUrl(value.colorImage, 60, 60);  
364 - thumbImageList[key] = params;  
365 -  
366 - // 商品库存总数  
367 - totalStorageNum += colorStorageNum;  
368 - });  
369 -  
370 - // 遍历所有尺码,构建颜色显示数据  
371 - let i = 1;  
372 -  
373 - _.forEach(allSizeList, function(value, key) {  
374 -  
375 - // 默认尺码  
376 - sizeGroup[0] = {};  
377 -  
378 - sizeGroup[0].size = {};  
379 - sizeGroup[0].size[key] = {};  
380 - sizeGroup[0].size[key].name = sizeName;  
381 - sizeGroup[0].size[key].sizeNum = (value.storage === undefined || value.storage === null) ? false : true;  
382 - sizeGroup[0].size[key].id = value.id;  
383 -  
384 - // 各个颜色的尺码, 每行显示一个尺码对应的颜色  
385 - _.forEach(colorList, function(colorArr, keyForColorArr) {  
386 - colorGroup[i] = {};  
387 - colorGroup[i].color = {};  
388 - colorGroup[i].color[keyForColorArr] = {};  
389 - colorGroup[i].color[keyForColorArr].colorNum =  
390 - (colorStorageGroup[colorArr.skcId][sizeName] !== null &&  
391 - colorStorageGroup[colorArr.skcId][sizeName] !== undefined) ?  
392 - colorStorageGroup[colorArr.skcId][sizeName] : 0;  
393 - });  
394 - colorGroup[i].id = value.id;  
395 -  
396 - ++i;  
397 - });  
398 -  
399 - // 遍历所有颜色, 构建尺码显示数据  
400 -  
401 - i = 1;  
402 - _.forEach(colorList, function(value, key) {  
403 - // 各个尺码的颜色, 每行显示一个颜色的对应尺码  
404 - sizeGroup[i] = {};  
405 - sizeGroup[i].size = sizeList[value.skcId];  
406 - sizeGroup[i].colorId = value.skcId;  
407 -  
408 - // 默认颜色  
409 - colorGroup[0] = {};  
410 - colorGroup[0].color = {};  
411 - colorGroup[0].color[key] = value;  
412 -  
413 - ++i;  
414 - });  
415 -  
416 - // 商品图:多个  
417 - if (goodsGroup[1] !== null && goodsGroup[1] !== undefined) {  
418 - _.forEach(goodsGroup, function(value, key) {  
419 - dest.bannerTop = {};  
420 -  
421 - dest.bannerTop.list = {};  
422 - let params = {};  
423 -  
424 - params.img = helpers.getImageUrl(value.img, 450, 600);  
425 - dest.bannerTop.list[key] = params;  
426 - });  
427 - } else if (goodsGroup[0] !== null && goodsGroup[0] !== undefined) {  
428 - dest.bannerTop = {};  
429 - dest.bannerTop.img = helpers.getImageUrl(goodsGroup[0].img, 450, 600);  
430 - }  
431 - }  
432 -  
433 - // 悬浮的购物车信息  
434 - dest.cartInfo = {};  
435 - dest.cartInfo.cartUrl = helpers.url('/cart/index/index', null);  
436 - dest.cartInfo.numInCart = 0;  
437 - dest.cartInfo.goodsInstore = origin.storage;  
438 -  
439 - let soldOut = (origin.storage === 0) || (origin.status === 0 || totalStorageNum === 0);  
440 - let notForSale = origin.attribute === 2;  
441 -  
442 - // 显示加入购物车链接  
443 - if (!soldOut && !notForSale) {  
444 - _.orderBy(colorGroup);  
445 -  
446 - dest.cartInfo = {};  
447 - dest.cartInfo.productId = origin.id;  
448 - dest.cartInfo.thumbs = thumbImageList;  
449 - dest.cartInfo.name = (dest.goodsName !== null && dest.goodsName !== undefined) ? dest.goodsName : '';  
450 - dest.cartInfo.price = (dest.goodsPrice.previousPrice !== null &&  
451 - dest.goodsPrice.previousPrice !== undefined) ? dest.goodsPrice.previousPrice : '';  
452 - dest.cartInfo.salePrice = (dest.goodsPrice.currentPrice !== null &&  
453 - dest.goodsPrice.currentPrice !== undefined) ? dest.goodsPrice.currentPrice : '';  
454 - dest.cartInfo.totalNum = totalStorageNum;  
455 - dest.cartInfo.colors = colorGroup;  
456 - dest.cartInfo.sizes = sizeGroup;  
457 -  
458 - // 限购商品  
459 - if (origin.isLimitBuy === 'Y') {  
460 - // 是否开售  
461 - let isBeginSale = (origin.saleStatus !== null && origin.saleStatus !== undefined &&  
462 - origin.saleStatus === 1);  
463 -  
464 - // 限购商品有关的展示状态  
465 - let showStatus = 1;  
466 -  
467 - if (origin.showStatus !== null && origin.showStatus !== undefined) {  
468 - showStatus = parseInt(origin.showStatus);  
469 - }  
470 -  
471 - // 处理限购商品有关的按钮状态  
472 - dest = procShowStatus(dest, showStatus, isBeginSale);  
473 - dest.cartInfo.limitProductCode = origin.limitProductCode;  
474 - dest.cartInfo.limitCodeUrl = getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua);  
475 - dest.cartInfo.limitProductPay = helpers.url('/cart/index/orderEnsure');  
476 - } else {  
477 - dest.cartInfo.addToCartUrl = helpers.url('/product/buy_' + origin.id + '_' +  
478 - origin.goodsList.id + '.html'); // 待处理 确认 goodsId 的含义  
479 - }  
480 - } else if (notForSale) {  
481 - dest.cartInfo.notForSale = true;  
482 - } else if (soldOut) {  
483 - dest.cartInfo.soldOut = true;  
484 - }  
485 -  
486 - // 是否收藏  
487 -  
488 - dest.isCollect = false;  
489 - if (origin.isCollect !== null && origin.isCollect !== undefined && origin.isCollect === 'Y') {  
490 - dest.isCollect = true;  
491 - }  
492 -  
493 - // 底部简介的URL链接  
494 - dest.introUrl = helpers.url('/product/intro_' + origin.erpProductId + '/' + origin.cnAlphabet + '.html', null, '');  
495 - dest.id = origin.id;  
496 -  
497 - return dest;  
498 -};  
499 -  
500 -module.exports = (data) => {  
501 - var finalResult;  
502 -  
503 - return api.get('', sign.apiSign({  
504 - productId: data.id,  
505 - uid: data.uid,  
506 - vipLevel: data.vipLevel,  
507 - method: 'h5.product.data'  
508 - })).then(result => {  
509 - finalResult = detailDataPkg(result, data.uid, data.vipLevel, data.ua);  
510 -  
511 - return api.get('', sign.apiSign({  
512 - method: 'app.shop.queryShopsByBrandId',  
513 - brand_id: result.brand.id  
514 - })).then(shops => {  
515 - if (shops.code === 200) {  
516 - finalResult.enterStore = getShopsInfo(shops.data);  
517 - }  
518 - return finalResult;  
519 - });  
520 - });  
521 -};  
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 {{/ banner}} 20 {{/ banner}}
21 21
22 <div class="center-content"> 22 <div class="center-content">
  23 + {{> product/path-nav}}
23 24
24 {{# goodsInfo}} 25 {{# goodsInfo}}
25 <div class="main clearfix" data-skn="{{skn}}" data-id="{{productId}}"> 26 <div class="main clearfix" data-skn="{{skn}}" data-id="{{productId}}">
@@ -153,7 +154,8 @@ @@ -153,7 +154,8 @@
153 <span class="title pull-left">选颜色:</span> 154 <span class="title pull-left">选颜色:</span>
154 <ul class="colors pull-left clearfix"> 155 <ul class="colors pull-left clearfix">
155 {{#each colors}} 156 {{#each colors}}
156 - <li class="{{#if focus}}focus{{/if}} {{#if disable}}disable{{/if}} pull-left" title="{{title}}" data-color="{{name}}" data-total="{{total}}"> 157 + <li class="{{#if focus}}focus{{/if}} {{#if disable}}disable{{/if}} pull-left"
  158 + title="{{title}}" data-color="{{name}}" data-total="{{total}}">
157 <img src="{{src}}"> 159 <img src="{{src}}">
158 </li> 160 </li>
159 {{/each}} 161 {{/each}}
@@ -173,7 +175,8 @@ @@ -173,7 +175,8 @@
173 {{#each colors}} 175 {{#each colors}}
174 <ul class="size{{#unless focus}} hide{{/unless}}"> 176 <ul class="size{{#unless focus}} hide{{/unless}}">
175 {{#each size}} 177 {{#each size}}
176 - <li {{#unless num}}class="disable"{{/unless}} data-sku="{{sku}}" data-num="{{num}}" data-name="{{name}}">{{name}}</li> 178 + <li {{#unless num}}class="disable"{{/unless}} data-sku="{{sku}}"
  179 + data-num="{{num}}" data-name="{{name}}">{{name}}</li>
177 {{/each}} 180 {{/each}}
178 181
179 {{#unless virtualGoods}} 182 {{#unless virtualGoods}}
@@ -239,7 +242,8 @@ @@ -239,7 +242,8 @@
239 {{!-- 各颜色下所有尺码均售罄则只显示售罄按钮 --}} 242 {{!-- 各颜色下所有尺码均售罄则只显示售罄按钮 --}}
240 {{#unless soldOut}} 243 {{#unless soldOut}}
241 {{# buyNow}} 244 {{# buyNow}}
242 - <span id="buy-now" class="buy-btn buy-now item-buy{{#if dis}} dis{{/if}}" data-base="{{buyNowBase}}">立即购买</span> 245 + <span id="buy-now" class="buy-btn buy-now item-buy{{#if dis}} dis{{/if}}"
  246 + data-base="{{buyNowBase}}">立即购买</span>
243 {{/ buyNow}} 247 {{/ buyNow}}
244 {{# openSoon}} 248 {{# openSoon}}
245 <span id="open-soon" class="buy-btn item-buy dis">即将开售</span> 249 <span id="open-soon" class="buy-btn item-buy dis">即将开售</span>
@@ -275,6 +279,7 @@ @@ -275,6 +279,7 @@
275 279
276 <div class="share-row"> 280 <div class="share-row">
277 <span class="title pull-left">分享商品:</span> 281 <span class="title pull-left">分享商品:</span>
  282 + {{> product/share }}
278 </div> 283 </div>
279 </div> 284 </div>
280 285
@@ -370,24 +375,24 @@ @@ -370,24 +375,24 @@
370 {{# size}} 375 {{# size}}
371 <table class="size-table"> 376 <table class="size-table">
372 <thead> 377 <thead>
373 - <tr>  
374 - {{# thead}}  
375 - <th>{{name}}</th>  
376 - {{/ thead}}  
377 - </tr> 378 + <tr>
  379 + {{# thead}}
  380 + <th>{{name}}</th>
  381 + {{/ thead}}
  382 + </tr>
378 </thead> 383 </thead>
379 <tbody> 384 <tbody>
380 - {{# tbody}}  
381 - <tr>  
382 - {{#each .}}  
383 - <td>{{.}}</td>  
384 - {{/each}}  
385 - </tr>  
386 - {{/ tbody}} 385 + {{# tbody}}
  386 + <tr>
  387 + {{#each .}}
  388 + <td>{{.}}</td>
  389 + {{/each}}
  390 + </tr>
  391 + {{/ tbody}}
387 </tbody> 392 </tbody>
388 </table> 393 </table>
389 <p class="size-tip"> 394 <p class="size-tip">
390 - ※ 以上尺寸为实物人工测量,因测量方式不同会有1-2CM误差,相关数据仅作参考,以收到实物为准。 单位:CM 395 + ※ 以上尺寸为实物人工测量,因测量方式不同会有1-2CM误差,相关数据仅作参考,以收到实物为准。 单位:CM
391 </p> 396 </p>
392 <p class="size-tip"> 397 <p class="size-tip">
393 ※ 参考尺码因衣服版型、剪裁不同会有误差,仅供参考 398 ※ 参考尺码因衣服版型、剪裁不同会有误差,仅供参考
@@ -406,26 +411,26 @@ @@ -406,26 +411,26 @@
406 {{# reference}} 411 {{# reference}}
407 <table class="reference-table"> 412 <table class="reference-table">
408 <thead> 413 <thead>
409 - <tr>  
410 - {{# thead}}  
411 - <th class="{{#if @first}}avatar-col{{/if}}{{#if modelCol}}model-col{{/if}}{{#if remarkCol}}remark-col{{/if}}">{{name}}</th>  
412 - {{/ thead}}  
413 - </tr> 414 + <tr>
  415 + {{# thead}}
  416 + <th class="{{#if @first}}avatar-col{{/if}}{{#if modelCol}}model-col{{/if}}{{#if remarkCol}}remark-col{{/if}}">{{name}}</th>
  417 + {{/ thead}}
  418 + </tr>
414 </thead> 419 </thead>
415 <tbody> 420 <tbody>
416 - {{# tbody}}  
417 - <tr>  
418 - {{#each .}}  
419 - <td> 421 + {{# tbody}}
  422 + <tr>
  423 + {{#each .}}
  424 + <td>
420 {{#if @first}} 425 {{#if @first}}
421 <img class="avatar" src="{{.}}"> 426 <img class="avatar" src="{{.}}">
422 {{^}} 427 {{^}}
423 {{.}} 428 {{.}}
424 {{/if}} 429 {{/if}}
425 - </td>  
426 - {{/each}}  
427 - </tr>  
428 - {{/ tbody}} 430 + </td>
  431 + {{/each}}
  432 + </tr>
  433 + {{/ tbody}}
429 </tbody> 434 </tbody>
430 </table> 435 </table>
431 {{/ reference}} 436 {{/ reference}}
@@ -460,20 +465,20 @@ @@ -460,20 +465,20 @@
460 {{^}} 465 {{^}}
461 <table class="fitting-report-table"> 466 <table class="fitting-report-table">
462 <thead> 467 <thead>
463 - <tr>  
464 - {{# thead}}  
465 - <th>{{.}}</th>  
466 - {{/ thead}}  
467 - </tr> 468 + <tr>
  469 + {{# thead}}
  470 + <th>{{.}}</th>
  471 + {{/ thead}}
  472 + </tr>
468 </thead> 473 </thead>
469 <tbody> 474 <tbody>
470 - {{# tbody}}  
471 - <tr>  
472 - {{#each .}}  
473 - <td>{{.}}</td>  
474 - {{/each}}  
475 - </tr>  
476 - {{/ tbody}} 475 + {{# tbody}}
  476 + <tr>
  477 + {{#each .}}
  478 + <td>{{.}}</td>
  479 + {{/each}}
  480 + </tr>
  481 + {{/ tbody}}
477 </tbody> 482 </tbody>
478 </table> 483 </table>
479 {{/if}} 484 {{/if}}
@@ -562,7 +567,8 @@ @@ -562,7 +567,8 @@
562 <div class="img-2"></div> 567 <div class="img-2"></div>
563 <div class="text"> 568 <div class="text">
564 <h4>退换货承诺</h4> 569 <h4>退换货承诺</h4>
565 - <p>自您签收商品7日内可以退货,15日内可以换货,在商品不影响二次销售的情况下,YOHO!有货将为您办理退换货服务,请在网站提交"退换货"申请。需要说明的是:非质量问题的退换货,来回运费由您承担。</p> 570 + <p>
  571 + 自您签收商品7日内可以退货,15日内可以换货,在商品不影响二次销售的情况下,YOHO!有货将为您办理退换货服务,请在网站提交"退换货"申请。需要说明的是:非质量问题的退换货,来回运费由您承担。</p>
566 <h4>退换货方式</h4> 572 <h4>退换货方式</h4>
567 <p> 573 <p>
568 针对国内大中型城市,YOHO!有货开通了<span class="orange">"上门换货"</span>服务,上门服务区域及费用请联系客服中心;若您所在的区域不在上门换货范围内,请您选择普通快递将商品、内包装、赠品及发货单等一并寄回。质量问题的退换货,目前不支持运费到付款业务,请您先垫付运费寄回。如需退换货,请致电客服电话:400-889-9646。 574 针对国内大中型城市,YOHO!有货开通了<span class="orange">"上门换货"</span>服务,上门服务区域及费用请联系客服中心;若您所在的区域不在上门换货范围内,请您选择普通快递将商品、内包装、赠品及发货单等一并寄回。质量问题的退换货,目前不支持运费到付款业务,请您先垫付运费寄回。如需退换货,请致电客服电话:400-889-9646。
@@ -593,77 +599,78 @@ @@ -593,77 +599,78 @@
593 </div> 599 </div>
594 {{/ detail}} 600 {{/ detail}}
595 <script id="comments-tpl" type="text/html"> 601 <script id="comments-tpl" type="text/html">
596 - \{{# comments}}  
597 - <li>  
598 - <div class="user-info clearfix">  
599 - <img class="user-avatar pull-left" src="\{{avatar}}">  
600 - <p>  
601 - <span class="name">\{{userName}} </span>  
602 - 购买了\{{color}}/\{{size}}  
603 - <br>  
604 - <span class="date">\{{date}}</span>  
605 - </p>  
606 - </div>  
607 - <p class="comment">\{{comment}}</p>  
608 - </li>  
609 - \{{/ comments}} 602 + \{{# comments}}
  603 + <li>
  604 + <div class="user-info clearfix">
  605 + <img class="user-avatar pull-left" src="\{{avatar}}">
  606 + <p>
  607 + <span class="name">\{{userName}} </span>
  608 + 购买了\{{color}}/\{{size}}
  609 + <br>
  610 + <span class="date">\{{date}}</span>
  611 + </p>
  612 + </div>
  613 + <p class="comment">\{{comment}}</p>
  614 + </li>
  615 + \{{/ comments}}
610 </script> 616 </script>
611 <script id="consults-tpl" type="text/html"> 617 <script id="consults-tpl" type="text/html">
612 - \{{# consults}}  
613 - <li>  
614 - <div class="user-info clearfix">  
615 - <img class="user-avatar" src="\{{avatar}}">  
616 - <p>  
617 - <span class="question">\{{question}}</span>  
618 - <br>  
619 - <span class="date">\{{date}}</span>  
620 - </p>  
621 - </div>  
622 - <p class="consult">\{{answer}}</p>  
623 - </li>  
624 - \{{/ consults}} 618 + \{{# consults}}
  619 + <li>
  620 + <div class="user-info clearfix">
  621 + <img class="user-avatar" src="\{{avatar}}">
  622 + <p>
  623 + <span class="question">\{{question}}</span>
  624 + <br>
  625 + <span class="date">\{{date}}</span>
  626 + </p>
  627 + </div>
  628 + <p class="consult">\{{answer}}</p>
  629 + </li>
  630 + \{{/ consults}}
625 </script> 631 </script>
626 </div> 632 </div>
627 633
628 {{# statGoodsInfo}} 634 {{# statGoodsInfo}}
629 -<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>  
630 -<script type="text/javascript">  
631 - window.criteo_q = window.criteo_q || [];  
632 - window.criteo_q.push(  
633 - { event: "setAccount", account: 16184 },  
634 - { event: "setCustomerId", id: "{{uid}}" },  
635 - { event: "setSiteType", type: "d" },  
636 - { event: "viewItem", item: "{{skn}}" }  
637 - );  
638 -</script>  
639 -<script type="text/javascript">  
640 -var _mvq = _mvq || [];  
641 -_mvq.push(['$setAccount', 'm-23428-1']);  
642 -_mvq.push(['$setGeneral', 'goodsdetail', '', /*用户名*/ '', /*用户id*/ '']);  
643 -_mvq.push(['$logConversion']);  
644 -_mvq.push(['$addGoods', /*分类id*/ '', /*品牌id*/ '', /*商品名称*/ '',/*商品ID*/ '{{skn}}',/*商品售价*/ '',/*商品图片url*/ '', /*分类名*/ '',/*品牌名*/ '', /*商品库存状态1或是0*/ '', /*网络价*/ '',/*收藏人数*/ '']);  
645 -_mvq.push(['$logData']);  
646 -var _goodsData = {  
647 - id:'{{skn}}',// 商品ID  
648 - name:'{{productName}}', // 商品名称  
649 - brand:'{{brandName}}', // 商品品牌(非必填)  
650 - origPrice:'{{marketPrice}}', // 商品原价(非必填)  
651 - price:'{{salePrice}}', // 商品售价  
652 - imgUrl:'{{imageUrl}}', // 商品预览图  
653 - productUrl:'{{productUrl}}', // 商品URL地址  
654 - categoryId:'{{smallSortId}}', // 所属分类ID  
655 - category:'{{fullSortName}}', // 所属分类完整路径, // 所属分类完整路径  
656 - soldOut:'{{soldOut}}' // 状态 1下架,0在售(必填)  
657 - };  
658 -</script> 635 + <script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
  636 + <script type="text/javascript">
  637 + window.criteo_q = window.criteo_q || [];
  638 + window.criteo_q.push(
  639 + {event: "setAccount", account: 16184},
  640 + {event: "setCustomerId", id: "{{uid}}"},
  641 + {event: "setSiteType", type: "d"},
  642 + {event: "viewItem", item: "{{skn}}"}
  643 + );
  644 + </script>
  645 + <script type="text/javascript">
  646 + var _mvq = _mvq || [];
  647 + _mvq.push(['$setAccount', 'm-23428-1']);
  648 + _mvq.push(['$setGeneral', 'goodsdetail', '', /*用户名*/ '', /*用户id*/ '']);
  649 + _mvq.push(['$logConversion']);
  650 + _mvq.push(['$addGoods', /*分类id*/ '', /*品牌id*/ '', /*商品名称*/ '', /*商品ID*/ '{{skn}}', /*商品售价*/ '', /*商品图片url*/ '', /*分类名*/ '', /*品牌名*/ '', /*商品库存状态1或是0*/ '', /*网络价*/ '', /*收藏人数*/ '']);
  651 + _mvq.push(['$logData']);
  652 + var _goodsData = {
  653 + id: '{{skn}}',// 商品ID
  654 + name: '{{productName}}', // 商品名称
  655 + brand: '{{brandName}}', // 商品品牌(非必填)
  656 + origPrice: '{{marketPrice}}', // 商品原价(非必填)
  657 + price: '{{salePrice}}', // 商品售价
  658 + imgUrl: '{{imageUrl}}', // 商品预览图
  659 + productUrl: '{{productUrl}}', // 商品URL地址
  660 + categoryId: '{{smallSortId}}', // 所属分类ID
  661 + category: '{{fullSortName}}', // 所属分类完整路径, // 所属分类完整路径
  662 + soldOut: '{{soldOut}}' // 状态 1下架,0在售(必填)
  663 + };
  664 + </script>
659 {{/statGoodsInfo}} 665 {{/statGoodsInfo}}
660 666
661 <script type="text/javascript"> 667 <script type="text/javascript">
662 -(function () {  
663 - try {  
664 - var timestamp = (new Date()).valueOf();  
665 - var view = document.createElement('img');  
666 - view.src = 'http://shopping.yohobuy.com/1.jpg?t='+timestamp;  
667 - } catch (e) {}  
668 -} )(); 668 + (function () {
  669 + try {
  670 + var timestamp = (new Date()).valueOf();
  671 + var view = document.createElement('img');
  672 + view.src = 'http://shopping.yohobuy.com/1.jpg?t=' + timestamp;
  673 + } catch (e) {
  674 + }
  675 + })();
669 </script> 676 </script>
1 -{{#if list}}  
2 -<div class="banner-top">  
3 - <div class="banner-swiper swiper-container">  
4 - <ul class="swiper-wrapper">  
5 - {{# list}}  
6 - <li class="swiper-slide">  
7 - <a href="javascript:;">  
8 - <img src="{{img}}" alt="">  
9 - </a>  
10 - </li>  
11 - {{/ list}}  
12 - </ul>  
13 - </div>  
14 - <div class="swiper-pagination">  
15 - <div class="pagination-inner">  
16 - </div>  
17 - </div>  
18 -  
19 - <div class="my-swiper-button-prev prev-grey"></div>  
20 - <div class="my-swiper-button-next next-grey"></div>  
21 -</div>  
22 - {{^}}  
23 -<div class="banner-top-single">  
24 -<a href={{url}}>  
25 -<img class="img" src="{{img}}">  
26 -</a>  
27 -</div>  
28 - {{/if}}  
1 -<ul id="nav-tab" class="nav-tab clearfix">  
2 - <li class="comment-nav tap-hightlight">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li>  
3 - <li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>  
4 -</ul>  
5 -<div id="feedback-content" >  
6 - <div class="comment-content content ">  
7 - {{#if commentsNum}}  
8 - <div class="comment-content-main content-main">  
9 - {{# comments}}  
10 - <span class="user-name">  
11 - {{userName}}  
12 - </span>  
13 - <span class="goods-spec">  
14 - 购买了{{desc}}  
15 - </span>  
16 - <p class="detail-content">  
17 - {{content}}  
18 - </p>  
19 - <span class="comment-time">  
20 - {{time}}  
21 - </span>  
22 - {{/ comments}}  
23 - </div>  
24 - <a class="comment-content-footer tap-hightlight" href="{{commentsUrl}}">  
25 - 查看更多  
26 - <span class="iconfont">&#xe604;</span>  
27 - </a>  
28 - {{^}}  
29 - <div class="comment-content-main content-main no-item">  
30 - <span class="iconfont">&#xe63d;</span>暂无评论  
31 - </div>  
32 - {{/if}}  
33 - </div>  
34 -  
35 - <div class="consult-content content hide ">  
36 - {{#if consultsNum}}  
37 - <div class="consult-content-main content-main">  
38 - {{# consults}}  
39 - <div class="question">  
40 - <span class="iconfont">&#xe644;</span>  
41 - <p>  
42 - {{question}}<br>  
43 - <span class="time">{{time}}</span>  
44 - </p>  
45 - </div>  
46 -  
47 - <div class="answer">  
48 - <span class="iconfont">&#xe642;</span>  
49 - <p>{{answer}}</p>  
50 - </div>  
51 - {{/ consults}}  
52 - </div>  
53 - <a class="consult-content-footer tap-hightlight" href="{{consultsUrl}}">  
54 - 查看更多  
55 - <span class="iconfont">&#xe604;</span>  
56 - </a>  
57 - {{else}}  
58 - <div class="consult-content-main content-main no-item">  
59 - <span class="iconfont">&#xe63f;</span>暂无咨询  
60 - </div>  
61 -  
62 - <div class="consult-content-footer tap-hightlight">  
63 - <a href="{{consultsUrl}}">  
64 - 我要咨询  
65 - <span class="iconfont">&#xe604;</span></a>  
66 - </div>  
67 - {{/if}}  
68 - </div>  
69 -</div>  
  1 +{{#if pathNav}}
  2 + <p class="path-nav">
  3 + {{#each pathNav}}
  4 + {{#if name}}
  5 + {{#if href}}
  6 + <a {{#if @last}}class="last"{{/if}} href="{{href}}" title="{{pathTitle}}">{{{name}}}</a>
  7 + {{^}}
  8 + <span {{#if @last}}class="last"{{/if}} title="{{pathTitle}}">{{{name}}}</span>
  9 + {{/if}}
  10 + {{#unless @last}}
  11 + <span class="iconfont">&#xe601;</span>
  12 + {{/unless}}
  13 + {{/if}}
  14 + {{/each}}
  15 + </p>
  16 +{{/if}}
1 -<div class="recommend-for-you hide">  
2 -</div>  
  1 +<span class="share-wrapper share-to pull-left clearfix">
  2 + <i class="weibo" data-type="weibo" title="分享到新浪微博"></i>
  3 + <i class="weixin" data-type="weixin" title="分享到微信朋友圈"></i>
  4 + <i class="tweibo" data-type="tweibo" title="分享到腾讯微博"></i>
  5 + <i class="qzone" data-type="qzone" title="分享到QQ空间"></i>
  6 + <i class="qq" data-type="qq" title="分享到QQ好友"></i>
  7 + <i class="renren" data-type="renren" title="分享到人人"></i>
  8 + <i class="douban" data-type="douban" title="分享到豆瓣"></i>
  9 + <div class="weixin-share-box"></div>
  10 +</span>
  11 +<input id="share-img" type="hidden" value="{{shareImg}}">
  12 +<input id="share-desc" type="hidden" value="{{shareDesc}}">
  13 +<input id="weixin-url" type="hidden" value="{{weixinUrl}}">
1 const seoMap = { 1 const seoMap = {
2 -/* eslint-disable */  
3 - '/': {  
4 - title: 'YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证',  
5 - keywords: 'Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款',  
6 - description: 'YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。'  
7 - },  
8 - '/woman': {  
9 - title: '女生|时尚潮流女装,日韩女装,潮牌女装全球购|YOHO!BUY有货 100%正品保证',  
10 - keywords: '女生服饰,时尚潮流女装,日韩女装,女装正品购物网站,女装全球购',  
11 - description: 'YOHO!BUY有货官网女生频道汇集了全球女装潮流时尚,提供时尚潮流女装,日版女装,韩版女装,潮牌女装正品全球购。YOHO!BUY有货购物100%正品保证,支持货到付款。'  
12 - },  
13 - '/kids': {  
14 - title: '潮童|男童装,女童装,韩版童装,儿童服装服饰|YOHO!BUY有货 100%正品保证',  
15 - keywords: '潮童,男童装,女童装,韩版童装,儿童服装服饰',  
16 - description: 'YOHO!BUY有货官网潮童频道汇集了全球潮童潮流时尚,提供新款男童装,女童装,韩版童装,儿童服装服饰正品全球购。YOHO!BUY有货购物100%正品保证,支持货到付款。'  
17 - },  
18 - '/lifestyle': {  
19 - title: '创意生活|创意生活馆,潮流创意家居,家居生活用品|YOHO!BUY有货 100%正品保证',  
20 - keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,YOHO!有货',  
21 - description: 'YOHO!BUY有货官网创意生活频道汇集了创意生活馆,潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。YOHO!BUY有货购物100%正品保证,支持货到付款。'  
22 - } 2 +/* eslint-disable */
  3 + '/': {
  4 + title: 'YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证',
  5 + keywords: 'Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款',
  6 + description: 'YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。'
  7 + },
  8 + '/woman': {
  9 + title: '女生|时尚潮流女装,日韩女装,潮牌女装全球购|YOHO!BUY有货 100%正品保证',
  10 + keywords: '女生服饰,时尚潮流女装,日韩女装,女装正品购物网站,女装全球购',
  11 + description: 'YOHO!BUY有货官网女生频道汇集了全球女装潮流时尚,提供时尚潮流女装,日版女装,韩版女装,潮牌女装正品全球购。YOHO!BUY有货购物100%正品保证,支持货到付款。'
  12 + },
  13 + '/kids': {
  14 + title: '潮童|男童装,女童装,韩版童装,儿童服装服饰|YOHO!BUY有货 100%正品保证',
  15 + keywords: '潮童,男童装,女童装,韩版童装,儿童服装服饰',
  16 + description: 'YOHO!BUY有货官网潮童频道汇集了全球潮童潮流时尚,提供新款男童装,女童装,韩版童装,儿童服装服饰正品全球购。YOHO!BUY有货购物100%正品保证,支持货到付款。'
  17 + },
  18 + '/lifestyle': {
  19 + title: '创意生活|创意生活馆,潮流创意家居,家居生活用品|YOHO!BUY有货 100%正品保证',
  20 + keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,YOHO!有货',
  21 + description: 'YOHO!BUY有货官网创意生活频道汇集了创意生活馆,潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。YOHO!BUY有货购物100%正品保证,支持货到付款。'
  22 + }
23 /* eslint-enable */ 23 /* eslint-enable */
24 }; 24 };
25 25
  1 +.share-wrapper {
  2 + position: relative;
  3 +
  4 +i {
  5 + display: block;
  6 + float: left;
  7 + width: 16px;
  8 + height: 16px;
  9 + margin-left: 5px;
  10 + cursor: pointer;
  11 +}
  12 +
  13 +@each $icon in weibo,tweibo,renren,qzone,qq,douban,weixin {
  14 + .$(icon) {
  15 + background: url(/share/$(icon).png) no-repeat;
  16 +}
  17 +}
  18 +
  19 +.weixin-share-box {
  20 + display:none;
  21 + position: absolute;
  22 + width: 282px;
  23 + height: 302px;
  24 + padding-top: 9px;
  25 + text-align: center;
  26 + font-family: Microsoft Yahei, Arial, Verdana;
  27 + top: 22px;
  28 + right: -26px;
  29 + z-index:2;
  30 +
  31 +em,
  32 +em i {
  33 + position: absolute;
  34 + width: 0;
  35 + height: 0;
  36 + font-size: 0;
  37 + border-width: 0 10px 9px;
  38 + border-style: dashed dashed solid;
  39 +}
  40 +
  41 +em {
  42 + border-color: transparent transparent #d6d6d6;
  43 + top: 0px;
  44 + left: 50%;
  45 + margin-left: -10px;
  46 +}
  47 +
  48 +em i {
  49 + border-color: transparent transparent #e8e8e8;
  50 + overflow: hidden;
  51 + top: 1px;
  52 + left: -15px;
  53 +}
  54 +
  55 +.con {
  56 + position: relative;
  57 + width: 280px;
  58 + height: 300px;
  59 + overflow: hidden;
  60 + background-color: #fff;
  61 + border: 1px solid #d6d6d6;
  62 + box-shadow: 0px 2px 4px #d1d1d1;
  63 +}
  64 +
  65 +h2 {
  66 + display: block;
  67 + height: 46px;
  68 + line-height: 46px;
  69 + background-color: #e8e8e8;
  70 + color: #000;
  71 + font-size: 18px;
  72 +}
  73 +
  74 +.pic,
  75 +.pic img {
  76 + width: 168px;
  77 + height: 168px;
  78 +}
  79 +
  80 +.pic {
  81 + overflow: hidden;
  82 + margin: 16px auto;
  83 +}
  84 +
  85 +.w {
  86 + font-size: 13px;
  87 + color: #9f9f9f;
  88 + line-height: 20px;
  89 +}
  90 +
  91 +.close {
  92 + position: absolute;
  93 + width: 45px;
  94 + height: 45px;
  95 + line-height: 45px;
  96 + overflow: hidden;
  97 + top: 0;
  98 + right: 0;
  99 + font-size: 16px;
  100 + color: #999999;
  101 +}
  102 +}
  103 +}
@@ -231,6 +231,7 @@ a { @@ -231,6 +231,7 @@ a {
231 @import "index/index"; 231 @import "index/index";
232 @import "product/index"; 232 @import "product/index";
233 @import "plugins/slider"; 233 @import "plugins/slider";
  234 +@import "share"
234 235
235 /* 模块 */ 236 /* 模块 */
236 @import "index/index"; 237 @import "index/index";