Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
2750e5f8149362aabf3d060eca10de6e4d3836ba
2 parents
d3e20d76
1a88f8ee
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
17 deletions
library/LibModels/Wap/Product/DetailData.php
static/js/product/detail/comments-consults.js
static/sass/category/_brand.scss
static/sass/product/_comments-consults.scss
template/m.yohobuy.com/actions/product/detail/consults.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 @
2750e5f
...
...
@@ -88,6 +88,20 @@ class DetailData
}
/**
* 常见问题列表
*
* @return array
*/
public
static
function
commonConsultList
()
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.consult.common'
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 评论内容列表
*
* @param int $productId 产品ID
...
...
static/js/product/detail/comments-consults.js
View file @
2750e5f
...
...
@@ -94,7 +94,8 @@ if ($('.goods-consults-page').length > 0) {
if
(
readmoreHammer
)
{
readmoreHammer
.
on
(
'tap'
,
function
()
{
$
(
'.readmore'
).
hide
();
$
(
'.goods-consults .consult-item'
).
show
();
$
(
'.goods-consults.customer-consults'
).
removeClass
(
'customer-consults'
);
return
false
;
});
}
...
...
static/sass/category/_brand.scss
View file @
2750e5f
...
...
@@ -135,7 +135,7 @@
}
.banner-top
{
padding-top
:
17
8rem
/
$pxConvertRem
;
padding-top
:
25
8rem
/
$pxConvertRem
;
background-color
:
#f8f8f8
;
}
...
...
static/sass/product/_comments-consults.scss
View file @
2750e5f
...
...
@@ -71,23 +71,26 @@
color
:
$subFontC
;
}
}
.goods-consults
{
margin-top
:
5
.25rem
;
overflow
:
hidden
;
.goods-consults.customer-consults
{
.consult-item
:nth-child
(
1
)
{
display
:
block
;
}
.consult-item
:nth-child
(
2
)
{
display
:
block
;
}
.consult-item
{
display
:
none
;
}
}
.goods-consults
{
margin-top
:
5
.25rem
;
overflow
:
hidden
;
.consult-item
{
margin-top
:
pxToRem
(
30px
);
padding
:
pxToRem
(
20px
)
pxToRem
(
28px
);
background-color
:
#fff
;
border-bottom
:
1px
solid
$borderC
;
border-top
:
1px
solid
$borderC
;
display
:none
;
.question
{
font-size
:
pxToRem
(
24px
);
color
:
$mainFontC
;
...
...
template/m.yohobuy.com/actions/product/detail/consults.phtml
View file @
2750e5f
...
...
@@ -6,7 +6,7 @@
<a
href=
"{{link}}"
class=
"iconfont enter-consult-page"
>
604
;</a>
</div>
{
{#
consults
}
}
<div
class=
"goods-consults"
id=
"goods-consults"
>
<div
class=
"goods-consults
customer-consults
"
id=
"goods-consults"
>
{
{#list
}
}
<div
class=
"consult-item"
data-id=
"{{id}}"
>
<div
class=
"question"
>
...
...
@@ -55,7 +55,7 @@
{
{#faq
}
}
<div
class=
"goods-consults"
style=
"margin-top:0"
>
{
{#
list
}
}
{
{#
commonConsults
}
}
<div
class=
"faq-item"
>
<div
class=
"question"
>
<span
class=
"iconfont"
>
639
;</span>
...
...
@@ -69,7 +69,7 @@
<p>
{
{answer
}
}</p>
</div>
</div>
{
{/
list
}
}
{
{/
commonConsults
}
}
</div>
{
{/faq
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
2750e5f
...
...
@@ -7,7 +7,7 @@ use Plugin\Helpers;
/**
* 商品详情页模板相关的数据模型
*
*
* @name DetailModel
* @package Product
* @copyright yoho.inc
...
...
@@ -19,7 +19,7 @@ class DetailModel
/**
* 商品基本信息
*
*
* @param int $productId 商品ID SKN 和 ID 只需要传一个
* @param int $goodsId 某个颜色的商品
* @param int $uid 当前登录用户ID, 未登录为0
...
...
@@ -309,7 +309,7 @@ class DetailModel
/**
* 商品尺码信息
*
*
* @param int $productSkn
* @return array
*/
...
...
@@ -520,7 +520,7 @@ class DetailModel
/**
* 获取评价列表
*
*
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
...
...
@@ -571,9 +571,9 @@ class DetailModel
$build
[
'answer'
]
=
$value
[
'answer'
];
$build
[
'id'
]
=
$value
[
'id'
];
$build
[
'isLike'
]
=
$value
[
'is_like'
]
===
'Y'
;
$build
[
'like'
]
=
$value
[
'like'
]
;
$build
[
'like'
]
=
intval
(
$value
[
'like'
])
;
$build
[
'isUseful'
]
=
$value
[
'is_useful'
]
===
'Y'
;
$build
[
'useful'
]
=
$value
[
'useful'
]
;
$build
[
'useful'
]
=
intval
(
$value
[
'useful'
])
;
$result
[]
=
$build
;
}
}
...
...
@@ -584,6 +584,24 @@ class DetailModel
}
/**
* 获取常见问题列表
*
* @return array
*/
public
static
function
getCommonConsults
()
{
$result
=
array
();
$consults
=
DetailData
::
commonConsultList
();
if
(
isset
(
$consults
[
'code'
])
&&
$consults
[
'code'
]
===
200
)
{
$result
[
'commonConsults'
]
=
$consults
[
'data'
];
$consults
=
array
();
}
return
$result
;
}
/**
* 咨询点赞
*
* @param int $uid 用户ID
...
...
@@ -649,7 +667,7 @@ class DetailModel
/**
* 获取为你优选的商品
*
*
* @param int $productSkn 商品SKN
* @return array
*/
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php
View file @
2750e5f
...
...
@@ -158,6 +158,7 @@ class DetailController extends AbstractAction
'consults'
=>
array
(
'list'
=>
$consults
),
'faq'
=>
\Product\DetailModel
::
getCommonConsults
(),
'showReadMore'
=>
count
(
$consults
)
>
2
,
'link'
=>
Helpers
::
url
(
'/product/detail/consultform'
,
array
(
'product_id'
=>
$productId
)),
);
...
...
@@ -166,6 +167,7 @@ class DetailController extends AbstractAction
$this
->
_view
->
display
(
'consults'
,
$data
);
}
/*
* 咨询点赞
*/
...
...
Please
register
or
login
to post a comment