|
@@ -39,22 +39,28 @@ const index = (req, res, next) => { |
|
@@ -39,22 +39,28 @@ const index = (req, res, next) => { |
39
|
// 个人信息调用失败返回
|
39
|
// 个人信息调用失败返回
|
40
|
if (profile) {
|
40
|
if (profile) {
|
41
|
|
41
|
|
42
|
- userInfo.result = 1;
|
42
|
+ // userInfo.result = 1;
|
|
|
43
|
+ console.log(profile);
|
|
|
44
|
+
|
|
|
45
|
+ let curYearCost = parseInt(_.get(profile, 'vip_info.curYearCost', 0)); //eslint-disable-line
|
|
|
46
|
+ let nextVipNeedCost = parseInt(_.get(profile, 'vip_info.nextVipNeedCost', 0)); //eslint-disable-line
|
43
|
|
47
|
|
44
|
Object.assign(userInfo, {
|
48
|
Object.assign(userInfo, {
|
45
|
|
49
|
|
46
|
// 个人资料
|
50
|
// 个人资料
|
47
|
profileName: _.get(profile, 'profile_name', ''),
|
51
|
profileName: _.get(profile, 'profile_name', ''),
|
48
|
headIco: !_.get(profile, 'head_ico') ? helpers.image(_.get(profile, 'head_ico'), 63, 63) : '',
|
52
|
headIco: !_.get(profile, 'head_ico') ? helpers.image(_.get(profile, 'head_ico'), 63, 63) : '',
|
|
|
53
|
+ curTitle: _.get(profile, 'vip_info.title', 0),
|
49
|
|
54
|
|
50
|
// VIP信息
|
55
|
// VIP信息
|
51
|
- curYearCost: _.get(profile, 'vip_info.curYearCost', 0),
|
56
|
+ curYearCost: curYearCost,
|
52
|
nextLevel: _.get(profile, 'vip_info.next_level', 0),
|
57
|
nextLevel: _.get(profile, 'vip_info.next_level', 0),
|
53
|
nextVipTitle: _.get(profile, 'vip_info.nextVipTitle', 0),
|
58
|
nextVipTitle: _.get(profile, 'vip_info.nextVipTitle', 0),
|
54
|
- nextVipNeedCost: _.get(profile, 'vip_info.nextVipNeedCost', 0),
|
59
|
+ nextVipNeedCost: nextVipNeedCost,
|
55
|
|
60
|
|
56
|
// 升级百分比
|
61
|
// 升级百分比
|
57
|
- curYearCostPer: userInfo.nextVipNeedCost ? Math.round(profile.curYearCost / profile.nextVipNeedCost * 100) : 0,
|
62
|
+ curYearCostPer: nextVipNeedCost ?
|
|
|
63
|
+ Math.round(curYearCost / (nextVipNeedCost + curYearCost) * 100) : 0,
|
58
|
|
64
|
|
59
|
// 待处理订单
|
65
|
// 待处理订单
|
60
|
order: _.get(userNum, 'wait_pay_num + wait_cargo_num + send_cargo_num', 0),
|
66
|
order: _.get(userNum, 'wait_pay_num + wait_cargo_num + send_cargo_num', 0),
|
|
@@ -84,7 +90,7 @@ const index = (req, res, next) => { |
|
@@ -84,7 +90,7 @@ const index = (req, res, next) => { |
84
|
data: '',
|
90
|
data: '',
|
85
|
message: '加载失败'
|
91
|
message: '加载失败'
|
86
|
});
|
92
|
});
|
87
|
- }).catch(next);
|
93
|
+ })().catch(next);
|
88
|
};
|
94
|
};
|
89
|
|
95
|
|
90
|
module.exports = {
|
96
|
module.exports = {
|