Authored by 郝肖肖

'会员等级-进度条'

... ... @@ -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;
});
}
... ...
... ... @@ -11,7 +11,7 @@
<span class="name">拉拉</span>
<span class="vip-img{{level}}"></span>
<span class="info">
我的成长值:<span class="adolesce-val">{{current_total_growth}}</span>&nbsp;&nbsp;
我的成长值:<span class="adolesce-val" data-percent={{current_total_percent}}>{{current_total_growth}}</span>&nbsp;&nbsp;
{{#if need_total_growth}}
下次升级还需:<span class="adolesce-val">{{need_total_growth}}</span>
{{/if}}
... ...
... ... @@ -2,3 +2,7 @@
* Created by DELL on 2017.2.10.
*/
require('../common');
let percentVal = $('.adolesce-val').data('percent');
$('head').append('<style>.vip-me-page .vip-level .user .progress::before{width:' + percentVal + '%}</style>');
... ...
... ... @@ -99,7 +99,7 @@
&:before {
content: "";
width: 85%;
width: 0;
height: 2px;
position: relative;
background-color: #000;
... ... @@ -141,6 +141,18 @@
.p-footer p {
margin-top: 3px;
}
&:first-child {
width: 11.4%;
}
&:first-child + li {
width: 31.4%;
}
&:first-child + li + li {
width: 57.1%;
}
}
}
}
... ...