Authored by 514335620@qq.com

outlet tab 代码

... ... @@ -23,3 +23,15 @@ exports.activity = (req, res) => {
res.render('outlet/activity', Object.assign(renderData, result));
});
};
exports.willBeEnd = (req, res) => {
outletModel.willBeEnd().then(result => {
res.render('outlet/willBeEnd', Object.assign(renderData, result));
});
};
exports.willBeCome = (req, res) => {
outletModel.willBeCome().then(result => {
res.render('outlet/willBeCome', Object.assign(renderData, result));
});
};
... ...
... ... @@ -140,26 +140,29 @@ const convertActicityData = (data) => {
return {data: formatData, showMore: showMore};
};
const getHomeActivity = () => {
const getHomeActivity = (id) => {
var params = {
method: 'app.outlets.activityGet',
platform: 2,
size: 0,
yh_channel: 1,
type: 0,
type: id,
sort: 2,
client_type: 'h5'
};
return api.get('', sign.apiSign(params)).then(res => {
if (id === 0) {
return convertActicityData(res.data);
}
return res.data;
});
};
exports.getContent = () => {
let floorsData = {};
return Promise.all([getNavData(), getOutletResource(), getHomeActivity(), getGoodsList()]).then(data => {
return Promise.all([getNavData(), getOutletResource(), getHomeActivity(0), getGoodsList()]).then(data => {
floorsData.nav = data[0] || [];
floorsData.content = data[1] || [];
floorsData.activity = data[2] || [];
... ... @@ -178,3 +181,15 @@ exports.getActivity = () => {
return data;
});
};
exports.willBeEnd = () => {
return getHomeActivity(3).then(res => {
return res;
});
};
exports.willBeCome = () => {
return getHomeActivity(4).then(res => {
return res;
});
};
... ...
... ... @@ -36,6 +36,7 @@ router.get('/sale/filter', sale.filter);
router.get('/outlet', outlet.index);
router.get('/outlet/activity', outlet.activity);
router.get('/outlet/willBeEnd', outlet.willBeEnd);
router.get('/outlet/willBeCome', outlet.willBeCome);
module.exports = router;
... ...
... ... @@ -4,6 +4,8 @@
{{#each data}}
<li><a href="{{url}}">{{name}}</a></li>
{{/each}}
<li><a href="{{url}}" data-url="outlet/willBeEnd">即将结束</a></li>
<li><a href="{{url}}" data-url="/outlet/willBeCome">上线预告</a></li>
</ul>
</nav>
{{/nav}}
... ...
... ... @@ -24,5 +24,16 @@ if (('.outlet-page').length > 0) {
$('.more-activity').addClass('hidden');
$('.back-ground-white').removeClass('hidden');
});
}
if (('.outlet-page').length > 0) {
$('.outlet-nav').find('li').each(function() {
$(this).on('click', function() {
});
});
}
... ...