Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
12 changed files
with
215 additions
and
160 deletions
@@ -19,6 +19,7 @@ class DetailData | @@ -19,6 +19,7 @@ class DetailData | ||
19 | 19 | ||
20 | const PRODUCT_BASE_INFO = 'product/queryProductDetailByProductId'; | 20 | const PRODUCT_BASE_INFO = 'product/queryProductDetailByProductId'; |
21 | const PRODUCT_SIZE_INFO = 'product/queryProductIntroBySkn'; | 21 | const PRODUCT_SIZE_INFO = 'product/queryProductIntroBySkn'; |
22 | + const PRODUCT_CONSULT_LIST = 'consult/queryConsults'; | ||
22 | 23 | ||
23 | /** | 24 | /** |
24 | * 商品基本信息 | 25 | * 商品基本信息 |
@@ -29,7 +30,9 @@ class DetailData | @@ -29,7 +30,9 @@ class DetailData | ||
29 | */ | 30 | */ |
30 | public static function baseInfo($productId, $uid) | 31 | public static function baseInfo($productId, $uid) |
31 | { | 32 | { |
32 | - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('param' => intval($productId), 'userId' => intval($uid)) ); | 33 | + return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array( |
34 | + 'param' => intval($productId), 'userId' => intval($uid) | ||
35 | + ) ); | ||
33 | } | 36 | } |
34 | 37 | ||
35 | /** | 38 | /** |
@@ -43,4 +46,21 @@ class DetailData | @@ -43,4 +46,21 @@ class DetailData | ||
43 | return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn) ) ); | 46 | return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn) ) ); |
44 | } | 47 | } |
45 | 48 | ||
49 | + /** | ||
50 | + * 咨询内容列表 | ||
51 | + * | ||
52 | + * @param int $productId 产品ID | ||
53 | + * @param int $pageNum 页码数 | ||
54 | + * @param int $pageSize 每页显示个数 | ||
55 | + * @return array | ||
56 | + */ | ||
57 | + public static function consultList($productId, $pageNum, $pageSize) | ||
58 | + { | ||
59 | + return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_CONSULT_LIST, array( | ||
60 | + 'productId' => intval($productId), | ||
61 | + 'pageNum' => intval($pageNum), | ||
62 | + 'pageSize' => intval($pageSize), | ||
63 | + ) ); | ||
64 | + } | ||
65 | + | ||
46 | } | 66 | } |
@@ -131,6 +131,7 @@ | @@ -131,6 +131,7 @@ | ||
131 | .good-detail-page { | 131 | .good-detail-page { |
132 | .feedback-list { | 132 | .feedback-list { |
133 | padding-top: pxToRem(30px); | 133 | padding-top: pxToRem(30px); |
134 | + margin-bottom: pxToRem(30px); | ||
134 | background-color: #f0f0f0; | 135 | background-color: #f0f0f0; |
135 | .nav-tab { | 136 | .nav-tab { |
136 | width: 100%; | 137 | width: 100%; |
@@ -41,6 +41,7 @@ $basicBtnC:#eb0313; | @@ -41,6 +41,7 @@ $basicBtnC:#eb0313; | ||
41 | border-bottom: 1px solid $borderC; | 41 | border-bottom: 1px solid $borderC; |
42 | border-top: 1px solid $borderC; | 42 | border-top: 1px solid $borderC; |
43 | padding: 0 pxToRem(28px); | 43 | padding: 0 pxToRem(28px); |
44 | + margin-bottom: pxToRem(30px); | ||
44 | >.title { | 45 | >.title { |
45 | line-height: pxToRem(88px); | 46 | line-height: pxToRem(88px); |
46 | color: $mainFontC; | 47 | color: $mainFontC; |
@@ -146,6 +147,7 @@ $basicBtnC:#eb0313; | @@ -146,6 +147,7 @@ $basicBtnC:#eb0313; | ||
146 | padding-left: pxToRem(28px); | 147 | padding-left: pxToRem(28px); |
147 | padding-right: pxToRem(28px); | 148 | padding-right: pxToRem(28px); |
148 | border-bottom: 1px solid $borderC; | 149 | border-bottom: 1px solid $borderC; |
150 | + margin-bottom: pxToRem(30px); | ||
149 | background-color: #f4f4f4; | 151 | background-color: #f4f4f4; |
150 | } | 152 | } |
151 | .price-date { | 153 | .price-date { |
@@ -22,6 +22,9 @@ | @@ -22,6 +22,9 @@ | ||
22 | margin-top: pxToRem(20px); | 22 | margin-top: pxToRem(20px); |
23 | } | 23 | } |
24 | .materials { | 24 | .materials { |
25 | + &.page-block{ | ||
26 | + margin-bottom: 0; | ||
27 | + } | ||
25 | .detail { | 28 | .detail { |
26 | .material-item{ | 29 | .material-item{ |
27 | min-height: pxToRem(136px); | 30 | min-height: pxToRem(136px); |
@@ -52,7 +55,7 @@ | @@ -52,7 +55,7 @@ | ||
52 | .wash-tips{ | 55 | .wash-tips{ |
53 | padding-top:pxToRem(18px); | 56 | padding-top:pxToRem(18px); |
54 | &.page-block{ | 57 | &.page-block{ |
55 | - border-top: none; | 58 | + border-top: 0px; |
56 | padding-left: pxToRem(15px); | 59 | padding-left: pxToRem(15px); |
57 | padding-right: pxToRem(15px); | 60 | padding-right: pxToRem(15px); |
58 | } | 61 | } |
@@ -3,78 +3,77 @@ | @@ -3,78 +3,77 @@ | ||
3 | <div class="banner-container"> | 3 | <div class="banner-container"> |
4 | <h1 class="is-new-lable">NEW</h1> | 4 | <h1 class="is-new-lable">NEW</h1> |
5 | {{# bannerTop}} | 5 | {{# bannerTop}} |
6 | - {{> product/banner_swiper_arrow}} | 6 | + {{> product/banner-swiper-arrow}} |
7 | {{/ bannerTop}} | 7 | {{/ bannerTop}} |
8 | </div> | 8 | </div> |
9 | - | ||
10 | {{# goodsName}} | 9 | {{# goodsName}} |
11 | <h2 class="goodsName"><span>{{.}}</span></h2> | 10 | <h2 class="goodsName"><span>{{.}}</span></h2> |
12 | {{/ goodsName}} | 11 | {{/ goodsName}} |
13 | - | 12 | + |
14 | {{# goodsSubtitle}} | 13 | {{# goodsSubtitle}} |
15 | <h1 class="goodsSubtitle"><span>{{.}}</span></h1> | 14 | <h1 class="goodsSubtitle"><span>{{.}}</span></h1> |
16 | {{/ goodsSubtitle}} | 15 | {{/ goodsSubtitle}} |
17 | 16 | ||
18 | <div class="price-date"> | 17 | <div class="price-date"> |
19 | - {{#goodsPrice}} | ||
20 | - <div class="goodsPrice"> | ||
21 | - <h1 class="currentPrice">{{currentPrice}}</h1> | ||
22 | - <h1 class="previousPrice">{{previousPrice}}</h1> | ||
23 | - </div> | ||
24 | - {{/goodsPrice}} | 18 | + {{# goodsPrice}} |
19 | + <div class="goodsPrice"> | ||
20 | + <h1 class="currentPrice">{{currentPrice}}</h1> | ||
21 | + <h1 class="previousPrice">{{previousPrice}}</h1> | ||
22 | + </div> | ||
23 | + {{/ goodsPrice}} | ||
25 | 24 | ||
26 | - {{#periodOfMarket}} | ||
27 | - <div class="periodOfMarket"> | ||
28 | - <h1>上市期:</h1> | ||
29 | - <h1 >{{.}}</h1> | 25 | + {{# periodOfMarket}} |
26 | + <div class="periodOfMarket"> | ||
27 | + <h1>上市期:</h1> | ||
28 | + <h1 >{{.}}</h1> | ||
29 | + </div> | ||
30 | + {{/ periodOfMarket}} | ||
30 | </div> | 31 | </div> |
31 | - {{/periodOfMarket}} | ||
32 | -</div> | ||
33 | 32 | ||
34 | -{{# vipLevel}} | ||
35 | -<div class="vipLevel"> | ||
36 | - {{# list}} | ||
37 | -<span class="vip-img"> | ||
38 | - <div class="img" alt="" style="background-size:cover;"></div> | ||
39 | -</span> | ||
40 | - <span class="vip-price">{{text}}</span> | ||
41 | - {{/ list}} | ||
42 | -</div> | ||
43 | -{{/ vipLevel}} | 33 | + {{# vipLevel}} |
34 | + <div class="vipLevel"> | ||
35 | + {{# list}} | ||
36 | + <span class="vip-img"> | ||
37 | + <div class="img" alt="" style="background-size:cover;"></div> | ||
38 | + </span> | ||
39 | + <span class="vip-price">{{text}}</span> | ||
40 | + {{/ list}} | ||
41 | + </div> | ||
42 | + {{/ vipLevel}} | ||
44 | 43 | ||
45 | - {{#goodsDiscount}} | 44 | + {{# goodsDiscount}} |
46 | <div class="goodsDiscount"> | 45 | <div class="goodsDiscount"> |
47 | - {{#list}} | ||
48 | - {{#if @first}} | ||
49 | - <h1 class="first-item">{{text}}<span class="icon-down iconfont dropdown"></span></h1> | ||
50 | - <div class="discount-folder"> | ||
51 | - {{else}} | ||
52 | - <h1 class="folder-item">{{text}}</h1> | ||
53 | - {{/if}} | ||
54 | - {{/list}} | 46 | + {{# list}} |
47 | + {{#if @first}} | ||
48 | + <h1 class="first-item">{{text}}<span class="icon-down iconfont dropdown"></span></h1> | ||
49 | + <div class="discount-folder"> | ||
50 | + {{else}} | ||
51 | + <h1 class="folder-item">{{text}}</h1> | ||
52 | + {{/if}} | ||
53 | + {{/ list}} | ||
55 | </div> | 54 | </div> |
56 | </div> | 55 | </div> |
57 | - {{/goodsDiscount}} | 56 | + {{/ goodsDiscount}} |
58 | 57 | ||
59 | <div class="feedback-list "> | 58 | <div class="feedback-list "> |
60 | - {{# feedbacks}} | ||
61 | - {{#if commentsNum}} | ||
62 | - {{> product/feedback-tab}} | ||
63 | - {{^}} | ||
64 | - {{#if consultsNum}} | ||
65 | - {{> product/feedback-tab}} | ||
66 | - {{^}} | ||
67 | - <div class="nodata"> | ||
68 | - <span>暂无商品评价和咨询</span> | ||
69 | - <a class="go-consult">我要咨询<span class="iconfont"></span></a> | ||
70 | - </div> | ||
71 | - {{/if}} | 59 | + {{# feedbacks}} |
60 | + {{#if commentsNum}} | ||
61 | + {{> product/feedback-tab}} | ||
62 | + {{else}} | ||
63 | + {{#if consultsNum}} | ||
64 | + {{> product/feedback-tab}} | ||
65 | + {{else}} | ||
66 | + <div class="nodata"> | ||
67 | + <span>暂无商品评价和咨询</span> | ||
68 | + <a class="go-consult">我要咨询<span class="iconfont"></span></a> | ||
69 | + </div> | ||
72 | {{/if}} | 70 | {{/if}} |
73 | - {{/ feedbacks}} | 71 | + {{/if}} |
72 | + {{/ feedbacks}} | ||
74 | </div> | 73 | </div> |
75 | 74 | ||
76 | <div class="gap-block"></div> | 75 | <div class="gap-block"></div> |
77 | - | 76 | + |
78 | {{# enterStore}} | 77 | {{# enterStore}} |
79 | <div id="enter-store" class="enter-store page-block"> | 78 | <div id="enter-store" class="enter-store page-block"> |
80 | <a class="store-logo" href="{{url}}" style=""> | 79 | <a class="store-logo" href="{{url}}" style=""> |
@@ -86,11 +85,8 @@ | @@ -86,11 +85,8 @@ | ||
86 | {{/ enterStore}} | 85 | {{/ enterStore}} |
87 | 86 | ||
88 | <div class="gap-block"></div> | 87 | <div class="gap-block"></div> |
89 | - | ||
90 | - | ||
91 | <div id="productDesc"></div> | 88 | <div id="productDesc"></div> |
92 | - | ||
93 | - | 89 | + |
94 | {{#cartInfo}} | 90 | {{#cartInfo}} |
95 | <div class="cart-bar"> | 91 | <div class="cart-bar"> |
96 | {{#if numInCart}} | 92 | {{#if numInCart}} |
@@ -99,8 +95,8 @@ | @@ -99,8 +95,8 @@ | ||
99 | <a href="" class="num-incart iconfont"></a> | 95 | <a href="" class="num-incart iconfont"></a> |
100 | {{#if goodsInstore}} | 96 | {{#if goodsInstore}} |
101 | <a href="" class="addto-cart ">加入购物车</a> | 97 | <a href="" class="addto-cart ">加入购物车</a> |
102 | - {{else}} | ||
103 | - <a href="" class="sold-out">已售罄</a> | 98 | + {{else}} |
99 | + <a href="" class="sold-out">已售罄</a> | ||
104 | {{/if}} | 100 | {{/if}} |
105 | <a href="" class="favorite iconfont"></a> | 101 | <a href="" class="favorite iconfont"></a> |
106 | </div> | 102 | </div> |
@@ -109,6 +105,6 @@ | @@ -109,6 +105,6 @@ | ||
109 | {{#if introUrl}} | 105 | {{#if introUrl}} |
110 | <input id="introUrl" type="hidden" value={{introUrl}}> | 106 | <input id="introUrl" type="hidden" value={{introUrl}}> |
111 | {{/if}} | 107 | {{/if}} |
112 | - | 108 | + |
113 | </div> | 109 | </div> |
114 | {{> layout/footer}} | 110 | {{> layout/footer}} |
@@ -3,59 +3,57 @@ | @@ -3,59 +3,57 @@ | ||
3 | <li class="consult-nav">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li> | 3 | <li class="consult-nav">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li> |
4 | </ul> | 4 | </ul> |
5 | <div id="feedback-content" > | 5 | <div id="feedback-content" > |
6 | - | ||
7 | <div class="comment-content content "> | 6 | <div class="comment-content content "> |
8 | - {{#if commentsNum}} | ||
9 | - <div class="comment-content-main content-main"> | ||
10 | - {{# comments}} | ||
11 | - <span class="user-name"> | ||
12 | - {{userName}} | ||
13 | - </span> | ||
14 | - <span class="goods-spec"> | ||
15 | - {{desc}} | ||
16 | - </span> | ||
17 | - <p class="detail-content"> | ||
18 | - {{content}} | ||
19 | - </p> | ||
20 | - <span class="comment-time"> | ||
21 | - {{time}} | ||
22 | - </span> | ||
23 | - {{/ comments}} | ||
24 | - </div> | ||
25 | - {{^}} | ||
26 | - <div class="comment-content-main content-main no-item"> | ||
27 | - <span class="iconfont"></span>暂无评论 | ||
28 | - </div> | ||
29 | - {{/if}} | ||
30 | - <div class="comment-content-footer"> | ||
31 | - <a href="{{link}}">查看更多 <span class="iconfont"></span></a> | ||
32 | - </div> | ||
33 | -</div> | ||
34 | - | ||
35 | - | ||
36 | -<div class="consult-content content hide "> | ||
37 | - {{#if consultsNum}} | ||
38 | - <div class="consult-content-main content-main"> | ||
39 | - {{# consults}} | ||
40 | - <div class="question"> | ||
41 | - <span class="iconfont"></span> | ||
42 | - <p>{{question}} | ||
43 | - <span class="time"> | ||
44 | - {{time}} | ||
45 | - </span> | 7 | + {{#if commentsNum}} |
8 | + <div class="comment-content-main content-main"> | ||
9 | + {{# comments}} | ||
10 | + <span class="user-name"> | ||
11 | + {{userName}} | ||
12 | + </span> | ||
13 | + <span class="goods-spec"> | ||
14 | + {{desc}} | ||
15 | + </span> | ||
16 | + <p class="detail-content"> | ||
17 | + {{content}} | ||
46 | </p> | 18 | </p> |
19 | + <span class="comment-time"> | ||
20 | + {{time}} | ||
21 | + </span> | ||
22 | + {{/ comments}} | ||
47 | </div> | 23 | </div> |
48 | - | ||
49 | - <div class="answer"> | ||
50 | - <span class="iconfont"></span> | ||
51 | - <p>{{answer}}</p> | 24 | + {{^}} |
25 | + <div class="comment-content-main content-main no-item"> | ||
26 | + <span class="iconfont"></span>暂无评论 | ||
27 | + </div> | ||
28 | + {{/if}} | ||
29 | + <div class="comment-content-footer"> | ||
30 | + <a href="{{link}}">查看更多 <span class="iconfont"></span></a> | ||
52 | </div> | 31 | </div> |
53 | - {{/ consults}} | ||
54 | </div> | 32 | </div> |
55 | - <div class="consult-content-footer"> | ||
56 | - <a href="{{link}}"> | ||
57 | - 查看更多 | ||
58 | - <span class="iconfont"></span></a> | 33 | + |
34 | + <div class="consult-content content hide "> | ||
35 | + {{#if consultsNum}} | ||
36 | + <div class="consult-content-main content-main"> | ||
37 | + {{# consults}} | ||
38 | + <div class="question"> | ||
39 | + <span class="iconfont"></span> | ||
40 | + <p>{{question}} | ||
41 | + <span class="time"> | ||
42 | + {{time}} | ||
43 | + </span> | ||
44 | + </p> | ||
45 | + </div> | ||
46 | + | ||
47 | + <div class="answer"> | ||
48 | + <span class="iconfont"></span> | ||
49 | + <p>{{answer}}</p> | ||
50 | + </div> | ||
51 | + {{/ consults}} | ||
52 | + </div> | ||
53 | + <div class="consult-content-footer"> | ||
54 | + <a href="{{link}}"> | ||
55 | + 查看更多 | ||
56 | + <span class="iconfont"></span></a> | ||
59 | </div> | 57 | </div> |
60 | {{else}} | 58 | {{else}} |
61 | <div class="comment-content-main content-main no-item"> | 59 | <div class="comment-content-main content-main no-item"> |
@@ -65,8 +63,7 @@ | @@ -65,8 +63,7 @@ | ||
65 | <a href="{{link}}"> | 63 | <a href="{{link}}"> |
66 | 我要咨询 | 64 | 我要咨询 |
67 | <span class="iconfont"></span></a> | 65 | <span class="iconfont"></span></a> |
68 | - </div> | ||
69 | - {{/if}} | ||
70 | - | ||
71 | </div> | 66 | </div> |
72 | - </div> | ||
67 | + {{/if}} | ||
68 | + </div> | ||
69 | +</div> |
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | </div> | 16 | </div> |
17 | {{/goodsDescription}} | 17 | {{/goodsDescription}} |
18 | 18 | ||
19 | -<div class="gap-block"></div> | 19 | +<!-- <div class="gap-block"></div> --> |
20 | 20 | ||
21 | {{#sizeInfo}} | 21 | {{#sizeInfo}} |
22 | <div class="size-info page-block"> | 22 | <div class="size-info page-block"> |
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | </div> | 43 | </div> |
44 | {{/sizeInfo}} | 44 | {{/sizeInfo}} |
45 | 45 | ||
46 | -<div class="gap-block"></div> | 46 | +<!-- <div class="gap-block"></div> --> |
47 | 47 | ||
48 | {{#measurementMethod}} | 48 | {{#measurementMethod}} |
49 | <div class="measurement-method page-block"> | 49 | <div class="measurement-method page-block"> |
@@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
57 | </div> | 57 | </div> |
58 | {{/measurementMethod}} | 58 | {{/measurementMethod}} |
59 | 59 | ||
60 | -<div class="gap-block"></div> | 60 | +<!-- <div class="gap-block"></div> --> |
61 | 61 | ||
62 | {{#reference}} | 62 | {{#reference}} |
63 | <div class="size-info page-block"> | 63 | <div class="size-info page-block"> |
@@ -90,7 +90,7 @@ | @@ -90,7 +90,7 @@ | ||
90 | </div> | 90 | </div> |
91 | {{/reference}} | 91 | {{/reference}} |
92 | 92 | ||
93 | -<div class="gap-block"></div> | 93 | +<!-- <div class="gap-block"></div> --> |
94 | 94 | ||
95 | {{#materials}} | 95 | {{#materials}} |
96 | <div class="materials page-block"> | 96 | <div class="materials page-block"> |
@@ -111,18 +111,19 @@ | @@ -111,18 +111,19 @@ | ||
111 | </div> | 111 | </div> |
112 | {{/materials}} | 112 | {{/materials}} |
113 | 113 | ||
114 | +{{#washTips}} | ||
114 | <div class="wash-tips page-block"> | 115 | <div class="wash-tips page-block"> |
115 | <div class="detail table clearfix"> | 116 | <div class="detail table clearfix"> |
116 | - {{#washTips}} | 117 | + {{#list}} |
117 | <div class="tip"> | 118 | <div class="tip"> |
118 | <img src="{{img}}" alt=""> | 119 | <img src="{{img}}" alt=""> |
119 | <span class="caption">{{caption}}</span> | 120 | <span class="caption">{{caption}}</span> |
120 | </div> | 121 | </div> |
121 | - {{/washTips}} | 122 | + {{/list}} |
122 | </div> | 123 | </div> |
123 | </div> | 124 | </div> |
124 | - | ||
125 | -<div class="gap-block"></div> | 125 | +{{/washTips}} |
126 | +<!-- <div class="gap-block"></div> --> | ||
126 | 127 | ||
127 | {{#productDetail}} | 128 | {{#productDetail}} |
128 | <div class="product-detail page-block"> | 129 | <div class="product-detail page-block"> |
@@ -73,10 +73,12 @@ class DetailModel | @@ -73,10 +73,12 @@ class DetailModel | ||
73 | } | 73 | } |
74 | } | 74 | } |
75 | 75 | ||
76 | - // 商品咨询和商品评价 | ||
77 | $result['feedbacks'] = array(); | 76 | $result['feedbacks'] = array(); |
77 | + | ||
78 | + // 商品咨询 | ||
79 | + $result['feedbacks']['consultsNum'] = 0; | ||
78 | if (!empty($baseInfo['consultBoWrapper'])) { | 80 | if (!empty($baseInfo['consultBoWrapper'])) { |
79 | - $result['feedbacks']['consultsNum'] = '0';//empty($baseInfo['consultBoWrapper']['consultTotal']) ? '0' : $baseInfo['consultBoWrapper']['consultTotal']; | 81 | + $result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal']; |
80 | $result['feedbacks']['consults'] = array(); | 82 | $result['feedbacks']['consults'] = array(); |
81 | $build = array(); | 83 | $build = array(); |
82 | foreach ($baseInfo['consultBoWrapper']['consultBoList'] as $value) { | 84 | foreach ($baseInfo['consultBoWrapper']['consultBoList'] as $value) { |
@@ -85,9 +87,13 @@ class DetailModel | @@ -85,9 +87,13 @@ class DetailModel | ||
85 | $build['answer'] = $value['answer']; | 87 | $build['answer'] = $value['answer']; |
86 | $result['feedbacks']['consults'][] = $build; | 88 | $result['feedbacks']['consults'][] = $build; |
87 | } | 89 | } |
90 | + $result['feedbacks']['link'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum'])); | ||
88 | } | 91 | } |
92 | + | ||
93 | + // 商品评价 | ||
94 | + $result['feedbacks']['commentsNum'] = 0; | ||
89 | if (!empty($baseInfo['commentBoWrapper'])) { | 95 | if (!empty($baseInfo['commentBoWrapper'])) { |
90 | - $result['feedbacks']['commentsNum'] = '0';//empty($baseInfo['commentBoWrapper']['commentTotal']) ? '0' : $baseInfo['commentBoWrapper']['commentTotal']; | 96 | + $result['feedbacks']['commentsNum'] = $baseInfo['commentBoWrapper']['commentTotal']; |
91 | $result['feedbacks']['comments'] = array(); | 97 | $result['feedbacks']['comments'] = array(); |
92 | $build = array(); | 98 | $build = array(); |
93 | foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) { | 99 | foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) { |
@@ -97,6 +103,7 @@ class DetailModel | @@ -97,6 +103,7 @@ class DetailModel | ||
97 | $build['time'] = $value['createTime']; | 103 | $build['time'] = $value['createTime']; |
98 | $result['feedbacks']['comments'][] = $build; | 104 | $result['feedbacks']['comments'][] = $build; |
99 | } | 105 | } |
106 | + $result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum'])); | ||
100 | } | 107 | } |
101 | 108 | ||
102 | // 品牌信息 | 109 | // 品牌信息 |
@@ -323,10 +330,31 @@ class DetailModel | @@ -323,10 +330,31 @@ class DetailModel | ||
323 | 330 | ||
324 | /** | 331 | /** |
325 | * 获取咨询列表 | 332 | * 获取咨询列表 |
333 | + * | ||
334 | + * @param int $productId 产品ID | ||
335 | + * @param int $pageNum 页码数 | ||
336 | + * @param int $pageSize 每页显示个数 | ||
337 | + * @return array | ||
326 | */ | 338 | */ |
327 | - public static function getConsults() | 339 | + public static function getConsults($productId, $pageNum = 1, $pageSize = 100) |
328 | { | 340 | { |
341 | + $result = array(); | ||
342 | + | ||
343 | + if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) { | ||
344 | + $consultList = DetailData::consultList($productId, $pageNum, $pageSize); | ||
345 | + if (!empty($consultList)) { | ||
346 | + $build = array(); | ||
347 | + foreach ($consultList as $value) { | ||
348 | + $build['question'] = $value['ask']; | ||
349 | + $build['time'] = $value['askTime']; | ||
350 | + $build['answer'] = $value['answer']; | ||
351 | + $result[] = $build; | ||
352 | + } | ||
353 | + } | ||
354 | + $consultList = array(); | ||
355 | + } | ||
329 | 356 | ||
357 | + return $result; | ||
330 | } | 358 | } |
331 | 359 | ||
332 | } | 360 | } |
@@ -42,34 +42,45 @@ class DetailController extends AbstractAction | @@ -42,34 +42,45 @@ class DetailController extends AbstractAction | ||
42 | // 渲染模板 | 42 | // 渲染模板 |
43 | $this->_view->display('index', $data); | 43 | $this->_view->display('index', $data); |
44 | } | 44 | } |
45 | - | 45 | + |
46 | /** | 46 | /** |
47 | * 尺码描述信息 | 47 | * 尺码描述信息 |
48 | */ | 48 | */ |
49 | public function introAction() | 49 | public function introAction() |
50 | { | 50 | { |
51 | - $productSkn = $this->param('productSkn'); | 51 | + $productSkn = $this->param('productSkn'); |
52 | if (!is_numeric($productSkn)) { | 52 | if (!is_numeric($productSkn)) { |
53 | $this->error(); | 53 | $this->error(); |
54 | } | 54 | } |
55 | $data = \Product\DetailModel::getSizeInfo($productSkn); | 55 | $data = \Product\DetailModel::getSizeInfo($productSkn); |
56 | if (array() === $data) { | 56 | if (array() === $data) { |
57 | - echo ' '; | 57 | + echo ' '; |
58 | exit(); | 58 | exit(); |
59 | } | 59 | } |
60 | $this->_view->display('intro', $data); | 60 | $this->_view->display('intro', $data); |
61 | } | 61 | } |
62 | - | ||
63 | 62 | ||
63 | + /** | ||
64 | + * 购买评价列表 | ||
65 | + * | ||
66 | + * @param int productId | ||
67 | + * @param int total | ||
68 | + */ | ||
64 | public function commentsAction() | 69 | public function commentsAction() |
65 | { | 70 | { |
71 | + $total = $this->get('total'); | ||
72 | + if (!is_numeric($total)) { | ||
73 | + $total = 0; | ||
74 | + } | ||
75 | + if ($total) { | ||
76 | + $this->setNavHeader('购买评价(' . $total . ')'); | ||
77 | + } else { | ||
78 | + $this->setNavHeader('购买评价'); | ||
79 | + } | ||
80 | + $this->setTitle('购买评价'); | ||
81 | + | ||
66 | $data = array( | 82 | $data = array( |
67 | 'goodsCommentsPage' => true, | 83 | 'goodsCommentsPage' => true, |
68 | - 'pageHeader' => array( | ||
69 | - 'navBack' => 'sss ', | ||
70 | - // 'navHome' => 'sss ', | ||
71 | - 'navTitle' => '购买评价(6)' | ||
72 | - ), | ||
73 | 'pageFooter' => true, | 84 | 'pageFooter' => true, |
74 | 'comments' => array( | 85 | 'comments' => array( |
75 | 'list' => array( | 86 | 'list' => array( |
@@ -98,49 +109,45 @@ class DetailController extends AbstractAction | @@ -98,49 +109,45 @@ class DetailController extends AbstractAction | ||
98 | ), | 109 | ), |
99 | ); | 110 | ); |
100 | 111 | ||
101 | - $this->_view->assign('title', '购买评价'); | ||
102 | - //$this->_view->display('brand', compact('brands')); | ||
103 | // 渲染模板 | 112 | // 渲染模板 |
104 | $this->_view->display('comments', $data); | 113 | $this->_view->display('comments', $data); |
105 | } | 114 | } |
106 | 115 | ||
116 | + /** | ||
117 | + * 购买咨询列表 | ||
118 | + * | ||
119 | + * @param int productId | ||
120 | + * @param int total | ||
121 | + */ | ||
107 | public function consultsAction() | 122 | public function consultsAction() |
108 | { | 123 | { |
124 | + $productId = $this->get('product_id', 0); | ||
125 | + $total = $this->get('total', 0); | ||
126 | + if (!is_numeric($total)) { | ||
127 | + $total = 0; | ||
128 | + } | ||
129 | + if ($total) { | ||
130 | + $this->setNavHeader('购买咨询(' . $total . ')'); | ||
131 | + } else { | ||
132 | + $this->setNavHeader('购买咨询'); | ||
133 | + } | ||
134 | + $this->setTitle('购买咨询'); | ||
135 | + | ||
109 | $data = array( | 136 | $data = array( |
110 | 'goodsConsultsPage' => true, | 137 | 'goodsConsultsPage' => true, |
111 | - 'pageHeader' => array( | ||
112 | - 'navBack' => 'sss ', | ||
113 | - // 'navHome' => 'sss ', | ||
114 | - 'navTitle' => '购买咨询(6)' | ||
115 | - ), | ||
116 | 'pageFooter' => true, | 138 | 'pageFooter' => true, |
117 | 'consults' => array( | 139 | 'consults' => array( |
118 | - 'list' => array( | ||
119 | - array( | ||
120 | - 'question' => '您好 我一米七七 140斤 穿M的行吗', | ||
121 | - 'time' => '2014-08-12 10:24:26', | ||
122 | - 'answer' => '您好,建议您参考XL的款式,由于版型和个人穿衣风格不同,需要' | ||
123 | - ), | ||
124 | - array( | ||
125 | - 'question' => '您好 我一米七七 140斤 穿M的行吗', | ||
126 | - 'time' => '2014-08-12 10:24:26', | ||
127 | - 'answer' => '您好,建议您参考XL的款式,由于版型和个人穿衣风格不同,需要' | ||
128 | - ), | ||
129 | - array( | ||
130 | - 'question' => '您好 我一米七七 140斤 穿M的行吗', | ||
131 | - 'time' => '2014-08-12 10:24:26', | ||
132 | - 'answer' => '您好,建议您参考XL的款式,由于版型和个人穿衣风格不同,需要' | ||
133 | - ) | ||
134 | - ) | ||
135 | - ), | 140 | + 'list' => \Product\DetailModel::getConsults($productId), |
141 | + ) | ||
136 | ); | 142 | ); |
137 | 143 | ||
138 | - $this->_view->assign('title', '购买咨询'); | ||
139 | - //$this->_view->display('brand', compact('brands')); | ||
140 | // 渲染模板 | 144 | // 渲染模板 |
141 | $this->_view->display('consults', $data); | 145 | $this->_view->display('consults', $data); |
142 | } | 146 | } |
143 | 147 | ||
148 | + /** | ||
149 | + * 我要咨询 | ||
150 | + */ | ||
144 | public function consultformAction() | 151 | public function consultformAction() |
145 | { | 152 | { |
146 | $data = array( | 153 | $data = array( |
-
Please register or login to post a comment