This commit is contained in:
杨航
2025-11-27 21:01:13 +08:00
parent fea819d199
commit 10c9fde2fa
4 changed files with 57 additions and 14 deletions
+2 -2
View File
@@ -8,13 +8,13 @@ ENV = 'development'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_API_Url = 'http://192.168.247.200'
# VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001'
# VITE_APP_BASE_API_Url = 'http://192.168.108.129'
# dev
# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# sit
# VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
# UAT
+3 -2
View File
@@ -1,10 +1,11 @@
import request from '@/api/request'
export const prepareApi = (name) => {
export const prepareApi = (data) => {
return request({
url: '/trapractice/audio/session/prepare?name=' + name,
url: '/trapractice/traPartnerVoiceCall/voiceCallPrepare' ,
method: 'post',
toastErrors: true,
data,
baseUrl: 'http://25.64.32.157:9603'
});
};
+30 -3
View File
@@ -1,5 +1,5 @@
<template>
<talkCom ref="talkComRef"/>
<talkCom ref="talkComRef" />
<ImagePreview class="show-box-avatar" :src="detailInfo.ossAddr" :isCache="true">
</ImagePreview>
<view class="show-box">
@@ -20,7 +20,8 @@
</template>
<script setup>
import {
onLoad
onLoad,
onBackPress
} from '@dcloudio/uni-app'
import {
ref,
@@ -32,6 +33,7 @@
partnerChatReportTrigger
} from "@/api/sparring.js"
import ImagePreview from '@/components/image-preview/image-preview.vue';
import common from '@/common/common';
const traId = ref('')
const chaId = ref('')
@@ -47,12 +49,36 @@
detailInfo.value = {
...res.body
}
talkComRef.value.prepare()
talkComRef.value.prepare({
traId: traId.value,
chaId: chaId.value,
traTyp: talkingType.value
})
})
}
const timeShow = ref('12:11')
const closeTalking = () => {
talkComRef.value.close()
overTalking()
}
const overTalking = () => {
partnerChatReportTrigger({
execId: execId.value,
traId: traId.value,
talkingType: isPreview.value? 'preview' : 'practice'
}).then(res=>{
watchFlag.value = 1;
socketStore?.closeSocket();
changePlayItemId('')
common.navigateTo('/pages/sparring/result?isOver=1&traId='
+ traId.value
+ '&execId='
+ execId.value
+ '&type='
+ talkingType.value
+ '&isPreview='
+ (isPreview.value ?'1':''))
})
}
onLoad((params) => {
traId.value = params.traId;
@@ -61,6 +87,7 @@
isPreview.value = params.isPreview === '1'
getDetailInfo()
});
onBackPress((res) => res.from === 'backbutton');
</script>
<style scoped lang="scss">
.show-box {
+22 -7
View File
@@ -24,7 +24,8 @@
data() {
return {
baseName: 'wangwu',
context: null
context: null,
isGetting: true
}
},
computed: {
@@ -36,6 +37,7 @@
// this.prepare()
},
beforeUnmount() {
this.isGetting = false
this.stop()
this.close()
},
@@ -86,18 +88,31 @@
switchCamera() {},
startPreview() {},
stopPreview() {},
prepare() {
prepareApi(this.baseName).then(res => {
prepare({traId, chaId, traTyp}) {
if(!this.isGetting){
this.isGetting = true
return
}
prepareApi({
traId: traId,
chaId: chaId,
traTyp: traTyp,
}).then(res => {
console.log(res)
if(res.body.prepare){
this.baseName = res.body.sid
this.initPusher()
}else{
setTimeout(()=> {
this.prepare({traId, chaId, traTyp})
},2000)
}
}).catch(err => {
console.log(err)
if (err === 'prepare') {
this.initPusher()
}
})
},
initPusher() {
console.log(1)
console.log('rtmp://25.18.122.148:9605/voice_in/' + this.baseName)
pusher = new plus.video.LivePusher('pusher-box', {
url: 'rtmp://25.18.122.148:9605/voice_in/' + this.baseName,
"enable-camera": true,