Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
0cbeac7d957c0c579c26a0ba0ea4e1e7f1422343
2 parents
df68bfee
75ace9d2
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
215 additions
and
160 deletions
library/LibModels/Wap/Product/DetailData.php
static/sass/product/_comments-consults.scss
static/sass/product/_detail.scss
static/sass/product/_product-description.scss
template/m.yohobuy.com/actions/product/detail/index.phtml
template/m.yohobuy.com/actions/product/detail/intro.phtml
template/m.yohobuy.com/partials/product/banner_swipe_and_single.phtml → template/m.yohobuy.com/partials/product/banner-swipe-and-single.phtml
template/m.yohobuy.com/partials/product/banner_swiper_arrow.phtml → template/m.yohobuy.com/partials/product/banner-swiper-arrow.phtml
template/m.yohobuy.com/partials/product/feedback-tab.phtml
template/m.yohobuy.com/partials/product/product_description.phtml → template/m.yohobuy.com/partials/product/product-description.phtml
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
library/LibModels/Wap/Product/DetailData.php
View file @
0cbeac7
...
...
@@ -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
),
)
);
}
}
...
...
static/sass/product/_comments-consults.scss
View file @
0cbeac7
...
...
@@ -131,6 +131,7 @@
.good-detail-page
{
.feedback-list
{
padding-top
:
pxToRem
(
30px
);
margin-bottom
:
pxToRem
(
30px
);
background-color
:
#f0f0f0
;
.nav-tab
{
width
:
100%
;
...
...
static/sass/product/_detail.scss
View file @
0cbeac7
...
...
@@ -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
{
...
...
static/sass/product/_product-description.scss
View file @
0cbeac7
...
...
@@ -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
);
}
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
0cbeac7
...
...
@@ -3,78 +3,77 @@
<div
class=
"banner-container"
>
<h
1
class=
"is-new-lable"
>NEW</h
1
>
{
{#
bannerTop
}
}
{
{>
product/banner
_swiper_
arrow
}
}
{
{>
product/banner
-swiper-
arrow
}
}
{
{/
bannerTop
}
}
</div>
{
{#
goodsName
}
}
<h
2
class=
"goodsName"
><span>
{
{.
}
}</span></h
2
>
{
{/
goodsName
}
}
{
{#
goodsSubtitle
}
}
<h
1
class=
"goodsSubtitle"
><span>
{
{.
}
}</span></h
1
>
{
{/
goodsSubtitle
}
}
<div
class=
"price-date"
>
{
{#goodsPrice
}
}
<div
class=
"goodsPrice"
>
<h
1
class=
"currentPrice"
>
{
{currentPrice
}
}</h
1
>
<h
1
class=
"previousPrice"
>
{
{previousPrice
}
}</h
1
>
</div>
{
{/goodsPrice
}
}
{
{#
goodsPrice
}
}
<div
class=
"goodsPrice"
>
<h
1
class=
"currentPrice"
>
{
{currentPrice
}
}</h
1
>
<h
1
class=
"previousPrice"
>
{
{previousPrice
}
}</h
1
>
</div>
{
{/
goodsPrice
}
}
{
{#periodOfMarket
}
}
<div
class=
"periodOfMarket"
>
<h
1
>上市期:</h
1
>
<h
1
>
{
{.
}
}</h
1
>
{
{#
periodOfMarket
}
}
<div
class=
"periodOfMarket"
>
<h
1
>上市期:</h
1
>
<h
1
>
{
{.
}
}</h
1
>
</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
}
}
<h
1
class=
"first-item"
>
{
{text
}
}<span
class=
"icon-down iconfont dropdown"
>
609
;</span></h
1
>
<div
class=
"discount-folder"
>
{
{else
}
}
<h
1
class=
"folder-item"
>
{
{text
}
}</h
1
>
{
{/if
}
}
{
{/list
}
}
{
{#
list
}
}
{
{#if
@first
}
}
<h
1
class=
"first-item"
>
{
{text
}
}<span
class=
"icon-down iconfont dropdown"
>
609
;</span></h
1
>
<div
class=
"discount-folder"
>
{
{else
}
}
<h
1
class=
"folder-item"
>
{
{text
}
}</h
1
>
{
{/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"
>
604
;</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"
>
604
;</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"
>
62
c;</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"
>
605
;</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
...
...
template/m.yohobuy.com/actions/product/detail/intro.phtml
View file @
0cbeac7
{
{>
product/product_description
}
}
\ No newline at end of file
{
{>
product/product-description
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/banner
_swipe_and_
single.phtml → template/m.yohobuy.com/partials/product/banner
-swipe-and-
single.phtml
View file @
0cbeac7
...
...
@@ -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
}
}
...
...
template/m.yohobuy.com/partials/product/banner
_swiper_
arrow.phtml → template/m.yohobuy.com/partials/product/banner
-swiper-
arrow.phtml
View file @
0cbeac7
template/m.yohobuy.com/partials/product/feedback-tab.phtml
View file @
0cbeac7
...
...
@@ -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"></span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont"></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"></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"></span>
<p>{{answer}}</p>
{{^}}
<div class="comment-content-main content-main no-item">
<span class="iconfont"></span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont"></span></a>
</div>
{{/ consults}}
</div>
<div class="consult-content-footer">
<a href="{{link}}">
查看更多
<span class="iconfont"></span></a>
<div class="consult-content content hide ">
{{#if consultsNum}}
<div class="consult-content-main content-main">
{{# consults}}
<div class="question">
<span class="iconfont"></span>
<p>{{question}}
<span class="time">
{{time}}
</span>
</p>
</div>
<div class="answer">
<span class="iconfont"></span>
<p>{{answer}}</p>
</div>
{{/ consults}}
</div>
<div class="consult-content-footer">
<a href="{{link}}">
查看更多
<span class="iconfont"></span></a>
</div>
{{else}}
<div class="comment-content-main content-main no-item">
...
...
@@ -65,8 +63,7 @@
<a href="{{link}}">
我要咨询
<span class="iconfont"></span></a>
</div>
{{/if}}
</div>
</div>
\ No newline at end of file
{{/if}}
</div>
</div>
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/product
_
description.phtml → template/m.yohobuy.com/partials/product/product
-
description.phtml
View file @
0cbeac7
...
...
@@ -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"
>
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
0cbeac7
...
...
@@ -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
;
}
}
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
View file @
0cbeac7
...
...
@@ -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
(
...
...
Please
register
or
login
to post a comment