...
|
...
|
@@ -324,13 +324,13 @@ exports.getGrade = (uid, channel) => { |
|
|
|
|
|
_.forEach(result[0].data.enjoy_preferential, function(val) {
|
|
|
|
|
|
if (val.id === 7 || val.id === 8) {
|
|
|
if (parseInt(val.id, 10) === 7 || parseInt(val.id, 10) === 8) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
obj.privilege.push({
|
|
|
description: val.description,
|
|
|
pic: iconId(parseInt(val.id)),
|
|
|
pic: iconId(parseInt(val.id, 10)),
|
|
|
title: val.title
|
|
|
});
|
|
|
|
...
|
...
|
@@ -339,7 +339,7 @@ exports.getGrade = (uid, channel) => { |
|
|
switch (result[0].data.current_vip_level) {
|
|
|
case '0': // 普通会员
|
|
|
obj = _.assign(obj, {
|
|
|
vip1: true
|
|
|
vip0: true
|
|
|
});
|
|
|
break;
|
|
|
case '1': // 银卡会员
|
...
|
...
|
@@ -366,7 +366,7 @@ exports.getGrade = (uid, channel) => { |
|
|
obj = _.assign(obj, {
|
|
|
costOfThisYear: result[0].data.current_year_cost,
|
|
|
sumCost: result[0].data.current_total_cost,
|
|
|
allUrl: helpers.urlFormat('/home/privilege'),
|
|
|
allUrl: helpers.urlFormat('/me/privilege'),
|
|
|
costGap: upg
|
|
|
});
|
|
|
|
...
|
...
|
@@ -401,3 +401,38 @@ exports.getGrade = (uid, channel) => { |
|
|
}
|
|
|
};
|
|
|
|
|
|
exports.getPreferential = (params) => {
|
|
|
|
|
|
return api.get('', {
|
|
|
method: 'app.passport.getPrivilege',
|
|
|
uid: params.uid,
|
|
|
channel: params.channel || 1
|
|
|
}, {
|
|
|
code: 200
|
|
|
}).then((result) => {
|
|
|
|
|
|
let obj = {};
|
|
|
|
|
|
let resu = {
|
|
|
privilege: []
|
|
|
};
|
|
|
|
|
|
_.forEach(result.data, function(val) {
|
|
|
|
|
|
if (parseInt(val.id, 10) === 7 || parseInt(val.id, 10) === 8) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
resu.privilege.push({
|
|
|
description: val.description,
|
|
|
pic: iconId(parseInt(val.id, 10)),
|
|
|
title: val.title
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
return resu;
|
|
|
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
|