Authored by 王水玲

帮助中心所有问题添加分页

... ... @@ -46,7 +46,8 @@ const detail = (req, res, next) => {
contId: +req.query.contId || 0,
keywords: req.query.helpQuery,
channel: req.query.channel ? req.query.channel : 'boys',
url: req.originalUrl
url: req.originalUrl,
page: q.page || 1
};
let nav = [
... ...
... ... @@ -53,10 +53,12 @@ const helpSearch = (params) => {
});
};
const allQA = () => {
const allQA = (page) => {
return api.get('', {
method: 'app.helper.allQA',
showPlatform: 'yohobuy_pc'
showPlatform: 'yohobuy_pc',
viewNum: 15,
page: page
}, {
code: 200
});
... ...
... ... @@ -231,12 +231,18 @@ const _processDetailData = (result, params) => {
});
if (params.id === 1 && !params.keywords) {
let page = pager(_.get(result, '[3].data.page_total', 0), {
id: params.id,
page: params.page
});
contData = {
isShowMenu: _processCountLength(data.faqs),
id: 1,
commonProblem: true,
faqs: data.faqs,
allQa: _.get(result, '[3].data', [])
allQa: _.get(result, '[3].data.list', []),
footPager: page
};
}
}
... ... @@ -309,7 +315,7 @@ const detailData = (params) => {
];
if (params.id === 1 && !params.keywords) {
promiseData.push(helpApi.allQA());
promiseData.push(helpApi.allQA(params.page));
}
return Promise.all(promiseData).then(result => {
... ...
... ... @@ -14,6 +14,7 @@
</li>
{{/allQa}}
</ul>
{{> common/foot-pager}}
</div>
... ...
... ... @@ -88,6 +88,10 @@
.all-problem {
.cont {
height: auto;
img {
max-width: 100%;
}
}
}
... ...