feat(客服配置): 添加显示系统客服选项及控制逻辑
在客服类型配置页面中新增"同时显示小程序系统客服"复选框选项,并添加相关显示控制逻辑。该选项仅在客服类型为aikefu、wxwork或miniprogram时显示,通过JavaScript动态控制其可见性
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
{case value="miniprogram"}第三方微信小程序{/case}
|
||||
{/switch}
|
||||
{if addon_is_exit('aikefu') && $config.weapp.type == 'aikefu'}智能客服{/if}
|
||||
{if !empty($config.weapp.show_system_service) && $config.weapp.show_system_service == 1 && in_array($config.weapp.type, ['aikefu', 'wxwork', 'miniprogram'])}(同时显示系统客服){/if}
|
||||
</div>
|
||||
</div>
|
||||
{if addon_is_exit('pc', request()->siteid()) == 1}
|
||||
@@ -149,6 +150,12 @@
|
||||
<input type="radio" name="weapp[type]" lay-filter="serviceType" lay-type="weapp" value="miniprogram" title="第三方微信小程序" {if condition="$config.weapp.type == 'miniprogram'"} checked {/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item weapp-system-service" {if !in_array($config.weapp.type, ['aikefu', 'wxwork', 'miniprogram'])} style="display: none" {/if}>
|
||||
<label class="layui-form-label">附加设置:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="weapp[show_system_service]" value="1" lay-skin="primary" title="同时显示小程序系统客服" {if !empty($config.weapp.show_system_service) && $config.weapp.show_system_service == 1} checked {/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="weapp-wrap wxwork" {if $config.weapp.type != 'wxwork'} style="display: none" {/if}>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>企业ID:</label>
|
||||
@@ -311,6 +318,27 @@
|
||||
value = data.value;
|
||||
$('.' + type + '-wrap').hide();
|
||||
$('.' + type + '-wrap.' + value).show();
|
||||
|
||||
// 控制是否显示附加设置
|
||||
if (type === 'weapp') {
|
||||
if (['aikefu', 'wxwork', 'miniprogram'].indexOf(value) > -1) {
|
||||
$('.weapp-system-service').show();
|
||||
} else {
|
||||
$('.weapp-system-service').hide();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 初始化时设置默认值
|
||||
$(document).ready(function(){
|
||||
// 检查是否需要显示附加设置
|
||||
var weappType = $('[name="weapp[type]"]:checked').val();
|
||||
if (weappType && ['aikefu', 'wxwork', 'miniprogram'].indexOf(weappType) > -1) {
|
||||
$('.weapp-system-service').show();
|
||||
}
|
||||
|
||||
// 为复选框添加value属性
|
||||
$('[name="weapp[show_system_service]"]').val('1');
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user