呼出接口调试

This commit is contained in:
张运江 2025-01-17 09:54:42 +08:00
parent b1b5bf3a67
commit cb08f91def
2 changed files with 38 additions and 10 deletions

View File

@ -32,9 +32,9 @@
<div class="wrap-btn-left-dial pl-22 pr-24 f14 flex-row justify-content-between ml-16"> <div class="wrap-btn-left-dial pl-22 pr-24 f14 flex-row justify-content-between ml-16">
<div class="flex-row justify-content-between align-items-center"> <div class="flex-row justify-content-between align-items-center">
<div v-if="calling" class="mr-8 f16 color-F53F3F cursor-p" @click="pauseTimer()"><i class="el-icon-video-pause"></i></div> <div v-if="calling" class="mr-8 f16 color-F53F3F cursor-p" @click="pauseTimer()"><i class="el-icon-video-pause"></i></div>
<div v-else class="mr-8 f16 color-F53F3F cursor-p" @cilck="startCall()"><i class="el-icon-video-play"></i></div> <div v-else class="mr-8 f16 color-F53F3F cursor-p" @click="startCall()"><i class="el-icon-video-play"></i></div>
<div class="mr-8 cursor-p" v-if="calling" @click="pauseTimer()">暂停拨打</div> <div class="mr-8 cursor-p" v-if="calling" @click="pauseTimer()">暂停拨打</div>
<div class="mr-8 cursor-p" v-else @cilck="startCall()">开始拨打</div> <div class="mr-8 cursor-p" v-else @click="startCall()">开始拨打</div>
<div class="mr-8 f12 color-000" v-if="calling">{{formattedTime || '00:00'}}</div> <div class="mr-8 f12 color-000" v-if="calling">{{formattedTime || '00:00'}}</div>
<div class="mr-8 f20 cursor-p" v-if="calling" @click="hungUp()"><i class="el-icon-phone-outline"></i></div> <div class="mr-8 f20 cursor-p" v-if="calling" @click="hungUp()"><i class="el-icon-phone-outline"></i></div>
<div class="mr-8 f20 cursor-p" v-if="calling && !isMute" @click="muteMic()"><i class="el-icon-microphone"></i></div> <div class="mr-8 f20 cursor-p" v-if="calling && !isMute" @click="muteMic()"><i class="el-icon-microphone"></i></div>
@ -375,6 +375,8 @@ export default {
if (this.queue) { if (this.queue) {
await this.callingQueue() // await this.callingQueue() //
await this.callingInfo() // await this.callingInfo() //
} else {
await this.callingCaseList() //
} }
const that = this const that = this
window.tccc.on('sessionEnded', (options) => { window.tccc.on('sessionEnded', (options) => {
@ -410,7 +412,7 @@ export default {
await api.getCaseInfoById(this.$route.query.caseId).then(res => { await api.getCaseInfoById(this.$route.query.caseId).then(res => {
if (!res.code) { if (!res.code) {
this.baseInfo = res this.baseInfo = res
this.phoneNumber = res.debtorEntityList.find(item => item.role == 'DEBTOR').phone
if(res.jointDebt == 1){ if(res.jointDebt == 1){
// mainCaseId // mainCaseId
this.caseId = res.mainCaseId.toString() this.caseId = res.mainCaseId.toString()
@ -498,6 +500,11 @@ export default {
this.todayCountData = res this.todayCountData = res
} catch (err) {} } catch (err) {}
}, },
callingCaseList() {
api.callingCaseList({}).then(res => {
this.queueList = res.queue || []
})
},
// //
callingQueue() { callingQueue() {
api.callingQueue({}).then(res => { api.callingQueue({}).then(res => {
@ -508,19 +515,27 @@ export default {
}) })
}, },
startCall () { startCall () {
if (!this.$clickThrottle()) {
return
}
console.log('queueList==================',this.queueList) console.log('queueList==================',this.queueList)
for (let i=0; i < this.queueList.length; i++) { if (this.queue) {
if (this.queueList[i].status.code === 1) { for (let i=0; i < this.queueList.length; i++) {
console.log('定位到可拨打的案件',i) if (this.queueList[i].status.code === 1) {
this.index = i console.log('定位到可拨打的案件',i)
this.startOutboundCall() this.index = i
return this.startOutboundCall()
return
}
} }
} else {
this.startOutboundCall()
} }
}, },
// //
async startOutboundCall() { async startOutboundCall() {
// this.phoneNumber = this.queueList[this.index].phone // this.phoneNumber = this.queue ? this.queueList[this.index].phone : this.baseInfo.phone
this.calling = true this.calling = true
console.log('进入呼叫电话:', this.phoneNumber) console.log('进入呼叫电话:', this.phoneNumber)
try { try {
@ -550,6 +565,9 @@ export default {
}, },
// //
async hungUp() { async hungUp() {
if (!this.$clickThrottle()) {
return
}
try { try {
let res = await window.tccc.Call.hungUp({sessionId: this.sessionId}) let res = await window.tccc.Call.hungUp({sessionId: this.sessionId})
this.calling = false this.calling = false
@ -590,6 +608,9 @@ export default {
}, },
// //
async muteMic() { async muteMic() {
if (!this.$clickThrottle()) {
return
}
try { try {
let data = await window.tccc.Call.muteMic({sessionId: this.sessionId}) let data = await window.tccc.Call.muteMic({sessionId: this.sessionId})
this.isMute = true this.isMute = true
@ -601,6 +622,9 @@ export default {
}, },
// //
async unmuteMic() { async unmuteMic() {
if (!this.$clickThrottle()) {
return
}
try { try {
let data = await window.tccc.Call.unmuteMic({sessionId: this.sessionId}) let data = await window.tccc.Call.unmuteMic({sessionId: this.sessionId})
this.isMute = false this.isMute = false

View File

@ -322,6 +322,10 @@ const caseManagementApi = {
callingTodayCount: data => { callingTodayCount: data => {
return service.service.post(`${apiAdmin}api/trace/calling/todayCount`, data) return service.service.post(`${apiAdmin}api/trace/calling/todayCount`, data)
}, },
// 当前调解员案件列表
callingCaseList: data => {
return service.service.post(`${apiAdmin}api/trace/calling/caseList`, data)
},