Merge branch 'feature/family' of git.yoho.cn:fe/yohobuywap-node into feature/family
Showing
4 changed files
with
30 additions
and
1 deletions
@@ -47,6 +47,16 @@ exports.downLoadData = (req, res, next) => { | @@ -47,6 +47,16 @@ exports.downLoadData = (req, res, next) => { | ||
47 | }).catch(next); | 47 | }).catch(next); |
48 | }; | 48 | }; |
49 | 49 | ||
50 | +// 设置潮流口令 | ||
51 | +exports.setTrendWord = (req, res, next) => { | ||
52 | + let uid = req.user.uid; | ||
53 | + let trendWord = req.query.trendWord; | ||
54 | + | ||
55 | + req.ctx(family).setTrendWord(uid, trendWord).then(result => { | ||
56 | + res.json(result); | ||
57 | + }).catch(next); | ||
58 | +}; | ||
59 | + | ||
50 | exports.coinDetail = (req, res) => { | 60 | exports.coinDetail = (req, res) => { |
51 | let responseData = { | 61 | let responseData = { |
52 | module: 'home', | 62 | module: 'home', |
@@ -381,6 +381,10 @@ class familyModel extends global.yoho.BaseModel { | @@ -381,6 +381,10 @@ class familyModel extends global.yoho.BaseModel { | ||
381 | let colorList = []; | 381 | let colorList = []; |
382 | 382 | ||
383 | if (result && result.data) { | 383 | if (result && result.data) { |
384 | + result.data.data.sort(function(a, b) { | ||
385 | + return b.proportion - a.proportion; | ||
386 | + }); | ||
387 | + | ||
384 | chartsData.total = _.get(result.data, 'total', ''); | 388 | chartsData.total = _.get(result.data, 'total', ''); |
385 | 389 | ||
386 | _.forEach(result.data.data, function(data) { | 390 | _.forEach(result.data.data, function(data) { |
@@ -488,6 +492,19 @@ class familyModel extends global.yoho.BaseModel { | @@ -488,6 +492,19 @@ class familyModel extends global.yoho.BaseModel { | ||
488 | }); | 492 | }); |
489 | } | 493 | } |
490 | 494 | ||
495 | + /** | ||
496 | + * 设置我的潮流口令 | ||
497 | + */ | ||
498 | + setTrendWord(uid, trendWord) { | ||
499 | + return family.get('user/updateInviteCode', { | ||
500 | + uid: uid, | ||
501 | + trendWord: trendWord | ||
502 | + }).then((result) => { | ||
503 | + | ||
504 | + return result; | ||
505 | + }); | ||
506 | + } | ||
507 | + | ||
491 | userInfo(params) { | 508 | userInfo(params) { |
492 | return Promise.all([ | 509 | return Promise.all([ |
493 | this._userData(params.uid), | 510 | this._userData(params.uid), |
@@ -188,4 +188,6 @@ router.get('/family/coinMall', auth, family.coinMall); // 积分商城 | @@ -188,4 +188,6 @@ router.get('/family/coinMall', auth, family.coinMall); // 积分商城 | ||
188 | router.get('/family/coinMall/getList', auth, family.getList); // 积分商城-获取积分列表 | 188 | router.get('/family/coinMall/getList', auth, family.getList); // 积分商城-获取积分列表 |
189 | router.get('/family/modify', auth, family.modify); // family修改个人信息页 | 189 | router.get('/family/modify', auth, family.modify); // family修改个人信息页 |
190 | router.get('/family/integralCharts', auth, family.integralCharts); // family积分商城 | 190 | router.get('/family/integralCharts', auth, family.integralCharts); // family积分商城 |
191 | +router.get('/family/set-trend-word', auth, family.setTrendWord); // family设置潮流口令 | ||
192 | + | ||
191 | module.exports = router; | 193 | module.exports = router; |
@@ -220,7 +220,7 @@ class FamilyIndex extends Page { | @@ -220,7 +220,7 @@ class FamilyIndex extends Page { | ||
220 | 220 | ||
221 | this.ajax({ | 221 | this.ajax({ |
222 | type: 'GET', | 222 | type: 'GET', |
223 | - url: location.protocol + '//m.yohobuy.com/activity/set-trend-world', | 223 | + url: location.protocol + '//m.yohobuy.com/home/family/set-trend-word', |
224 | data: { | 224 | data: { |
225 | trendWord: trendWord | 225 | trendWord: trendWord |
226 | } | 226 | } |
-
Please register or login to post a comment