Authored by ccbikai

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -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,10 +3,9 @@ @@ -3,10 +3,9 @@
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}}
@@ -16,54 +15,54 @@ @@ -16,54 +15,54 @@
16 {{/ goodsSubtitle}} 15 {{/ goodsSubtitle}}
17 16
18 <div class="price-date"> 17 <div class="price-date">
19 - {{#goodsPrice}} 18 + {{# goodsPrice}}
20 <div class="goodsPrice"> 19 <div class="goodsPrice">
21 <h1 class="currentPrice">{{currentPrice}}</h1> 20 <h1 class="currentPrice">{{currentPrice}}</h1>
22 <h1 class="previousPrice">{{previousPrice}}</h1> 21 <h1 class="previousPrice">{{previousPrice}}</h1>
23 </div> 22 </div>
24 - {{/goodsPrice}} 23 + {{/ goodsPrice}}
25 24
26 - {{#periodOfMarket}} 25 + {{# periodOfMarket}}
27 <div class="periodOfMarket"> 26 <div class="periodOfMarket">
28 <h1>上市期:</h1> 27 <h1>上市期:</h1>
29 <h1 >{{.}}</h1> 28 <h1 >{{.}}</h1>
30 </div> 29 </div>
31 - {{/periodOfMarket}}  
32 -</div> 30 + {{/ periodOfMarket}}
  31 + </div>
33 32
34 -{{# vipLevel}}  
35 -<div class="vipLevel"> 33 + {{# vipLevel}}
  34 + <div class="vipLevel">
36 {{# list}} 35 {{# list}}
37 -<span class="vip-img"> 36 + <span class="vip-img">
38 <div class="img" alt="" style="background-size:cover;"></div> 37 <div class="img" alt="" style="background-size:cover;"></div>
39 -</span> 38 + </span>
40 <span class="vip-price">{{text}}</span> 39 <span class="vip-price">{{text}}</span>
41 {{/ list}} 40 {{/ list}}
42 -</div>  
43 -{{/ vipLevel}} 41 + </div>
  42 + {{/ vipLevel}}
44 43
45 - {{#goodsDiscount}} 44 + {{# goodsDiscount}}
46 <div class="goodsDiscount"> 45 <div class="goodsDiscount">
47 - {{#list}} 46 + {{# list}}
48 {{#if @first}} 47 {{#if @first}}
49 <h1 class="first-item">{{text}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1> 48 <h1 class="first-item">{{text}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>
50 <div class="discount-folder"> 49 <div class="discount-folder">
51 {{else}} 50 {{else}}
52 <h1 class="folder-item">{{text}}</h1> 51 <h1 class="folder-item">{{text}}</h1>
53 {{/if}} 52 {{/if}}
54 - {{/list}} 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}} 59 {{# feedbacks}}
61 {{#if commentsNum}} 60 {{#if commentsNum}}
62 {{> product/feedback-tab}} 61 {{> product/feedback-tab}}
63 - {{^}} 62 + {{else}}
64 {{#if consultsNum}} 63 {{#if consultsNum}}
65 {{> product/feedback-tab}} 64 {{> product/feedback-tab}}
66 - {{^}} 65 + {{else}}
67 <div class="nodata"> 66 <div class="nodata">
68 <span>暂无商品评价和咨询</span> 67 <span>暂无商品评价和咨询</span>
69 <a class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a> 68 <a class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
@@ -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 89
93 -  
94 {{#cartInfo}} 90 {{#cartInfo}}
95 <div class="cart-bar"> 91 <div class="cart-bar">
96 {{#if numInCart}} 92 {{#if numInCart}}
1 -{{> product/product_description}}  
  1 +{{> product/product-description}}
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 {{^}} 20 {{^}}
21 <div class="banner-top-single"> 21 <div class="banner-top-single">
22 <a href={{url}}> 22 <a href={{url}}>
23 - <img class="img" src={{img}}> 23 + <img class="img" src="{{img}}">
24 </a> 24 </a>
25 </div> 25 </div>
26 {{/if}} 26 {{/if}}
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
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}} 7 {{#if commentsNum}}
9 <div class="comment-content-main content-main"> 8 <div class="comment-content-main content-main">
@@ -30,10 +29,9 @@ @@ -30,10 +29,9 @@
30 <div class="comment-content-footer"> 29 <div class="comment-content-footer">
31 <a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a> 30 <a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
32 </div> 31 </div>
33 -</div>  
34 - 32 + </div>
35 33
36 -<div class="consult-content content hide "> 34 + <div class="consult-content content hide ">
37 {{#if consultsNum}} 35 {{#if consultsNum}}
38 <div class="consult-content-main content-main"> 36 <div class="consult-content-main content-main">
39 {{# consults}} 37 {{# consults}}
@@ -67,6 +65,5 @@ @@ -67,6 +65,5 @@
67 <span class="iconfont">&#xe604;</span></a> 65 <span class="iconfont">&#xe604;</span></a>
68 </div> 66 </div>
69 {{/if}} 67 {{/if}}
70 -  
71 - </div>  
72 </div> 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 }
@@ -60,16 +60,27 @@ class DetailController extends AbstractAction @@ -60,16 +60,27 @@ class DetailController extends AbstractAction
60 $this->_view->display('intro', $data); 60 $this->_view->display('intro', $data);
61 } 61 }
62 62
63 - 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 - ) 140 + 'list' => \Product\DetailModel::getConsults($productId),
134 ) 141 )
135 - ),  
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(