Authored by lijing

会员页优化

... ... @@ -155,10 +155,12 @@ exports.grade = (req, res, next) => {
pageFooter: true
};
indexModel.getGrade({
let param = {
uid: req.user.uid,
channel: req.query.channel || 1
}).then((result) => {
};
indexModel.getGrade(param).then((result) => {
res.render('vip-grade/vip-grade', Object.assign(result, responseData));
}).catch(next);
... ... @@ -185,10 +187,12 @@ exports.preferential = (req, res, next) => {
pageFooter: true
};
indexModel.getPreferential({
let param = {
uid: req.user.uid,
channel: req.query.channel || 1
}).then((result) => {
};
indexModel.getPreferential(param).then((result) => {
res.render('vip-grade/privilege', Object.assign(result, responseData));
}).catch(next);
... ...
... ... @@ -220,7 +220,7 @@ const delRecord = (uid, skn) => {
* 会员等级
* @param params
*/
const getGradeGrade = (channel, uid) => {
const getGradeGrade = (uid, channel) => {
return api.get('', {
method: 'app.passport.vip',
uid: uid,
... ... @@ -228,21 +228,19 @@ const getGradeGrade = (channel, uid) => {
}, {code: 200});
};
const getGradeUser = (channel, uid) => {
if (uid) {
const getGradeUser = (uid, channel) => {
return api.get('', {
method: 'app.passport.profile',
uid: uid,
channel: channel || 1
}, {code: 200});
}
};
const getGrade = (channel, uid) => {
const getGrade = (param) => {
if (param.uid) {
return api.all([
getGradeGrade(channel, uid),
getGradeUser(channel, uid)
getGradeGrade(param.uid, param.channel),
getGradeUser(param.uid, param.channel)
]).then((result) => {
let resu = {
... ... @@ -330,6 +328,19 @@ const getGrade = (channel, uid) => {
return resu;
});
} else {
return api.get('', {
}).then(() => {
let resu = {
vipGrade: []
};
return resu;
});
}
};
/**
... ...
... ... @@ -49,7 +49,7 @@ router.get('/cancelOrder', orderDetailController.cancelOrder); // 取消订单
router.get('/', homeController.index); // 个人中心首页
router.get('/mydetails', homeController.myDetails); // 个人基本资料页面
router.get('/grade', homeController.grade); // 会员等级页
router.get('/grade', auth, homeController.grade); // 会员等级页
router.get('/privilege', homeController.preferential); // 会员特权列表页
router.get('/mycurrency', currencyController.myCurrency); // yoho币总数
... ...