Authored by 毕凯

Merge branch 'feature/userVip' into 'feature/qps'

个人中心为你优选开关



See merge request !1023
... ... @@ -4,6 +4,7 @@ const mRoot = '../models';
const headerModel = require('../../../doraemon/models/header'); // 头部model
const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab
const newHomeModel = require(`${mRoot}/new-home`);
const _ = require('lodash');
let yhchannels = {
'1,3': 1,
... ... @@ -46,6 +47,11 @@ exports.index = (req, res, next) => {
};
req.ctx(newHomeModel).index(params).then(result => {
res.render('new-home', Object.assign(responseData, result));
// 为你优选开关
let recommendHide = _.get(req.app.locals.wap, 'ucenter.removePrefe', false);
res.render('new-home', Object.assign(responseData, result, {
recommendHide: recommendHide
}));
}).catch(next);
};
... ...
... ... @@ -161,7 +161,7 @@
{{> content}}
</div>
</div>
<div id="new-recommend-c">
<div id="new-recommend-c" class="{{#if recommendHide}}hide{{/if}}" data-switch="{{recommendHide}}">
<div class="toper">
<div class="title">为你优选</div>
</div>
... ...
... ... @@ -31,6 +31,7 @@ class NewRecommend extends Page {
}
getRecommend() {
if (this.selector.$recommendC.data('switch') !== true) {
this.ajax({
url: '/product/new-recommend/getRecommend',
}).then((result) => {
... ... @@ -53,6 +54,7 @@ class NewRecommend extends Page {
this.selector.$recommendC.remove();
});
}
}
}
$(() => {
... ...