From 43559d5aca986f69a05e5a4c2412f6b6f551674c Mon Sep 17 00:00:00 2001 From: Terry <2358269014@qq.com> Date: Fri, 23 Feb 2018 09:44:02 +0800 Subject: [PATCH] appfront product review list show info --- app/appfront/languages/zh_CN/appfront.php | 25 ++- .../Catalog/block/reviewproduct/Lists.php | 27 ++-- .../front/catalog/product/index/review.php | 52 +++---- .../front/catalog/reviewproduct/lists.php | 144 ++++++++++++------ 4 files changed, 160 insertions(+), 88 deletions(-) diff --git a/app/appfront/languages/zh_CN/appfront.php b/app/appfront/languages/zh_CN/appfront.php index 12d8974c..1a299415 100644 --- a/app/appfront/languages/zh_CN/appfront.php +++ b/app/appfront/languages/zh_CN/appfront.php @@ -360,5 +360,28 @@ return [ 'We Couldn’t Find this Page' => '我们无法找到这个页面', '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' => '填写用户评论', + '' => '', + '' => '', + '' => '', + '' => '', + + + + + + + + + + + + ]; diff --git a/app/appfront/modules/Catalog/block/reviewproduct/Lists.php b/app/appfront/modules/Catalog/block/reviewproduct/Lists.php index 9cf0f3e3..a439557b 100644 --- a/app/appfront/modules/Catalog/block/reviewproduct/Lists.php +++ b/app/appfront/modules/Catalog/block/reviewproduct/Lists.php @@ -99,22 +99,23 @@ 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, + '_id' => $this->product_id, + 'spu' => $this->spu, + 'review_count' => $review_count, 'reviw_rate_star_average' => $reviw_rate_star_average, - 'pageToolBar' => $pageToolBar, - 'coll' => $coll, - 'noActiveStatus'=> Yii::$service->product->review->noActiveStatus(), - 'addReviewUrl' => $addReviewUrl, - 'name' => $name, - 'price_info' => $price_info, - 'main_img' => $main_img, - 'editForm' => $editForm, - 'url' => Yii::$service->url->getUrl($url_key), + 'reviw_rate_star_info' => $reviw_rate_star_info, + 'pageToolBar' => $pageToolBar, + 'coll' => $coll, + 'noActiveStatus' => Yii::$service->product->review->noActiveStatus(), + 'addReviewUrl' => $addReviewUrl, + 'name' => $name, + 'price_info' => $price_info, + 'main_img' => $main_img, + 'editForm' => $editForm, + 'url' => Yii::$service->url->getUrl($url_key), ]; } } diff --git a/app/appfront/theme/base/front/catalog/product/index/review.php b/app/appfront/theme/base/front/catalog/product/index/review.php index ab328a3c..07c593a5 100644 --- a/app/appfront/theme/base/front/catalog/product/index/review.php +++ b/app/appfront/theme/base/front/catalog/product/index/review.php @@ -21,59 +21,53 @@
- -
- Average Rating: + page->translate->__('Average Rating'); ?>: - based on Customer Reviews + page->translate->__('based on {review_count} Customer Reviews',['review_count' => $review_count]) ?>
+ % + +
- -
diff --git a/app/appfront/theme/base/front/catalog/reviewproduct/lists.php b/app/appfront/theme/base/front/catalog/reviewproduct/lists.php index 061f5912..300e4155 100644 --- a/app/appfront/theme/base/front/catalog/reviewproduct/lists.php +++ b/app/appfront/theme/base/front/catalog/reviewproduct/lists.php @@ -41,7 +41,7 @@
page->translate->__('Average rating :');?> - + ( page->translate->__('reviews');?>) @@ -51,10 +51,7 @@ page->translate->__('Add To Cart');?> - - - page->translate->__('Add Review');?> - +
@@ -64,46 +61,103 @@
page->translate->__('Product Review');?>
-
- - - -
- -
- -
- - - +
+ + +
+
+ page->translate->__('Average Rating'); ?>: + + + page->translate->__('based on {review_count} Customer Reviews',['review_count' => $review_count]) ?> +
+
+
+ +
+ +
+
+ + + +
+ + + +
+ +
+ +
+ +
+ + \ No newline at end of file -- GitLab