...
|
...
|
@@ -24,10 +24,10 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
vip.level = parseInt(data.current_vip_level, 10) || 0;
|
|
|
vip.current_total_growth = parseInt(data.current_total_growth, 10) || 0;
|
|
|
vip.grades = [
|
|
|
{name: '普通会员', val: 0, percent: 0},
|
|
|
{name: '银卡会员', val: 800, percent: 11.4},
|
|
|
{name: '金卡会员', val: 3000, percent: 42.9},
|
|
|
{name: '白金会员', val: 7000, percent: 100}
|
|
|
{name: '普通会员', val: 0},
|
|
|
{name: '银卡会员', val: 800},
|
|
|
{name: '金卡会员', val: 3000},
|
|
|
{name: '白金会员', val: 7000}
|
|
|
];
|
|
|
|
|
|
if (vip.grades[vip.level + 1]) {
|
...
|
...
|
@@ -35,6 +35,9 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
vip.need_total_growth = vip.need_total_growth > 0 ? vip.need_total_growth : 0;
|
|
|
}
|
|
|
|
|
|
vip.current_total_percent = ((vip.current_total_growth / vip.grades[3].val) * 100).toFixed(2);
|
|
|
vip.current_total_percent = vip.current_total_percent > 100 ? 100 : vip.current_total_percent;
|
|
|
|
|
|
return vip;
|
|
|
});
|
|
|
}
|
...
|
...
|
|