Authored by ccbikai

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

... ... @@ -19,6 +19,7 @@ class DetailData
const PRODUCT_BASE_INFO = 'product/queryProductDetailByProductId';
const PRODUCT_SIZE_INFO = 'product/queryProductIntroBySkn';
const PRODUCT_CONSULT_LIST = 'consult/queryConsults';
/**
* 商品基本信息
... ... @@ -29,7 +30,9 @@ class DetailData
*/
public static function baseInfo($productId, $uid)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('param' => intval($productId), 'userId' => intval($uid)) );
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array(
'param' => intval($productId), 'userId' => intval($uid)
) );
}
/**
... ... @@ -43,4 +46,21 @@ class DetailData
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn) ) );
}
/**
* 咨询内容列表
*
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public static function consultList($productId, $pageNum, $pageSize)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_CONSULT_LIST, array(
'productId' => intval($productId),
'pageNum' => intval($pageNum),
'pageSize' => intval($pageSize),
) );
}
}
... ...
... ... @@ -131,6 +131,7 @@
.good-detail-page {
.feedback-list {
padding-top: pxToRem(30px);
margin-bottom: pxToRem(30px);
background-color: #f0f0f0;
.nav-tab {
width: 100%;
... ...
... ... @@ -41,6 +41,7 @@ $basicBtnC:#eb0313;
border-bottom: 1px solid $borderC;
border-top: 1px solid $borderC;
padding: 0 pxToRem(28px);
margin-bottom: pxToRem(30px);
>.title {
line-height: pxToRem(88px);
color: $mainFontC;
... ... @@ -146,6 +147,7 @@ $basicBtnC:#eb0313;
padding-left: pxToRem(28px);
padding-right: pxToRem(28px);
border-bottom: 1px solid $borderC;
margin-bottom: pxToRem(30px);
background-color: #f4f4f4;
}
.price-date {
... ...
... ... @@ -22,6 +22,9 @@
margin-top: pxToRem(20px);
}
.materials {
&.page-block{
margin-bottom: 0;
}
.detail {
.material-item{
min-height: pxToRem(136px);
... ... @@ -52,7 +55,7 @@
.wash-tips{
padding-top:pxToRem(18px);
&.page-block{
border-top: none;
border-top: 0px;
padding-left: pxToRem(15px);
padding-right: pxToRem(15px);
}
... ...
... ... @@ -3,78 +3,77 @@
<div class="banner-container">
<h1 class="is-new-lable">NEW</h1>
{{# bannerTop}}
{{> product/banner_swiper_arrow}}
{{> product/banner-swiper-arrow}}
{{/ bannerTop}}
</div>
{{# goodsName}}
<h2 class="goodsName"><span>{{.}}</span></h2>
{{/ goodsName}}
{{# goodsSubtitle}}
<h1 class="goodsSubtitle"><span>{{.}}</span></h1>
{{/ goodsSubtitle}}
<div class="price-date">
{{#goodsPrice}}
<div class="goodsPrice">
<h1 class="currentPrice">{{currentPrice}}</h1>
<h1 class="previousPrice">{{previousPrice}}</h1>
</div>
{{/goodsPrice}}
{{# goodsPrice}}
<div class="goodsPrice">
<h1 class="currentPrice">{{currentPrice}}</h1>
<h1 class="previousPrice">{{previousPrice}}</h1>
</div>
{{/ goodsPrice}}
{{#periodOfMarket}}
<div class="periodOfMarket">
<h1>上市期:</h1>
<h1 >{{.}}</h1>
{{# periodOfMarket}}
<div class="periodOfMarket">
<h1>上市期:</h1>
<h1 >{{.}}</h1>
</div>
{{/ periodOfMarket}}
</div>
{{/periodOfMarket}}
</div>
{{# vipLevel}}
<div class="vipLevel">
{{# list}}
<span class="vip-img">
<div class="img" alt="" style="background-size:cover;"></div>
</span>
<span class="vip-price">{{text}}</span>
{{/ list}}
</div>
{{/ vipLevel}}
{{# vipLevel}}
<div class="vipLevel">
{{# list}}
<span class="vip-img">
<div class="img" alt="" style="background-size:cover;"></div>
</span>
<span class="vip-price">{{text}}</span>
{{/ list}}
</div>
{{/ vipLevel}}
{{#goodsDiscount}}
{{# goodsDiscount}}
<div class="goodsDiscount">
{{#list}}
{{#if @first}}
<h1 class="first-item">{{text}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>
<div class="discount-folder">
{{else}}
<h1 class="folder-item">{{text}}</h1>
{{/if}}
{{/list}}
{{# list}}
{{#if @first}}
<h1 class="first-item">{{text}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>
<div class="discount-folder">
{{else}}
<h1 class="folder-item">{{text}}</h1>
{{/if}}
{{/ list}}
</div>
</div>
{{/goodsDiscount}}
{{/ goodsDiscount}}
<div class="feedback-list ">
{{# feedbacks}}
{{#if commentsNum}}
{{> product/feedback-tab}}
{{^}}
{{#if consultsNum}}
{{> product/feedback-tab}}
{{^}}
<div class="nodata">
<span>暂无商品评价和咨询</span>
<a class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{# feedbacks}}
{{#if commentsNum}}
{{> product/feedback-tab}}
{{else}}
{{#if consultsNum}}
{{> product/feedback-tab}}
{{else}}
<div class="nodata">
<span>暂无商品评价和咨询</span>
<a class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{/ feedbacks}}
{{/if}}
{{/ feedbacks}}
</div>
<div class="gap-block"></div>
{{# enterStore}}
<div id="enter-store" class="enter-store page-block">
<a class="store-logo" href="{{url}}" style="">
... ... @@ -86,11 +85,8 @@
{{/ enterStore}}
<div class="gap-block"></div>
<div id="productDesc"></div>
{{#cartInfo}}
<div class="cart-bar">
{{#if numInCart}}
... ... @@ -99,8 +95,8 @@
<a href="" class="num-incart iconfont">&#xe62c;</a>
{{#if goodsInstore}}
<a href="" class="addto-cart ">加入购物车</a>
{{else}}
<a href="" class="sold-out">已售罄</a>
{{else}}
<a href="" class="sold-out">已售罄</a>
{{/if}}
<a href="" class="favorite iconfont">&#xe605;</a>
</div>
... ... @@ -109,6 +105,6 @@
{{#if introUrl}}
<input id="introUrl" type="hidden" value={{introUrl}}>
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> product/product_description}}
\ No newline at end of file
{{> product/product-description}}
\ No newline at end of file
... ...
... ... @@ -20,7 +20,7 @@
{{^}}
<div class="banner-top-single">
<a href={{url}}>
<img class="img" src={{img}}>
<img class="img" src="{{img}}">
</a>
</div>
{{/if}}
... ...
... ... @@ -3,59 +3,57 @@
<li class="consult-nav">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
</ul>
<div id="feedback-content" >
<div class="comment-content content ">
{{#if commentsNum}}
<div class="comment-content-main content-main">
{{# comments}}
<span class="user-name">
{{userName}}
</span>
<span class="goods-spec">
{{desc}}
</span>
<p class="detail-content">
{{content}}
</p>
<span class="comment-time">
{{time}}
</span>
{{/ comments}}
</div>
{{^}}
<div class="comment-content-main content-main no-item">
<span class="iconfont">&#xe63c;</span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
</div>
</div>
<div class="consult-content content hide ">
{{#if consultsNum}}
<div class="consult-content-main content-main">
{{# consults}}
<div class="question">
<span class="iconfont">&#xe639;</span>
<p>{{question}}
<span class="time">
{{time}}
</span>
{{#if commentsNum}}
<div class="comment-content-main content-main">
{{# comments}}
<span class="user-name">
{{userName}}
</span>
<span class="goods-spec">
{{desc}}
</span>
<p class="detail-content">
{{content}}
</p>
<span class="comment-time">
{{time}}
</span>
{{/ comments}}
</div>
<div class="answer">
<span class="iconfont">&#xe63c;</span>
<p>{{answer}}</p>
{{^}}
<div class="comment-content-main content-main no-item">
<span class="iconfont">&#xe63c;</span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
</div>
{{/ consults}}
</div>
<div class="consult-content-footer">
<a href="{{link}}">
查看更多
<span class="iconfont">&#xe604;</span></a>
<div class="consult-content content hide ">
{{#if consultsNum}}
<div class="consult-content-main content-main">
{{# consults}}
<div class="question">
<span class="iconfont">&#xe639;</span>
<p>{{question}}
<span class="time">
{{time}}
</span>
</p>
</div>
<div class="answer">
<span class="iconfont">&#xe63c;</span>
<p>{{answer}}</p>
</div>
{{/ consults}}
</div>
<div class="consult-content-footer">
<a href="{{link}}">
查看更多
<span class="iconfont">&#xe604;</span></a>
</div>
{{else}}
<div class="comment-content-main content-main no-item">
... ... @@ -65,8 +63,7 @@
<a href="{{link}}">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
</div>
</div>
\ No newline at end of file
{{/if}}
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -16,7 +16,7 @@
</div>
{{/goodsDescription}}
<div class="gap-block"></div>
<!-- <div class="gap-block"></div> -->
{{#sizeInfo}}
<div class="size-info page-block">
... ... @@ -43,7 +43,7 @@
</div>
{{/sizeInfo}}
<div class="gap-block"></div>
<!-- <div class="gap-block"></div> -->
{{#measurementMethod}}
<div class="measurement-method page-block">
... ... @@ -57,7 +57,7 @@
</div>
{{/measurementMethod}}
<div class="gap-block"></div>
<!-- <div class="gap-block"></div> -->
{{#reference}}
<div class="size-info page-block">
... ... @@ -90,7 +90,7 @@
</div>
{{/reference}}
<div class="gap-block"></div>
<!-- <div class="gap-block"></div> -->
{{#materials}}
<div class="materials page-block">
... ... @@ -111,18 +111,19 @@
</div>
{{/materials}}
{{#washTips}}
<div class="wash-tips page-block">
<div class="detail table clearfix">
{{#washTips}}
{{#list}}
<div class="tip">
<img src="{{img}}" alt="">
<span class="caption">{{caption}}</span>
</div>
{{/washTips}}
{{/list}}
</div>
</div>
<div class="gap-block"></div>
{{/washTips}}
<!-- <div class="gap-block"></div> -->
{{#productDetail}}
<div class="product-detail page-block">
... ...
... ... @@ -73,10 +73,12 @@ class DetailModel
}
}
// 商品咨询和商品评价
$result['feedbacks'] = array();
// 商品咨询
$result['feedbacks']['consultsNum'] = 0;
if (!empty($baseInfo['consultBoWrapper'])) {
$result['feedbacks']['consultsNum'] = '0';//empty($baseInfo['consultBoWrapper']['consultTotal']) ? '0' : $baseInfo['consultBoWrapper']['consultTotal'];
$result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal'];
$result['feedbacks']['consults'] = array();
$build = array();
foreach ($baseInfo['consultBoWrapper']['consultBoList'] as $value) {
... ... @@ -85,9 +87,13 @@ class DetailModel
$build['answer'] = $value['answer'];
$result['feedbacks']['consults'][] = $build;
}
$result['feedbacks']['link'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
}
// 商品评价
$result['feedbacks']['commentsNum'] = 0;
if (!empty($baseInfo['commentBoWrapper'])) {
$result['feedbacks']['commentsNum'] = '0';//empty($baseInfo['commentBoWrapper']['commentTotal']) ? '0' : $baseInfo['commentBoWrapper']['commentTotal'];
$result['feedbacks']['commentsNum'] = $baseInfo['commentBoWrapper']['commentTotal'];
$result['feedbacks']['comments'] = array();
$build = array();
foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
... ... @@ -97,6 +103,7 @@ class DetailModel
$build['time'] = $value['createTime'];
$result['feedbacks']['comments'][] = $build;
}
$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
}
// 品牌信息
... ... @@ -323,10 +330,31 @@ class DetailModel
/**
* 获取咨询列表
*
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public static function getConsults()
public static function getConsults($productId, $pageNum = 1, $pageSize = 100)
{
$result = array();
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$consultList = DetailData::consultList($productId, $pageNum, $pageSize);
if (!empty($consultList)) {
$build = array();
foreach ($consultList as $value) {
$build['question'] = $value['ask'];
$build['time'] = $value['askTime'];
$build['answer'] = $value['answer'];
$result[] = $build;
}
}
$consultList = array();
}
return $result;
}
}
... ...
... ... @@ -42,34 +42,45 @@ class DetailController extends AbstractAction
// 渲染模板
$this->_view->display('index', $data);
}
/**
* 尺码描述信息
*/
public function introAction()
{
$productSkn = $this->param('productSkn');
$productSkn = $this->param('productSkn');
if (!is_numeric($productSkn)) {
$this->error();
}
$data = \Product\DetailModel::getSizeInfo($productSkn);
if (array() === $data) {
echo ' ';
echo ' ';
exit();
}
$this->_view->display('intro', $data);
}
/**
* 购买评价列表
*
* @param int productId
* @param int total
*/
public function commentsAction()
{
$total = $this->get('total');
if (!is_numeric($total)) {
$total = 0;
}
if ($total) {
$this->setNavHeader('购买评价(' . $total . ')');
} else {
$this->setNavHeader('购买评价');
}
$this->setTitle('购买评价');
$data = array(
'goodsCommentsPage' => true,
'pageHeader' => array(
'navBack' => 'sss ',
// 'navHome' => 'sss ',
'navTitle' => '购买评价(6)'
),
'pageFooter' => true,
'comments' => array(
'list' => array(
... ... @@ -98,49 +109,45 @@ class DetailController extends AbstractAction
),
);
$this->_view->assign('title', '购买评价');
//$this->_view->display('brand', compact('brands'));
// 渲染模板
$this->_view->display('comments', $data);
}
/**
* 购买咨询列表
*
* @param int productId
* @param int total
*/
public function consultsAction()
{
$productId = $this->get('product_id', 0);
$total = $this->get('total', 0);
if (!is_numeric($total)) {
$total = 0;
}
if ($total) {
$this->setNavHeader('购买咨询(' . $total . ')');
} else {
$this->setNavHeader('购买咨询');
}
$this->setTitle('购买咨询');
$data = array(
'goodsConsultsPage' => true,
'pageHeader' => array(
'navBack' => 'sss ',
// 'navHome' => 'sss ',
'navTitle' => '购买咨询(6)'
),
'pageFooter' => true,
'consults' => array(
'list' => array(
array(
'question' => '您好 我一米七七 140斤 穿M的行吗',
'time' => '2014-08-12 10:24:26',
'answer' => '您好,建议您参考XL的款式,由于版型和个人穿衣风格不同,需要'
),
array(
'question' => '您好 我一米七七 140斤 穿M的行吗',
'time' => '2014-08-12 10:24:26',
'answer' => '您好,建议您参考XL的款式,由于版型和个人穿衣风格不同,需要'
),
array(
'question' => '您好 我一米七七 140斤 穿M的行吗',
'time' => '2014-08-12 10:24:26',
'answer' => '您好,建议您参考XL的款式,由于版型和个人穿衣风格不同,需要'
)
)
),
'list' => \Product\DetailModel::getConsults($productId),
)
);
$this->_view->assign('title', '购买咨询');
//$this->_view->display('brand', compact('brands'));
// 渲染模板
$this->_view->display('consults', $data);
}
/**
* 我要咨询
*/
public function consultformAction()
{
$data = array(
... ...