Files
xingque/utils/kefu-nav.js
2026-07-09 00:17:03 +08:00

28 lines
1005 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** 与消息页「联系客服」一致:跳转客服会话 */
export function openCustomerServiceChat() {
const app = getApp();
if (app.globalData.chatEnabled && app.ensureConnection) {
app.globalData.goEasyConnection.autoReconnect = true;
app.ensureConnection();
}
const param = { teamId: 'support_team' };
wx.navigateTo({
url: '/pages/cs-chat/cs-chat?data=' + encodeURIComponent(JSON.stringify(param)),
});
}
/** 与打手「我的」页在线客服同一图标beijing/tubiao/grzx_kefu.jpg */
export function resolveKefuIconUrl(app) {
app = app || getApp();
const rel = 'beijing/tubiao/grzx_kefu.jpg';
let base = (app.globalData && app.globalData.ossImageUrl) || '';
if (!base && typeof app.readConfigFromStorage === 'function') {
try {
const cached = app.readConfigFromStorage();
base = (cached && cached.cos && cached.cos.ossImageUrl) || '';
} catch (e) {}
}
if (!base) return '';
return base.endsWith('/') ? base + rel : base + rel;
}