help.js 1.01 KB
// 帮助 by acgpiano
'use strict';
const headerModel = require('../../../doraemon/models/header'), // 头部model
    model = require('../models/help');

exports.index = (req, res, next) => {
    model.getHelpList().then(result => {
        res.render('help', {
            module: 'home',
            page: 'help',
            pageHeader: headerModel.setNav({
                navTitle: '帮助中心',
                navBtn: false
            }),
            title: '帮助中心',
            pageFooter: true,
            iHelp: result
        });
    }).catch(next);
};

exports.helpDetail = (req, res, next) => {
    model.getHelpDetail(req.query.code).then(result => {
        res.render('help-detail', {
            module: 'home',
            page: 'help-detail',
            pageHeader: headerModel.setNav({
                navTitle: req.query.name,
                navBtn: false
            }),
            title: req.query.name,
            pageFooter: true,
            detail: result,
        });
    }).catch(next);
};