Authored by 周少峰

Merge branch 'feature/help' of git.yoho.cn:fe/yohobuy-node into feature/help

... ... @@ -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', '');
});
};
... ...
... ... @@ -5,12 +5,12 @@
<a href="javascript:void(0);" data-ask="{{caption}}" data-answer="{{content}}"><i class="dot-icon"></i>{{caption}}</a>
{{/faqs}}
</div>
<h2 class="all-problem-title nav-title">所有问题</h2>
<h2 class="all-problem-title nav-title">所有问题一览</h2>
<ul class="all-problem">
{{#allQa}}
<li class="problem-li">
<p class="title">{{caption}}</p>
<p class="cont">{{{content}}}</p>
<div class="cont">{{{content}}}</div>
</li>
{{/allQa}}
</ul>
... ...
... ... @@ -9,9 +9,9 @@
<li class="{{#if problem}}problem-li{{else}}article-li{{/if}}">
<p class="title">{{{caption}}}</p>
{{#if problem}}
<p class="cont">{{{allCont}}}</p>
<div class="cont">{{{allCont}}}</div>
{{else}}
<p class="cont">{{{content}}}</p>
<div class="cont">{{{content}}}</div>
{{/if}}
</li>
{{/helper_list}}
... ...

272 Bytes | W: | H:

371 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin

19.3 KB | W: | H:

19.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -12,7 +12,7 @@ var cutStr = function(params) {
params.str = params.str.replace(/<[^>]*>/g, '');
if (params.type === '2') {
if (params.type === 2) {
addTxt = '';
} else {
addTxt = '<a href="' + params.url + '" class="show-all" target="_blank">查看详情&gt;</a>';
... ...
... ... @@ -32,7 +32,7 @@ if (keywords) {
if (result.helper_list) {
$.each(result.helper_list, function(k, s) {
if (s.helperType === '2') {
if (s.helperType === 2) {
s.problem = true;
s.allCont = s.content;
}
... ...
... ... @@ -73,6 +73,8 @@
.cont {
color: #989898;
margin-top: 15px;
font-size: 14px;
line-height: 20px;
}
.show-all {
... ... @@ -105,7 +107,7 @@
content: "";
width: 18px;
height: 18px;
background: url("/help/q.png") no-repeat;
background: url("/help/a.png") no-repeat;
position: absolute;
left: 0;
}
... ... @@ -114,7 +116,7 @@
content: "";
width: 18px;
height: 18px;
background: url("/help/a.png") no-repeat;
background: url("/help/q.png") no-repeat;
position: absolute;
left: 0;
}
... ... @@ -131,11 +133,12 @@
.title:before {
content: "";
width: 18px;
height: 18px;
width: 13px;
height: 16px;
background: url("/help/file.png") no-repeat;
position: absolute;
left: 0;
left: 3px;
top: 2px;
}
}
}
... ...
... ... @@ -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;
}
}
... ...