Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
c25a47f4
Y
yii2_fecshop
项目概览
OpenDocCN
/
yii2_fecshop
通知
17
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yii2_fecshop
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c25a47f4
编写于
2月 23, 2018
作者:
T
Terry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apphtml5 product review star info
上级
12bb822f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
314 addition
and
107 deletion
+314
-107
app/appfront/theme/base/front/catalog/reviewproduct/lists.php
...appfront/theme/base/front/catalog/reviewproduct/lists.php
+48
-48
app/apphtml5/languages/zh_CN/apphtml5.php
app/apphtml5/languages/zh_CN/apphtml5.php
+10
-0
app/apphtml5/modules/Catalog/block/product/Index.php
app/apphtml5/modules/Catalog/block/product/Index.php
+2
-2
app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php
app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php
+2
-1
app/apphtml5/modules/Catalog/helpers/Review.php
app/apphtml5/modules/Catalog/helpers/Review.php
+32
-5
app/apphtml5/theme/base/html5/assets/css/fec.css
app/apphtml5/theme/base/html5/assets/css/fec.css
+67
-0
app/apphtml5/theme/base/html5/catalog/product/index.php
app/apphtml5/theme/base/html5/catalog/product/index.php
+6
-4
app/apphtml5/theme/base/html5/catalog/product/index/review.php
...pphtml5/theme/base/html5/catalog/product/index/review.php
+64
-9
app/apphtml5/theme/base/html5/catalog/reviewproduct/lists.php
...apphtml5/theme/base/html5/catalog/reviewproduct/lists.php
+83
-38
未找到文件。
app/appfront/theme/base/front/catalog/reviewproduct/lists.php
浏览文件 @
c25a47f4
...
...
@@ -66,55 +66,55 @@
<div
class=
"box pro_commit"
>
<div
class=
"averageWarp"
>
<span
class=
"lineBlock fon14"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Average Rating'
);
?>
:
</span>
<a
lehref=
"#"
class=
"review_star review_star_
<?=
round
(
$reviw_rate_star_average
)
?>
"
onclick=
"javascript:return false;"
></a>
<b
class=
"lineBlock fon18"
>
<?=
$reviw_rate_star_average
?>
</b>
<span
class=
"lineBlock"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'based on {review_count} Customer Reviews'
,[
'review_count'
=>
$review_count
])
?>
</span>
</div>
<div
class=
"clear"
></div>
<div
class=
"lbBox writeRiviewTitle"
>
<ul
class=
"lineBlock proportionStars"
>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'5 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'4 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'3 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'2 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'1 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%
</span>
</li>
</ul>
<div
class=
"lineBlock writeRiviewBtn"
>
<button
type=
"submit"
title=
"Save"
class=
"button btn btn-primary addreview"
onclick=
"javascrtpt:window.location.href='
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/add'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
'"
><span><span>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Write a Customer Review'
);
?>
</span></span></button>
<span
class=
"lineBlock fon14"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Average Rating'
);
?>
:
</span>
<a
lehref=
"#"
class=
"review_star review_star_
<?=
round
(
$reviw_rate_star_average
)
?>
"
onclick=
"javascript:return false;"
></a>
<b
class=
"lineBlock fon18"
>
<?=
$reviw_rate_star_average
?>
</b>
<span
class=
"lineBlock"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'based on {review_count} Customer Reviews'
,[
'review_count'
=>
$review_count
])
?>
</span>
</div>
</div>
<div
class=
"clear"
></div>
<div
class=
"lbBox writeRiviewTitle"
>
<ul
class=
"lineBlock proportionStars"
>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'5 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'4 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'3 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'2 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'1 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%
</span>
</li>
</ul>
<div
class=
"lineBlock writeRiviewBtn"
>
<button
type=
"submit"
title=
"Save"
class=
"button btn btn-primary addreview"
onclick=
"javascrtpt:window.location.href='
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/add'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
'"
><span><span>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Write a Customer Review'
);
?>
</span></span></button>
</div>
</div>
<div
class=
"product-Reviews_top"
>
...
...
app/apphtml5/languages/zh_CN/apphtml5.php
浏览文件 @
c25a47f4
...
...
@@ -462,4 +462,14 @@ return [
'Please contact us if you think this is a server error, Thank you.'
=>
'如果您认为这是服务器错误,请与我们联系,谢谢。'
,
'Bring me back Home'
=>
'带我去首页'
,
'Average Rating'
=>
'平均评分'
,
'based on {review_count} Customer Reviews'
=>
'基于{review_count}条客户评论'
,
'5 stars'
=>
'5星'
,
'4 stars'
=>
'4星'
,
'3 stars'
=>
'3星'
,
'2 stars'
=>
'2星'
,
'1 stars'
=>
'1星'
,
'Write a Customer Review'
=>
'填写用户评论'
,
];
app/apphtml5/modules/Catalog/block/product/Index.php
浏览文件 @
c25a47f4
...
...
@@ -58,8 +58,7 @@ class Index
}
$reviewHelper
=
$this
->
_reviewHelper
;
$reviewHelper
::
initReviewConfig
();
$ReviewAndStarCount
=
$reviewHelper
::
getReviewAndStarCount
(
$this
->
_product
);
list
(
$review_count
,
$reviw_rate_star_average
)
=
$ReviewAndStarCount
;
list
(
$review_count
,
$reviw_rate_star_average
,
$reviw_rate_star_info
)
=
$reviewHelper
::
getReviewAndStarCount
(
$this
->
_product
);
$this
->
filterProductImg
(
$this
->
_product
[
'image'
]);
$groupAttrInfo
=
Yii
::
$service
->
product
->
getGroupAttrInfo
(
$this
->
_product
[
'attr_group'
]);
$groupAttrArr
=
$this
->
getGroupAttrArr
(
$groupAttrInfo
);
...
...
@@ -74,6 +73,7 @@ class Index
'attr_group'
=>
$this
->
_product
[
'attr_group'
],
'review_count'
=>
$review_count
,
'reviw_rate_star_average'
=>
$reviw_rate_star_average
,
'reviw_rate_star_info'
=>
$reviw_rate_star_info
,
'price_info'
=>
$this
->
getProductPriceInfo
(),
'tier_price'
=>
$this
->
_product
[
'tier_price'
],
'media_size'
=>
[
...
...
app/apphtml5/modules/Catalog/block/reviewproduct/Lists.php
浏览文件 @
c25a47f4
...
...
@@ -101,13 +101,14 @@ class Lists
$coll
=
$data
[
'coll'
];
$reviewHelper
=
$this
->
_reviewHelper
;
$ReviewAndStarCount
=
$reviewHelper
::
getReviewAndStarCount
(
$product
);
list
(
$review_count
,
$reviw_rate_star_average
)
=
$ReviewAndStarCount
;
list
(
$review_count
,
$reviw_rate_star_average
,
$reviw_rate_star_info
)
=
$ReviewAndStarCount
;
return
[
'_id'
=>
$this
->
product_id
,
'spu'
=>
$this
->
spu
,
'review_count'
=>
$review_count
,
'reviw_rate_star_average'
=>
$reviw_rate_star_average
,
'reviw_rate_star_info'
=>
$reviw_rate_star_info
,
'pageToolBar'
=>
$pageToolBar
,
'coll'
=>
$coll
,
'noActiveStatus'
=>
Yii
::
$service
->
product
->
review
->
noActiveStatus
(),
...
...
app/apphtml5/modules/Catalog/helpers/Review.php
浏览文件 @
c25a47f4
...
...
@@ -17,7 +17,7 @@ use Yii;
*/
class
Review
{
// 初始化当前app
html5
的设置,覆盖service的初始设置。
// 初始化当前app
front
的设置,覆盖service的初始设置。
public
static
function
initReviewConfig
()
{
// 用当前的配置,覆盖service的公用配置。
...
...
@@ -40,11 +40,13 @@ class Review
// 这个是是否通过语言进行过滤评论,可以通过上面的函数 self::initReviewConfig进行初始化,
// 也就是通过当前模块的配置,来覆盖service的配置
$filterByLang
=
Yii
::
$service
->
product
->
review
->
filterByLang
;
if
(
$filterByLang
)
{
$langCode
=
Yii
::
$service
->
store
->
currentLangCode
;
if
(
$langCode
)
{
$a
=
Yii
::
$service
->
fecshoplang
->
getLangAttrName
(
'review_count_lang'
,
$langCode
);
$b
=
Yii
::
$service
->
fecshoplang
->
getLangAttrName
(
'reviw_rate_star_average_lang'
,
$langCode
);
$c
=
Yii
::
$service
->
fecshoplang
->
getLangAttrName
(
'reviw_rate_star_info_lang'
,
$langCode
);
$review_count_lang
=
0
;
if
(
isset
(
$product
[
'review_count_lang'
][
$a
]))
{
$review_count_lang
=
$product
[
'review_count_lang'
][
$a
];
...
...
@@ -55,14 +57,39 @@ class Review
$reviw_rate_star_average_lang
=
$product
[
'reviw_rate_star_average_lang'
][
$b
];
$reviw_rate_star_average_lang
=
$reviw_rate_star_average_lang
?
$reviw_rate_star_average_lang
:
0
;
}
return
[
$review_count_lang
,
$reviw_rate_star_average_lang
];
$reviw_rate_star_info_lang
=
[];
if
(
isset
(
$product
[
'reviw_rate_star_info_lang'
][
$c
]))
{
$reviw_rate_star_info_lang
=
$product
[
'reviw_rate_star_info_lang'
][
$c
];
$reviw_rate_star_info_lang
=
$reviw_rate_star_info_lang
?
$reviw_rate_star_info_lang
:
[];
}
$reviw_rate_star_info
=
self
::
getRateStarInfo
(
$review_count_lang
,
$reviw_rate_star_info_lang
);
return
[
$review_count_lang
,
$reviw_rate_star_average_lang
,
$reviw_rate_star_info
];
}
}
else
{
$review_count
=
$product
[
'review_count'
]
?
$product
[
'review_count'
]
:
0
;
$reviw_rate_star_average
=
$product
[
'reviw_rate_star_average'
]
?
$product
[
'reviw_rate_star_average'
]
:
0
;
return
[
$review_count
,
$reviw_rate_star_average
];
$reviw_rate_star_info
=
$product
[
'reviw_rate_star_info'
]
?
$product
[
'reviw_rate_star_info'
]
:
[];
$reviw_rate_star_info
=
self
::
getRateStarInfo
(
$review_count
,
$reviw_rate_star_info
);
return
[
$review_count
,
$reviw_rate_star_average
,
$reviw_rate_star_info
];
}
}
public
static
function
getRateStarInfo
(
$review_count
,
$reviw_rate_star_info
){
if
(
empty
(
$reviw_rate_star_info
))
{
$reviw_rate_star_info
[
'star_0'
]
=
0
;
$reviw_rate_star_info
[
'star_1'
]
=
0
;
$reviw_rate_star_info
[
'star_2'
]
=
0
;
$reviw_rate_star_info
[
'star_3'
]
=
0
;
$reviw_rate_star_info
[
'star_4'
]
=
0
;
$reviw_rate_star_info
[
'star_5'
]
=
0
;
}
foreach
(
$reviw_rate_star_info
as
$k
=>
$v
)
{
if
(
$review_count
)
{
$reviw_rate_star_info
[
$k
]
=
ceil
(
$v
/
$review_count
*
1000
)
/
10
;
}
}
return
$reviw_rate_star_info
;
}
}
app/apphtml5/theme/base/html5/assets/css/fec.css
浏览文件 @
c25a47f4
...
...
@@ -1052,6 +1052,73 @@ width: 80%;}
.averageWarp
{
margin-top
:
10px
;
}
.averageWarp
span
,
.averageWarp
b
{
float
:
left
;
display
:
block
;
margin-right
:
20px
;}
.averageWarp
a
{
float
:
left
;
margin-right
:
10px
;}
.lbBox
{
font-size
:
0
;
*
word-spacing
:
-1px
;
}
.lineBlock
{
display
:
inline-block
;
zoom
:
1
;
padding-left
:
0
;
*
display
:
inline
;
font-size
:
13px
;
letter-spacing
:
normal
;
word-spacing
:
normal
;
vertical-align
:
top
;
}
.pro_commit
.writeRiviewTitle
,
.writeLeft
.writeRiviewTitle
{
margin
:
15px
0
;
padding-bottom
:
20px
;
border-bottom
:
1px
solid
#e2e2e2
;
}
.pro_commit
.writeRiviewTitle
.proportionStars
li
,
.writeLeft
.writeRiviewTitle
.proportionStars
li
{
margin-bottom
:
10px
;
}
.fz_blue
,
.link
{
color
:
#4d82b8
;
}
.pro_commit
.writeRiviewTitle
.proportionStars
.proportionBox
,
.writeLeft
.writeRiviewTitle
.proportionStars
.proportionBox
{
background-color
:
#e6e6e6
;
width
:
145px
;
height
:
15px
;
position
:
relative
;
margin-left
:
10px
;
margin-right
:
10px
;
border
:
1px
solid
#c4c4c4
;
}
.pro_commit
.writeRiviewTitle
.proportionStars
.proportionBox
>
div
::before
,
.writeLeft
.writeRiviewTitle
.proportionStars
.proportionBox
>
div
::before
{
background-color
:
rgba
(
255
,
255
,
255
,
.25
);
content
:
""
;
display
:
block
;
font-size
:
0
;
height
:
1px
;
margin
:
1px
;
}
.pro_commit
.writeRiviewTitle
.proportionStars
.proportionBox
>
div
,
.writeLeft
.writeRiviewTitle
.proportionStars
.proportionBox
>
div
{
position
:
absolute
;
left
:
0
;
top
:
0
;
height
:
15px
;
background-color
:
#f90
;
font-size
:
0
;
box-shadow
:
0
0
0
1px
rgba
(
0
,
0
,
0
,
.25
)
inset
,
0
-1px
0
rgba
(
0
,
0
,
0
,
.05
)
inset
;
width
:
0
;
transition
:
width
.5s
ease
0s
;
}
.pro_commit
.writeRiviewTitle
.writeRiviewBtn
,
.writeLeft
.writeRiviewTitle
.writeRiviewBtn
{
width
:
770px
;
margin-left
:
150px
;
}
.buttons-row
{
padding
:
0
0.6rem
;}
...
...
app/apphtml5/theme/base/html5/catalog/product/index.php
浏览文件 @
c25a47f4
...
...
@@ -33,8 +33,8 @@
<div
class=
"rbc_cold"
>
<span>
<span
class=
"average_rating"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Average rating'
);
?>
:
</span>
<span
class=
"review_star review_star_
<?=
$reviw_rate_star_average
?>
"
style=
"font-weight:bold;"
itemprop=
"average"
></span>
<span
class=
"review_star review_star_
<?=
round
(
$reviw_rate_star_average
)
?>
"
style=
"font-weight:bold;"
itemprop=
"average"
></span>
<a
external
rel=
"nofollow"
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/lists'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
"
>
(
<span
itemprop=
"count"
>
<?=
$review_count
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'reviews'
);
?>
</span>
)
</a>
...
...
@@ -187,8 +187,10 @@
'view'
=>
'catalog/product/index/review.php'
,
'product_id'
=>
$_id
,
'spu'
=>
$spu
,
];
];
$reviewParam
[
'reviw_rate_star_info'
]
=
$reviw_rate_star_info
;
$reviewParam
[
'review_count'
]
=
$review_count
;
$reviewParam
[
'reviw_rate_star_average'
]
=
$reviw_rate_star_average
;
?>
<?=
Yii
::
$service
->
page
->
widget
->
render
(
$reviewView
,
$reviewParam
);
?>
</div>
...
...
app/apphtml5/theme/base/html5/catalog/product/index/review.php
浏览文件 @
c25a47f4
...
...
@@ -7,10 +7,72 @@
* @license http://www.fecshop.com/license/
*/
?>
<?php
$reviw_rate_star_info
=
$parentThis
[
'reviw_rate_star_info'
];
$review_count
=
$parentThis
[
'review_count'
];
$reviw_rate_star_average
=
$parentThis
[
'reviw_rate_star_average'
];
//var_dump($reviw_rate_star_info);
?>
<div
class=
"product-Reviews"
>
<div
id=
"pic_list_2"
class=
"scroll_horizontal"
>
<div
class=
"clear"
></div>
<div
class=
"box"
>
<div
class=
"box pro_commit"
>
<div
class=
"averageWarp"
>
<span
class=
"lineBlock fon14"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Average Rating'
);
?>
:
</span>
<a
lehref=
"#"
class=
"review_star review_star_
<?=
round
(
$reviw_rate_star_average
)
?>
"
onclick=
"javascript:return false;"
></a>
<b
class=
"lineBlock fon18"
>
<?=
$reviw_rate_star_average
?>
</b>
</div>
<div
class=
"clear"
></div>
<div
class=
"lbBox writeRiviewTitle"
>
<ul
class=
"lineBlock proportionStars"
>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'5 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'4 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'3 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'2 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'1 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%
</span>
</li>
</ul>
<p
class=
"buttons-row"
>
<a
external
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/add'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
"
class=
"button button-round"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Add Review'
);
?>
</a>
<a
external
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/lists'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
"
class=
"button button-round"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'View All Review'
);
?>
(
<?=
$review_count
;
?>
)
</a>
</p>
</div>
<div
class=
"product-Reviews_top"
>
<?php
if
(
is_array
(
$coll
)
&&
!
empty
(
$coll
))
:
?>
...
...
@@ -48,14 +110,7 @@
</div>
<div
class=
"clear"
></div>
<p
class=
"buttons-row"
>
<a
external
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/add'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
"
class=
"button button-round"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Add Review'
);
?>
</a>
<a
external
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/lists'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
"
class=
"button button-round"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'View All Review'
);
?>
(
<?=
$review_count
;
?>
)
</a>
</p>
</div>
</div>
</div>
\ No newline at end of file
app/apphtml5/theme/base/html5/catalog/reviewproduct/lists.php
浏览文件 @
c25a47f4
...
...
@@ -49,7 +49,7 @@
<div
class=
"rbc_cold"
>
<span>
<span
class=
"average_rating"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Average rating :'
);
?>
</span>
<span
class=
"review_star review_star_
<?=
$reviw_rate_star_average
?>
"
style=
"font-weight:bold;"
itemprop=
"average"
></span>
<span
class=
"review_star review_star_
<?=
round
(
$reviw_rate_star_average
)
?>
"
style=
"font-weight:bold;"
itemprop=
"average"
></span>
<a
external
rel=
"nofollow"
href=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalog/reviewproduct/lists'
,[
'spu'
=>
$spu
,
'_id'
=>
$_id
]);
?>
"
>
(
<span
itemprop=
"count"
>
<?=
$review_count
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'reviews'
);
?>
</span>
)
...
...
@@ -76,44 +76,89 @@
</div>
<div
class=
"clear"
></div>
</div>
<div
class=
"product-reviews"
>
<div
class=
"product-reviews pro_commit"
>
<div
class=
"clear"
></div>
<div
class=
"review_title"
>
<a
external
href=
"#"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Product Review'
);
?>
</a>
</div>
<?php
if
(
is_array
(
$coll
)
&&
!
empty
(
$coll
))
:
?>
<?php
foreach
(
$coll
as
$one
)
:
?>
<div
class=
"card"
>
<div
class=
"fec-card-header"
>
<?=
$one
[
'summary'
]
?>
</div>
<div
class=
"fec-card-content"
>
<div
class=
"fec-card-content-inner"
>
<div
class=
"review-content"
>
<?=
$one
[
'review_content'
]
?>
</div>
<div
class=
"moderation"
>
<?php
if
(
$one
[
'status'
]
==
$noActiveStatus
)
:
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Your Review is awaiting moderation...'
);
?>
<?php
elseif
(
$one
[
'status'
]
==
$refuseStatus
)
:
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Your Review is refused.'
);
?>
<?php
endif
;
?>
</div>
<div
class=
"review_list_remark"
>
<p>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'By'
);
?>
<?=
$one
[
'name'
]
?>
</p>
<span>
<?=
$one
[
'review_date'
]
?
date
(
'Y-m-d H:i:s'
,
$one
[
'review_date'
])
:
''
?>
</span>
</div>
</div>
</div>
<div
class=
"fec-card-footer"
>
<a
href=
"#"
class=
"review_star review_star_
<?=
$one
[
'rate_star'
]
?>
"
onclick=
"javascript:return false;"
></a>
</div>
</div>
<?php
endforeach
;
?>
<?php
endif
;
?>
<div
class=
"averageWarp"
>
<span
class=
"lineBlock fon14"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Average Rating'
);
?>
:
</span>
<b
class=
"lineBlock fon18"
>
<?=
$reviw_rate_star_average
?>
</b>
</div>
<div
class=
"clear"
></div>
<div
class=
"lbBox writeRiviewTitle"
>
<ul
class=
"lineBlock proportionStars"
>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'5 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_5'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'4 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_4'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'3 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_3'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'2 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_2'
]
?>
%
</span>
</li>
<li
class=
"lbBox"
>
<span
class=
"lineBlock fz_blue"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'1 stars'
);
?>
</span>
<div
class=
"lineBlock proportionBox"
>
<div
style=
"width:
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%"
>
</div>
</div>
<span
class=
"lineBlock"
>
<?=
$reviw_rate_star_info
[
'star_1'
]
?>
%
</span>
</li>
</ul>
</div>
<?php
if
(
is_array
(
$coll
)
&&
!
empty
(
$coll
))
:
?>
<?php
foreach
(
$coll
as
$one
)
:
?>
<div
class=
"card"
>
<div
class=
"fec-card-header"
>
<?=
$one
[
'summary'
]
?>
</div>
<div
class=
"fec-card-content"
>
<div
class=
"fec-card-content-inner"
>
<div
class=
"review-content"
>
<?=
$one
[
'review_content'
]
?>
</div>
<div
class=
"moderation"
>
<?php
if
(
$one
[
'status'
]
==
$noActiveStatus
)
:
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Your Review is awaiting moderation...'
);
?>
<?php
elseif
(
$one
[
'status'
]
==
$refuseStatus
)
:
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Your Review is refused.'
);
?>
<?php
endif
;
?>
</div>
<div
class=
"review_list_remark"
>
<p>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'By'
);
?>
<?=
$one
[
'name'
]
?>
</p>
<span>
<?=
$one
[
'review_date'
]
?
date
(
'Y-m-d H:i:s'
,
$one
[
'review_date'
])
:
''
?>
</span>
</div>
</div>
</div>
<div
class=
"fec-card-footer"
>
<a
href=
"#"
class=
"review_star review_star_
<?=
$one
[
'rate_star'
]
?>
"
onclick=
"javascript:return false;"
></a>
</div>
</div>
<?php
endforeach
;
?>
<?php
endif
;
?>
<?php
if
(
$pageToolBar
)
:
?>
<div
class=
"pageToolbar"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录