Showing
4 changed files
with
15 additions
and
3 deletions
@@ -100,7 +100,7 @@ if ($('.goods-consults .consult-item').length > 10) { | @@ -100,7 +100,7 @@ if ($('.goods-consults .consult-item').length > 10) { | ||
100 | if (readmoreHammer) { | 100 | if (readmoreHammer) { |
101 | readmoreHammer.on('tap', function() { | 101 | readmoreHammer.on('tap', function() { |
102 | $('.readmore').hide(); | 102 | $('.readmore').hide(); |
103 | - $('.goods-consults .consult-item:nth-child(n+11)').show(); | 103 | + $('.goods-consults .consult-item').show(); |
104 | return false; | 104 | return false; |
105 | }); | 105 | }); |
106 | } | 106 | } |
@@ -74,12 +74,20 @@ | @@ -74,12 +74,20 @@ | ||
74 | .goods-consults { | 74 | .goods-consults { |
75 | margin-top: 5.25rem; | 75 | margin-top: 5.25rem; |
76 | overflow: hidden; | 76 | overflow: hidden; |
77 | + .consult-item:nth-child(1) { | ||
78 | + display: block; | ||
79 | + } | ||
80 | + .consult-item:nth-child(2) { | ||
81 | + display: block; | ||
82 | + } | ||
83 | + | ||
77 | .consult-item { | 84 | .consult-item { |
78 | margin-top: pxToRem(30px); | 85 | margin-top: pxToRem(30px); |
79 | padding: pxToRem(20px) pxToRem(28px); | 86 | padding: pxToRem(20px) pxToRem(28px); |
80 | background-color: #fff; | 87 | background-color: #fff; |
81 | border-bottom: 1px solid $borderC; | 88 | border-bottom: 1px solid $borderC; |
82 | border-top: 1px solid $borderC; | 89 | border-top: 1px solid $borderC; |
90 | + display:none; | ||
83 | .question { | 91 | .question { |
84 | font-size: pxToRem(24px); | 92 | font-size: pxToRem(24px); |
85 | color: $mainFontC; | 93 | color: $mainFontC; |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div class="goto-consult tap-hightlight" id="goto-consult" data-href="{{link}}"> | 3 | <div class="goto-consult tap-hightlight" id="goto-consult" data-href="{{link}}"> |
4 | <i class="iconfont consult-logo"></i> | 4 | <i class="iconfont consult-logo"></i> |
5 | <span>我要咨询</span> | 5 | <span>我要咨询</span> |
6 | - <a href="javascript:;" class="iconfont enter-consult-page"></a> | 6 | + <a href="{{link}}" class="iconfont enter-consult-page"></a> |
7 | </div> | 7 | </div> |
8 | {{# consults}} | 8 | {{# consults}} |
9 | <div class="goods-consults" id="goods-consults"> | 9 | <div class="goods-consults" id="goods-consults"> |
@@ -43,7 +43,9 @@ | @@ -43,7 +43,9 @@ | ||
43 | </div> | 43 | </div> |
44 | {{/ consults}} | 44 | {{/ consults}} |
45 | 45 | ||
46 | + {{#showReadMore}} | ||
46 | <a href="javascript:;" id="readmore" class="readmore tap-hightlight" >查看更多 <i class="iconfont"></i></a> | 47 | <a href="javascript:;" id="readmore" class="readmore tap-hightlight" >查看更多 <i class="iconfont"></i></a> |
48 | + {{/showReadMore}} | ||
47 | 49 | ||
48 | {{#faq}} | 50 | {{#faq}} |
49 | <h1 class="faq-title"> | 51 | <h1 class="faq-title"> |
@@ -150,12 +150,14 @@ class DetailController extends AbstractAction | @@ -150,12 +150,14 @@ class DetailController extends AbstractAction | ||
150 | } | 150 | } |
151 | $this->setTitle('购买咨询'); | 151 | $this->setTitle('购买咨询'); |
152 | 152 | ||
153 | + $consults = \Product\DetailModel::getConsults($productId); | ||
153 | $data = array( | 154 | $data = array( |
154 | 'goodsConsultsPage' => true, | 155 | 'goodsConsultsPage' => true, |
155 | 'pageFooter' => true, | 156 | 'pageFooter' => true, |
156 | 'consults' => array( | 157 | 'consults' => array( |
157 | - 'list' => \Product\DetailModel::getConsults($productId), | 158 | + 'list' => $consults |
158 | ), | 159 | ), |
160 | + 'showReadMore' => count($consults) > 2, | ||
159 | 'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)), | 161 | 'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)), |
160 | ); | 162 | ); |
161 | 163 |
-
Please register or login to post a comment