Authored by 李靖

删除老板帮助中心

// 帮助 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);
};
// 帮助 by acgpiano
'use strict';
const api = global.yoho.API;
// 获取帮助列表
exports.getHelpList = () => {
return api.get('', {
method: 'app.help.li'
}).then(result => {
if (result && result.code === 200 && result.data) {
let final = [];
for (let name of result.data) {
final.push({
name: name.caption,
code: name.code,
});
}
return final;
}
});
};
// 获取帮助详情
exports.getHelpDetail = (code) => {
return api.get('', {
method: 'app.help.detail',
code: code,
}).then(result => {
return result.replace(/^<!DOCTYPE.*<body>/g, '').
replace(/<\/body>.*<\/html>/g, '');
});
};
... ... @@ -24,7 +24,6 @@ const orderController = require(`${cRoot}/order`);
const orderDetailController = require(`${cRoot}/orderDetail`);
const currencyController = require(`${cRoot}/myCurrency`);
const coupons = require(`${cRoot}/coupons`);
const help = require(`${cRoot}/help`);
const suggest = require(`${cRoot}/suggest`);
const message = require(`${cRoot}/message`);
const onlineService = require(`${cRoot}/onlineService`);
... ... @@ -84,10 +83,6 @@ router.post('/favoriteDel', auth, favorite.favoriteDelete);// 取消收藏
router.use('/coupons', auth, coupons.index);
router.use('/couponsAjax', coupons.couponsAjax);
// 帮助中心
router.get('/help', help.index);
router.get('/helpDetail', help.helpDetail);
// 意见反馈
router.get('/suggest', suggest.suggestData);
router.post('/upAndDown', suggest.upAndDown);
... ...
{{{detail}}}
\ No newline at end of file
<div class="i-help">
<ul>
{{#iHelp}}
<li><a href="//m.yohobuy.com/home/helpDetail?code={{code}}&name={{name}}"><span>{{name}}</span><i class="iconfont num">&#xe604;</i></a></li>
{{/iHelp}}
</ul>
</div>
\ No newline at end of file