Authored by 郝肖肖

'fix'

... ... @@ -114,13 +114,13 @@ class Grade {
req.ctx(GradeModel).vipIconList({uid}).then(result => {
let vipNav = _.filter(_.get(result, 'data', {}), {status: 1});
let id = parseInt(`0${req.query.vrid}`, 10) || _.get(vipNav, '[0].id', 0);
let findex = _.findIndex(vipNav, {id: id});
_.each(vipNav, item => {
if (item.id === id) {
item.active = true;
return false;
}
});
if (vipNav[findex]) {
vipNav[findex].active = true;
} else {
vipNav[0].active = true;
}
res.render('grade/droit', {
module: 'activity',
... ...
... ... @@ -39,7 +39,7 @@ class GradeDroitPage extends Page {
let $activeDom = this.selector.$droitNav.find('.droit-nav-item.active');
let aOffset = $activeDom.offset();
if (aOffset.left > winWidth) {
if (aOffset && aOffset.left > winWidth) {
this.selector.$droitNav.animate({
scrollLeft: (aOffset.left - winWidth / 2 + $activeDom.width() / 2) + 'px'
}, 1000);
... ...