Merge branch 'feature/sale' into release/4.8
Showing
39 changed files
with
421 additions
and
324 deletions
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | 9 | ||
10 | const api = global.yoho.API; | 10 | const api = global.yoho.API; |
11 | 11 | ||
12 | -const RegService = { | 12 | +const BindService = { |
13 | bindCheck(mobile, openId, sourceType, area) { | 13 | bindCheck(mobile, openId, sourceType, area) { |
14 | let params = { | 14 | let params = { |
15 | method: 'app.passport.signCheck', | 15 | method: 'app.passport.signCheck', |
@@ -84,4 +84,4 @@ const RegService = { | @@ -84,4 +84,4 @@ const RegService = { | ||
84 | } | 84 | } |
85 | }; | 85 | }; |
86 | 86 | ||
87 | -module.exports = RegService; | 87 | +module.exports = BindService; |
@@ -96,7 +96,6 @@ AlipayStrategy.prototype.authenticate = function(req, options) { | @@ -96,7 +96,6 @@ AlipayStrategy.prototype.authenticate = function(req, options) { | ||
96 | params.sign = md5(signString); | 96 | params.sign = md5(signString); |
97 | params.sign_type = 'MD5'; | 97 | params.sign_type = 'MD5'; |
98 | } | 98 | } |
99 | - | ||
100 | this.redirect(ALIPAY_URL + '?' + paramsToRaw(params)); | 99 | this.redirect(ALIPAY_URL + '?' + paramsToRaw(params)); |
101 | } | 100 | } |
102 | }; | 101 | }; |
@@ -104,4 +103,3 @@ AlipayStrategy.prototype.authenticate = function(req, options) { | @@ -104,4 +103,3 @@ AlipayStrategy.prototype.authenticate = function(req, options) { | ||
104 | exports = module.exports = AlipayStrategy; | 103 | exports = module.exports = AlipayStrategy; |
105 | 104 | ||
106 | exports.Strategy = AlipayStrategy; | 105 | exports.Strategy = AlipayStrategy; |
107 | - |
@@ -46,6 +46,10 @@ router.get('/passport/login/qq/callback', login.qq.callback); | @@ -46,6 +46,10 @@ router.get('/passport/login/qq/callback', login.qq.callback); | ||
46 | router.get('/passport/login/alipay', login.common.beforeLogin, login.alipay.login); | 46 | router.get('/passport/login/alipay', login.common.beforeLogin, login.alipay.login); |
47 | router.get('/passport/login/alipay/callback', login.alipay.callback); | 47 | router.get('/passport/login/alipay/callback', login.alipay.callback); |
48 | 48 | ||
49 | +// alipay登录 | ||
50 | +router.get('/login/alipay', login.common.beforeLogin, login.alipay.login); | ||
51 | +router.get('/login/alipay/callback', login.alipay.callback); | ||
52 | + | ||
49 | // 登录绑定 | 53 | // 登录绑定 |
50 | router.get('/passport/bind/index', bind.indexPage); | 54 | router.get('/passport/bind/index', bind.indexPage); |
51 | router.post('/passport/bind/bindCheck', bind.bindCheck); | 55 | router.post('/passport/bind/bindCheck', bind.bindCheck); |
@@ -8,11 +8,10 @@ | @@ -8,11 +8,10 @@ | ||
8 | 8 | ||
9 | const mRoot = '../models'; | 9 | const mRoot = '../models'; |
10 | const headerModel = require('../../../doraemon/models/header'); // 头部model | 10 | const headerModel = require('../../../doraemon/models/header'); // 头部model |
11 | -const detail = require(`${mRoot}/detail`); // 商品详情 model | ||
12 | -const intro = require(`${mRoot}/intro`); // 商品尺码信息 model | 11 | +const detailModel = require(`${mRoot}/detail`); // 商品详情 model |
12 | +const introModel = require(`${mRoot}/intro`); // 商品尺码信息 model | ||
13 | const preference = require(`${mRoot}/preference`); // 商品偏好 model | 13 | const preference = require(`${mRoot}/preference`); // 商品偏好 model |
14 | const detailRelated = require(`${mRoot}/consult-comment`); // 商品评论咨询 model | 14 | const detailRelated = require(`${mRoot}/consult-comment`); // 商品评论咨询 model |
15 | -const _ = require('lodash'); | ||
16 | 15 | ||
17 | /** | 16 | /** |
18 | * 商品基本信息 | 17 | * 商品基本信息 |
@@ -21,18 +20,18 @@ const _ = require('lodash'); | @@ -21,18 +20,18 @@ const _ = require('lodash'); | ||
21 | * @return {[type]} [description] | 20 | * @return {[type]} [description] |
22 | */ | 21 | */ |
23 | exports.index = (req, res, next) => { | 22 | exports.index = (req, res, next) => { |
24 | - let vipLevel = 0; // 用户等级 待处理 | ||
25 | - let uid = _.isEmpty(req.user.uid) ? null : req.user.uid; | ||
26 | - | 23 | + if (!req.params[0] || !req.params[1]) { |
24 | + return next(); | ||
25 | + } | ||
26 | + let uid = req.user.uid || 0; | ||
27 | let headerData = headerModel.setNav({ | 27 | let headerData = headerModel.setNav({ |
28 | navTitle: '商品详情' | 28 | navTitle: '商品详情' |
29 | }); | 29 | }); |
30 | 30 | ||
31 | - detail({ | 31 | + detailModel.getProductData({ |
32 | id: req.params[0], | 32 | id: req.params[0], |
33 | goodsId: req.params[1], | 33 | goodsId: req.params[1], |
34 | uid: uid, | 34 | uid: uid, |
35 | - vipLevel: vipLevel, | ||
36 | ua: req.get('user-agent') || '' | 35 | ua: req.get('user-agent') || '' |
37 | }).then((result) => { | 36 | }).then((result) => { |
38 | res.render('detail/detail', { | 37 | res.render('detail/detail', { |
@@ -51,15 +50,19 @@ exports.index = (req, res, next) => { | @@ -51,15 +50,19 @@ exports.index = (req, res, next) => { | ||
51 | * @param {[type]} res [description] | 50 | * @param {[type]} res [description] |
52 | * @return {[type]} [description] | 51 | * @return {[type]} [description] |
53 | */ | 52 | */ |
54 | -exports.intro = (req, res) => { | ||
55 | - intro({ | 53 | +exports.intro = (req, res, next) => { |
54 | + if (!req.params.productskn) { | ||
55 | + return next(); | ||
56 | + } | ||
57 | + | ||
58 | + introModel.getintroData({ | ||
56 | productskn: req.params.productskn | 59 | productskn: req.params.productskn |
57 | - }).then((result) => { | 60 | + }, req).then((result) => { |
58 | res.render('detail/intro', { | 61 | res.render('detail/intro', { |
59 | result: result, | 62 | result: result, |
60 | layout: false | 63 | layout: false |
61 | }); | 64 | }); |
62 | - }); | 65 | + }).catch(next); |
63 | }; | 66 | }; |
64 | 67 | ||
65 | /** | 68 | /** |
@@ -71,7 +74,7 @@ exports.intro = (req, res) => { | @@ -71,7 +74,7 @@ exports.intro = (req, res) => { | ||
71 | exports.preference = (req, res) => { | 74 | exports.preference = (req, res) => { |
72 | preference({ | 75 | preference({ |
73 | productskn: req.query.productSkn, | 76 | productskn: req.query.productSkn, |
74 | - yhchannel: 1, | 77 | + yhchannel: req.yoho.channel, |
75 | brandId: req.query.brandId | 78 | brandId: req.query.brandId |
76 | }).then((result) => { | 79 | }).then((result) => { |
77 | res.render('detail/preference', Object.assign({ | 80 | res.render('detail/preference', Object.assign({ |
@@ -115,11 +118,14 @@ exports.consults = (req, res, next) => { | @@ -115,11 +118,14 @@ exports.consults = (req, res, next) => { | ||
115 | /** | 118 | /** |
116 | * 咨询表单页 | 119 | * 咨询表单页 |
117 | */ | 120 | */ |
118 | -exports.consultform = (req, res) => { | 121 | +exports.consultform = (req, res, next) => { |
119 | let headerData = headerModel.setNav({ | 122 | let headerData = headerModel.setNav({ |
120 | navTitle: '我要咨询' | 123 | navTitle: '我要咨询' |
121 | }); | 124 | }); |
122 | 125 | ||
126 | + if (!req.query.product_id) { | ||
127 | + return next(); | ||
128 | + } | ||
123 | res.render('detail/consult-form', { | 129 | res.render('detail/consult-form', { |
124 | pageHeader: headerData, | 130 | pageHeader: headerData, |
125 | productId: req.query.product_id, | 131 | productId: req.query.product_id, |
@@ -11,11 +11,31 @@ const _ = require('lodash'); | @@ -11,11 +11,31 @@ const _ = require('lodash'); | ||
11 | const helpers = global.yoho.helpers; | 11 | const helpers = global.yoho.helpers; |
12 | 12 | ||
13 | /** | 13 | /** |
14 | + * 获取用户数据信息 | ||
15 | + * @param {[string]} uid | ||
16 | + * @return {[array]} | ||
17 | + */ | ||
18 | +const _getUserProfile = (uid) => { | ||
19 | + if (!uid) { | ||
20 | + return Promise.resolve({ | ||
21 | + code: 200, | ||
22 | + data: {} | ||
23 | + }); | ||
24 | + } | ||
25 | + return api.get('', { | ||
26 | + method: 'app.passport.profile', | ||
27 | + uid: uid | ||
28 | + }, { | ||
29 | + cache: true | ||
30 | + }); | ||
31 | +}; | ||
32 | + | ||
33 | +/** | ||
14 | * 处理品牌关联店铺信息 | 34 | * 处理品牌关联店铺信息 |
15 | * @param {array} | 35 | * @param {array} |
16 | * @return {array} | 36 | * @return {array} |
17 | */ | 37 | */ |
18 | -const getShopsInfo = (data) => { | 38 | +const _processShopsInfo = (data) => { |
19 | let enterStore = []; | 39 | let enterStore = []; |
20 | 40 | ||
21 | _.forEach(data, function(value) { | 41 | _.forEach(data, function(value) { |
@@ -44,7 +64,7 @@ const getShopsInfo = (data) => { | @@ -44,7 +64,7 @@ const getShopsInfo = (data) => { | ||
44 | * @param {Boolean} 限购商品是否已开售 | 64 | * @param {Boolean} 限购商品是否已开售 |
45 | * @return {array} | 65 | * @return {array} |
46 | */ | 66 | */ |
47 | -const procShowStatus = (data, showStatus, isBeginSale) => { | 67 | +const _procShowStatus = (data, showStatus, isBeginSale) => { |
48 | switch (showStatus) { | 68 | switch (showStatus) { |
49 | case 1: // 开售前/后,立即分享获得限购码(用户未领取限购码) | 69 | case 1: // 开售前/后,立即分享获得限购码(用户未领取限购码) |
50 | // 显示获取限购码按钮 | 70 | // 显示获取限购码按钮 |
@@ -93,7 +113,7 @@ const procShowStatus = (data, showStatus, isBeginSale) => { | @@ -93,7 +113,7 @@ const procShowStatus = (data, showStatus, isBeginSale) => { | ||
93 | * @param {string} skn 限购商品skn | 113 | * @param {string} skn 限购商品skn |
94 | * @return {string} 限购商品跳转url | 114 | * @return {string} 限购商品跳转url |
95 | */ | 115 | */ |
96 | -const getLimitCodeUrl = (productCode, skn, ua) => { | 116 | +const _getLimitCodeUrl = (productCode, skn, ua) => { |
97 | let url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode + | 117 | let url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode + |
98 | '&product_skn=' + skn; | 118 | '&product_skn=' + skn; |
99 | 119 | ||
@@ -114,7 +134,7 @@ const getLimitCodeUrl = (productCode, skn, ua) => { | @@ -114,7 +134,7 @@ const getLimitCodeUrl = (productCode, skn, ua) => { | ||
114 | * @param origin Object 原始数据 | 134 | * @param origin Object 原始数据 |
115 | * @return dest Object 格式化数据 | 135 | * @return dest Object 格式化数据 |
116 | */ | 136 | */ |
117 | -const detailDataPkg = (origin, uid, vipLevel, ua) => { | 137 | +const _detailDataPkg = (origin, uid, vipLevel, ua) => { |
118 | let dest = {}, // 结果输出 | 138 | let dest = {}, // 结果输出 |
119 | thumbImageList = [], | 139 | thumbImageList = [], |
120 | colorGroup = {}, | 140 | colorGroup = {}, |
@@ -128,8 +148,8 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -128,8 +148,8 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
128 | 148 | ||
129 | dest.goodsName = origin.productName; | 149 | dest.goodsName = origin.productName; |
130 | 150 | ||
131 | - // 用户未登录时 待处理 | ||
132 | - if (uid === null || typeof uid === 'undefined') { | 151 | + // 用户未登录时 |
152 | + if (!uid) { | ||
133 | let params = {}; | 153 | let params = {}; |
134 | 154 | ||
135 | params.refer = helpers.urlFormat('/product/show_' + origin.erpProductId + '.html'); | 155 | params.refer = helpers.urlFormat('/product/show_' + origin.erpProductId + '.html'); |
@@ -217,7 +237,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -217,7 +237,7 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
217 | dest.periodOfMarket = `${origin.expectArrivalTime}月`; | 237 | dest.periodOfMarket = `${origin.expectArrivalTime}月`; |
218 | } | 238 | } |
219 | 239 | ||
220 | - // 促销信息 | 240 | + // 促销信息 TODO: 换新接口 |
221 | if (origin.promotionBoList) { | 241 | if (origin.promotionBoList) { |
222 | let discountList = []; | 242 | let discountList = []; |
223 | 243 | ||
@@ -257,10 +277,11 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -257,10 +277,11 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
257 | 277 | ||
258 | if (_.has(dest, 'feedbacks.consultsNum')) { | 278 | if (_.has(dest, 'feedbacks.consultsNum')) { |
259 | consultParams.total = dest.feedbacks.consultsNum; | 279 | consultParams.total = dest.feedbacks.consultsNum; |
280 | + dest.feedbacks.consultsUrl = helpers.urlFormat('/product/detail/consult', consultParams); | ||
281 | + } else { | ||
282 | + dest.feedbacks.consultsUrl = helpers.urlFormat('/product/detail/consultform', consultParams); | ||
260 | } | 283 | } |
261 | 284 | ||
262 | - dest.feedbacks.consultsUrl = helpers.urlFormat('/product/detail/consultform', consultParams); | ||
263 | - | ||
264 | 285 | ||
265 | // 商品评价 | 286 | // 商品评价 |
266 | dest.feedbacks.commentsNum = 0; | 287 | dest.feedbacks.commentsNum = 0; |
@@ -481,14 +502,14 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -481,14 +502,14 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
481 | } | 502 | } |
482 | 503 | ||
483 | // 处理限购商品有关的按钮状态 | 504 | // 处理限购商品有关的按钮状态 |
484 | - dest = procShowStatus(dest, showStatus, isBeginSale); | ||
485 | - Object.assign; | 505 | + dest = _procShowStatus(dest, showStatus, isBeginSale); |
506 | + | ||
486 | dest.cartInfo.limitProductCode = origin.limitProductCode; | 507 | dest.cartInfo.limitProductCode = origin.limitProductCode; |
487 | - dest.cartInfo.limitCodeUrl = getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua); | ||
488 | - dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure'); // 待处理 相关处理逻辑还不存在 | 508 | + dest.cartInfo.limitCodeUrl = _getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua); |
509 | + dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure'); | ||
489 | } else { | 510 | } else { |
490 | dest.cartInfo.addToCartUrl = helpers.urlFormat('/product/buy_' + origin.id + '_' + | 511 | dest.cartInfo.addToCartUrl = helpers.urlFormat('/product/buy_' + origin.id + '_' + |
491 | - origin.goodsList.id + '.html'); // 待处理 相关处理逻辑还不存在 | 512 | + origin.goodsList.id + '.html'); |
492 | } | 513 | } |
493 | } else if (notForSale) { | 514 | } else if (notForSale) { |
494 | dest.cartInfo.notForSale = true; | 515 | dest.cartInfo.notForSale = true; |
@@ -497,7 +518,6 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -497,7 +518,6 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
497 | } | 518 | } |
498 | 519 | ||
499 | // 是否收藏 | 520 | // 是否收藏 |
500 | - | ||
501 | dest.isCollect = false; | 521 | dest.isCollect = false; |
502 | if (origin.isCollect !== null && typeof origin.isCollect !== 'undefined' && origin.isCollect === 'Y') { | 522 | if (origin.isCollect !== null && typeof origin.isCollect !== 'undefined' && origin.isCollect === 'Y') { |
503 | dest.isCollect = true; | 523 | dest.isCollect = true; |
@@ -510,7 +530,37 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | @@ -510,7 +530,37 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { | ||
510 | return dest; | 530 | return dest; |
511 | }; | 531 | }; |
512 | 532 | ||
513 | -module.exports = (data) => { | 533 | +let _getShopsInfo = (brandId) => { |
534 | + return api.get('', { | ||
535 | + method: 'app.shop.queryShopsByBrandId', | ||
536 | + brand_id: _.toString(brandId) | ||
537 | + }, { | ||
538 | + cache: true | ||
539 | + }).then(shops => { | ||
540 | + if (shops.code === 200) { | ||
541 | + return _processShopsInfo(shops.data); | ||
542 | + } | ||
543 | + | ||
544 | + return []; | ||
545 | + }); | ||
546 | +}; | ||
547 | + | ||
548 | +let _getPromotionInfo = (skn) => { | ||
549 | + return api.get('', { | ||
550 | + method: 'app.product.promotion', | ||
551 | + product_skn: _.toString(skn) | ||
552 | + }, { | ||
553 | + cache: true | ||
554 | + }).then((result) => { | ||
555 | + if (result.code === 200) { | ||
556 | + return result.data; | ||
557 | + } | ||
558 | + | ||
559 | + return {}; | ||
560 | + }); | ||
561 | +}; | ||
562 | + | ||
563 | +let getProductData = (data) => { | ||
514 | let finalResult; | 564 | let finalResult; |
515 | let params = { | 565 | let params = { |
516 | productId: _.toString(data.id), | 566 | productId: _.toString(data.id), |
@@ -521,18 +571,25 @@ module.exports = (data) => { | @@ -521,18 +571,25 @@ module.exports = (data) => { | ||
521 | params.uid = data.uid; | 571 | params.uid = data.uid; |
522 | } | 572 | } |
523 | 573 | ||
524 | - return api.get('', params).then(result => { | ||
525 | - finalResult = detailDataPkg(result, data.uid, data.vipLevel, data.ua); | 574 | + return _getUserProfile(params.uid).then((user) => { |
575 | + data.vipLevel = (user.data && user.data.vip_info && user.data.vip_info.cur_level) || '0'; | ||
526 | 576 | ||
527 | - return api.get('', { | ||
528 | - method: 'app.shop.queryShopsByBrandId', | ||
529 | - brand_id: _.toString(result.brandId) | ||
530 | - }).then(shops => { | ||
531 | - if (shops.code === 200) { | ||
532 | - finalResult.enterStore = getShopsInfo(shops.data); | ||
533 | - } | 577 | + return api.get('', params, { |
578 | + cache: true | ||
579 | + }).then(result => { | ||
580 | + return Promise.all([_getShopsInfo(result.brandId), _getPromotionInfo(result.erpProductId)]).then((info) => { | ||
581 | + result.promotionBoList = info[1]; | ||
582 | + | ||
583 | + finalResult = _detailDataPkg(result, data.uid, data.vipLevel, data.ua); | ||
584 | + finalResult.enterStore = info[0]; | ||
585 | + | ||
586 | + return finalResult; | ||
587 | + }); | ||
534 | 588 | ||
535 | - return finalResult; | ||
536 | }); | 589 | }); |
537 | }); | 590 | }); |
538 | }; | 591 | }; |
592 | + | ||
593 | +module.exports = { | ||
594 | + getProductData | ||
595 | +}; |
@@ -157,7 +157,7 @@ const getSizeInfo = (sizeInfo) => { | @@ -157,7 +157,7 @@ const getSizeInfo = (sizeInfo) => { | ||
157 | dest.sizeInfo.detail.list.push(temp); | 157 | dest.sizeInfo.detail.list.push(temp); |
158 | }); | 158 | }); |
159 | } else { | 159 | } else { |
160 | - dest.sizeInfo.detail.list[0].params[0] = ''; | 160 | + dest.sizeInfo.detail.list[0] && (dest.sizeInfo.detail.list[0].params[0] = ''); |
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
@@ -172,40 +172,92 @@ const getSizeInfo = (sizeInfo) => { | @@ -172,40 +172,92 @@ const getSizeInfo = (sizeInfo) => { | ||
172 | 172 | ||
173 | // 模特试穿, 竖着输出排列显示 | 173 | // 模特试穿, 竖着输出排列显示 |
174 | if (!_.isEmpty(sizeInfo.modelBos)) { | 174 | if (!_.isEmpty(sizeInfo.modelBos)) { |
175 | - dest.reference = {}; | ||
176 | - dest.reference.title = '模特试穿'; | ||
177 | - dest.reference.enTitle = 'REFERENCE'; | ||
178 | - dest.reference.detail = {}; | ||
179 | - dest.reference.detail.list = {}; | 175 | + let reference = { |
176 | + title: '模特试穿', | ||
177 | + enTitle: 'REFERENCE' | ||
178 | + }; | ||
180 | 179 | ||
181 | - // 控制是否显示备注 | ||
182 | - // let showRemark = false; | ||
183 | - let remarkList = {}; | 180 | + dest.reference = reference; |
184 | 181 | ||
185 | - remarkList[0] = {}; | ||
186 | - remarkList[0].param = '备注'; | 182 | + // 控制是否显示备注 |
183 | + let showRemark = false; | ||
184 | + let remarkList = [{ | ||
185 | + param: '备注' | ||
186 | + }]; | ||
187 | + | ||
188 | + let detail = { | ||
189 | + list: [{ | ||
190 | + params: [{ | ||
191 | + param: '' | ||
192 | + }] | ||
193 | + }, { | ||
194 | + params: [{ | ||
195 | + param: '模特' | ||
196 | + }] | ||
197 | + }, { | ||
198 | + params: [{ | ||
199 | + param: '身高' | ||
200 | + }] | ||
201 | + }, { | ||
202 | + params: [{ | ||
203 | + param: '体重' | ||
204 | + }] | ||
205 | + }, { | ||
206 | + params: [{ | ||
207 | + param: '三围' | ||
208 | + }] | ||
209 | + }, { | ||
210 | + params: [{ | ||
211 | + param: '吊牌尺码' | ||
212 | + }] | ||
213 | + }, { | ||
214 | + params: [{ | ||
215 | + param: '试穿描述' | ||
216 | + }] | ||
217 | + }] | ||
218 | + }; | ||
219 | + | ||
220 | + reference.detail = detail; | ||
221 | + _.forEach(sizeInfo.modelBos, function(value) { | ||
222 | + detail.list[0].params.push({ | ||
223 | + param: value.avatar.replace('http://', '//') | ||
224 | + }); | ||
225 | + detail.list[1].params.push({ | ||
226 | + param: value.modelName | ||
227 | + }); | ||
228 | + detail.list[2].params.push({ | ||
229 | + param: value.height | ||
230 | + }); | ||
231 | + detail.list[3].params.push({ | ||
232 | + param: value.weight | ||
233 | + }); | ||
234 | + detail.list[4].params.push({ | ||
235 | + param: value.vitalStatistics | ||
236 | + }); | ||
237 | + detail.list[5].params.push({ | ||
238 | + param: value.fitModelBo && value.fitModelBo.fit_size | ||
239 | + }); | ||
240 | + detail.list[6].params.push({ | ||
241 | + param: value.fitModelBo && value.fitModelBo.feel | ||
242 | + }); | ||
187 | 243 | ||
188 | - for (let i = 0; i < 7; i++) { | ||
189 | - dest.reference.detail.list[i] = {}; | ||
190 | - dest.reference.detail.list[i].params = {}; | ||
191 | - dest.reference.detail.list[0].params[0] = {}; | ||
192 | - } | ||
193 | - dest.reference.detail.list[0].params[0].param = ''; | ||
194 | - dest.reference.detail.list[1].params[0].param = '模特'; | ||
195 | - dest.reference.detail.list[2].params[0].param = '身高'; | ||
196 | - dest.reference.detail.list[3].params[0].param = '体重'; | ||
197 | - dest.reference.detail.list[4].params[0].param = '三围'; | ||
198 | - dest.reference.detail.list[5].params[0].param = '吊牌尺码'; | ||
199 | - dest.reference.detail.list[6].params[0].param = '试穿描述'; | ||
200 | - | ||
201 | - // _.forEach(sizeInfo.modelBos, function(value) { | ||
202 | - // // 待处理 | ||
203 | - // }); | 244 | + if (value.fitModelBo && value.fitModelBo.fit_remark) { |
245 | + showRemark = true; | ||
246 | + remarkList.push({ | ||
247 | + param: value.fitModelBo && value.fitModelBo.fit_remark | ||
248 | + }); | ||
249 | + } else { | ||
250 | + remarkList.push({ | ||
251 | + param: '' | ||
252 | + }); | ||
253 | + } | ||
254 | + }); | ||
204 | 255 | ||
205 | // 显示模特备注 | 256 | // 显示模特备注 |
206 | - // if (showRemark) { | ||
207 | - | ||
208 | - // } | 257 | + if (showRemark) { |
258 | + detail.list[7] = {}; | ||
259 | + detail.list[7].params = remarkList; | ||
260 | + } | ||
209 | 261 | ||
210 | } | 262 | } |
211 | 263 | ||
@@ -250,15 +302,15 @@ const getSizeInfo = (sizeInfo) => { | @@ -250,15 +302,15 @@ const getSizeInfo = (sizeInfo) => { | ||
250 | dest.productDetail.enTitle = 'DETAILS'; | 302 | dest.productDetail.enTitle = 'DETAILS'; |
251 | 303 | ||
252 | dest.productDetail.desc = productIntro.replace(/\r\n\t/g, ''). | 304 | dest.productDetail.desc = productIntro.replace(/\r\n\t/g, ''). |
253 | - replace(/<\/p>/g, ''). | ||
254 | - replace(/<img src=/g, '<img class="lazy" src="data:image/gif;' + | ||
255 | - 'base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="' + | ||
256 | - ' data-original='). | ||
257 | - replace(/<img border="0" src=/g, '<img border="0" class="lazy" ' + | ||
258 | - 'src="data:image/gif;base64,' + | ||
259 | - 'R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="' + | ||
260 | - ' data-original='). | ||
261 | - replace(/.jpg/g, '.jpg?imageMogr2/thumbnail/750x/quality/90'); | 305 | + replace(/<\/p>/g, ''). |
306 | + replace(/<img src=/g, '<img class="lazy" src="data:image/gif;' + | ||
307 | + 'base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="' + | ||
308 | + ' data-original='). | ||
309 | + replace(/<img border="0" src=/g, '<img border="0" class="lazy" ' + | ||
310 | + 'src="data:image/gif;base64,' + | ||
311 | + 'R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=="' + | ||
312 | + ' data-original='). | ||
313 | + replace(/.jpg/g, '.jpg?imageMogr2/thumbnail/750x/quality/90'); | ||
262 | } | 314 | } |
263 | 315 | ||
264 | // 清空变量,释放内存 | 316 | // 清空变量,释放内存 |
@@ -267,16 +319,20 @@ const getSizeInfo = (sizeInfo) => { | @@ -267,16 +319,20 @@ const getSizeInfo = (sizeInfo) => { | ||
267 | return dest; | 319 | return dest; |
268 | }; | 320 | }; |
269 | 321 | ||
270 | -module.exports = (data) => { | 322 | +let getintroData = (data, req) => { |
271 | var finalResult; | 323 | var finalResult; |
272 | 324 | ||
273 | return api.get('', { | 325 | return api.get('', { |
274 | method: 'h5.product.intro', | 326 | method: 'h5.product.intro', |
275 | productskn: data.productskn, | 327 | productskn: data.productskn, |
276 | - udid: 'f528764d624db129b32c21fbca0cb8d6' | 328 | + udid: req.sessionID || 'yoho' |
277 | }).then(result => { | 329 | }).then(result => { |
278 | finalResult = getSizeInfo(result); | 330 | finalResult = getSizeInfo(result); |
279 | 331 | ||
280 | return finalResult; | 332 | return finalResult; |
281 | }); | 333 | }); |
282 | }; | 334 | }; |
335 | + | ||
336 | +module.exports = { | ||
337 | + getintroData | ||
338 | +}; |
@@ -11,6 +11,13 @@ const _ = require('lodash'); | @@ -11,6 +11,13 @@ const _ = require('lodash'); | ||
11 | const api = global.yoho.API; | 11 | const api = global.yoho.API; |
12 | const helpers = global.yoho.helpers; | 12 | const helpers = global.yoho.helpers; |
13 | 13 | ||
14 | +const yhchannelMap = { | ||
15 | + boys: '1', | ||
16 | + girls: '2', | ||
17 | + kids: '3', | ||
18 | + lifestyle: '4' | ||
19 | +}; | ||
20 | + | ||
14 | const _formatProduct = (data) => { | 21 | const _formatProduct = (data) => { |
15 | let list = []; | 22 | let list = []; |
16 | 23 | ||
@@ -46,7 +53,7 @@ module.exports = (data) => { | @@ -46,7 +53,7 @@ module.exports = (data) => { | ||
46 | return api.get('', { | 53 | return api.get('', { |
47 | method: 'h5.preference.Search', | 54 | method: 'h5.preference.Search', |
48 | productskn: data.productskn, | 55 | productskn: data.productskn, |
49 | - yhchannel: data.yhchannel, | 56 | + yhchannel: yhchannelMap[data.yhchannel], |
50 | brandId: data.brandId | 57 | brandId: data.brandId |
51 | }).then(result => { | 58 | }).then(result => { |
52 | if (result) { | 59 | if (result) { |
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | {{/ tags}} | 24 | {{/ tags}} |
25 | </div> | 25 | </div> |
26 | {{# bannerTop}} | 26 | {{# bannerTop}} |
27 | - {{> product/banner-swiper-arrow}} | 27 | + {{> detail/banner-swiper-arrow}} |
28 | {{/ bannerTop}} | 28 | {{/ bannerTop}} |
29 | </div> | 29 | </div> |
30 | {{# goodsName}} | 30 | {{# goodsName}} |
@@ -102,10 +102,10 @@ | @@ -102,10 +102,10 @@ | ||
102 | {{# feedbacks}} | 102 | {{# feedbacks}} |
103 | <div class="feedback-list "> | 103 | <div class="feedback-list "> |
104 | {{#if commentsNum}} | 104 | {{#if commentsNum}} |
105 | - {{> product/detail/feedback-tab}} | 105 | + {{> detail/feedback-tab}} |
106 | {{else}} | 106 | {{else}} |
107 | {{#if consultsNum}} | 107 | {{#if consultsNum}} |
108 | - {{> product/detail/feedback-tab}} | 108 | + {{> detail/feedback-tab}} |
109 | {{else}} | 109 | {{else}} |
110 | <div class="nodata tap-hightlight" id="goto-consult"> | 110 | <div class="nodata tap-hightlight" id="goto-consult"> |
111 | <span>暂无商品评价和咨询</span> | 111 | <span>暂无商品评价和咨询</span> |
@@ -127,7 +127,7 @@ | @@ -127,7 +127,7 @@ | ||
127 | {{/ enterStore}} | 127 | {{/ enterStore}} |
128 | 128 | ||
129 | <div id="productDesc"> </div> | 129 | <div id="productDesc"> </div> |
130 | - {{> product/detail/recommend-for-you}} | 130 | + {{> detail/recommend-for-you}} |
131 | {{> cart/chose-panel}} | 131 | {{> cart/chose-panel}} |
132 | 132 | ||
133 | {{#cartInfo}} | 133 | {{#cartInfo}} |
@@ -184,4 +184,4 @@ | @@ -184,4 +184,4 @@ | ||
184 | {{/loginUrl}} | 184 | {{/loginUrl}} |
185 | 185 | ||
186 | </div> | 186 | </div> |
187 | -{{/ result}} | ||
187 | +{{/ result}} |
1 | {{# result}} | 1 | {{# result}} |
2 | - {{> product/detail/product-description}} | ||
3 | -{{/ result}} | ||
2 | + {{#goodsDescription}} | ||
3 | + <div class="goods-desc page-block"> | ||
4 | + <div class="service"></div> | ||
5 | + <h1 class="title"> | ||
6 | + {{title}} | ||
7 | + <span class="en-title">{{enTitle}}</span> | ||
8 | + </h1> | ||
9 | + {{#detail}} | ||
10 | + <div class="detail table"> | ||
11 | + {{#list}} | ||
12 | + <div class="column">{{param}}</div> | ||
13 | + {{/list}} | ||
14 | + </div> | ||
15 | + {{/detail}} | ||
16 | + {{#if desc}} | ||
17 | + <div class="desc-text">{{desc}}</div> | ||
18 | + {{/if}} | ||
19 | + </div> | ||
20 | + | ||
21 | + {{/goodsDescription}} | ||
22 | + | ||
23 | + {{#sizeInfo}} | ||
24 | + <div class="size-info page-block"> | ||
25 | + <h1 class="title"> | ||
26 | + {{title}} | ||
27 | + <span class="en-title">{{enTitle}}</span> | ||
28 | + </h1> | ||
29 | + {{#detail}} | ||
30 | + <div class="detail"> | ||
31 | + <div class="swiper-container detail-swiper" id="size-swiper-container"> | ||
32 | + <div class="swiper-wrapper"> | ||
33 | + {{#list}} | ||
34 | + <div class="swiper-slide " > | ||
35 | + {{#params}} | ||
36 | + <div class="cell">{{param}}</div> | ||
37 | + {{/params}} | ||
38 | + </div> | ||
39 | + {{/list}} | ||
40 | + </div> | ||
41 | + </div> | ||
42 | + <p class="tips">提示:左滑查看完整表格信息</p> | ||
43 | + </div> | ||
44 | + {{/detail}} | ||
45 | + </div> | ||
46 | + {{/sizeInfo}} | ||
47 | + | ||
48 | + {{#measurementMethod}} | ||
49 | + <div class="measurement-method page-block"> | ||
50 | + <h1 class="title"> | ||
51 | + {{title}} | ||
52 | + <span class="en-title">{{enTitle}}</span> | ||
53 | + </h1> | ||
54 | + <div class="detail" style="width:100%"> | ||
55 | + <img class="lazy" data-original="{{img}}" alt=""> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | + {{/measurementMethod}} | ||
59 | + | ||
60 | + {{#reference}} | ||
61 | + <div class="size-info page-block"> | ||
62 | + <h1 class="title"> | ||
63 | + {{title}} | ||
64 | + <span class="en-title">{{enTitle}}</span> | ||
65 | + </h1> | ||
66 | + {{#detail}} | ||
67 | + <div class="detail"> | ||
68 | + <div class="swiper-container detail-swiper" id="reference-swiper-container"> | ||
69 | + <div class="swiper-wrapper"> | ||
70 | + {{#list}} | ||
71 | + {{#if @first}} | ||
72 | + <div class="swiper-slide first-group" > | ||
73 | + {{#params}} | ||
74 | + {{#if @first}} | ||
75 | + {{else}} | ||
76 | + <div> | ||
77 | + <img class="avatar lazy" data-original="{{param}}" alt=""> | ||
78 | + </div> | ||
79 | + {{/if}} | ||
80 | + {{/params}} | ||
81 | + </div> | ||
82 | + {{else}} | ||
83 | + <div class="swiper-slide" > | ||
84 | + {{#params}} | ||
85 | + <div class=" cell">{{param}}</div> | ||
86 | + {{/params}} | ||
87 | + </div> | ||
88 | + {{/if}} | ||
89 | + {{/list}} | ||
90 | + </div> | ||
91 | + </div> | ||
92 | + <p class="tips">提示:左滑查看完整表格信息</p> | ||
93 | + </div> | ||
94 | + {{/detail}} | ||
95 | + </div> | ||
96 | + {{/reference}} | ||
97 | + | ||
98 | + {{#materials}} | ||
99 | + <div class="materials page-block"> | ||
100 | + <h1 class="title"> | ||
101 | + {{title}} | ||
102 | + <span class="en-title">{{enTitle}}</span> | ||
103 | + </h1> | ||
104 | + <div class="detail"> | ||
105 | + {{#list}} | ||
106 | + <div class="material-item"> | ||
107 | + <!-- <img class="lazy" data-original="{{img}}" alt=""> | ||
108 | + <p class="material-desc"> | ||
109 | + {{desc}} | ||
110 | + </p>--> | ||
111 | + <div class="material-image"> | ||
112 | + <img src="{{img}}" alt="材质图"> | ||
113 | + </div> | ||
114 | + <div class="material-desc"> | ||
115 | + {{desc}} | ||
116 | + </div> | ||
117 | + </div> | ||
118 | + {{/list}} | ||
119 | + </div> | ||
120 | + </div> | ||
121 | + {{/materials}} | ||
122 | + | ||
123 | + {{#washTips}} | ||
124 | + <div class="wash-tips page-block"> | ||
125 | + <div class="detail table clearfix"> | ||
126 | + {{#list}} | ||
127 | + <div class="tip"> | ||
128 | + <img src="{{img}}" alt=""> | ||
129 | + <span class="caption">{{caption}}</span> | ||
130 | + </div> | ||
131 | + {{/list}} | ||
132 | + </div> | ||
133 | + </div> | ||
134 | + {{/washTips}} | ||
135 | + | ||
136 | + {{#productDetail}} | ||
137 | + <div class="product-detail page-block"> | ||
138 | + <h1 class="title"> | ||
139 | + {{{title}}} | ||
140 | + <span class="en-title">{{{enTitle}}}</span> | ||
141 | + </h1> | ||
142 | + <div class="pro-detail"> | ||
143 | + <p>{{{desc}}}</p> | ||
144 | + {{#list}} | ||
145 | + <img class="lazy" data-original="{{img}}" alt=""> | ||
146 | + {{/list}} | ||
147 | + </div> | ||
148 | + </div> | ||
149 | + {{/productDetail}} | ||
150 | +{{/ result}} |
1 | -{{> product/detail/recommend-content}} | ||
1 | +<div class="title">为您优选新品</div> | ||
2 | +<div id="swiper-recommend" class="swiper-container"> | ||
3 | + <div class="swiper-wrapper swiper-wrapper-recommend"> | ||
4 | + {{# recommendList}} | ||
5 | + <a class="swiper-slide" href="{{url}}"> | ||
6 | + <img class="swiper-lazy img-box" data-src="{{image thumb 299 388}}"> | ||
7 | + <div class="sale-name"> | ||
8 | + {{name}} | ||
9 | + </div> | ||
10 | + <div class="price"> | ||
11 | + <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | ||
12 | + {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} | ||
13 | + </div> | ||
14 | + <div class="swiper-lazy-preloader"></div> | ||
15 | + </a> | ||
16 | + {{/ recommendList}} | ||
17 | + </div> | ||
18 | +</div> |
1 | <div class="outlet-page yoho-page"> | 1 | <div class="outlet-page yoho-page"> |
2 | - {{> product/outlet/nav}} | 2 | + {{> outlet/nav}} |
3 | <p class="more-fashion">更多潮品,敬请期待</p> | 3 | <p class="more-fashion">更多潮品,敬请期待</p> |
4 | {{# activity}} | 4 | {{# activity}} |
5 | {{> resources/acivity-outlets}} | 5 | {{> resources/acivity-outlets}} |
1 | <div class="discount-detail-page goods-page yoho-page" data-product-pool="{{productPool}}"> | 1 | <div class="discount-detail-page goods-page yoho-page" data-product-pool="{{productPool}}"> |
2 | - {{> product/sale/banner}} | 2 | + {{> sale/banner}} |
3 | 3 | ||
4 | <ul id="list-nav" class="list-nav clearfix"> | 4 | <ul id="list-nav" class="list-nav clearfix"> |
5 | <li class="all active"> | 5 | <li class="all active"> |
@@ -33,6 +33,6 @@ | @@ -33,6 +33,6 @@ | ||
33 | </li> | 33 | </li> |
34 | </ul> | 34 | </ul> |
35 | 35 | ||
36 | - {{> product/sale/common}} | 36 | + {{> sale/common}} |
37 | 37 | ||
38 | </div> | 38 | </div> |
1 | <div class="sale-vip-page goods-page yoho-page"> | 1 | <div class="sale-vip-page goods-page yoho-page"> |
2 | 2 | ||
3 | - {{> product/sale/banner}} | 3 | + {{> sale/banner}} |
4 | 4 | ||
5 | <ul id="list-nav" class="list-nav clearfix"> | 5 | <ul id="list-nav" class="list-nav clearfix"> |
6 | <li class="new active"> | 6 | <li class="new active"> |
@@ -30,6 +30,6 @@ | @@ -30,6 +30,6 @@ | ||
30 | </li> | 30 | </li> |
31 | </ul> | 31 | </ul> |
32 | 32 | ||
33 | - {{> product/sale/common}} | 33 | + {{> sale/common}} |
34 | 34 | ||
35 | </div> | 35 | </div> |
@@ -19,10 +19,10 @@ | @@ -19,10 +19,10 @@ | ||
19 | <div class="my-swiper-button-prev prev-grey"></div> | 19 | <div class="my-swiper-button-prev prev-grey"></div> |
20 | <div class="my-swiper-button-next next-grey"></div> | 20 | <div class="my-swiper-button-next next-grey"></div> |
21 | </div> | 21 | </div> |
22 | - {{^}} | ||
23 | -<div class="banner-top-single"> | ||
24 | -<a href={{url}}> | ||
25 | -<img class="img" src="{{image img 450 600}}"> | ||
26 | -</a> | ||
27 | -</div> | ||
28 | - {{/if}} | ||
22 | +{{^}} | ||
23 | + <div class="banner-top-single"> | ||
24 | + <a href={{url}}> | ||
25 | + <img class="img" src="{{image img 450 600}}"> | ||
26 | + </a> | ||
27 | + </div> | ||
28 | +{{/if}} |
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="{{url}}"> | ||
8 | - <img class="swiper-lazy" data-src="{{src}}"> | ||
9 | - </a> | ||
10 | - <div class="swiper-lazy-preloader"></div> | ||
11 | - </li> | ||
12 | - {{/ list}} | ||
13 | - </ul> | ||
14 | - </div> | ||
15 | - <div class="swiper-pagination"> | ||
16 | - <div class="pagination-inner"> | ||
17 | - </div> | ||
18 | - </div> | ||
19 | - </div> | ||
20 | -{{else}} | ||
21 | - <div class="banner-top-single"> | ||
22 | - <a href={{url}}> | ||
23 | - <img class="img" src="{{img}}"> | ||
24 | - </a> | ||
25 | - </div> | ||
26 | -{{/if}} | ||
27 | - |
1 | -{{#goodsDescription}} | ||
2 | -<div class="goods-desc page-block"> | ||
3 | - <div class="service"></div> | ||
4 | - <h1 class="title"> | ||
5 | - {{title}} | ||
6 | - <span class="en-title">{{enTitle}}</span> | ||
7 | - </h1> | ||
8 | - {{#detail}} | ||
9 | - <div class="detail table"> | ||
10 | - {{#list}} | ||
11 | - <div class="column">{{param}}</div> | ||
12 | - {{/list}} | ||
13 | - </div> | ||
14 | - {{/detail}} | ||
15 | - {{#if desc}} | ||
16 | - <div class="desc-text">{{desc}}</div> | ||
17 | - {{/if}} | ||
18 | -</div> | ||
19 | - | ||
20 | -{{/goodsDescription}} | ||
21 | - | ||
22 | -{{#sizeInfo}} | ||
23 | -<div class="size-info page-block"> | ||
24 | -<h1 class="title"> | ||
25 | - {{title}} | ||
26 | - <span class="en-title">{{enTitle}}</span> | ||
27 | -</h1> | ||
28 | -{{#detail}} | ||
29 | -<div class="detail"> | ||
30 | - <div class="swiper-container detail-swiper" id="size-swiper-container"> | ||
31 | - <div class="swiper-wrapper"> | ||
32 | - {{#list}} | ||
33 | - <div class="swiper-slide " > | ||
34 | - {{#params}} | ||
35 | - <div class="cell">{{param}}</div> | ||
36 | - {{/params}} | ||
37 | - </div> | ||
38 | - {{/list}} | ||
39 | - </div> | ||
40 | - </div> | ||
41 | - <p class="tips">提示:左滑查看完整表格信息</p> | ||
42 | -</div> | ||
43 | -{{/detail}} | ||
44 | -</div> | ||
45 | -{{/sizeInfo}} | ||
46 | - | ||
47 | -{{#measurementMethod}} | ||
48 | -<div class="measurement-method page-block"> | ||
49 | -<h1 class="title"> | ||
50 | - {{title}} | ||
51 | - <span class="en-title">{{enTitle}}</span> | ||
52 | -</h1> | ||
53 | -<div class="detail" style="width:100%"> | ||
54 | - <img class="lazy" data-original="{{img}}" alt=""> | ||
55 | -</div> | ||
56 | -</div> | ||
57 | -{{/measurementMethod}} | ||
58 | - | ||
59 | -{{#reference}} | ||
60 | -<div class="size-info page-block"> | ||
61 | - <h1 class="title"> | ||
62 | - {{title}} | ||
63 | - <span class="en-title">{{enTitle}}</span> | ||
64 | - </h1> | ||
65 | - {{#detail}} | ||
66 | - <div class="detail"> | ||
67 | - <div class="swiper-container detail-swiper" id="reference-swiper-container"> | ||
68 | - <div class="swiper-wrapper"> | ||
69 | - {{#list}} | ||
70 | - {{#if @first}} | ||
71 | - <div class="swiper-slide first-group" > | ||
72 | - {{#params}} | ||
73 | - {{#if @first}} | ||
74 | - {{else}} | ||
75 | - <div> | ||
76 | - <img class="avatar lazy" data-original="{{param}}" alt=""> | ||
77 | - </div> | ||
78 | - {{/if}} | ||
79 | - {{/params}} | ||
80 | - </div> | ||
81 | - {{else}} | ||
82 | - <div class="swiper-slide" > | ||
83 | - {{#params}} | ||
84 | - <div class=" cell">{{param}}</div> | ||
85 | - {{/params}} | ||
86 | - </div> | ||
87 | - {{/if}} | ||
88 | - {{/list}} | ||
89 | - </div> | ||
90 | - </div> | ||
91 | - <p class="tips">提示:左滑查看完整表格信息</p> | ||
92 | - </div> | ||
93 | - {{/detail}} | ||
94 | -</div> | ||
95 | -{{/reference}} | ||
96 | - | ||
97 | -{{#materials}} | ||
98 | -<div class="materials page-block"> | ||
99 | - <h1 class="title"> | ||
100 | - {{title}} | ||
101 | - <span class="en-title">{{enTitle}}</span> | ||
102 | - </h1> | ||
103 | - <div class="detail"> | ||
104 | - {{#list}} | ||
105 | - <div class="material-item"> | ||
106 | - <!-- <img class="lazy" data-original="{{img}}" alt=""> | ||
107 | - <p class="material-desc"> | ||
108 | - {{desc}} | ||
109 | - </p>--> | ||
110 | - <div class="material-image"> | ||
111 | - <img src="{{img}}" alt="材质图"> | ||
112 | - </div> | ||
113 | - <div class="material-desc"> | ||
114 | - {{desc}} | ||
115 | - </div> | ||
116 | - </div> | ||
117 | - {{/list}} | ||
118 | - </div> | ||
119 | -</div> | ||
120 | -{{/materials}} | ||
121 | - | ||
122 | -{{#washTips}} | ||
123 | -<div class="wash-tips page-block"> | ||
124 | - <div class="detail table clearfix"> | ||
125 | - {{#list}} | ||
126 | - <div class="tip"> | ||
127 | - <img src="{{img}}" alt=""> | ||
128 | - <span class="caption">{{caption}}</span> | ||
129 | - </div> | ||
130 | - {{/list}} | ||
131 | - </div> | ||
132 | -</div> | ||
133 | -{{/washTips}} | ||
134 | - | ||
135 | -{{#productDetail}} | ||
136 | -<div class="product-detail page-block"> | ||
137 | - <h1 class="title"> | ||
138 | - {{{title}}} | ||
139 | - <span class="en-title">{{{enTitle}}}</span> | ||
140 | - </h1> | ||
141 | - <div class="pro-detail"> | ||
142 | - <p>{{{desc}}}</p> | ||
143 | - {{#list}} | ||
144 | - <img class="lazy" data-original="{{img}}" alt=""> | ||
145 | - {{/list}} | ||
146 | - </div> | ||
147 | -</div> | ||
148 | -{{/productDetail}} |
1 | -<div class="title">为您优选新品</div> | ||
2 | -<div id="swiper-recommend" class="swiper-container"> | ||
3 | - <div class="swiper-wrapper swiper-wrapper-recommend"> | ||
4 | - {{# recommendList}} | ||
5 | - <a class="swiper-slide" href="{{url}}"> | ||
6 | - <img class="swiper-lazy img-box" data-src="{{image thumb 299 388}}"> | ||
7 | - <div class="sale-name"> | ||
8 | - {{name}} | ||
9 | - </div> | ||
10 | - <div class="price"> | ||
11 | - <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | ||
12 | - {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} | ||
13 | - </div> | ||
14 | - <div class="swiper-lazy-preloader"></div> | ||
15 | - </a> | ||
16 | - {{/ recommendList}} | ||
17 | - </div> | ||
18 | -</div> |
@@ -15,8 +15,8 @@ module.exports = { | @@ -15,8 +15,8 @@ module.exports = { | ||
15 | port: 6001, | 15 | port: 6001, |
16 | siteUrl: '//m.yohobuy.com', | 16 | siteUrl: '//m.yohobuy.com', |
17 | domains: { | 17 | domains: { |
18 | - api: 'http://testapi.yoho.cn:28078/', | ||
19 | - service: 'http://testservice.yoho.cn:28077/' | 18 | + api: 'http://api.yoho.yohoops.org/', |
19 | + service: 'http://service.yoho.yohoops.org/' | ||
20 | 20 | ||
21 | // api: 'http://devapi.yoho.cn:58078/', | 21 | // api: 'http://devapi.yoho.cn:58078/', |
22 | // service: 'http://devservice.yoho.cn:58077/' | 22 | // service: 'http://devservice.yoho.cn:58077/' |
@@ -100,6 +100,7 @@ | @@ -100,6 +100,7 @@ | ||
100 | "yoho-jquery": "^2.2.4", | 100 | "yoho-jquery": "^2.2.4", |
101 | "yoho-jquery-lazyload": "^1.9.7", | 101 | "yoho-jquery-lazyload": "^1.9.7", |
102 | "yoho-mlellipsis": "0.0.3", | 102 | "yoho-mlellipsis": "0.0.3", |
103 | + "yoho-node-lib": "0.0.17", | ||
103 | "yoho-swiper": "^3.3.1" | 104 | "yoho-swiper": "^3.3.1" |
104 | } | 105 | } |
105 | } | 106 | } |
@@ -8,8 +8,8 @@ var $ = require('yoho-jquery'), | @@ -8,8 +8,8 @@ var $ = require('yoho-jquery'), | ||
8 | Hammer = require('yoho-hammer'), | 8 | Hammer = require('yoho-hammer'), |
9 | lazyLoad = require('yoho-jquery-lazyload'); | 9 | lazyLoad = require('yoho-jquery-lazyload'); |
10 | 10 | ||
11 | -var $discountFolder = $('.goodsDiscount .discount-folder'), | ||
12 | - $discountArrow = $('.goodsDiscount .first-item span'); | 11 | +var $discountFolder = $('.goods-discount .discount-folder'), |
12 | + $discountArrow = $('.goods-discount .first-item span'); | ||
13 | 13 | ||
14 | var goodsDiscountEl = document.getElementById('goodsDiscount'), | 14 | var goodsDiscountEl = document.getElementById('goodsDiscount'), |
15 | goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl), | 15 | goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl), |
@@ -39,8 +39,6 @@ function showFooter() { | @@ -39,8 +39,6 @@ function showFooter() { | ||
39 | 39 | ||
40 | showFooter(); | 40 | showFooter(); |
41 | 41 | ||
42 | -require('./detail/like'); | ||
43 | - | ||
44 | lazyLoad($('img.lazy')); | 42 | lazyLoad($('img.lazy')); |
45 | 43 | ||
46 | if ($('#goodsDiscount h1').length < 1) { | 44 | if ($('#goodsDiscount h1').length < 1) { |
@@ -120,6 +118,7 @@ $('#limit-sale').on('touchend', function(e) { | @@ -120,6 +118,7 @@ $('#limit-sale').on('touchend', function(e) { | ||
120 | } | 118 | } |
121 | }); | 119 | }); |
122 | 120 | ||
121 | +require('./detail/like'); | ||
123 | require('./detail/desc'); | 122 | require('./detail/desc'); |
124 | require('./detail/comments-consults'); | 123 | require('./detail/comments-consults'); |
125 | require('./detail/consultform'); | 124 | require('./detail/consultform'); |
@@ -148,5 +147,3 @@ $.ajax({ | @@ -148,5 +147,3 @@ $.ajax({ | ||
148 | if ($('.good-detail-page').length > 0) { | 147 | if ($('.good-detail-page').length > 0) { |
149 | $('#yoho-footer').css('border-top', '1px solid #e0e0e0'); | 148 | $('#yoho-footer').css('border-top', '1px solid #e0e0e0'); |
150 | } | 149 | } |
151 | - | ||
152 | - |
@@ -22,8 +22,10 @@ function hiddenTips($ele) { | @@ -22,8 +22,10 @@ function hiddenTips($ele) { | ||
22 | 22 | ||
23 | if ($ele.length > 0) { | 23 | if ($ele.length > 0) { |
24 | offsetContainer = $ele[0].getBoundingClientRect().right; | 24 | offsetContainer = $ele[0].getBoundingClientRect().right; |
25 | - offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; | ||
26 | 25 | ||
26 | + if ($ele.find('.swiper-slide:last-child')[0]) { | ||
27 | + offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; | ||
28 | + } | ||
27 | 29 | ||
28 | if (offsetLastColumn - offsetContainer < 0) { | 30 | if (offsetLastColumn - offsetContainer < 0) { |
29 | $ele.next('.tips').css('display', 'none'); | 31 | $ele.next('.tips').css('display', 'none'); |
@@ -119,4 +121,3 @@ function scrollHandler() { | @@ -119,4 +121,3 @@ function scrollHandler() { | ||
119 | $(window).scroll(function() { | 121 | $(window).scroll(function() { |
120 | window.requestAnimationFrame(scrollHandler); | 122 | window.requestAnimationFrame(scrollHandler); |
121 | }); | 123 | }); |
122 | - |
@@ -24,8 +24,8 @@ function request() { | @@ -24,8 +24,8 @@ function request() { | ||
24 | 24 | ||
25 | if (preferenceUrl) { | 25 | if (preferenceUrl) { |
26 | $.get(preferenceUrl).then(function(html) { | 26 | $.get(preferenceUrl).then(function(html) { |
27 | - if (html.length < 5) { | ||
28 | - $recommendForYou.css('display', 'none'); | 27 | + if ($(html).find('.swiper-slide').length < 5) { |
28 | + $recommendForYou.hide(); | ||
29 | } else { | 29 | } else { |
30 | $recommendForYou.html(html).show(); | 30 | $recommendForYou.html(html).show(); |
31 | if ($('#swiper-recommend').length) { | 31 | if ($('#swiper-recommend').length) { |
@@ -694,10 +694,12 @@ $basicBtnC: #eb0313; | @@ -694,10 +694,12 @@ $basicBtnC: #eb0313; | ||
694 | position: relative; | 694 | position: relative; |
695 | position: fixed; | 695 | position: fixed; |
696 | bottom: 0; | 696 | bottom: 0; |
697 | + left: 50%; | ||
698 | + margin-left: -320px; | ||
697 | z-index: 2; | 699 | z-index: 2; |
698 | box-sizing: border-box; | 700 | box-sizing: border-box; |
699 | padding: 20px 28px; | 701 | padding: 20px 28px; |
700 | - width: 100%; | 702 | + width: 640px; |
701 | height: 120px; | 703 | height: 120px; |
702 | border-top: 1px solid $borderC; | 704 | border-top: 1px solid $borderC; |
703 | background-color: #fff; | 705 | background-color: #fff; |
@@ -13,13 +13,9 @@ | @@ -13,13 +13,9 @@ | ||
13 | } | 13 | } |
14 | 14 | ||
15 | .swiper-container { | 15 | .swiper-container { |
16 | - padding: 30px 0 20px; | 16 | + padding: 30px 30px 20px; |
17 | width: 100%; | 17 | width: 100%; |
18 | 18 | ||
19 | - .swiper-wrapper { | ||
20 | - padding: 0 30px; | ||
21 | - } | ||
22 | - | ||
23 | .swiper-slide { | 19 | .swiper-slide { |
24 | float: left; | 20 | float: left; |
25 | margin: 0 10px; | 21 | margin: 0 10px; |
-
Please register or login to post a comment