Authored by 李靖

Merge branch 'feature/family' of git.yoho.cn:fe/yohobuywap-node into feature/family

... ... @@ -47,6 +47,16 @@ exports.downLoadData = (req, res, next) => {
}).catch(next);
};
// 设置潮流口令
exports.setTrendWord = (req, res, next) => {
let uid = req.user.uid;
let trendWord = req.query.trendWord;
req.ctx(family).setTrendWord(uid, trendWord).then(result => {
res.json(result);
}).catch(next);
};
exports.coinDetail = (req, res) => {
let responseData = {
module: 'home',
... ...
... ... @@ -381,6 +381,10 @@ class familyModel extends global.yoho.BaseModel {
let colorList = [];
if (result && result.data) {
result.data.data.sort(function(a, b) {
return b.proportion - a.proportion;
});
chartsData.total = _.get(result.data, 'total', '');
_.forEach(result.data.data, function(data) {
... ... @@ -488,6 +492,19 @@ class familyModel extends global.yoho.BaseModel {
});
}
/**
* 设置我的潮流口令
*/
setTrendWord(uid, trendWord) {
return family.get('user/updateInviteCode', {
uid: uid,
trendWord: trendWord
}).then((result) => {
return result;
});
}
userInfo(params) {
return Promise.all([
this._userData(params.uid),
... ...
... ... @@ -188,4 +188,6 @@ router.get('/family/coinMall', auth, family.coinMall); // 积分商城
router.get('/family/coinMall/getList', auth, family.getList); // 积分商城-获取积分列表
router.get('/family/modify', auth, family.modify); // family修改个人信息页
router.get('/family/integralCharts', auth, family.integralCharts); // family积分商城
router.get('/family/set-trend-word', auth, family.setTrendWord); // family设置潮流口令
module.exports = router;
... ...
... ... @@ -220,7 +220,7 @@ class FamilyIndex extends Page {
this.ajax({
type: 'GET',
url: location.protocol + '//m.yohobuy.com/activity/set-trend-world',
url: location.protocol + '//m.yohobuy.com/home/family/set-trend-word',
data: {
trendWord: trendWord
}
... ...