Authored by Rock Zhang

Merge branch 'feature/wap323' into develop

... ... @@ -88,6 +88,20 @@ class DetailData
}
/**
* 常见问题列表
*
* @return array
*/
public static function commonConsultList()
{
$param = Yohobuy::param();
$param['method'] = 'app.consult.common';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 评论内容列表
*
* @param int $productId 产品ID
... ...
... ... @@ -94,7 +94,8 @@ if ($('.goods-consults-page').length > 0) {
if (readmoreHammer) {
readmoreHammer.on('tap', function() {
$('.readmore').hide();
$('.goods-consults .consult-item').show();
$('.goods-consults.customer-consults').removeClass('customer-consults');
return false;
});
}
... ...
... ... @@ -135,7 +135,7 @@
}
.banner-top {
padding-top: 178rem / $pxConvertRem;
padding-top: 258rem / $pxConvertRem;
background-color:#f8f8f8;
}
... ...
... ... @@ -71,23 +71,26 @@
color: $subFontC;
}
}
.goods-consults {
margin-top: 5.25rem;
overflow: hidden;
.goods-consults.customer-consults {
.consult-item:nth-child(1) {
display: block;
}
.consult-item:nth-child(2) {
display: block;
}
.consult-item {
display: none;
}
}
.goods-consults {
margin-top: 5.25rem;
overflow: hidden;
.consult-item {
margin-top: pxToRem(30px);
padding: pxToRem(20px) pxToRem(28px);
background-color: #fff;
border-bottom: 1px solid $borderC;
border-top: 1px solid $borderC;
display:none;
.question {
font-size: pxToRem(24px);
color: $mainFontC;
... ...
... ... @@ -6,7 +6,7 @@
<a href="{{link}}" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults" id="goods-consults">
<div class="goods-consults customer-consults" id="goods-consults">
{{#list}}
<div class="consult-item" data-id="{{id}}">
<div class="question">
... ... @@ -55,7 +55,7 @@
{{#faq}}
<div class="goods-consults" style="margin-top:0">
{{#list}}
{{#commonConsults}}
<div class="faq-item">
<div class="question">
<span class="iconfont">&#xe639;</span>
... ... @@ -69,7 +69,7 @@
<p>{{answer}}</p>
</div>
</div>
{{/list}}
{{/commonConsults}}
</div>
{{/faq}}
... ...
... ... @@ -571,9 +571,9 @@ class DetailModel
$build['answer'] = $value['answer'];
$build['id'] = $value['id'];
$build['isLike'] = $value['is_like'] === 'Y';
$build['like'] = $value['like'];
$build['like'] = intval($value['like']);
$build['isUseful'] = $value['is_useful'] === 'Y';
$build['useful'] = $value['useful'];
$build['useful'] = intval($value['useful']);
$result[] = $build;
}
}
... ... @@ -584,6 +584,24 @@ class DetailModel
}
/**
* 获取常见问题列表
*
* @return array
*/
public static function getCommonConsults()
{
$result = array();
$consults = DetailData::commonConsultList();
if (isset($consults['code']) && $consults['code'] === 200) {
$result['commonConsults'] = $consults['data'];
$consults = array();
}
return $result;
}
/**
* 咨询点赞
*
* @param int $uid 用户ID
... ...
... ... @@ -158,6 +158,7 @@ class DetailController extends AbstractAction
'consults' => array(
'list' => $consults
),
'faq' => \Product\DetailModel::getCommonConsults(),
'showReadMore' => count($consults) > 2,
'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)),
);
... ... @@ -166,6 +167,7 @@ class DetailController extends AbstractAction
$this->_view->display('consults', $data);
}
/*
* 咨询点赞
*/
... ...