合并冲突
This commit is contained in:
@@ -5,8 +5,6 @@ ENV = 'development'
|
||||
|
||||
# VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
|
||||
|
||||
|
||||
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
|
||||
|
||||
|
||||
@@ -150,8 +150,8 @@
|
||||
return;
|
||||
}
|
||||
isPlaying.value = true
|
||||
emit('changePlay', unref(dataInfo)?.id);
|
||||
setTimeout(() => {
|
||||
emit('changePlay', unref(dataInfo)?.id);
|
||||
// readType 阅读内容类型pgrh段落/qns问题
|
||||
if (talkVoiceObj.value.src && talkVoiceObj.value.src === itemVoice.value) {
|
||||
if (voiceIsPlaying.value) return
|
||||
@@ -180,7 +180,7 @@
|
||||
return encodeURIComponent(t) + '=' + encodeURIComponent(_params[t]);
|
||||
})
|
||||
.join('&');
|
||||
storageStore.getStorageById('audio', _url + _params.teachNo, (url) => {
|
||||
storageStore.getStorageById('audio', _url + _params.execLogId, (url) => {
|
||||
if (url) {
|
||||
voiceLoading.value = false;
|
||||
itemVoice.value = url;
|
||||
@@ -201,7 +201,7 @@
|
||||
if (voiceIsPlaying.value) return
|
||||
if(unref(dataInfo)?.id !== props.activeVoiceId) return
|
||||
talkVoiceObj.value.play();
|
||||
storageStore.setStorage('audio', _url + _params.teachNo, itemVoice.value);
|
||||
storageStore.setStorage('audio', _url + _params.execLogId, itemVoice.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
voiceLoading.value = false;
|
||||
|
||||
@@ -46,6 +46,15 @@
|
||||
<script setup>
|
||||
import { computed, unref, ref, toRefs, watch, onMounted } from "vue"
|
||||
import { onUnload } from '@dcloudio/uni-app';
|
||||
import {
|
||||
useStorageStore
|
||||
} from '@/store/storage.js';
|
||||
import {
|
||||
downloadFile,
|
||||
downloadVoiceFile
|
||||
} from '@/api/common.js'
|
||||
|
||||
const storageStore = useStorageStore();
|
||||
const props = defineProps({
|
||||
dataInfo: {
|
||||
default: () => ({}),
|
||||
@@ -82,23 +91,56 @@ import { onUnload } from '@dcloudio/uni-app';
|
||||
isPlaying.value = false
|
||||
emit('changePlay', '')
|
||||
}
|
||||
const voiceIsPlaying = ref(false)
|
||||
const playVoice = () =>{
|
||||
emit('changePlay', unref(dataInfo)?.id)
|
||||
if(talkVoiceObj.value && talkVoiceObj.value.src) {
|
||||
setTimeout(()=>{
|
||||
talkVoiceObj.value.src = unref(dataInfo).talkingVoice
|
||||
talkVoiceObj.value.play()
|
||||
},300)
|
||||
return
|
||||
}else{
|
||||
talkVoiceObj.value.src = ''
|
||||
if(unref(dataInfo).talkingVoice){
|
||||
setTimeout(()=>{
|
||||
talkVoiceObj.value.src = unref(dataInfo).talkingVoice
|
||||
talkVoiceObj.value.play()
|
||||
isPlaying.value = true
|
||||
},100)
|
||||
}
|
||||
|
||||
if (talkVoiceObj.value.src && talkVoiceObj.value.src === itemVoice.value) {
|
||||
if (voiceIsPlaying.value) return
|
||||
talkVoiceObj.value.play();
|
||||
voiceLoading.value = false;
|
||||
return;
|
||||
}
|
||||
talkVoiceObj.value.src = '';
|
||||
if (itemVoice.value) {
|
||||
setTimeout(() => {
|
||||
talkVoiceObj.value.src = itemVoice.value;
|
||||
if (voiceIsPlaying.value) return
|
||||
if(unref(dataInfo)?.id !== props.activeVoiceId) return
|
||||
talkVoiceObj.value.play();
|
||||
}, 100);
|
||||
} else {
|
||||
voiceLoading.value = true;
|
||||
let _id = unref(dataInfo)?.fileId
|
||||
storageStore.getStorageById('audio', _id, (url) => {
|
||||
if (url) {
|
||||
voiceLoading.value = false;
|
||||
itemVoice.value = url;
|
||||
talkVoiceObj.value.src = url;
|
||||
if (voiceIsPlaying.value) return
|
||||
if(unref(dataInfo)?.id !== props.activeVoiceId) return
|
||||
talkVoiceObj.value.play();
|
||||
} else {
|
||||
downloadFile(_id)
|
||||
.then((res) => {
|
||||
if (res?.data) {
|
||||
common.msg(res.data.message);
|
||||
return;
|
||||
}
|
||||
voiceLoading.value = false;
|
||||
itemVoice.value = res.tempFilePath;
|
||||
talkVoiceObj.value.src = res.tempFilePath;
|
||||
if (voiceIsPlaying.value) return
|
||||
if(unref(dataInfo)?.id !== props.activeVoiceId) return
|
||||
talkVoiceObj.value.play();
|
||||
storageStore.setStorage('audio', _id, itemVoice.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
voiceLoading.value = false;
|
||||
emit('changePlay', '');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
const initVoice = () => {
|
||||
@@ -106,21 +148,39 @@ import { onUnload } from '@dcloudio/uni-app';
|
||||
talkVoiceObj.value.onPause(()=>{
|
||||
})
|
||||
talkVoiceObj.value.onPlay(()=>{
|
||||
voiceIsPlaying.value = true
|
||||
if(isTesting.value){
|
||||
talkVoiceObj.value.pause()
|
||||
isTesting.value = false
|
||||
isTesting.value = false
|
||||
}
|
||||
})
|
||||
talkVoiceObj.value.onEnded(()=>{
|
||||
emit('changePlay', '')
|
||||
talkVoiceObj.value.src = ''
|
||||
voiceIsPlaying.value = false
|
||||
})
|
||||
talkVoiceObj.value.onError(()=>{
|
||||
talkVoiceObj.value.src = ''
|
||||
voiceIsPlaying.value = false
|
||||
})
|
||||
}
|
||||
const isTesting= ref(false)
|
||||
watch(() => props.dataInfo, () => {},{deep: true,immediate: true})
|
||||
watch(
|
||||
() => props.activeVoiceId,
|
||||
(val) => {
|
||||
if (val !== props.dataInfo.id) {
|
||||
if (voiceIsPlaying.value) {
|
||||
voiceIsPlaying.value = false
|
||||
if (!talkVoiceObj.value) return
|
||||
talkVoiceObj.value.pause()
|
||||
}
|
||||
}
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -158,11 +158,12 @@
|
||||
background-image: url(@/static/images/sparring/top-bg.png);
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
height: 436rpx;
|
||||
clip-path: ellipse(650rpx 327rpx at 375rpx 109rpx);
|
||||
height: calc(var(--status-bar-height) + 436rpx);
|
||||
clip-path: ellipse(650rpx 327rpx at 375rpx calc(var(--status-bar-height) + 109rpx));
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: var(--status-bar-height);
|
||||
padding-top: var(--status-bar-height);
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
|
||||
|
||||
@@ -75,6 +75,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<Feedback ref="feedbackRef" />
|
||||
<badge ref="badgeRef"></badge>
|
||||
<points ref="pointsRef"></points>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -102,6 +104,11 @@
|
||||
import {
|
||||
partnerChatReport
|
||||
} from "@/api/sparring.js"
|
||||
import badge from '@/components/points-and-badge/badge';
|
||||
import points from '@/components/points-and-badge/points';
|
||||
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
|
||||
|
||||
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
|
||||
const traId = ref('')
|
||||
const execId = ref('')
|
||||
const talkingType = ref('')
|
||||
@@ -196,7 +203,7 @@
|
||||
if (res.body.reportFlag){
|
||||
traInfo.value = res.body.traPartnerInfo || {}
|
||||
roleInfo.value = res.body.traPartnerCharacterInfoVo || {}
|
||||
traTm.value = res.body.traTm || '0'
|
||||
traTm.value = res.body.traTmFmtHMS || '0'
|
||||
isPass.value = res.body.traPartnerExecuteHisVo?.traResult === 'P'
|
||||
totalScore.value = res.body.traPartnerExecuteHisVo?.traGrade || '0'
|
||||
positiveList.value = res.body.positiveList || []
|
||||
@@ -240,6 +247,9 @@
|
||||
isLoading.value = false
|
||||
setTimeout(() => {
|
||||
showLoading.value = false
|
||||
if(isPass.value && isOver.value){
|
||||
pointAndBadgesRun(talkingType.value === '01' ? '07': '08', '', ()=>{})
|
||||
}
|
||||
}, 800)
|
||||
} else {
|
||||
setTimeout(getData, 2000)
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
execId: execId.value,
|
||||
intrctWay: '02', //01-文本;02-语音;03-图片
|
||||
intrctContent: _res.body.transContent,
|
||||
bucketKey: _res.body.fileId,
|
||||
fileId: _res.body.fileId,
|
||||
ossFileAddr: _res.body.ossFileAddr,
|
||||
talkingVoice: voicePath
|
||||
};
|
||||
@@ -423,9 +423,10 @@
|
||||
watchFlag.value = 1;
|
||||
socketStore?.closeSocket();
|
||||
changePlayItemId('')
|
||||
pointAndBadgesRun(talkingType.value === '01'? '07': '08', null, ()=>{
|
||||
common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':''))
|
||||
})
|
||||
common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':''))
|
||||
// pointAndBadgesRun(talkingType.value === '01'? '07': '08', '', ()=>{
|
||||
// common.navigateTo('/pages/sparring/result?isOver=1&traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':''))
|
||||
// })
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user