mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-30 02:49:03 +08:00
商品评价新增开关
This commit is contained in:
parent
edd5b04523
commit
cd309a48f6
@ -22,6 +22,15 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_is_show_goods_comments.name}}<span class="am-form-group-label-tips">{{$data.common_is_show_goods_comments.describe}}</span></label>
|
||||
<select name="{{$data.common_is_show_goods_comments.only_tag}}" class="am-radius chosen-select" data-validation-message="{{$data.common_is_show_goods_comments.error_tips}}" required>
|
||||
{{foreach $common_is_text_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($data['common_is_show_goods_comments']['value']) and $data['common_is_show_goods_comments']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_show_goods_category_level.name}}<span class="am-form-group-label-tips">{{$data.common_show_goods_category_level.describe}}</span></label>
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
|
@ -279,16 +279,16 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!--销量/浏览/评论-->
|
||||
<!--销量/浏览/评价-->
|
||||
<ul class="tm-ind-panel">
|
||||
<li class="tm-ind-item">
|
||||
<div class="tm-indcon"><span class="tm-label">累计销量</span><span class="tm-count">{{$goods.sales_count}}</span></div>
|
||||
<div class="tm-indcon"><span class="tm-label">库存</span><span class="tm-count">{{$goods.inventory}}</span></div>
|
||||
</li>
|
||||
<li class="tm-ind-item">
|
||||
<div class="tm-indcon"><span class="tm-label">浏览次数</span><span class="tm-count">{{$goods.access_count}}</span></div>
|
||||
<div class="tm-indcon"><span class="tm-label">销量</span><span class="tm-count">{{$goods.sales_count}}</span></div>
|
||||
</li>
|
||||
<li class="tm-ind-item ind-panel-comment">
|
||||
<div class="tm-indcon"><span class="tm-label">累计评论</span><span class="tm-count">{{$goods.comments_count}}</span></div>
|
||||
<li class="tm-ind-item">
|
||||
<div class="tm-indcon"><span class="tm-label">热度</span><span class="tm-count">{{$goods.access_count}}</span></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -732,7 +732,7 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 评论 -->
|
||||
<!-- 评价 -->
|
||||
{{if in_array('comments', $middle_tabs_nav['type'])}}
|
||||
<div class="am-tab-panel goods-comment" data-goods-id="{{$goods.id}}" data-url="{{:MyUrl('index/goods/comments')}}">
|
||||
<div class="am-cf tabs-nav-base-container score-container">
|
||||
@ -770,7 +770,7 @@
|
||||
<div class="goods-comment-content"></div>
|
||||
<div class="table-no goods-page-no-data none">
|
||||
<i class="am-icon-warning"></i>
|
||||
<span>没有评论数据</span>
|
||||
<span>没有评价数据</span>
|
||||
</div>
|
||||
<div class="goods-page-container"></div>
|
||||
</div>
|
||||
|
@ -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' => '猜你喜欢',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user