merge-hotfix-home
Showing
12 changed files
with
40 additions
and
40 deletions
@@ -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 = {}; |
@@ -49,7 +49,7 @@ exports.addressAct = (req, res, next) => { | @@ -49,7 +49,7 @@ 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 | navBtn: false |
54 | }), | 54 | }), |
55 | title: result.navTitle | 55 | title: result.navTitle |
@@ -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 | }; |
@@ -62,8 +62,6 @@ const currencyDetail = (uid, page, limit) => { | @@ -62,8 +62,6 @@ const currencyDetail = (uid, page, limit) => { | ||
62 | _.forEach(_.get(result, 'data.coinlist', []), perCoin => { | 62 | _.forEach(_.get(result, 'data.coinlist', []), perCoin => { |
63 | if (perCoin.num > 0) { | 63 | if (perCoin.num > 0) { |
64 | perCoin.num = '+' + perCoin.num; | 64 | perCoin.num = '+' + perCoin.num; |
65 | - } else if (perCoin.num < 0) { | ||
66 | - perCoin.num = '-' + perCoin.num; | ||
67 | } | 65 | } |
68 | }); | 66 | }); |
69 | 67 | ||
@@ -87,7 +85,7 @@ const currencyDetail = (uid, page, limit) => { | @@ -87,7 +85,7 @@ const currencyDetail = (uid, page, limit) => { | ||
87 | } | 85 | } |
88 | 86 | ||
89 | } else { | 87 | } else { |
90 | - logger.error('youholist cood 不是 200'); | 88 | + logger.error('youholist code no 200'); |
91 | } | 89 | } |
92 | 90 | ||
93 | }); | 91 | }); |
@@ -289,7 +289,7 @@ const orderDetailData = (uid, orderCode) => { | @@ -289,7 +289,7 @@ const orderDetailData = (uid, orderCode) => { | ||
289 | 289 | ||
290 | // return orderDetail; | 290 | // return orderDetail; |
291 | } else { | 291 | } else { |
292 | - logger.error('详情信息 返回不是200'); | 292 | + logger.error('detail info return no 200'); |
293 | return {}; | 293 | return {}; |
294 | } | 294 | } |
295 | 295 |
@@ -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 | }; |
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> |
@@ -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 | }); |
@@ -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 | }; |
@@ -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) { |
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%; |
-
Please register or login to post a comment