cate.js
916 Bytes
/**
* 分类页面
*/
'use strict';
const cateModel = require('../models/cate');
const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab
const helpers = global.yoho.helpers;
let index = (req, res, next) => {
// 唤起 APP 的路径
res.locals.appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.attention","params":{"actiontype":"0"}}';
req.ctx(cateModel).getCateData(req.yoho.channel).then((result) => {
res.render('cate', {
module: 'channel',
page: 'cate',
title: '商品分类',
pageFooter: false,
category: {
nav: result.nav,
list: result.list,
searchUrl: helpers.urlFormat('', null, 'search')
},
showFooterTab: footerModel.getUrlData('category')
});
}).catch(next);
};
module.exports = {
index
};