From cd309a48f6b22677e4b814e98843d069a9a6b69a Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sat, 23 Oct 2021 16:29:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=84=E4=BB=B7=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/default/site/siteset/goods.html | 9 +++++ app/index/view/default/goods/index.html | 14 ++++---- app/service/GoodsService.php | 33 ++++++++++++++----- app/service/SystemBaseService.php | 1 + public/static/index/default/js/goods.js | 7 ---- 5 files changed, 42 insertions(+), 22 deletions(-) diff --git a/app/admin/view/default/site/siteset/goods.html b/app/admin/view/default/site/siteset/goods.html index 793847861..f503ee62e 100644 --- a/app/admin/view/default/site/siteset/goods.html +++ b/app/admin/view/default/site/siteset/goods.html @@ -22,6 +22,15 @@ +
+ + +
+
diff --git a/app/index/view/default/goods/index.html b/app/index/view/default/goods/index.html index 0def5a674..bd707800d 100755 --- a/app/index/view/default/goods/index.html +++ b/app/index/view/default/goods/index.html @@ -279,16 +279,16 @@ {{/if}}
- + @@ -732,7 +732,7 @@
{{/if}} - + {{if in_array('comments', $middle_tabs_nav['type'])}}
@@ -770,7 +770,7 @@
- 没有评论数据 + 没有评价数据
diff --git a/app/service/GoodsService.php b/app/service/GoodsService.php index 3f1ea59c9..737a7dc3d 100755 --- a/app/service/GoodsService.php +++ b/app/service/GoodsService.php @@ -2802,15 +2802,25 @@ class GoodsService */ public static function GoodsDetailMiddleTabsNavList($goods) { + // 是否展示商品评价 + $is_comments = MyC('common_is_show_goods_comments', 1); + // app与web端不一致 if(APPLICATION == 'app') { // 这里的 ent 值必须和系统中区域块定义的一致 $data = [ ['name'=>'商品', 'ent'=>'.page'], - ['name'=>'评价', 'ent'=>'.goods-comment'], - ['name'=>'详情', 'ent'=>'.goods-detail'], ]; + + // 是否展示商品评价 + if($is_comments == 1) + { + $data[] = ['name'=>'评价', 'ent'=>'.goods-comment']; + } + + // 商品详情介绍 + $data[] = ['name'=>'详情', 'ent'=>'.goods-detail']; } else { // 评论总数 $comments_count = isset($goods['comments_count']) ? $goods['comments_count'] : GoodsCommentsService::GoodsCommentsTotal(['goods_id'=>$goods['id'], 'is_show'=>1]); @@ -2826,14 +2836,21 @@ class GoodsService 'name' => '详情', 'active' => 1, ], - [ + ]; + + // 是否展示商品评价 + if($is_comments == 1) + { + $data[] = [ 'type' => 'comments', 'name' => '评价('.$comments_count.')', - ], - [ - 'type' => 'guess_you_like', - 'name' => '猜你喜欢', - ] + ]; + } + + // 猜你喜欢,目前以销量最高推荐 + $data[] = [ + 'type' => 'guess_you_like', + 'name' => '猜你喜欢', ]; } diff --git a/app/service/SystemBaseService.php b/app/service/SystemBaseService.php index b12e73e58..05717a316 100644 --- a/app/service/SystemBaseService.php +++ b/app/service/SystemBaseService.php @@ -154,6 +154,7 @@ class SystemBaseService 'common_app_is_poster_share' => (int) MyC('common_app_is_poster_share'), 'common_is_goods_detail_show_photo' => (int) MyC('common_is_goods_detail_show_photo', 0, true), 'common_is_exhibition_mode_btn_text'=> MyC('common_is_exhibition_mode_btn_text', '立即咨询', true), + 'common_is_show_goods_comments' => (int) MyC('common_is_show_goods_comments', 1), // 百度地图密钥 'common_baidu_map_ak' => MyC('common_baidu_map_ak', null, true), diff --git a/public/static/index/default/js/goods.js b/public/static/index/default/js/goods.js index 4bd7aeee7..1c4a5b02d 100755 --- a/public/static/index/default/js/goods.js +++ b/public/static/index/default/js/goods.js @@ -762,13 +762,6 @@ $(function() { } }); - // 累计评价点击事件 - $('.tm-ind-panel .ind-panel-comment').on('click', function() - { - $(window).smoothScroll({position: $('.introduce-main').offset().top}); - $('.introduce-main .am-tabs').tabs('open', 1); - }); - // tab事件 $('.introduce-main .am-tabs li').on('click', function() {