chore: 优化公共端都支持打开企业微信客服的方法
This commit is contained in:
2009
common/js/util.js
2009
common/js/util.js
File diff suppressed because it is too large
Load Diff
@@ -89,7 +89,7 @@
|
||||
|
||||
switch (this.config.type) {
|
||||
case 'wxwork':
|
||||
this.openWxWorkService();
|
||||
this.openWxWorkServiceChat();
|
||||
break;
|
||||
case 'third':
|
||||
location.href = this.config.third_url;
|
||||
@@ -103,11 +103,11 @@
|
||||
},
|
||||
/**
|
||||
* 打开企业微信客服
|
||||
* @param {boolean} useOriginalService 是否使用原有客服方式
|
||||
* @param {boolean} useOpenCustomerServiceChat 是否使用原有客服方式
|
||||
*/
|
||||
openWxWorkService(useOriginalService = false) {
|
||||
openWxWorkServiceChat(useOpenCustomerServiceChat = false) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (this.wxworkConfig?.contact_url && !useOriginalService) {
|
||||
if (this.wxworkConfig?.enable && this.wxworkConfig?.contact_url && !useOpenCustomerServiceChat) {
|
||||
// 直接使用活码链接跳转
|
||||
wx.navigateToMiniProgram({
|
||||
appId: 'wxeb490c6f9b154ef9', // 是企业微信官方小程序的AppID(固定值, 由腾讯企业微信团队维护, 不需要修改,用于展示"添加企业微信联系人"的官方页面)
|
||||
@@ -135,7 +135,7 @@
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
if (this.wxworkConfig?.contact_url) {
|
||||
if (this.wxworkConfig?.enable && this.wxworkConfig?.contact_url) {
|
||||
// H5环境直接跳转活码链接
|
||||
window.location.href = this.wxworkConfig.contact_url;
|
||||
} else {
|
||||
@@ -154,7 +154,7 @@
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
console.log('降级处理:使用原有客服方式');
|
||||
this.openWxWorkService(true);
|
||||
this.openWxWorkServiceChat(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user