Authored by zhangxiaoru

设置潮流口令

... ... @@ -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',
... ...
... ... @@ -492,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
}
... ...