Authored by 王水玲

帮助中心修改

... ... @@ -12,6 +12,10 @@ const index = (req, res, next) => {
let channel = req.query.channel ? req.query.channel : 'boys';
helpModel.helpData(channel).then(result => {
if (result.content.menuData.length === 0) {
return next();
}
res.render('help', Object.assign({
module: 'help',
page: 'help-index',
... ... @@ -59,6 +63,10 @@ const detail = (req, res, next) => {
let newData = result.newData;
let headerData = result.headerData;
if (result.newData.data.menuData.length === 0) {
return next();
}
if (!(typeof (newData.nav) === 'undefined')) {
nav = nav.concat(newData.nav);
}
... ...
... ... @@ -221,7 +221,7 @@ const _processSearch = (list, params) => {
const _processDetailData = (result, params) => {
let menuData = [];
let contData = false;
let data = result[2].data || {};
let data = _.get(result, '[2].data', {});
let nav = [];
// 常见问题
... ... @@ -237,7 +237,7 @@ const _processDetailData = (result, params) => {
id: 1,
commonProblem: true,
faqs: data.faqs,
allQa: result[3].data
allQa: _.get(result, '[3].data', [])
};
}
}
... ... @@ -289,14 +289,14 @@ const helpData = (channel) => {
helpApi.getSelfService()
]).then(result => {
return {
headerData: result[0],
headerData: _.get(result, '[0]', {}),
content: _.assign({
hotSearch: _.slice(result[1].data, 0, 5),
hotSearch: _.slice(_.get(result, '[1].data', []), 0, 5),
selfService: {
categoryName: '自助服务',
list: result[3].data
list: _.get(result, '[3].data', [])
}
}, _processHomeCategoryFaq(result[2].data))
}, _processHomeCategoryFaq(_.get(result, '[2].data', {})))
};
});
};
... ... @@ -316,9 +316,9 @@ const detailData = (params) => {
return Promise.all(promiseData).then(result => {
let newData = _processDetailData(result, params);
_.set(newData, 'data.hotSearch', _.slice(_.get(result, '[1].data', {}), 0, 5));
_.set(newData, 'data.hotSearch', _.slice(_.get(result, '[1].data', []), 0, 5));
return {
headerData: result[0],
headerData: _.get(result, '[0]', {}),
newData: newData
};
});
... ... @@ -336,11 +336,7 @@ const searchData = (params) => {
// 在线客服
const onlineService = () => {
return helpApi.onlineService().then(result => {
if (result.code === 200) {
return result.data.url;
} else {
return '';
}
return _.get(result, 'data.url', '');
});
};
... ...
... ... @@ -10,7 +10,7 @@
{{#allQa}}
<li class="problem-li">
<p class="title">{{caption}}</p>
<p class="cont">{{{content}}}</p>
<div class="cont">{{{content}}}</div>
</li>
{{/allQa}}
</ul>
... ...
... ... @@ -73,6 +73,8 @@
.cont {
color: #989898;
margin-top: 15px;
font-size: 14px;
line-height: 20px;
}
.show-all {
... ...
... ... @@ -18,12 +18,11 @@
}
.iconfont {
font-size: 18px;
font-size: 16px;
color: #3a3a3a;
padding: 0 5px;
cursor: pointer;
position: relative;
top: 3px;
top: 2px;
}
}
... ... @@ -71,7 +70,7 @@
}
.notice {
margin-top: 5px;
margin: 3px 0 5px;
height: 30px;
overflow: hidden;
... ...
... ... @@ -130,7 +130,7 @@
width: 610px;
height: 350px;
background-color: #000;
opacity: 0.5;
opacity: 0.4;
position: absolute;
}
... ... @@ -147,18 +147,18 @@
height: 220px;
margin: 60px auto;
overflow: auto;
width: 530px;
width: 558px;
}
.a-area,
.q-area {
width: 465px;
width: 460px;
position: relative;
font-size: 14px;
color: #1b1b1b;
color: #444;
min-height: 20px;
margin-top: 15px;
padding-left: 36px;
padding-left: 66px;
&:before {
content: "";
... ... @@ -166,12 +166,19 @@
height: 18px;
display: block;
position: absolute;
left: 5px;
left: 26px;
top: 3px;
}
}
.a-area {
margin-top: 10px;
font-size: 18px;
color: #000;
}
.q-area {
line-height: 24px;
}
.a-area:before {
... ... @@ -184,10 +191,10 @@
.iconfont {
position: absolute;
right: 20px;
top: 20px;
right: 35px;
top: 25px;
cursor: pointer;
font-size: 26px;
font-size: 30px;
z-index: 4;
}
}
... ...