Showing
4 changed files
with
22 additions
and
10 deletions
@@ -100,9 +100,9 @@ if ($('.goods-consults .consult-item').length > 10) { | @@ -100,9 +100,9 @@ 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 | } |
107 | 107 | ||
108 | -require('./fav'); | ||
108 | +require('./fav'); |
@@ -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"> |
@@ -12,7 +12,7 @@ class DetailController extends AbstractAction | @@ -12,7 +12,7 @@ class DetailController extends AbstractAction | ||
12 | 12 | ||
13 | /** | 13 | /** |
14 | * 商品详情 | 14 | * 商品详情 |
15 | - * | 15 | + * |
16 | * @param int productId | 16 | * @param int productId |
17 | * @param int goodsId | 17 | * @param int goodsId |
18 | */ | 18 | */ |
@@ -50,7 +50,7 @@ class DetailController extends AbstractAction | @@ -50,7 +50,7 @@ class DetailController extends AbstractAction | ||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * 商品详情 (SKN) | 52 | * 商品详情 (SKN) |
53 | - * | 53 | + * |
54 | * @param int productSkn | 54 | * @param int productSkn |
55 | */ | 55 | */ |
56 | public function showAction() | 56 | public function showAction() |
@@ -100,7 +100,7 @@ class DetailController extends AbstractAction | @@ -100,7 +100,7 @@ class DetailController extends AbstractAction | ||
100 | 100 | ||
101 | /** | 101 | /** |
102 | * 购买评价列表 | 102 | * 购买评价列表 |
103 | - * | 103 | + * |
104 | * @param int productId | 104 | * @param int productId |
105 | * @param int total | 105 | * @param int total |
106 | */ | 106 | */ |
@@ -132,7 +132,7 @@ class DetailController extends AbstractAction | @@ -132,7 +132,7 @@ class DetailController extends AbstractAction | ||
132 | 132 | ||
133 | /** | 133 | /** |
134 | * 购买咨询列表 | 134 | * 购买咨询列表 |
135 | - * | 135 | + * |
136 | * @param int productId | 136 | * @param int productId |
137 | * @param int total | 137 | * @param int total |
138 | */ | 138 | */ |
@@ -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 | ||
@@ -222,7 +224,7 @@ class DetailController extends AbstractAction | @@ -222,7 +224,7 @@ class DetailController extends AbstractAction | ||
222 | 224 | ||
223 | /** | 225 | /** |
224 | * 添加咨询操作 | 226 | * 添加咨询操作 |
225 | - * | 227 | + * |
226 | * @param int product_id 商品ID | 228 | * @param int product_id 商品ID |
227 | * @param string content 咨询内容 | 229 | * @param string content 咨询内容 |
228 | * @return json | 230 | * @return json |
@@ -243,7 +245,7 @@ class DetailController extends AbstractAction | @@ -243,7 +245,7 @@ class DetailController extends AbstractAction | ||
243 | 245 | ||
244 | /** | 246 | /** |
245 | * 为你优选 | 247 | * 为你优选 |
246 | - * | 248 | + * |
247 | * @param int productSkn 商品SKN号 | 249 | * @param int productSkn 商品SKN号 |
248 | * @return json | 250 | * @return json |
249 | */ | 251 | */ |
-
Please register or login to post a comment