|
|
@@ -420,6 +420,7 @@ export default {
|
|
|
_ccReconnectTimer: null,
|
|
|
_ccReconnectAttempts: 0,
|
|
|
_isDestroying: false,
|
|
|
+ _ccEventsBoundFor: null,
|
|
|
|
|
|
// ===== 坐席状态 =====
|
|
|
isCallingReady: false,
|
|
|
@@ -1054,6 +1055,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
_bindCCEvents() {
|
|
|
+ if (this._ccEventsBoundFor === this.ccPhoneBar) return;
|
|
|
+ this._ccEventsBoundFor = this.ccPhoneBar;
|
|
|
this.ccPhoneBar.on(EventList.WS_CONNECTED, () => {
|
|
|
// 注册为共享实例,供其他组件复用
|
|
|
window.__sharedCCPhoneBar = this.ccPhoneBar;
|
|
|
@@ -1402,11 +1405,27 @@ export default {
|
|
|
this._scheduleCCReconnect();
|
|
|
return;
|
|
|
}
|
|
|
- // 通知弹窗组件通过其phoneBar执行外呼(走弹窗完整的通话记录、客户信息流程)
|
|
|
- // 不再通过浮动电话自己的ccPhoneBar.call()拨号,避免创建独立通话
|
|
|
- this.$root.$emit('floating-softphone-call-triggered', phoneNumber);
|
|
|
- this.delegatedCallActive = true;
|
|
|
- this.showStatus('拨号中...', 'info');
|
|
|
+ if (!this.isCallingReady) {
|
|
|
+ this.showStatus('坐席未就绪,请稍候', 'warn');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 人工外呼弹窗打开时,委托弹窗 phoneBar(含通话记录、工作流等业务逻辑)
|
|
|
+ if (window.__floatingPhoneCallDelegateActive) {
|
|
|
+ this.$root.$emit('floating-softphone-call-triggered', phoneNumber);
|
|
|
+ this.delegatedCallActive = true;
|
|
|
+ this.showStatus('拨号中...', 'info');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 普通页面:使用浮动软电话自身的 ccPhoneBar 直接外呼
|
|
|
+ try {
|
|
|
+ this.delegatedCallActive = false;
|
|
|
+ this.ccPhoneBar.call(phoneNumber, 'audio', VideoLevels.HD.levelId);
|
|
|
+ } catch (err) {
|
|
|
+ console.error('[FloatingSoftPhone] 外呼失败:', err);
|
|
|
+ this.showStatus('拨号失败', 'error');
|
|
|
+ }
|
|
|
},
|
|
|
endCall() {
|
|
|
if (this.callStatus === UI_STATE.IDLE) { this.showStatus('当前无通话', 'warn'); return; }
|
|
|
@@ -1669,6 +1688,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.ccPhoneBar = null;
|
|
|
+ this._ccEventsBoundFor = null;
|
|
|
}
|
|
|
this.callUuidMap = {};
|
|
|
this.currentCallUuid = '';
|