修改bug

This commit is contained in:
田岩
2025-12-05 17:41:02 +08:00
18 changed files with 176 additions and 70 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ 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 = 'http://192.168.247.200'
# VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001'
@@ -15,7 +16,8 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
#VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# sit
#VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
# VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
# UAT
# VITE_APP_BASE_API_Url = 'http://25.18.122.78:9786'
+2 -2
View File
@@ -2,9 +2,9 @@
ENV = 'development.yh'
# 'development.yh'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.32.154:9604'
+3
View File
@@ -7,6 +7,9 @@
animationType: 'slide-in-bottom'
});
});
//#ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary')
// #endif
},
onShow: function () {
+2 -2
View File
@@ -86,7 +86,7 @@ export default class WebSocketUtil {
// console.log('WebSocket连接已关闭', res);
clearInterval(this.heartbeatTimer); // 清除心跳计时器
this.triggerEvent('close', res); // 触发连接关闭事件
this.tryReconnect(); // 尝试重连
// this.tryReconnect(); // 尝试重连
});
// 监听WebSocket错误事件
@@ -106,7 +106,7 @@ export default class WebSocketUtil {
*/
on(event, callback) {
if (this.callbacks[event]) {
this.callbacks[event].push(callback);
this.callbacks[event] = [callback];
}
return this;
}
@@ -24,7 +24,8 @@
watch:{
mdString: {
handler(val){
this.contentHtml = this.parseContent(val)
let _text = val.replace(/</g,'&lt;').replace(/>/g,'&gt;')
this.contentHtml = this.parseContent(_text)
},
deep: true,
immediate: true
+1
View File
@@ -590,6 +590,7 @@
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom",
"screenOrientation": "portrait",
"app-plus": {
"titleView": false,
"bounce": "none",
+41 -18
View File
@@ -107,36 +107,36 @@
</view>
</view>
</view>
<view class="evaluation-box dens" v-if="loading">
<view class="evaluation-box dens" v-if="loading1">
<CommonLoading color="#06f" class="loading-box" />
</view>
<view class="evaluation-box dens" v-if="!loading">
<view class="evaluation-box dens" v-if="!loading1">
<view class="dens-item" v-for="(item, index) in dimesionList">
<view :class="['item-title', index%2===0?'study1-tip': 'study2-tip']">{{item.title}}</view>
<view :class="['item-cont ', index%2===0?'study1-bg': 'study2-bg']">{{item.content}}</view>
</view>
</view>
<view class="evaluation-box study" v-if="loading">
<view class="evaluation-box study" v-if="loading2">
<CommonLoading color="#06f" class="loading-box" />
</view>
<view class="evaluation-box study" v-if="!loading">
<view class="evaluation-box study" v-if="!loading2">
<view class="study-item" v-for="(item, index) in studyList">
<view :class="['item-title', index%2===0?'study1-tip': 'study2-tip']">{{item.title}}</view>
<view :class="['item-cont ', index%2===0?'study1-bg': 'study2-bg']">{{item.content}}</view>
</view>
</view>
<view class="evaluation-box study1" v-if="loading">
<view class="evaluation-box study1" v-if="loading3">
<CommonLoading color="#06f" class="loading-box" />
</view>
<view class="evaluation-box study1" v-if="!loading">
<view class="evaluation-box study1" v-if="!loading3">
<view class="study1-item">
<view class="item-cont study3-bg">{{suggestObj.content}}</view>
</view>
</view>
<view class="evaluation-box course" v-if="loading">
<view class="evaluation-box course" v-if="loading4">
<CommonLoading color="#06f" class="loading-box" />
</view>
<view class="evaluation-box course" v-if="!loading">
<view class="evaluation-box course" v-if="!loading4">
<CourseItem v-for="item in courseList" :itemInfo="item" @clickItem="toCourseDetail(item)" />
<view class="empty-box" v-if="courseList.length === 0">暂无数据</view>
</view>
@@ -225,26 +225,45 @@
}
}
const loading = ref(false)
const loading1 = ref(false)
const loading2 = ref(false)
const loading3 = ref(false)
const loading4 = ref(false)
const getInfoNow = async (params) => {
loading.value = true
try {
let _res1 = await queryStudyStatistics(params)
loading2.value = true
loading1.value = true
loading3.value = true
queryStudyStatistics(params).then(_res1 => {
statisticsObj.value = {
..._res1.body
}
let _res2 = await queryDimesionInfo(params)
loading.value = false
}).catch(() => {
loading.value = false
})
queryDimesionInfo(params).then(_res2 => {
dimesionList.value = [..._res2.body]
let _res3 = await queryHabitInfo(params)
loading1.value = false
}).catch(() => {
loading1.value = false
})
queryHabitInfo(params).then(_res3 => {
studyList.value = [..._res3.body]
let _res4 = await querySuggestInfo(params)
loading2.value = false
}).catch(() => {
loading2.value = false
})
querySuggestInfo(params).then(_res4 => {
if (_res4.body && _res4.body.length > 0) {
suggestObj.value = {
..._res4.body[0]
}
}
} catch {} finally {
loading.value = false
}
loading3.value = false
}).catch(() => {
loading3.value = false
})
}
// 跳转 课程详情
const toCourseDetail = item => {
@@ -263,9 +282,12 @@
}
const getCrsListNow = () => {
loading4.value = true
queryRecmdCrsInfo().then(res => {
console.log(res)
courseList.value = res.body || []
loading4.value = false
}).catch(() => {
loading4.value = false
})
}
onMounted(() => {
@@ -377,8 +399,9 @@
backdrop-filter: blur(10rpx);
z-index: 1;
&.loading-box-cont{
&.loading-box-cont {
background: #ddeafa;
&::before {
content: '';
display: block;
+1 -1
View File
@@ -694,7 +694,7 @@
voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 0) + 's';
} else {
if (sum === 100) {
voiceTime.value = 0 + 's';
voiceTime.value = (unref(dataInfo).voiceTime || 0) + 's';
return;
}
setTimeout(() => {
+19 -1
View File
@@ -174,6 +174,7 @@
const initRecord = () => {
recordObjCom.value = uni.getRecorderManager();
unref(recordObjCom)?.onStop((res, duration) => {
isRecording.value = false
if(isGettingPermission.value){
isGettingPermission.value = false
return
@@ -196,13 +197,20 @@
});
} else {
closeModel();
emit('uploadVoice', audioPath.value);
emit('uploadVoice', audioPath.value, recordTime.value);
}
} else {
closeModel();
}
});
unref(recordObjCom).onStart(() => {
isRecording.value = true
recordTime.value = 0
setRecordTime()
if(isGettingPermission.value){
isGettingPermission.value = false
return
}
startFlag.value = 1;
setTimeout(() => {
startFlag.value = 2;
@@ -219,6 +227,16 @@
}
});
};
const setRecordTime = () => {
setTimeout(()=>{
if(isRecording.value){
recordTime.value += 1
setRecordTime()
}
},1000)
}
const isRecording = ref(false)
const recordTime = ref(0)
const startFlag = ref(1);
// const canStart = ref(true)
const startRecord = () => {
+3 -2
View File
@@ -839,7 +839,7 @@ const testAnswer = computed(() => {
let _num = _arr.map(t => [1, 2, 6].indexOf(Number(t.type)) >= 0).filter(t => !!t)
return _num.length < 5
})
const uploadRecordNow = voicePath => {
const uploadRecordNow = (voicePath, voiceTime) => {
if (!testAnswer.value) {
common.msg('每个问题最多连续发送五次答案!')
return
@@ -911,7 +911,8 @@ const uploadRecordNow = voicePath => {
userInfo: {
...choiceTeacherInfo.value
},
id: _id
id: _id,
voiceTime: voiceTime
}
} else {
return t
+1 -1
View File
@@ -131,7 +131,7 @@ import { onUnload } from '@dcloudio/uni-app';
voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 1 ) + 's'
}else{
if(sum === 20) {
voiceTime.value = 0 + 's'
voiceTime.value = (unref(dataInfo).voiceTime || 0) + 's';
return
}
setTimeout(()=>{
+6 -2
View File
@@ -662,7 +662,7 @@
submitAnswerNow(item);
};
//
const uploadRecordNow = (voicePath) => {
const uploadRecordNow = (voicePath, voiceTime) => {
// /traask/traAskchat/voiceTrans
//#ifndef APP-PLUS
// h5
@@ -683,7 +683,8 @@
intrctContent: _res.body.transContent,
bucketKey: _res.body.fileId,
ossFileAddr: _res.body.ossFileAddr,
talkingVoice: voicePath
talkingVoice: voicePath,
voiceTime: voiceTime
};
sendMessage({
commond: 'ASK',
@@ -791,6 +792,9 @@
initsocketTask();
};
onLoad(() => {
//#ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary')
// #endif
changeAppHeightBottom();
if (!common.isLogin()) {
common.navigateTo('/pages/login/login');
+8 -4
View File
@@ -130,8 +130,12 @@
talkUserVoiceObj.value.onError(() => {
talkUserVoiceObj.value.src = ''
})
talkUserVoiceObj.value.onCanplay(() => {
setVoiceTime(0)
})
itemVoice.value = unref(dataInfo).talkingVoice
talkUserVoiceObj.value.src = itemVoice.value
talkUserVoiceObj.value.sessionCategory = 'soloAmbient'
//#ifdef APP-PLUS
//
if (IsAndEnv) {
@@ -141,9 +145,9 @@
// talkUserVoiceObj.value.pause()
}
// #endif
setTimeout(() => {
setVoiceTime(0)
}, 100)
// setTimeout(() => {
// setVoiceTime(0)
// }, 100)
}
const isTesting = ref(false)
const setVoiceTime = (sum) => {
@@ -152,7 +156,7 @@
voiceTime.value = (Math.ceil(talkUserVoiceObj.value.duration) || 1) + 's'
} else {
if (sum === 20) {
voiceTime.value = 0 + 's'
voiceTime.value = (props.dataInfo.voiceTime|| 0) + 's'
return
}
setTimeout(() => {
@@ -16,7 +16,7 @@
:isAnswering="props.isAnswering" @handleEvents="handleEvents" :activeVoiceId="activeVoiceId">
</answerVue>
<view v-else></view>
<view class="talking-tips" v-if="talkingType === 'answer' && !isExam">
<view class="talking-tips" v-if="talkingType === 'answer' && !isExam && isLast">
<view class="talking-tips-btn" @click="getTips()">回答提示</view>
<view class="talking-tips-loading" v-if="loadingTips">
<CommonLoading color="#06f" />
+15 -1
View File
@@ -127,6 +127,7 @@
const initRecord = () => {
recordObjCom.value = uni.getRecorderManager();
unref(recordObjCom)?.onStop((res, duration) => {
isRecording.value = false
if(isGettingPermission.value){
isGettingPermission.value = false
return
@@ -141,13 +142,16 @@
});
} else {
closeModel();
emit('uploadVoice', audioPath.value);
emit('uploadVoice', audioPath.value, recordTime.value);
}
} else {
closeModel();
}
});
unref(recordObjCom).onStart(() => {
isRecording.value = true
recordTime.value = 0
setRecordTime()
if(isGettingPermission.value){
stopRecord();
return
@@ -167,6 +171,16 @@
}
});
};
const setRecordTime = () => {
setTimeout(()=>{
if(isRecording.value){
recordTime.value += 1
setRecordTime()
}
},1000)
}
const isRecording = ref(false)
const recordTime = ref(0)
const startFlag = ref(1);
const startRecord = () => {
isStartNum.value += 1;
+5 -1
View File
@@ -18,7 +18,8 @@
</view>
<view class="body-top-item"> 已陪练次数{{ detailInfo.practiceTimes }} </view>
<view class="body-top-item"> 类型{{ detailInfo.traInterTypDesc }} </view>
<view class="body-top-item"> 截止时间{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}}</view>
<view :class="['body-top-item',detailInfo.limitTyp === '01'?'':'full' ]"> 截止时间{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}}</view>
<view class="body-top-item"> 通过分数{{detailInfo.passGrade || 0}} </view>
<scroll-view class="body-top-tags" :scroll-x="true">
<view class="item-tag-view">
<view class="item-tag active-tag" v-for="item in detailInfo.traPartnerTagList || []">
@@ -296,6 +297,9 @@
display: inline-block;
width: 50%;
margin-bottom: 15rpx;
&.full{
width: 100%;
}
}
&-tags {
+62 -32
View File
@@ -104,6 +104,7 @@
onShow,
onLoad,
onUnload,
onLaunch,
onBackPress
} from '@dcloudio/uni-app';
import common from '@/common/common';
@@ -188,7 +189,7 @@
}, time);
});
};
const uploadRecordNow = (voicePath) => {
const uploadRecordNow = (voicePath, voiceTime) => {
//#ifndef APP-PLUS
// h5
// #endif
@@ -199,6 +200,8 @@
isLoading: true
});
scrollToBottomNow();
//
answerIsOver.value = false
commonUploadVoiceFile(voicePath, '/trapractice/traPartnerChat/voiceTrans', {})
.then((_res) => {
if (!!(_res.body.transContent || '').trim()) {
@@ -208,13 +211,15 @@
intrctContent: _res.body.transContent,
fileId: _res.body.fileId,
ossFileAddr: _res.body.ossFileAddr,
talkingVoice: voicePath
talkingVoice: voicePath,
voiceTime: voiceTime
};
sendMessage({
commond: 'ASK',
body: askData.value
});
} else {
answerIsOver.value = true
talkingList.value.pop();
uni.showToast({
title: '未识别到文字',
@@ -224,6 +229,7 @@
}
})
.catch((err) => {
answerIsOver.value = true
talkingList.value.pop();
uni.showToast({
title: '系统异常,请联系管理员',
@@ -294,8 +300,10 @@
common
.show('提示信息', '网络环境不稳定,请重试!', false, '', '确认')
.then((res) => {
reconcatNum.value += 1;
common.redirectTo(`/pages/index/dialog`);
overNow(()=>{
reconcatNum.value += 1;
common.redirectTo(`/pages/index/dialog`);
})
})
.finally(() => {
showModelComfirm.value = false;
@@ -310,6 +318,7 @@
let _id = new Date().getTime() + 'id';
if (rtnCode === '0000') {
if (commond === 'ASK-OPEN') {
console.log('ASK-OPEN', body)
//
sendMessage({
commond: 'ASK-START',
@@ -323,7 +332,7 @@
return;
}
if (commond === 'ASK-START') {
// console.log('')
console.log('开启对话!', body)
execId.value = body.execId;
return;
}
@@ -332,7 +341,9 @@
console.log(body);
console.log(talkingList.value[talkingList.value.length - 1].isLoading);
if (talkingList.value.length > 0 && talkingList.value[talkingList.value.length - 1].isLoading) {
talkingList.value.pop();
talkingList.value = talkingList.value.filter(t => {
return !(t.type === 'question' && t.isLoading)
})
}
// seqNo.value = body.seqNo;
// touchBtnCallBack.value && touchBtnCallBack.value();
@@ -367,7 +378,10 @@
if (body.event === 'start') {
answerIsOver.value = false;
answerText.value = '';
talkingList.value.pop();
// talkingList.value.pop();
talkingList.value = talkingList.value.filter(t => {
return !(t.type === 'answer' && t.isLoading)
})
talkingList.value.push({
type: 'answer',
talkingText: answerText.value,
@@ -410,12 +424,12 @@
return;
}
if (commond === 'ASK-OVER') {
console.log(body );
console.log(body);
console.log('陪练已结束,去结果页面!');
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' : ''))
return;
}
} else {
@@ -436,28 +450,35 @@
const overTalking = () => {
common.show('提示', '确定结束陪练吗?').then(res => {
if (res) {
partnerChatReportTrigger({
execId: execId.value,
traId: traId.value,
talkingType: isPreview.value ? 'preview' : 'practice'
}).then(res => {
watchFlag.value = 1;
sendMessage({
commond: 'ASK-STOP',
body: {
execId: execId.value || ''
}
})
socketStore?.closeSocket();
changePlayItemId('')
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':''))
// })
})
overNow()
}
})
}
const overNow = (cb= ()=>{}) => {
partnerChatReportTrigger({
execId: execId.value,
traId: traId.value,
talkingType: isPreview.value ? 'preview' : 'practice'
}).then(res => {
watchFlag.value = 1;
sendMessage({
commond: 'ASK-STOP',
body: {
execId: execId.value || ''
}
})
socketStore?.closeSocket();
changePlayItemId('')
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':''))
// })
}).catch(()=>{
cb()
})
}
const sendMessage = (data) => {
unref(SocketObj).send(data);
@@ -471,8 +492,13 @@
talkingType.value = params.type;
isPreview.value = params.isPreview === '1'
getDetailInfo()
console.log('onLoad')
//#ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary')
// #endif
});
onUnload(() => {
console.log('onUnload')
watchFlag.value = 1;
sendMessage({
commond: 'ASK-STOP',
@@ -481,7 +507,11 @@
}
})
socketStore?.closeSocket();
execId.value = ''
});
onLaunch(() => {
console.log('onLaunch')
})
onMounted(() => {
// getDetailInfo()
})
+1
View File
@@ -103,6 +103,7 @@
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom",
"screenOrientation": "portrait",
"app-plus": {
"titleView": false,
"bounce": "none",