...
|
...
|
@@ -8,53 +8,11 @@ |
|
|
const helpModel = require('../models/help');
|
|
|
|
|
|
/**
|
|
|
* 主界面
|
|
|
*/
|
|
|
const index = (req, res) => {
|
|
|
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: '帮助中心'
|
|
|
}
|
|
|
];
|
|
|
nav = nav.concat(getNav(id));
|
|
|
res.display('detail', {
|
|
|
module: 'help',
|
|
|
page: 'help',
|
|
|
content: Object.assign({nav}, data)
|
|
|
});
|
|
|
});
|
|
|
/* 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)
|
|
|
});*/
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 根据id获取文章数据
|
|
|
* @param id
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
const getData = (id)=> {
|
|
|
/* const getData = (id)=> {
|
|
|
let contentData = helpModel.contentData().content;
|
|
|
|
|
|
for (var i = 0; i < contentData.length; i++) {
|
...
|
...
|
@@ -62,7 +20,7 @@ const getData = (id)=> { |
|
|
return contentData[i]
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};*/
|
|
|
|
|
|
/**
|
|
|
* 根据id获取当前所在位置,拼接面包屑
|
...
|
...
|
@@ -81,7 +39,7 @@ const getNav = (id)=> { |
|
|
}, {
|
|
|
name: menuData[i].subsets[j].text
|
|
|
}
|
|
|
]
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
} else {
|
...
|
...
|
@@ -90,12 +48,59 @@ const getNav = (id)=> { |
|
|
{
|
|
|
name: menuData[i].text
|
|
|
}
|
|
|
]
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 主界面
|
|
|
*/
|
|
|
const index = (req, res) => {
|
|
|
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: '帮助中心'
|
|
|
}
|
|
|
];
|
|
|
|
|
|
nav = nav.concat(getNav(id));
|
|
|
res.display('detail', {
|
|
|
module: 'help',
|
|
|
page: 'help',
|
|
|
content: Object.assign({nav}, data)
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/* 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)
|
|
|
});*/
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
index
|
|
|
}; |
...
|
...
|
|