fix: 接口调整

This commit is contained in:
杨航
2025-11-17 14:40:07 +08:00
parent ab96769b00
commit 4c6fdfd6b7
5 changed files with 25 additions and 14 deletions
+3 -2
View File
@@ -91,13 +91,14 @@
console.log('轮播图切换:', e);
currentIndex.value = data.index;
}
const isPreview = ref(false)
const toTip = () => {
common.navigateTo('/pages/sparring/tip?traId=' + traId.value + '&chaId=' + activeRole.value.chaId + '&type=' + talkingType.value)
common.navigateTo('/pages/sparring/tip?traId=' + traId.value + '&chaId=' + activeRole.value.chaId + '&type=' + talkingType.value+ '&isPreview=' + (isPreview.value ?'1':''))
}
onLoad((params) => {
traId.value = params.traId;
talkingType.value = params.type
isPreview.value = params.isPreview === '1'
});
onMounted(() => {
getDetailInfo()
@@ -16,7 +16,7 @@
:isAnswering="props.isAnswering" @handleEvents="handleEvents" :activeVoiceId="activeVoiceId">
</answerVue>
<view v-else></view>
<view class="talking-tips" v-if="talkingType === 'answer'">
<view class="talking-tips" v-if="talkingType === 'answer' && !isExam">
<view class="talking-tips-btn" @click="getTips()">回答提示</view>
<view class="talking-tips-loading" v-if="loadingTips">
<CommonLoading color="#06f" />
@@ -71,6 +71,10 @@
default: false,
type: Boolean
},
isExam: {
default: false,
type: Boolean
},
})
watch(() => props.activeVoiceId, () => {}, {
deep: true,
+7 -6
View File
@@ -60,12 +60,13 @@
@click="previewFile(item)"> {{ item.dataName }}.{{ item.dataSuffix }} </view>
</view>
</view>
<view class="body-bottom" v-if="isPreview">
<view class="body-bottom-btn" @click="toChooseRole('preview')">预览陪练</view>
<view class="body-bottom">
<!-- v-if="isPreview" -->
<!-- <view class="body-bottom-btn" @click="toChooseRole('preview')">预览陪练</view>
</view>
<view class="body-bottom" v-else>
<view class="body-bottom-btn" @click="toChooseRole('test')">去练习</view>
<view class="body-bottom-btn" @click="toChooseRole('exam')">去考试</view>
<view class="body-bottom" v-else> -->
<view class="body-bottom-btn" @click="toChooseRole('01')">去练习</view>
<view class="body-bottom-btn" @click="toChooseRole('02')">去考试</view>
</view>
</view>
</view>
@@ -118,7 +119,7 @@
})
}
const toChooseRole = type => {
common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type)
common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type + '&isPreview=' + (isPreview.value ?'1':''))
}
const isPreview = ref(false)
onLoad(params => {
+4 -1
View File
@@ -182,7 +182,8 @@
const getData = () => {
partnerChatReport({
traId: traId.value,
execId: execId.value
execId: execId.value,
talkingType: isPreview.value? 'preview' : 'practice'
// traId: 'PARTNERINFO02501812207220251103160409000007402',
// execId: 'db2f275b-c04a-4572-83dd-74a95ff49d67'
}).then(res => {
@@ -249,11 +250,13 @@
console.log(_str)
return _str
}
const isPreview = ref(false)
onLoad((params) => {
traId.value = params.traId;
execId.value = params.execId
talkingType.value = params.type;
showLoading.value = true
isPreview.value = params.isPreview === '1'
getData()
});
onMounted(() => {})
+6 -4
View File
@@ -58,7 +58,7 @@
</view>
<view class="talking-box">
<TalkingItem v-for="(item, index) in talkingList" :talkingType="item.type" :talkingInfo="item" :roleInfo="detailInfo"
:traId="traId" :execId="execId"
:traId="traId" :execId="execId" :isExam="talkingType === '02'"
:isLast="index + 1 === talkingList.length" :isAnswering="!answerIsOver"
:activeVoiceId="activeVoiceTalkingItemId" @handleEvents="talkItemEvents"></TalkingItem>
</view>
@@ -129,6 +129,7 @@
const traId = ref('')
const chaId = ref('')
const talkingType = ref('')
const isPreview = ref(false)
const detailInfo = ref({})
const currentIndex = ref(0)
const showRoleInfo = ref(false)
@@ -249,7 +250,7 @@
const answerText = ref('')
const touchBtnCallBack = ref(null)
const initsocketTask = () => {
let _src = talkingType.value === 'preview'?'/trapractice/previewsocket/open':'/trapractice/partnersocket/open'
let _src = isPreview.value ?'/trapractice/previewsocket/open':'/trapractice/partnersocket/open'
socketStore.creatSocket(_src + '?summary=');
// unref(SocketObj).on('open', (res)=>{
// if(!answerIsOver.value){
@@ -405,11 +406,11 @@
partnerChatReportTrigger({
execId: execId.value,
traId: traId.value,
talkingType: talkingType.value
talkingType: isPreview.value? 'preview' : 'practice'
}).then(res=>{
watchFlag.value = 1;
socketStore?.closeSocket();
common.navigateTo('/pages/sparring/result?traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value)
common.navigateTo('/pages/sparring/result?traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':''))
})
}
const sendMessage = (data) => {
@@ -422,6 +423,7 @@
traId.value = params.traId;
chaId.value = params.chaId;
talkingType.value = params.type;
isPreview.value = params.isPreview === '1'
getDetailInfo()
});
onUnload(() => {