...
|
...
|
@@ -12,15 +12,15 @@ const helpModel = require('../models/help'); |
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
/* const getData = (id)=> {
|
|
|
let contentData = helpModel.contentData().content;
|
|
|
const getData = (id)=> {
|
|
|
let contentData = helpModel.contentData().content;
|
|
|
|
|
|
for (var i = 0; i < contentData.length; i++) {
|
|
|
if (contentData[i].id === id) {
|
|
|
return contentData[i]
|
|
|
}
|
|
|
}
|
|
|
};*/
|
|
|
for (let i = 0; i < contentData.length; i++) {
|
|
|
if (contentData[i].id === id) {
|
|
|
return contentData[i];
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 根据id获取当前所在位置,拼接面包屑
|
...
|
...
|
@@ -57,48 +57,27 @@ const getNav = (id)=> { |
|
|
/**
|
|
|
* 主界面
|
|
|
*/
|
|
|
const index = (req, res, next) => {
|
|
|
let id = req.query.id || '11';
|
|
|
|
|
|
helpModel.getHelpDetail('81', 1, 15, '').then(result=> {
|
|
|
let content = {content: result.helpdetail_list[0].content};
|
|
|
let data = Object.assign(content, helpModel.menuData());
|
|
|
let nav = [
|
|
|
{
|
|
|
link: global.yoho.config.sitUrl,
|
|
|
name: 'YOHO!BLK首页'
|
|
|
},
|
|
|
{
|
|
|
name: '帮助中心'
|
|
|
}
|
|
|
];
|
|
|
|
|
|
if (!(typeof (getNav(id)) === 'undefined')) {
|
|
|
nav = nav.concat(getNav(id));
|
|
|
const index = (req, res) => {
|
|
|
let id = req.query.id || '1';
|
|
|
let data = Object.assign(getData(id), helpModel.menuData());
|
|
|
let nav = [
|
|
|
{
|
|
|
link: global.yoho.config.sitUrl,
|
|
|
name: 'YOHO!BLK首页'
|
|
|
},
|
|
|
{
|
|
|
name: '帮助中心'
|
|
|
}
|
|
|
res.display('detail', {
|
|
|
module: 'help',
|
|
|
page: 'help',
|
|
|
content: Object.assign({nav}, data)
|
|
|
});
|
|
|
}).catch(next);
|
|
|
];
|
|
|
|
|
|
/* let data = Object.assign(getData(id), helpModel.menuData());
|
|
|
let nav = [
|
|
|
{
|
|
|
link: global.yoho.config.sitUrl,
|
|
|
name: 'YOHO!BLK首页'
|
|
|
},
|
|
|
{
|
|
|
name: '帮助中心'
|
|
|
}
|
|
|
];
|
|
|
nav = nav.concat(getNav(id));
|
|
|
res.display('detail', {
|
|
|
module: 'help',
|
|
|
page: 'help',
|
|
|
content: Object.assign({nav}, data)
|
|
|
});*/
|
|
|
if (!(typeof (getNav(id)) === 'undefined')) {
|
|
|
nav = nav.concat(getNav(id));
|
|
|
}
|
|
|
res.display('detail', {
|
|
|
module: 'help',
|
|
|
page: 'help',
|
|
|
content: Object.assign({nav}, data)
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
...
|
...
|
|