Merge branch 'master' into release/5.1
Showing
61 changed files
with
260 additions
and
152 deletions
@@ -83,6 +83,7 @@ app.use((req, res, next) => { | @@ -83,6 +83,7 @@ app.use((req, res, next) => { | ||
83 | try { | 83 | try { |
84 | const user = require('./doraemon/middleware/user'); | 84 | const user = require('./doraemon/middleware/user'); |
85 | const subDomain = require('./doraemon/middleware/sub-domain'); | 85 | const subDomain = require('./doraemon/middleware/sub-domain'); |
86 | + const itemNameHandler = require('./doraemon/middleware/item-name-handler'); | ||
86 | const setYohoData = require('./doraemon/middleware/set-yoho-data'); | 87 | const setYohoData = require('./doraemon/middleware/set-yoho-data'); |
87 | const errorHanlder = require('./doraemon/middleware/error-handler'); | 88 | const errorHanlder = require('./doraemon/middleware/error-handler'); |
88 | const setPageInfo = require('./doraemon/middleware/set-pageinfo'); | 89 | const setPageInfo = require('./doraemon/middleware/set-pageinfo'); |
@@ -91,6 +92,7 @@ try { | @@ -91,6 +92,7 @@ try { | ||
91 | 92 | ||
92 | // YOHO 前置中间件 | 93 | // YOHO 前置中间件 |
93 | app.use(subDomain()); | 94 | app.use(subDomain()); |
95 | + app.use(itemNameHandler); | ||
94 | app.use(setYohoData()); | 96 | app.use(setYohoData()); |
95 | app.use(user()); | 97 | app.use(user()); |
96 | app.use(seo()); | 98 | app.use(seo()); |
@@ -7,9 +7,7 @@ const _ = require('lodash'); | @@ -7,9 +7,7 @@ const _ = require('lodash'); | ||
7 | const helpers = global.yoho.helpers; | 7 | const helpers = global.yoho.helpers; |
8 | const crypto = global.yoho.crypto; | 8 | const crypto = global.yoho.crypto; |
9 | 9 | ||
10 | -const SUB_DOMAIN = '.dev.yohobuy.com', | ||
11 | - OLD_MAIN = '//m.yohobuy.com', | ||
12 | - SITE_MAIN = '//m.dev.yohobuy.com'; | 10 | +const SITE_MAIN = '//m.yohobuy.com'; |
13 | 11 | ||
14 | /** | 12 | /** |
15 | * 仿php的strrpos | 13 | * 仿php的strrpos |
@@ -60,7 +58,8 @@ const getShare = (code, shareTitle, shareDesc, shareImg) => { | @@ -60,7 +58,8 @@ const getShare = (code, shareTitle, shareDesc, shareImg) => { | ||
60 | * 过滤app的url | 58 | * 过滤app的url |
61 | */ | 59 | */ |
62 | const _getFilterUrl = url => { | 60 | const _getFilterUrl = url => { |
63 | - url = url.replace('.m.yohobuy.com', SUB_DOMAIN).replace(OLD_MAIN, SITE_MAIN).replace('www.yohobuy.com', SITE_MAIN); | 61 | + url = url.replace('www.yohobuy.com', SITE_MAIN); |
62 | + | ||
64 | if (strrpos(url, 'm.yohobuy.com') && !strrpos(url, 'sale.m.yohobuy.com') && !strrpos(url, 'cuxiao.m.yohobuy.com') && | 63 | if (strrpos(url, 'm.yohobuy.com') && !strrpos(url, 'sale.m.yohobuy.com') && !strrpos(url, 'cuxiao.m.yohobuy.com') && |
65 | !strrpos(url, 'activity.m.yohobuy.com') && !strrpos(url, 'huodong.m.yohobuy.com') && | 64 | !strrpos(url, 'activity.m.yohobuy.com') && !strrpos(url, 'huodong.m.yohobuy.com') && |
66 | strrpos(url, 'cdn.yoho.cn/myohobuy') && !strrpos(url, '/home/orders/pay')) { | 65 | strrpos(url, 'cdn.yoho.cn/myohobuy') && !strrpos(url, '/home/orders/pay')) { |
@@ -353,4 +352,4 @@ exports.receiveCoupon = (receiveData, uid) => { | @@ -353,4 +352,4 @@ exports.receiveCoupon = (receiveData, uid) => { | ||
353 | } | 352 | } |
354 | return returnData; | 353 | return returnData; |
355 | }); | 354 | }); |
356 | -}; | 355 | +}; |
@@ -40,25 +40,28 @@ const getUserStatus = (param) => { | @@ -40,25 +40,28 @@ const getUserStatus = (param) => { | ||
40 | var dest = {}; | 40 | var dest = {}; |
41 | 41 | ||
42 | dest.code = param.code; | 42 | dest.code = param.code; |
43 | - dest.returnCode = param.data.returnCode; | ||
44 | - dest.mobile = param.data.mobile; | ||
45 | - if (param.data.returnCode === 0) { | ||
46 | - dest.geted = true; | ||
47 | - } else if (param.data.returnCode === 1) { | ||
48 | - dest.wrongNumb = true; | ||
49 | - } else if (param.data.returnCode === 2) { | ||
50 | - dest.newUser = true; | ||
51 | - } else if (param.data.returnCode === 8) { | ||
52 | - dest.oldUserAskCouponOnceMore = true; | ||
53 | - } else if (param.data.returnCode === 5) { | ||
54 | - dest.vertifyWrong = true; | ||
55 | - } else { | ||
56 | - dest.ended = true; | ||
57 | - } | ||
58 | - if (param.data.newUser === 1) { | ||
59 | - dest.newUser = true; | 43 | + dest.returnCode = param && param.data && param.data.returnCode; |
44 | + dest.mobile = param && param.data && param.data.mobile; | ||
45 | + if (param && param.data) { | ||
46 | + if (param.data.returnCode === 0) { | ||
47 | + dest.geted = true; | ||
48 | + } else if (param.data.returnCode === 1) { | ||
49 | + dest.wrongNumb = true; | ||
50 | + } else if (param.data.returnCode === 2) { | ||
51 | + dest.newUser = true; | ||
52 | + } else if (param.data.returnCode === 8) { | ||
53 | + dest.oldUserAskCouponOnceMore = true; | ||
54 | + } else if (param.data.returnCode === 5) { | ||
55 | + dest.vertifyWrong = true; | ||
56 | + } else { | ||
57 | + dest.ended = true; | ||
58 | + } | ||
59 | + | ||
60 | + if (param.data.newUser === 1) { | ||
61 | + dest.newUser = true; | ||
62 | + } | ||
63 | + dest.message = param.data.returnMsg; | ||
60 | } | 64 | } |
61 | - dest.message = param.data.returnMsg; | ||
62 | 65 | ||
63 | // 清空变量,释放内存 | 66 | // 清空变量,释放内存 |
64 | param = {}; | 67 | param = {}; |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <strong class="fz18">现金券</strong> | 6 | <strong class="fz18">现金券</strong> |
7 | <p class="fz9 bold">CPOUPON</p> | 7 | <p class="fz9 bold">CPOUPON</p> |
8 | <div class="pirbox absolute"> | 8 | <div class="pirbox absolute"> |
9 | - <em class="absolute">¥</em>0 | 9 | + <em class="absolute">¥</em>0 |
10 | </div> | 10 | </div> |
11 | </div>--> | 11 | </div>--> |
12 | <div class="coupon-box chit0"></div> | 12 | <div class="coupon-box chit0"></div> |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <strong class="fz18">现金券</strong> | 6 | <strong class="fz18">现金券</strong> |
7 | <p class="fz9 bold">CPOUPON</p> | 7 | <p class="fz9 bold">CPOUPON</p> |
8 | <div class="pirbox absolute"> | 8 | <div class="pirbox absolute"> |
9 | - <em class="absolute">¥</em>{{amount}} | 9 | + <em class="absolute">¥</em>{{amount}} |
10 | </div> | 10 | </div> |
11 | <div class="count-not fz11 absolute"><hr class="fn-left"><hr class="fn-right">已送达您的账户</div> | 11 | <div class="count-not fz11 absolute"><hr class="fn-left"><hr class="fn-right">已送达您的账户</div> |
12 | </div> | 12 | </div> |
@@ -165,16 +165,15 @@ const tag = (req, res, next) => { | @@ -165,16 +165,15 @@ const tag = (req, res, next) => { | ||
165 | pageHeader: headerData, | 165 | pageHeader: headerData, |
166 | module: 'guang', | 166 | module: 'guang', |
167 | page: 'index-editor', | 167 | page: 'index-editor', |
168 | - title: tagTitle + ' | Yoho!Buy有货 | 潮流购物逛不停', | ||
169 | - pageFooter: true | 168 | + title: tagTitle + ' | Yoho!Buy有货 | 潮流购物逛不停' |
170 | }; | 169 | }; |
171 | 170 | ||
172 | let param = { | 171 | let param = { |
173 | tag: req.query.query, | 172 | tag: req.query.query, |
174 | isApp: req.query.app_version || req.query.appVersion || false, | 173 | isApp: req.query.app_version || req.query.appVersion || false, |
175 | - gender: req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3', | ||
176 | - uid: req.user.uid, | ||
177 | - udid: req.user.udid, | 174 | + gender: req.query.gender || '1,3', |
175 | + uid: req.user.uid || 0, | ||
176 | + udid: req.sessionID, | ||
178 | type: req.query.type || 0 | 177 | type: req.query.type || 0 |
179 | 178 | ||
180 | }; | 179 | }; |
@@ -288,7 +288,11 @@ const index = (req, res, next) => { | @@ -288,7 +288,11 @@ const index = (req, res, next) => { | ||
288 | }; | 288 | }; |
289 | 289 | ||
290 | // guang双头部的问题 20160601 | 290 | // guang双头部的问题 20160601 |
291 | - data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${detail.getAuthor.author_id}"},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${helpers.urlFormat('/author/index', {}, 'guang')}"}}`); | 291 | + // 正确的URL |
292 | + data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${detail.getAuthor.url}"}}`); | ||
293 | + | ||
294 | + // 错误的URL | ||
295 | + // data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${detail.getAuthor.author_id}"},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${helpers.urlFormat('/author/index', {}, 'guang')}"}}`); | ||
292 | } | 296 | } |
293 | let guang = data.guang; | 297 | let guang = data.guang; |
294 | 298 |
@@ -16,29 +16,59 @@ let channels = { | @@ -16,29 +16,59 @@ let channels = { | ||
16 | lifestyle: '4' | 16 | lifestyle: '4' |
17 | }; | 17 | }; |
18 | 18 | ||
19 | +let yhChannel = { | ||
20 | + boys: 1, | ||
21 | + girl: 2 | ||
22 | +}; | ||
23 | + | ||
19 | const getListData = (req, res, next) => { | 24 | const getListData = (req, res, next) => { |
20 | let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3'; | 25 | let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3'; |
21 | let recom = '4'; | 26 | let recom = '4'; |
22 | let all = '1'; | 27 | let all = '1'; |
28 | + let type = req.query.type; | ||
29 | + let channel = req.cookies._Channel && yhChannel[req.cookies._Channel] || 1; | ||
30 | + let isRecommend = '0'; | ||
31 | + let starBrand = '2'; | ||
32 | + let originalBrand = '3'; | ||
23 | 33 | ||
24 | - plustarModel.getListData(gender, recom, all).then((result) => { | 34 | + if (type === '2') { |
35 | + plustarModel.getBrandsData(gender, starBrand, originalBrand, channel, isRecommend).then((result) => { | ||
36 | + res.render('plustar/list', { | ||
37 | + module: 'guang', | ||
38 | + page: 'plustar-list', | ||
39 | + title: '明星原创', | ||
40 | + pageHeader: headerModel.setNav({ | ||
41 | + navTitle: '明星原创' | ||
42 | + }), | ||
43 | + pageFooter: true, | ||
44 | + ps: { | ||
45 | + sName: '明星潮品', | ||
46 | + pName: '原创潮牌', | ||
47 | + star: result.star, | ||
48 | + plus: result.plus | ||
49 | + } | ||
50 | + }); | ||
51 | + }).catch(next); | ||
52 | + } else { | ||
53 | + plustarModel.getListData(gender, recom, all).then((result) => { | ||
25 | 54 | ||
26 | - res.render('plustar/list', { | ||
27 | - module: 'guang', | ||
28 | - page: 'plustar-list', | ||
29 | - title: '国际优选', | ||
30 | - pageHeader: headerModel.setNav({ | ||
31 | - navTitle: '国际优选' | ||
32 | - }), | ||
33 | - pageFooter: true, | ||
34 | - ps: { | ||
35 | - sName: '设计师', | ||
36 | - pName: '经典潮牌', | ||
37 | - star: result.star, | ||
38 | - plus: result.plus | ||
39 | - } | ||
40 | - }); | ||
41 | - }).catch(next); | 55 | + res.render('plustar/list', { |
56 | + module: 'guang', | ||
57 | + page: 'plustar-list', | ||
58 | + title: '国际优选', | ||
59 | + pageHeader: headerModel.setNav({ | ||
60 | + navTitle: '国际优选' | ||
61 | + }), | ||
62 | + pageFooter: true, | ||
63 | + ps: { | ||
64 | + sName: '设计师', | ||
65 | + pName: '经典潮牌', | ||
66 | + star: result.star, | ||
67 | + plus: result.plus | ||
68 | + } | ||
69 | + }); | ||
70 | + }).catch(next); | ||
71 | + } | ||
42 | }; | 72 | }; |
43 | 73 | ||
44 | const getDetailData = (req, res, next) => { | 74 | const getDetailData = (req, res, next) => { |
@@ -142,10 +142,10 @@ const _article = (param) => { | @@ -142,10 +142,10 @@ const _article = (param) => { | ||
142 | page: param.page || 1, | 142 | page: param.page || 1, |
143 | uid: param.uid, | 143 | uid: param.uid, |
144 | udid: param.udid, | 144 | udid: param.udid, |
145 | - sort_id: param.type === '0' ? param.type : '1', | 145 | + sort_id: 0, |
146 | tag: param.tag ? param.tag : null, | 146 | tag: param.tag ? param.tag : null, |
147 | - author_id: param.authorId ? param.authorId : null, | ||
148 | - limit: param.limit ? param.limit : null | 147 | + //author_id: param.authorId ? param.authorId : null, |
148 | + //limit: param.limit ? param.limit : null | ||
149 | }, { | 149 | }, { |
150 | cache: true, | 150 | cache: true, |
151 | code: 200 | 151 | code: 200 |
@@ -279,13 +279,14 @@ const getTagEditor = (param) => { | @@ -279,13 +279,14 @@ const getTagEditor = (param) => { | ||
279 | } | 279 | } |
280 | }; | 280 | }; |
281 | 281 | ||
282 | - if (result && result[0] && result[0].data && result[0].data.list) { | 282 | + if (result && result[0] && result[0].data && result[0].data.list && result[0].data.list.artList) { |
283 | 283 | ||
284 | let inf = []; | 284 | let inf = []; |
285 | 285 | ||
286 | let infoList = result[0].data.list.artList; | 286 | let infoList = result[0].data.list.artList; |
287 | 287 | ||
288 | infoList.forEach(val => { | 288 | infoList.forEach(val => { |
289 | + val.url = helpers.https(`${val.url}&openby:yohobuy={"action":"go.h5","params":{"param":{},"share":"","id":"","type":0,"islogin":"N","url":"${val.url}"}}`); | ||
289 | inf.push(guangProcess.formatArticle(val, true, false, true)); | 290 | inf.push(guangProcess.formatArticle(val, true, false, true)); |
290 | }); | 291 | }); |
291 | 292 |
@@ -39,7 +39,7 @@ const packageData = (id, isApp) => { | @@ -39,7 +39,7 @@ const packageData = (id, isApp) => { | ||
39 | cache: true | 39 | cache: true |
40 | }).then(data => { | 40 | }).then(data => { |
41 | // 接口要判断一下返回状态是否成功 | 41 | // 接口要判断一下返回状态是否成功 |
42 | - if (data.code !== 200) { | 42 | + if (data === '' && data.code !== 200) { |
43 | result.code = 400; | 43 | result.code = 400; |
44 | return result; | 44 | return result; |
45 | } | 45 | } |
@@ -109,28 +109,43 @@ const packageData = (id, isApp) => { | @@ -109,28 +109,43 @@ const packageData = (id, isApp) => { | ||
109 | } | 109 | } |
110 | 110 | ||
111 | return Promise.all(promises).then(datas => { | 111 | return Promise.all(promises).then(datas => { |
112 | - let getArticleContent = datas[1].data; | 112 | + if (datas) { |
113 | + if (datas[1]) { | ||
113 | 114 | ||
114 | - if (isApp && datas[4].data) { | 115 | + let getArticleContent = datas[1].data; |
115 | 116 | ||
116 | - let preCount = 0; | ||
117 | - let i; | 117 | + result.getArticleContent = getArticleContent; |
118 | 118 | ||
119 | - for (i = 0; i < getArticleContent.length; i++) { | ||
120 | - if (getArticleContent[i].singleImage || getArticleContent[i].text || getArticleContent[i].smallPic) { | ||
121 | - preCount++; | 119 | + } |
120 | + | ||
121 | + if (isApp && datas[4] && datas[4].data) { | ||
122 | + | ||
123 | + let preCount = 0; | ||
124 | + let i; | ||
125 | + | ||
126 | + for (i = 0; i < getArticleContent.length; i++) { | ||
127 | + if (getArticleContent[i].singleImage || getArticleContent[i].text || getArticleContent[i].smallPic) { | ||
128 | + preCount++; | ||
129 | + } | ||
122 | } | 130 | } |
131 | + | ||
132 | + getArticleContent.splice(preCount, 0, {weixinPublic: datas[4].data}); | ||
133 | + } | ||
134 | + if (datas[0]) { | ||
135 | + result.getAuthor = datas[0].data; | ||
123 | } | 136 | } |
124 | 137 | ||
125 | - getArticleContent.splice(preCount, 0, {weixinPublic: datas[4].data}); | ||
126 | - } | ||
127 | 138 | ||
128 | - result.getAuthor = datas[0].data; | ||
129 | - result.getArticleContent = getArticleContent; | ||
130 | - result.getBrand = datas[2].data; | ||
131 | - if (datas.length === 5 && isApp || datas.length === 4 && !isApp) { | ||
132 | - result.getOtherArticle = datas[3].data; | 139 | + if (datas[2]) { |
140 | + result.getBrand = datas[2].data; | ||
141 | + } | ||
142 | + if (datas.length === 5 && isApp || datas.length === 4 && !isApp) { | ||
143 | + if (datas[3]) { | ||
144 | + result.getOtherArticle = datas[3].data; | ||
145 | + } | ||
146 | + } | ||
133 | } | 147 | } |
148 | + | ||
134 | return result; | 149 | return result; |
135 | }); | 150 | }); |
136 | }); | 151 | }); |
@@ -9,11 +9,9 @@ const helpers = global.yoho.helpers; | @@ -9,11 +9,9 @@ const helpers = global.yoho.helpers; | ||
9 | const formaData = (data, gender) => { | 9 | const formaData = (data, gender) => { |
10 | let build = []; | 10 | let build = []; |
11 | 11 | ||
12 | - // console.log(data) | ||
13 | _.forEach(data, function(val) { | 12 | _.forEach(data, function(val) { |
14 | // 多张图 | 13 | // 多张图 |
15 | if (val.data[1]) { | 14 | if (val.data[1]) { |
16 | - | ||
17 | let imgs = []; | 15 | let imgs = []; |
18 | 16 | ||
19 | _.forEach(val.data, function(list) { | 17 | _.forEach(val.data, function(list) { |
@@ -34,7 +32,7 @@ const formaData = (data, gender) => { | @@ -34,7 +32,7 @@ const formaData = (data, gender) => { | ||
34 | } | 32 | } |
35 | 33 | ||
36 | // 单张图 | 34 | // 单张图 |
37 | - if (val.data[0]) { | 35 | + if (val.data[0] && !val.data[1]) { |
38 | _.forEach(val.data, function(list) { | 36 | _.forEach(val.data, function(list) { |
39 | build.push({ | 37 | build.push({ |
40 | url: '/guang/plustar/brandinfo?id=' + val.id + '&gender=' + gender, | 38 | url: '/guang/plustar/brandinfo?id=' + val.id + '&gender=' + gender, |
@@ -48,15 +46,19 @@ const formaData = (data, gender) => { | @@ -48,15 +46,19 @@ const formaData = (data, gender) => { | ||
48 | return build; | 46 | return build; |
49 | }; | 47 | }; |
50 | 48 | ||
49 | +const getContentData = (gender, type, channel, isRecommend) => { | ||
50 | + let param = { | ||
51 | + gender: gender, | ||
52 | + brand_type: type, | ||
53 | + yh_channel: channel | ||
54 | + }; | ||
51 | 55 | ||
52 | -const getContentData = (gender, type) => { | 56 | + if (isRecommend) { |
57 | + param.is_recommend = isRecommend; | ||
58 | + } | ||
53 | 59 | ||
54 | - return serviceAPI.get('guang/api/v3/plustar/getlist', { | ||
55 | - gender: gender, | ||
56 | - brand_type: type | ||
57 | - }).then((result) => { | 60 | + return serviceAPI.get('guang/api/v3/plustar/getlist', param).then((result) => { |
58 | if (result && result.code === 200) { | 61 | if (result && result.code === 200) { |
59 | - // console.log(result) | ||
60 | return formaData(result.data.data.list[0].data, gender); | 62 | return formaData(result.data.data.list[0].data, gender); |
61 | } else { | 63 | } else { |
62 | logger.error('列表 list data return code is not 200'); | 64 | logger.error('列表 list data return code is not 200'); |
@@ -74,6 +76,15 @@ const getListData = (gender, recom, all) => { | @@ -74,6 +76,15 @@ const getListData = (gender, recom, all) => { | ||
74 | }); | 76 | }); |
75 | }; | 77 | }; |
76 | 78 | ||
79 | +const getBrandsData = (gender, starBrand, originalBrand, channel, isRecommend) => { | ||
80 | + return Promise.all([getContentData(gender, starBrand, isRecommend, channel), getContentData(gender, originalBrand, isRecommend, channel)]).then((result) => { | ||
81 | + return { | ||
82 | + star: result[0], | ||
83 | + plus: result[1] | ||
84 | + }; | ||
85 | + }); | ||
86 | +}; | ||
87 | + | ||
77 | // 新品到着 | 88 | // 新品到着 |
78 | const getNewProduct = (brandId, gender, url) => { | 89 | const getNewProduct = (brandId, gender, url) => { |
79 | 90 | ||
@@ -97,7 +108,6 @@ const getNewProduct = (brandId, gender, url) => { | @@ -97,7 +108,6 @@ const getNewProduct = (brandId, gender, url) => { | ||
97 | let obj = {}; | 108 | let obj = {}; |
98 | let price; | 109 | let price; |
99 | 110 | ||
100 | - // console.log(list) | ||
101 | if (index <= 5) { | 111 | if (index <= 5) { |
102 | let tag = []; | 112 | let tag = []; |
103 | 113 | ||
@@ -270,5 +280,6 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { | @@ -270,5 +280,6 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { | ||
270 | module.exports = { | 280 | module.exports = { |
271 | getListData, | 281 | getListData, |
272 | getContentData, | 282 | getContentData, |
273 | - getDetailData | 283 | + getDetailData, |
284 | + getBrandsData | ||
274 | }; | 285 | }; |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | <div class="loading status hide"> | 22 | <div class="loading status hide"> |
23 | 正在加载... | 23 | 正在加载... |
24 | </div> | 24 | </div> |
25 | - <span class="no-more status">没有更多啦</span> | 25 | + <span class="no-more status hide">没有更多啦</span> |
26 | </div> | 26 | </div> |
27 | 27 | ||
28 | {{#if tag}} | 28 | {{#if tag}} |
@@ -90,9 +90,9 @@ | @@ -90,9 +90,9 @@ | ||
90 | <span class="reco-name">{{name}}</span> | 90 | <span class="reco-name">{{name}}</span> |
91 | </p> | 91 | </p> |
92 | <p class="price"> | 92 | <p class="price"> |
93 | - <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | 93 | + <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> |
94 | {{#price}} | 94 | {{#price}} |
95 | - <span class="market-price">¥{{.}}</span> | 95 | + <span class="market-price">¥{{.}}</span> |
96 | {{/price}} | 96 | {{/price}} |
97 | <a class="check-detail" href={{url}}> | 97 | <a class="check-detail" href={{url}}> |
98 | 查看详情 | 98 | 查看详情 |
@@ -49,7 +49,8 @@ exports.addressAct = (req, res, next) => { | @@ -49,7 +49,8 @@ exports.addressAct = (req, res, next) => { | ||
49 | module: 'home', | 49 | module: 'home', |
50 | page: 'address-act', | 50 | page: 'address-act', |
51 | pageHeader: headerModel.setNav({ | 51 | pageHeader: headerModel.setNav({ |
52 | - navTitle: result.navTitle | 52 | + navTitle: result && result.navTitle, |
53 | + navBtn: false | ||
53 | }), | 54 | }), |
54 | title: result.navTitle | 55 | title: result.navTitle |
55 | }; | 56 | }; |
@@ -161,7 +162,8 @@ exports.addressModify = (req, res, next) => { | @@ -161,7 +162,8 @@ exports.addressModify = (req, res, next) => { | ||
161 | module: 'home', | 162 | module: 'home', |
162 | page: 'address-modify', | 163 | page: 'address-modify', |
163 | pageHeader: headerModel.setNav({ | 164 | pageHeader: headerModel.setNav({ |
164 | - navTitle: '选择地址' | 165 | + navTitle: '选择地址', |
166 | + navBtn: false | ||
165 | }), | 167 | }), |
166 | title: '选择地址', | 168 | title: '选择地址', |
167 | }; | 169 | }; |
@@ -9,11 +9,12 @@ exports.index = (req, res, next) => { | @@ -9,11 +9,12 @@ exports.index = (req, res, next) => { | ||
9 | module: 'home', | 9 | module: 'home', |
10 | page: 'help', | 10 | page: 'help', |
11 | pageHeader: headerModel.setNav({ | 11 | pageHeader: headerModel.setNav({ |
12 | - navTitle: '帮助中心' | 12 | + navTitle: '帮助中心', |
13 | + navBtn: false | ||
13 | }), | 14 | }), |
14 | title: '帮助中心', | 15 | title: '帮助中心', |
15 | pageFooter: true, | 16 | pageFooter: true, |
16 | - iHelp: result, | 17 | + iHelp: result |
17 | }); | 18 | }); |
18 | }).catch(next); | 19 | }).catch(next); |
19 | }; | 20 | }; |
@@ -24,7 +25,8 @@ exports.helpDetail = (req, res, next) => { | @@ -24,7 +25,8 @@ exports.helpDetail = (req, res, next) => { | ||
24 | module: 'home', | 25 | module: 'home', |
25 | page: 'help-detail', | 26 | page: 'help-detail', |
26 | pageHeader: headerModel.setNav({ | 27 | pageHeader: headerModel.setNav({ |
27 | - navTitle: req.query.name | 28 | + navTitle: req.query.name, |
29 | + navBtn: false | ||
28 | }), | 30 | }), |
29 | title: req.query.name, | 31 | title: req.query.name, |
30 | pageFooter: true, | 32 | pageFooter: true, |
@@ -65,7 +65,7 @@ let ajaxCurrencyDetail = (req, res, next) => { | @@ -65,7 +65,7 @@ let ajaxCurrencyDetail = (req, res, next) => { | ||
65 | 65 | ||
66 | res.render('ajax-currency-detail', { | 66 | res.render('ajax-currency-detail', { |
67 | layout: false, | 67 | layout: false, |
68 | - coinlist: result.coinlist | 68 | + coinlist: _.get(result, 'coinlist', []) |
69 | }); | 69 | }); |
70 | }).catch(next); | 70 | }).catch(next); |
71 | }; | 71 | }; |
@@ -109,7 +109,7 @@ const favProduct = (uid, page, limit) => { | @@ -109,7 +109,7 @@ const favProduct = (uid, page, limit) => { | ||
109 | 109 | ||
110 | return resu; | 110 | return resu; |
111 | } else { | 111 | } else { |
112 | - logger.error('收藏商品 cood 不是 200'); | 112 | + logger.error('fav goods code no 200'); |
113 | return { | 113 | return { |
114 | total: 0, | 114 | total: 0, |
115 | }; | 115 | }; |
@@ -192,7 +192,7 @@ const favfavBrand = (uid, page, limit) => { | @@ -192,7 +192,7 @@ const favfavBrand = (uid, page, limit) => { | ||
192 | 192 | ||
193 | return resu; | 193 | return resu; |
194 | } else { | 194 | } else { |
195 | - logger.error('收藏品牌 cood 不是 200'); | 195 | + logger.error('fav brand code no 200'); |
196 | return { | 196 | return { |
197 | total: 0, | 197 | total: 0, |
198 | }; | 198 | }; |
@@ -15,7 +15,7 @@ const yohoCoin = (uid) => { | @@ -15,7 +15,7 @@ const yohoCoin = (uid) => { | ||
15 | if (result && result.code === 200) { | 15 | if (result && result.code === 200) { |
16 | return camelCase(result.data); | 16 | return camelCase(result.data); |
17 | } else { | 17 | } else { |
18 | - logger.error('youhocoin cood 不是 200'); | 18 | + logger.error('youhocoin code no 200'); |
19 | } | 19 | } |
20 | }); | 20 | }); |
21 | }; | 21 | }; |
@@ -59,6 +59,12 @@ const currencyDetail = (uid, page, limit) => { | @@ -59,6 +59,12 @@ const currencyDetail = (uid, page, limit) => { | ||
59 | if (result && result.code === 200) { | 59 | if (result && result.code === 200) { |
60 | let total = parseInt(result.data.page_total, 10) + 1; | 60 | let total = parseInt(result.data.page_total, 10) + 1; |
61 | 61 | ||
62 | + _.forEach(_.get(result, 'data.coinlist', []), perCoin => { | ||
63 | + if (perCoin.num > 0) { | ||
64 | + perCoin.num = '+' + perCoin.num; | ||
65 | + } | ||
66 | + }); | ||
67 | + | ||
62 | if (page && page <= total) { | 68 | if (page && page <= total) { |
63 | return yohoCoin(uid).then(list => { | 69 | return yohoCoin(uid).then(list => { |
64 | 70 | ||
@@ -79,7 +85,7 @@ const currencyDetail = (uid, page, limit) => { | @@ -79,7 +85,7 @@ const currencyDetail = (uid, page, limit) => { | ||
79 | } | 85 | } |
80 | 86 | ||
81 | } else { | 87 | } else { |
82 | - logger.error('youholist cood 不是 200'); | 88 | + logger.error('youholist code no 200'); |
83 | } | 89 | } |
84 | 90 | ||
85 | }); | 91 | }); |
@@ -290,7 +290,7 @@ const orderDetailData = (uid, orderCode) => { | @@ -290,7 +290,7 @@ const orderDetailData = (uid, orderCode) => { | ||
290 | 290 | ||
291 | // return orderDetail; | 291 | // return orderDetail; |
292 | } else { | 292 | } else { |
293 | - logger.error('详情信息 返回不是200'); | 293 | + logger.error('detail info return no 200'); |
294 | return {}; | 294 | return {}; |
295 | } | 295 | } |
296 | 296 |
@@ -7,12 +7,9 @@ | @@ -7,12 +7,9 @@ | ||
7 | 'use strict'; | 7 | 'use strict'; |
8 | 8 | ||
9 | const logger = global.yoho.logger; | 9 | const logger = global.yoho.logger; |
10 | -const api = global.yoho.API; | ||
11 | const serviceAPI = global.yoho.ServiceAPI; | 10 | const serviceAPI = global.yoho.ServiceAPI; |
12 | const camelCase = global.yoho.camelCase; | 11 | const camelCase = global.yoho.camelCase; |
13 | const _ = require('lodash'); | 12 | const _ = require('lodash'); |
14 | -const config = global.yoho.config; | ||
15 | -const helpers = global.yoho.helpers; | ||
16 | 13 | ||
17 | const suggestData = (udid, page, limit) => { | 14 | const suggestData = (udid, page, limit) => { |
18 | 15 | ||
@@ -22,10 +19,10 @@ const suggestData = (udid, page, limit) => { | @@ -22,10 +19,10 @@ const suggestData = (udid, page, limit) => { | ||
22 | limit: limit | 19 | limit: limit |
23 | }).then((result) => { | 20 | }).then((result) => { |
24 | 21 | ||
25 | - if (result && result.code === 200) { | 22 | + if (result && result.code === 200 && result.data) { |
26 | _.forEach(result.data.list, function(data) { | 23 | _.forEach(result.data.list, function(data) { |
27 | 24 | ||
28 | - data = _.assign(data, { | 25 | + Object.assign(data, { |
29 | good: data.is_reliable === 1, | 26 | good: data.is_reliable === 1, |
30 | bad: data.is_reliable === 2, | 27 | bad: data.is_reliable === 2, |
31 | none: data.is_reliable === 0 | 28 | none: data.is_reliable === 0 |
@@ -33,7 +30,7 @@ const suggestData = (udid, page, limit) => { | @@ -33,7 +30,7 @@ const suggestData = (udid, page, limit) => { | ||
33 | }); | 30 | }); |
34 | return camelCase(result.data.list); | 31 | return camelCase(result.data.list); |
35 | } else { | 32 | } else { |
36 | - logger.error('收藏商品 cood 不是 200'); | 33 | + logger.error('fav goods code no 200'); |
37 | } | 34 | } |
38 | }); | 35 | }); |
39 | }; | 36 | }; |
@@ -52,6 +52,7 @@ router.get('/locationList', auth, addressController.locationList); // 异æ¥èŽ·å | @@ -52,6 +52,7 @@ router.get('/locationList', auth, addressController.locationList); // 异æ¥èŽ·å | ||
52 | router.get('/orders', auth, orderController.order); // 订单列表 | 52 | router.get('/orders', auth, orderController.order); // 订单列表 |
53 | router.get('/getOrders', auth, orderController.getOrders); // 获取订单列表数据 | 53 | router.get('/getOrders', auth, orderController.getOrders); // 获取订单列表数据 |
54 | router.get('/orderDetail', auth, orderDetailController.orderDetailData); // 订单详情页 | 54 | router.get('/orderDetail', auth, orderDetailController.orderDetailData); // 订单详情页 |
55 | +router.get('/orders/detail', auth, orderDetailController.orderDetailData); // 订单详情页兼容老的 | ||
55 | router.get('/delOrder', auth, orderDetailController.delOrder); // 删除订单 | 56 | router.get('/delOrder', auth, orderDetailController.delOrder); // 删除订单 |
56 | router.get('/readd', auth, orderDetailController.readdData); // 再次购买 | 57 | router.get('/readd', auth, orderDetailController.readdData); // 再次购买 |
57 | router.get('/cancelOrder', auth, orderDetailController.cancelOrder); // 取消订单 | 58 | router.get('/cancelOrder', auth, orderDetailController.cancelOrder); // 取消订单 |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | {{# banner}} | 21 | {{# banner}} |
22 | {{# data}} | 22 | {{# data}} |
23 | <a href="{{url}}"> | 23 | <a href="{{url}}"> |
24 | - <img src="{{image src 640 200 2}}" alt="img"> | 24 | + <img src="{{image src 640 200}}" alt="img"> |
25 | </a> | 25 | </a> |
26 | {{/ data}} | 26 | {{/ data}} |
27 | {{/ banner}} | 27 | {{/ banner}} |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | {{# productList}} | 23 | {{# productList}} |
24 | <li class="swiper-slide"> | 24 | <li class="swiper-slide"> |
25 | <a href="{{link}}"> | 25 | <a href="{{link}}"> |
26 | - <img class="swiper-lazy" data-src="{{image imgUrl 97 150}}" alt=""/> | 26 | + <img class="swiper-lazy" data-src="{{image imgUrl 235 314}}" alt=""/> |
27 | </a> | 27 | </a> |
28 | <div class="brand-product"> | 28 | <div class="brand-product"> |
29 | <div class="{{# discount}}price-discount{{/ discount}}"> | 29 | <div class="{{# discount}}price-discount{{/ discount}}"> |
1 | -<div class="iHelp"> | 1 | +<div class="i-help"> |
2 | <ul> | 2 | <ul> |
3 | {{#iHelp}} | 3 | {{#iHelp}} |
4 | <li><a href="//m.yohobuy.com/home/helpDetail?code={{code}}&name={{name}}"><span>{{name}}</span><i class="iconfont num"></i></a></li> | 4 | <li><a href="//m.yohobuy.com/home/helpDetail?code={{code}}&name={{name}}"><span>{{name}}</span><i class="iconfont num"></i></a></li> |
@@ -7,11 +7,11 @@ | @@ -7,11 +7,11 @@ | ||
7 | <ul class="cost block"> | 7 | <ul class="cost block"> |
8 | <li> | 8 | <li> |
9 | 年度累计金额: | 9 | 年度累计金额: |
10 | - <span>¥{{costOfThisYear}}</span> | 10 | + <span>¥{{costOfThisYear}}</span> |
11 | </li> | 11 | </li> |
12 | <li> | 12 | <li> |
13 | 历史消费总金额: | 13 | 历史消费总金额: |
14 | - <span>¥{{sumCost}}</span> | 14 | + <span>¥{{sumCost}}</span> |
15 | </li> | 15 | </li> |
16 | </ul> | 16 | </ul> |
17 | 17 |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | 您已升级至最高的等级啦! | 7 | 您已升级至最高的等级啦! |
8 | </p> | 8 | </p> |
9 | <p class="sum-cost"> | 9 | <p class="sum-cost"> |
10 | - 年度累计金额<span> ¥{{costOfThisYear}}</span> | 10 | + 年度累计金额<span> ¥{{costOfThisYear}}</span> |
11 | </p> | 11 | </p> |
12 | <div class="progresser"> | 12 | <div class="progresser"> |
13 | <div class="outer"></div> | 13 | <div class="outer"></div> |
@@ -24,11 +24,11 @@ | @@ -24,11 +24,11 @@ | ||
24 | <span class="vip-icon vip-2"></span> | 24 | <span class="vip-icon vip-2"></span> |
25 | </p> | 25 | </p> |
26 | <p class="grade-desc"> | 26 | <p class="grade-desc"> |
27 | - 还差<span class="cost-gap">¥{{costGap}}</span>就可以升级为白金会员! | 27 | + 还差<span class="cost-gap">¥{{costGap}}</span>就可以升级为白金会员! |
28 | <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span> | 28 | <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span> |
29 | </p> | 29 | </p> |
30 | <p class="sum-cost"> | 30 | <p class="sum-cost"> |
31 | - 年度累计金额<span> ¥{{costOfThisYear}}</span> | 31 | + 年度累计金额<span> ¥{{costOfThisYear}}</span> |
32 | </p> | 32 | </p> |
33 | <div class="progresser"> | 33 | <div class="progresser"> |
34 | <div class="outer"></div> | 34 | <div class="outer"></div> |
@@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
37 | 金卡会员 | 37 | 金卡会员 |
38 | </span> | 38 | </span> |
39 | <span class="beacon beacon-max">白金卡会员</span> | 39 | <span class="beacon beacon-max">白金卡会员</span> |
40 | - <span class="cost-limit">¥5000.00</span> | 40 | + <span class="cost-limit">¥5000.00</span> |
41 | </div> | 41 | </div> |
42 | {{/if}} | 42 | {{/if}} |
43 | 43 | ||
@@ -47,11 +47,11 @@ | @@ -47,11 +47,11 @@ | ||
47 | <span class="vip-icon vip-1"></span> | 47 | <span class="vip-icon vip-1"></span> |
48 | </p> | 48 | </p> |
49 | <p class="grade-desc"> | 49 | <p class="grade-desc"> |
50 | - 还差<span class="cost-gap">¥{{costGap}}</span>就可以升级为金卡会员! | 50 | + 还差<span class="cost-gap">¥{{costGap}}</span>就可以升级为金卡会员! |
51 | <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span> | 51 | <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span> |
52 | </p> | 52 | </p> |
53 | <p class="sum-cost"> | 53 | <p class="sum-cost"> |
54 | - 年度累计金额<span> ¥{{costOfThisYear}}</span> | 54 | + 年度累计金额<span> ¥{{costOfThisYear}}</span> |
55 | </p> | 55 | </p> |
56 | <div class="progresser"> | 56 | <div class="progresser"> |
57 | <div class="outer"></div> | 57 | <div class="outer"></div> |
@@ -60,7 +60,7 @@ | @@ -60,7 +60,7 @@ | ||
60 | 银卡会员 | 60 | 银卡会员 |
61 | </span> | 61 | </span> |
62 | <span class="beacon beacon-max">金卡会员</span> | 62 | <span class="beacon beacon-max">金卡会员</span> |
63 | - <span class="cost-limit">¥2000.00</span> | 63 | + <span class="cost-limit">¥2000.00</span> |
64 | </div> | 64 | </div> |
65 | {{/if}} | 65 | {{/if}} |
66 | 66 | ||
@@ -70,11 +70,11 @@ | @@ -70,11 +70,11 @@ | ||
70 | <span>普通会员</span> | 70 | <span>普通会员</span> |
71 | </p> | 71 | </p> |
72 | <p class="grade-desc"> | 72 | <p class="grade-desc"> |
73 | - 还差<span class="cost-gap">¥{{costGap}}</span>就可以升级为银卡会员! | 73 | + 还差<span class="cost-gap">¥{{costGap}}</span>就可以升级为银卡会员! |
74 | <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span> | 74 | <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span> |
75 | </p> | 75 | </p> |
76 | <p class="sum-cost"> | 76 | <p class="sum-cost"> |
77 | - 年度累计金额<span> ¥{{costOfThisYear}}</span> | 77 | + 年度累计金额<span> ¥{{costOfThisYear}}</span> |
78 | </p> | 78 | </p> |
79 | <div class="progresser"> | 79 | <div class="progresser"> |
80 | <div class="outer"></div> | 80 | <div class="outer"></div> |
@@ -83,6 +83,6 @@ | @@ -83,6 +83,6 @@ | ||
83 | 普通 | 83 | 普通 |
84 | </span> | 84 | </span> |
85 | <span class="beacon beacon-max">银卡会员</span> | 85 | <span class="beacon beacon-max">银卡会员</span> |
86 | - <span class="cost-limit">¥600.00</span> | 86 | + <span class="cost-limit">¥600.00</span> |
87 | </div> | 87 | </div> |
88 | {{/if}} | 88 | {{/if}} |
@@ -34,7 +34,7 @@ const getAreaDataAsync = () => { | @@ -34,7 +34,7 @@ const getAreaDataAsync = () => { | ||
34 | 34 | ||
35 | return result; | 35 | return result; |
36 | } else { | 36 | } else { |
37 | - logger.error('获取地区数据返回 code 不是 200'); | 37 | + logger.error('获取地区数据返回 code no 200'); |
38 | return []; | 38 | return []; |
39 | } | 39 | } |
40 | }); | 40 | }); |
@@ -35,7 +35,8 @@ const newGoods = (req, res, next) => { | @@ -35,7 +35,8 @@ const newGoods = (req, res, next) => { | ||
35 | dayLimit: 1, | 35 | dayLimit: 1, |
36 | discount: '', | 36 | discount: '', |
37 | cartUrl: helpers.urlFormat('/cart/index/index', null), | 37 | cartUrl: helpers.urlFormat('/cart/index/index', null), |
38 | - pageFooter: true | 38 | + pageFooter: true, |
39 | + showDownloadApp: true | ||
39 | }); | 40 | }); |
40 | }).catch(next); | 41 | }).catch(next); |
41 | }; | 42 | }; |
@@ -178,7 +178,7 @@ let consults = (params) => { | @@ -178,7 +178,7 @@ let consults = (params) => { | ||
178 | data.consults = result[1].list; | 178 | data.consults = result[1].list; |
179 | } | 179 | } |
180 | 180 | ||
181 | - data.showReadMore = result[1].list.length > 2; | 181 | + data.showReadMore = _.get(result[1], 'list.length', 0) > 2; |
182 | 182 | ||
183 | return data; | 183 | return data; |
184 | }); | 184 | }); |
@@ -929,7 +929,7 @@ let _getShopsInfo = (brandId) => { | @@ -929,7 +929,7 @@ let _getShopsInfo = (brandId) => { | ||
929 | }, { | 929 | }, { |
930 | cache: true | 930 | cache: true |
931 | }).then(shops => { | 931 | }).then(shops => { |
932 | - if (shops.code === 200) { | 932 | + if (shops && shops.code === 200) { |
933 | return _processShopsInfo(shops.data); | 933 | return _processShopsInfo(shops.data); |
934 | } | 934 | } |
935 | 935 |
@@ -596,8 +596,7 @@ const getBrandIntro = (brandId, uid) => { | @@ -596,8 +596,7 @@ const getBrandIntro = (brandId, uid) => { | ||
596 | method: 'app.brand.getBrandIntro', | 596 | method: 'app.brand.getBrandIntro', |
597 | brand_id: brandId | 597 | brand_id: brandId |
598 | }, param), { | 598 | }, param), { |
599 | - code: 200, | ||
600 | - cache: true | 599 | + code: 200 |
601 | }).then(result => { | 600 | }).then(result => { |
602 | if (result && result.data) { | 601 | if (result && result.data) { |
603 | let list = result.data; | 602 | let list = result.data; |
@@ -71,7 +71,7 @@ const getNewFocus = (channel) => { | @@ -71,7 +71,7 @@ const getNewFocus = (channel) => { | ||
71 | const getSearchData = (params) => { | 71 | const getSearchData = (params) => { |
72 | return _searchGoods(params).then((result) => { | 72 | return _searchGoods(params).then((result) => { |
73 | if (result && result.code === 200) { | 73 | if (result && result.code === 200) { |
74 | - return productProcess.processProductList(result.data.product_list || []); | 74 | + return productProcess.processProductList(result.data.product_list || [], {showTags: false}); |
75 | } else { | 75 | } else { |
76 | logger.error('get product search api return code is not 200'); | 76 | logger.error('get product search api return code is not 200'); |
77 | return []; | 77 | return []; |
@@ -72,7 +72,7 @@ const mayLike = (uid, page, limit, gender, udid, recPos, channel) => { | @@ -72,7 +72,7 @@ const mayLike = (uid, page, limit, gender, udid, recPos, channel) => { | ||
72 | } | 72 | } |
73 | 73 | ||
74 | } else { | 74 | } else { |
75 | - logger.error('mayLike cood 不是 200'); | 75 | + logger.error('mayLike code no 200'); |
76 | } | 76 | } |
77 | }); | 77 | }); |
78 | }; | 78 | }; |
@@ -97,7 +97,7 @@ const mayLikeKids = (page, limit, channel) => { | @@ -97,7 +97,7 @@ const mayLikeKids = (page, limit, channel) => { | ||
97 | 97 | ||
98 | } | 98 | } |
99 | } else { | 99 | } else { |
100 | - logger.error('mayLikeKids cood 不是 200'); | 100 | + logger.error('mayLikeKids code no 200'); |
101 | } | 101 | } |
102 | }); | 102 | }); |
103 | }; | 103 | }; |
@@ -91,6 +91,10 @@ const _searchGoods = (params) => { | @@ -91,6 +91,10 @@ const _searchGoods = (params) => { | ||
91 | delete params.filter_poolId; | 91 | delete params.filter_poolId; |
92 | } | 92 | } |
93 | 93 | ||
94 | + if (params.brand) { | ||
95 | + method = 'app.search.brand'; | ||
96 | + } | ||
97 | + | ||
94 | // 排除基本筛选项默认值为0的对象 | 98 | // 排除基本筛选项默认值为0的对象 |
95 | for (let str in params) { | 99 | for (let str in params) { |
96 | if (str !== 'order' && params[str] === '0' || params[str] === null) { | 100 | if (str !== 'order' && params[str] === '0' || params[str] === null) { |
@@ -104,6 +104,7 @@ router.get('/search/search', search.search); | @@ -104,6 +104,7 @@ router.get('/search/search', search.search); | ||
104 | 104 | ||
105 | // 品类 | 105 | // 品类 |
106 | router.get('/index/index', list.category); | 106 | router.get('/index/index', list.category); |
107 | +router.get('/list/index', list.category); // 兼容 PC 的链接 | ||
107 | 108 | ||
108 | // 品牌 | 店铺 | 109 | // 品牌 | 店铺 |
109 | router.get('/index/brand', list.brand); | 110 | router.get('/index/brand', list.brand); |
@@ -122,6 +123,7 @@ router.get('/opt/favoriteBrand', list.favoriteBrand); | @@ -122,6 +123,7 @@ router.get('/opt/favoriteBrand', list.favoriteBrand); | ||
122 | 123 | ||
123 | // 新品到着 | 124 | // 新品到着 |
124 | router.get('/new', news.newGoods); | 125 | router.get('/new', news.newGoods); |
126 | +router.get('/list/new', news.newGoods); // 兼容 PC 的链接 | ||
125 | router.get('/new/selectNewSale', news.selectNewSale); | 127 | router.get('/new/selectNewSale', news.selectNewSale); |
126 | router.get('/new/filter', news.filter); | 128 | router.get('/new/filter', news.filter); |
127 | 129 |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | </div> | 9 | </div> |
10 | <div class="price"> | 10 | <div class="price"> |
11 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | 11 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> |
12 | - {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} | 12 | + {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} |
13 | </div> | 13 | </div> |
14 | <div class="swiper-lazy-preloader"></div> | 14 | <div class="swiper-lazy-preloader"></div> |
15 | </a> | 15 | </a> |
@@ -16,12 +16,12 @@ module.exports = { | @@ -16,12 +16,12 @@ module.exports = { | ||
16 | siteUrl: '//m.yohobuy.com', | 16 | siteUrl: '//m.yohobuy.com', |
17 | assetUrl: '//localhost:5001', | 17 | assetUrl: '//localhost:5001', |
18 | domains: { | 18 | domains: { |
19 | - api: 'http://api.yoho.cn/', | 19 | + // api: 'http://api.yoho.cn/', |
20 | + api: 'http://api-test3.yohops.com:9999/', | ||
20 | service: 'http://service.yoho.cn/', | 21 | service: 'http://service.yoho.cn/', |
21 | liveApi: 'http://api.live.yoho.cn/', | 22 | liveApi: 'http://api.live.yoho.cn/', |
22 | singleApi: 'http://single.yoho.cn/' | 23 | singleApi: 'http://single.yoho.cn/' |
23 | 24 | ||
24 | - // api: 'http://api-test1.yohops.com:9999/', | ||
25 | // service: 'http://service-test1.yohops.com:9999/', | 25 | // service: 'http://service-test1.yohops.com:9999/', |
26 | // liveApi: 'http://testapi.live.yohops.com:9999/', | 26 | // liveApi: 'http://testapi.live.yohops.com:9999/', |
27 | // singleApi: 'http://api-test1.yohops.com:9999/' | 27 | // singleApi: 'http://api-test1.yohops.com:9999/' |
doraemon/middleware/item-name-handler.js
0 → 100644
1 | +/** | ||
2 | + * 商品详情页部分商品名称重置,防止express内部decodeURIComponent不能解析url出错 | ||
3 | + * @author: xuqi<qi.xu@yoho.cn> | ||
4 | + * @date: 2016/8/23 | ||
5 | + */ | ||
6 | + | ||
7 | +module.exports = function(req, res, next) { | ||
8 | + if (/^\/product\/pro_/.test(req.url)) { | ||
9 | + req.url = req.url.replace(/\/pro_([\d]+)_([\d]+)\/(.*)/, '/pro_$1_$2/yoho-replace.html'); | ||
10 | + } | ||
11 | + next(); | ||
12 | +}; |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | */ | 5 | */ |
6 | 6 | ||
7 | 'use strict'; | 7 | 'use strict'; |
8 | +const helpers = global.yoho.helpers; | ||
8 | 9 | ||
9 | module.exports = () => { | 10 | module.exports = () => { |
10 | return (req, res, next) => { | 11 | return (req, res, next) => { |
@@ -31,6 +32,8 @@ module.exports = () => { | @@ -31,6 +32,8 @@ module.exports = () => { | ||
31 | res.set('Access-Control-Allow-Origin', '*'); | 32 | res.set('Access-Control-Allow-Origin', '*'); |
32 | } | 33 | } |
33 | 34 | ||
35 | + res.locals.cartUrl = helpers.urlFormat('/cart/index/index'); | ||
36 | + | ||
34 | next(); | 37 | next(); |
35 | }; | 38 | }; |
36 | }; | 39 | }; |
1 | <div id="suspend-cart" class="suspend-cart"> | 1 | <div id="suspend-cart" class="suspend-cart"> |
2 | - <a href={{cartUrl}}> | 2 | + <a href="{{@root.cartUrl}}"> |
3 | <span class="iconfont"></span> | 3 | <span class="iconfont"></span> |
4 | </a> | 4 | </a> |
5 | <span class="cart-count hide">0</span> | 5 | <span class="cart-count hide">0</span> |
6 | -</div> | ||
6 | +</div> |
@@ -14,13 +14,13 @@ | @@ -14,13 +14,13 @@ | ||
14 | <a href="{{url}}" class="nav-sub-right">{{text}}</a> | 14 | <a href="{{url}}" class="nav-sub-right">{{text}}</a> |
15 | {{/shopPage}} | 15 | {{/shopPage}} |
16 | {{#currencyPage}} | 16 | {{#currencyPage}} |
17 | - <a href="/home/helpDetail?code=20151230-102233&caption=有货币介绍" class="iconfont nav-home"></a> | 17 | + <a href="/home/helpDetail?code=20151230-102233&caption=有货币介绍&name=有货币介绍" class="iconfont nav-home"></a> |
18 | {{/currencyPage}} | 18 | {{/currencyPage}} |
19 | {{#currencyDetailPage}} | 19 | {{#currencyDetailPage}} |
20 | - <a href="/home/helpDetail?code=20111130-152530&caption=如何使用有货币支付" class="iconfont nav-home"></a> | 20 | + <a href="/home/helpDetail?code=20111130-152530&caption=如何使用有货币支付&name=如何使用有货币支付" class="iconfont nav-home"></a> |
21 | {{/currencyDetailPage}} | 21 | {{/currencyDetailPage}} |
22 | {{#installmentPage}} | 22 | {{#installmentPage}} |
23 | - <a href="/home/helpDetail?code=20151230-102233&caption=有货分期" class="iconfont nav-home"></a> | 23 | + <a href="/home/helpDetail?code=20151230-102233&caption=有货分期&name=有货分期" class="iconfont nav-home"></a> |
24 | {{/installmentPage}} | 24 | {{/installmentPage}} |
25 | {{#navPhone}} | 25 | {{#navPhone}} |
26 | <a href="{{.}}" class="iconfont nav-home"></a> | 26 | <a href="{{.}}" class="iconfont nav-home"></a> |
@@ -78,6 +78,10 @@ $categoryContainer.on('touchend', function(e) { | @@ -78,6 +78,10 @@ $categoryContainer.on('touchend', function(e) { | ||
78 | $subLevel.not('.hide').addClass('hide'); | 78 | $subLevel.not('.hide').addClass('hide'); |
79 | $subLevel.eq(index).removeClass('hide'); | 79 | $subLevel.eq(index).removeClass('hide'); |
80 | } | 80 | } |
81 | + | ||
82 | + if ($this.find('a').attr('href')) { | ||
83 | + location.href = $this.find('a').attr('href'); | ||
84 | + } | ||
81 | }); | 85 | }); |
82 | 86 | ||
83 | $categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() { | 87 | $categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() { |
@@ -128,11 +128,9 @@ module.exports = function(specificGender) { | @@ -128,11 +128,9 @@ module.exports = function(specificGender) { | ||
128 | 128 | ||
129 | var PRDID = []; | 129 | var PRDID = []; |
130 | if (data === ' ' || data === '') { | 130 | if (data === ' ' || data === '') { |
131 | - searching = false; | 131 | + searching = true; |
132 | loading.hideLoadingMask(); | 132 | loading.hideLoadingMask(); |
133 | 133 | ||
134 | - $('.maybe-like').hide(); | ||
135 | - | ||
136 | // 有货币页面不加载底部 | 134 | // 有货币页面不加载底部 |
137 | if (gender && !specificGender) { | 135 | if (gender && !specificGender) { |
138 | gender = gender.substr(0, 3); | 136 | gender = gender.substr(0, 3); |
@@ -122,7 +122,7 @@ function rePosFooter() { | @@ -122,7 +122,7 @@ function rePosFooter() { | ||
122 | 122 | ||
123 | winH = Math.min($(window).height(), window.screen.availHeight); | 123 | winH = Math.min($(window).height(), window.screen.availHeight); |
124 | 124 | ||
125 | - if ($('body').height() <= winH - parseInt($footer.css('height'), 0)) { | 125 | + if ($('body').height() <= winH) { |
126 | $footer.addClass('bottom'); | 126 | $footer.addClass('bottom'); |
127 | } else { | 127 | } else { |
128 | $footer.removeClass('bottom'); | 128 | $footer.removeClass('bottom'); |
@@ -198,6 +198,7 @@ function reMarginFooter(fixedElement) { | @@ -198,6 +198,7 @@ function reMarginFooter(fixedElement) { | ||
198 | a.src = j; | 198 | a.src = j; |
199 | m.parentNode.insertBefore(a, m); | 199 | m.parentNode.insertBefore(a, m); |
200 | }(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas')); | 200 | }(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas')); |
201 | + | ||
201 | (function() { | 202 | (function() { |
202 | var uid = getUid(); | 203 | var uid = getUid(); |
203 | 204 |
@@ -215,7 +215,7 @@ function loadMore($container, opt, url) { | @@ -215,7 +215,7 @@ function loadMore($container, opt, url) { | ||
215 | success: function(data) { | 215 | success: function(data) { |
216 | var $newItems; | 216 | var $newItems; |
217 | 217 | ||
218 | - if (data === ' ') { | 218 | + if (data === '') { |
219 | opt.end = true; | 219 | opt.end = true; |
220 | searching = false; | 220 | searching = false; |
221 | 221 |
@@ -3,6 +3,8 @@ var $ = require('yoho-jquery'), | @@ -3,6 +3,8 @@ var $ = require('yoho-jquery'), | ||
3 | var page = 1; | 3 | var page = 1; |
4 | var flag = true; | 4 | var flag = true; |
5 | 5 | ||
6 | +require('../common'); | ||
7 | + | ||
6 | loading.showLoadingMask(); | 8 | loading.showLoadingMask(); |
7 | 9 | ||
8 | function ajaxCurrencyDetail(curPage) { | 10 | function ajaxCurrencyDetail(curPage) { |
@@ -33,6 +33,8 @@ var now = new Date(), | @@ -33,6 +33,8 @@ var now = new Date(), | ||
33 | month = now.getMonth() + 1, | 33 | month = now.getMonth() + 1, |
34 | date = now.getDate(); | 34 | date = now.getDate(); |
35 | 35 | ||
36 | +require('../../common/footer'); | ||
37 | + | ||
36 | var $listNav = $('#list-nav'), | 38 | var $listNav = $('#list-nav'), |
37 | 39 | ||
38 | // 导航数据信息 | 40 | // 导航数据信息 |
@@ -221,7 +223,7 @@ function search(opt) { | @@ -221,7 +223,7 @@ function search(opt) { | ||
221 | break; | 223 | break; |
222 | } | 224 | } |
223 | 225 | ||
224 | - if (data === ' ') { | 226 | + if (data === ' ' || data === '') { |
225 | nav.end = true; | 227 | nav.end = true; |
226 | if (nav.reload) { | 228 | if (nav.reload) { |
227 | $container.html(noResult); | 229 | $container.html(noResult); |
@@ -192,7 +192,7 @@ function getQueryString(name) { | @@ -192,7 +192,7 @@ function getQueryString(name) { | ||
192 | shopId = getQueryString('shop_id'); | 192 | shopId = getQueryString('shop_id'); |
193 | sort = getQueryString('sort'); | 193 | sort = getQueryString('sort'); |
194 | outlets = getQueryString('outlets'); | 194 | outlets = getQueryString('outlets'); |
195 | -age_level = getQueryString('ageLevel'); | 195 | +age_level = getQueryString('age_level'); |
196 | app_type = getQueryString('app_type'); | 196 | app_type = getQueryString('app_type'); |
197 | msort = getQueryString('msort'); | 197 | msort = getQueryString('msort'); |
198 | misort = getQueryString('misort'); | 198 | misort = getQueryString('misort'); |
@@ -218,7 +218,6 @@ function search(opt) { | @@ -218,7 +218,6 @@ function search(opt) { | ||
218 | } | 218 | } |
219 | 219 | ||
220 | if (opt) { | 220 | if (opt) { |
221 | - | ||
222 | // 筛选项变更则重置reload为true | 221 | // 筛选项变更则重置reload为true |
223 | for (att in navInfo) { | 222 | for (att in navInfo) { |
224 | if (navInfo.hasOwnProperty(att)) { | 223 | if (navInfo.hasOwnProperty(att)) { |
@@ -255,7 +254,7 @@ function search(opt) { | @@ -255,7 +254,7 @@ function search(opt) { | ||
255 | color: opt.id | 254 | color: opt.id |
256 | }; | 255 | }; |
257 | break; | 256 | break; |
258 | - case 'age_level': | 257 | + case 'ageLevel': |
259 | ext = { | 258 | ext = { |
260 | age_level: opt.id | 259 | age_level: opt.id |
261 | }; | 260 | }; |
1 | -.iHelp { | 1 | +.i-help { |
2 | width: 100%; | 2 | width: 100%; |
3 | height: auto; | 3 | height: auto; |
4 | overflow: hidden; | 4 | overflow: hidden; |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | } | 29 | } |
30 | 30 | ||
31 | span { | 31 | span { |
32 | - width: 85%; | 32 | + width: 92%; |
33 | height: 100%; | 33 | height: 100%; |
34 | overflow: hidden; | 34 | overflow: hidden; |
35 | float: left; | 35 | float: left; |
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | -.deal_main { | 46 | +.deal-main { |
47 | margin: 0.5rem 3%; | 47 | margin: 0.5rem 3%; |
48 | font-size: 14.4PX; | 48 | font-size: 14.4PX; |
49 | width: 94%; | 49 | width: 94%; |
@@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
107 | font-size: 24px; | 107 | font-size: 24px; |
108 | border-bottom: 1px solid #e0e0e0; | 108 | border-bottom: 1px solid #e0e0e0; |
109 | padding-bottom: 20px; | 109 | padding-bottom: 20px; |
110 | - height: 120px; | 110 | + height: 140px; |
111 | overflow: hidden; | 111 | overflow: hidden; |
112 | position: relative; | 112 | position: relative; |
113 | 113 | ||
@@ -288,7 +288,7 @@ | @@ -288,7 +288,7 @@ | ||
288 | margin: 0 30px; | 288 | margin: 0 30px; |
289 | 289 | ||
290 | .swiper-slide { | 290 | .swiper-slide { |
291 | - width: 225px; | 291 | + width: 255px; |
292 | height: 100%; | 292 | height: 100%; |
293 | float: left; | 293 | float: left; |
294 | padding-right: 30px; | 294 | padding-right: 30px; |
@@ -124,14 +124,13 @@ | @@ -124,14 +124,13 @@ | ||
124 | .create-new-suggest { | 124 | .create-new-suggest { |
125 | display: block; | 125 | display: block; |
126 | width: 100%; | 126 | width: 100%; |
127 | - height: 88px; | 127 | + height: 150px; |
128 | line-height: 88px; | 128 | line-height: 88px; |
129 | text-align: center; | 129 | text-align: center; |
130 | font-size: 30px; | 130 | font-size: 30px; |
131 | border-top: 30px solid #f0f0f0; | 131 | border-top: 30px solid #f0f0f0; |
132 | border-bottom: 30px solid #f0f0f0; | 132 | border-bottom: 30px solid #f0f0f0; |
133 | position: relative; | 133 | position: relative; |
134 | - height: 88px; | ||
135 | 134 | ||
136 | .list-item { | 135 | .list-item { |
137 | padding: 0 35px; | 136 | padding: 0 35px; |
-
Please register or login to post a comment