feat(微信小程序): 添加第三方微信小程序客服支持

新增第三方微信小程序客服类型选项,包含AppID和页面路径的输入验证
This commit is contained in:
2026-01-22 17:16:21 +08:00
parent f7dc9977ac
commit 9a0dcc87e6

View File

@@ -64,6 +64,7 @@
{case value="none"}未启用{/case} {case value="none"}未启用{/case}
{case value="wxwork"}企业微信客服{/case} {case value="wxwork"}企业微信客服{/case}
{case value="weapp"}小程序系统客服{/case} {case value="weapp"}小程序系统客服{/case}
{case value="miniprogram"}第三方微信小程序{/case}
{/switch} {/switch}
{if addon_is_exit('aikefu') && $config.weapp.type == 'aikefu'}智能客服{/if} {if addon_is_exit('aikefu') && $config.weapp.type == 'aikefu'}智能客服{/if}
</div> </div>
@@ -145,6 +146,7 @@
<input type="radio" name="weapp[type]" lay-filter="serviceType" lay-type="weapp" value="weapp" title="小程序系统客服" {if condition="$config.weapp.type == 'weapp'"} checked {/if}> <input type="radio" name="weapp[type]" lay-filter="serviceType" lay-type="weapp" value="weapp" title="小程序系统客服" {if condition="$config.weapp.type == 'weapp'"} checked {/if}>
{if addon_is_exit('aikefu')}<input type="radio" name="weapp[type]" lay-filter="serviceType" lay-type="weapp" value="aikefu" title="智能客服" {if condition="$config.weapp.type == 'aikefu'"} checked {/if}>{/if} {if addon_is_exit('aikefu')}<input type="radio" name="weapp[type]" lay-filter="serviceType" lay-type="weapp" value="aikefu" title="智能客服" {if condition="$config.weapp.type == 'aikefu'"} checked {/if}>{/if}
<input type="radio" name="weapp[type]" lay-filter="serviceType" lay-type="weapp" value="wxwork" title="企业微信客服" {if condition="$config.weapp.type == 'wxwork'"} checked {/if}> <input type="radio" name="weapp[type]" lay-filter="serviceType" lay-type="weapp" value="wxwork" title="企业微信客服" {if condition="$config.weapp.type == 'wxwork'"} checked {/if}>
<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> </div>
<div class="weapp-wrap wxwork" {if $config.weapp.type != 'wxwork'} style="display: none" {/if}> <div class="weapp-wrap wxwork" {if $config.weapp.type != 'wxwork'} style="display: none" {/if}>
@@ -165,6 +167,21 @@
<div class="weapp-wrap aikefu" {if $config.weapp.type != 'aikefu'} style="display: none" {/if}> <div class="weapp-wrap aikefu" {if $config.weapp.type != 'aikefu'} style="display: none" {/if}>
<div class="word-aux">智能客服功能已启用系统将自动处理客户咨询</div> <div class="word-aux">智能客服功能已启用系统将自动处理客户咨询</div>
</div> </div>
<div class="weapp-wrap miniprogram" {if $config.weapp.type != 'miniprogram'} style="display: none" {/if}>
<div class="layui-form-item">
<label class="layui-form-label"><span class="required">*</span>AppID</label>
<div class="layui-input-block">
<input type="text" class="layui-input len-mid" name="weapp[appid]" value="{$config.weapp.appid ?? ''}" lay-verify="weappAppid">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span class="required">*</span></label>
<div class="layui-input-block">
<input type="text" class="layui-input len-mid" name="weapp[pagepath]" value="{$config.weapp.pagepath ?? ''}" lay-verify="weappPagepath">
</div>
</div>
<div class="word-aux">请填写目标小程序的AppID和客服页面路径例如pages/service/index</div>
</div>
{if addon_is_exit('pc', request()->siteid()) == 1} {if addon_is_exit('pc', request()->siteid()) == 1}
<div class="layui-form-item top"> <div class="layui-form-item top">
<label class="layui-form-label"><span class="border-left border-color"></span>PC</label> <label class="layui-form-label"><span class="border-left border-color"></span>PC</label>
@@ -259,6 +276,16 @@
return '请输入客服链接'; return '请输入客服链接';
} }
}, },
weappAppid: function(value){
if ($('[name="weapp[type]"]:checked').val() == 'miniprogram' && !/[\S]+/.test(value)) {
return '请输入小程序AppID';
}
},
weappPagepath: function(value){
if ($('[name="weapp[type]"]:checked').val() == 'miniprogram' && !/[\S]+/.test(value)) {
return '请输入小程序页面路径';
}
},
pcThirdUrl: function(value){ pcThirdUrl: function(value){
if ($('[name="pc[type]"]:checked').val() == 'third' && !/[\S]+/.test(value)) { if ($('[name="pc[type]"]:checked').val() == 'third' && !/[\S]+/.test(value)) {