Merge branch 'develop' into 'sit'

Develop

See merge request K17_AITS/tra-app!155
This commit is contained in:
田岩
2025-09-18 10:49:52 +08:00
13 changed files with 1840 additions and 1698 deletions
+3 -3
View File
@@ -24,16 +24,16 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# dev
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7002'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
# sit
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.92:9786'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.92:9786'
# UAT
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
# 任东
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
# VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604'
# 张建成
+6 -4
View File
@@ -86,22 +86,24 @@ export const commonUploadVoiceFile = (file, url, data = {}, fileKey = 'voice') =
filePath: file,
name: fileKey,
formData: data,
timeout: 6000,
success(result) {
try {
const res = JSON.parse(result.data);
if (res.rtnCode === '0000') {
resolve(result);
return resolve(result);
} else if (REQUES_ERROR_CODES['NO_LOGIN'].includes(res.rtnCode)) {
goto_login_fun()
} else {
reject(new Error(res.message));
return reject('NO_LOGIN');
}
return reject('Other');
} catch (error) {
reject(new Error('Failed to parse response'));
}
},
fail(error) {
reject(new Error('Upload failed'));
console.log('err', error);
return reject('Other');
}
});
});
+15 -10
View File
@@ -81,9 +81,9 @@
import { computed, unref, ref, toRefs, watch, onMounted, nextTick } from 'vue';
import { onUnload } from '@dcloudio/uni-app';
// import { useinnerAudio, useAudioFun } from '@/store/innerAudio';
import { useAudio } from './useAudio.js';
import {downloadFile} from '@/api/common.js'
import { downloadFile } from '@/api/common.js';
const props = defineProps({
dataInfo: {
default: () => ({}),
@@ -128,7 +128,7 @@
});
const innerAudio = useAudio();
const status = computed(() => props.status);
watch(
() => props.status,
@@ -157,6 +157,9 @@
nextTick(() => {
textShow.value = true;
});
setTimeout(() => {
voiceTime.value = '';
}, 0);
}
emit('buutton_click', type, props.dataInfo);
};
@@ -173,7 +176,7 @@
textShow.value = false;
}
};
const playVoice = () => {
// isPlaying.value = true;
console.log('点击播放');
@@ -206,20 +209,22 @@
// 赋值显示
console.log('displayTime', displayTime);
voiceTime.value = displayTime + 's';
console.log('displayTime', voiceTime.value);
});
watch(
() => props.dataInfo.voicePath,
(newVal) => {
console.log('newVal', newVal);
if(newVal === '' && props.dataInfo.ossKey) { // 去下载oss内容
if (newVal === '' && props.dataInfo.ossKey) {
// 去下载oss内容
console.log('去下载oss内容');
downloadFile(props.dataInfo.ossKey).then(res => {
downloadFile(props.dataInfo.ossKey).then((res) => {
voiceTime.value = '';
innerAudio.setAudioSrc(res.tempFilePath);
})
} else if(newVal === undefined){
});
} else if (newVal === undefined) {
innerAudio.stopAudio();
} else {
voiceTime.value = '';
innerAudio.setAudioSrc(newVal);
}
},
+14 -6
View File
@@ -148,6 +148,7 @@
};
// 结束录音
const stopRecord = (status = false) => {
console.log('结束录音stopRecord', status);
if (props.isDisabled) return;
if (startTimer.value) {
clearTimeout(startTimer.value);
@@ -162,10 +163,12 @@
const times = Math.max(500 - endTime + startTime, 0);
setTimeout(() => {
console.log('延迟数据', times);
nextTick(() => {
popupRef.value.close();
recorderManager.stop();
});
// nextTick(() => {
// });
popupRef.value.close();
console.log('停止录音');
recorderManager.stop();
}, times);
}
nextTick(() => (recordingStatus.value = 'not_started'));
@@ -181,13 +184,18 @@
console.log('说话时长', recordDuration);
if (props.minRecordDuration > recordDuration) {
nextTick(() => common.msg('说话时间太短,没有听清!'));
// console.log('说话时间太短,没有听清');
return;
}
stopRecord(true); // 在去主动执行一次关闭
popupRef.value?.close();
recordingStatus.value = 'not_started'
// stopRecord(true); // 在去主动执行一次关闭
console.log('录音结束,时长:', recordDuration, '秒');
emit('submit', 'voice', res.tempFilePath);
});
recorderManager.onError(function (err) {
console.log('录音错误', err);
});
recorderManager.onStart(function (res) {
// 检测是否已经抬手结束了
console.log('检测是否已经抬手结束了', recordingStatus.value);
+2 -1
View File
@@ -31,4 +31,5 @@ export const SUBJECT_TYPE = [{
value: "ES",
label: "问答题",
}
]
]
export const defaultAvatar = '/static/images/me/default_user_avatar.png'
File diff suppressed because it is too large Load Diff
+724 -745
View File
File diff suppressed because it is too large Load Diff
+30 -32
View File
@@ -82,7 +82,7 @@
:canAnswer="testAnswer"
:adjustPosition="true"
:canAnswerText="canAnswerText"
:isDisabled="(lastTalkingInfo.type || 0) !== 4 || ['SN','MU','JD'].includes(lastTalkingInfo.qnsTyp)"/>
:isDisabled="(lastTalkingInfo.type || 0) !== 4 || ['SN', 'MU', 'JD'].includes(lastTalkingInfo.qnsTyp)" />
</view>
<uv-overlay :show="showSeekModel" opacity=".6" @click="showSeekModel = false">
<view class="overlay-box">
@@ -166,7 +166,7 @@ const pageTopPadding = computed(() => statusBarHeight + 'px')
const isContinue = ref('N')
// 初始化数据
const getData = async flag => {
isContinue.value = "N"
isContinue.value = 'N'
try {
const { body } = await getCourseStudyInfoApi({
crsId: crsId.value
@@ -179,11 +179,11 @@ const getData = async flag => {
if (isPreview.value) {
resStartStudyNow(body.teacheList)
} else {
if(body.isStdyFinish === 'Y'){
// 重新学习
resStartStudyNow(body.teacheList)
return
}
if (body.isStdyFinish === 'Y') {
// 重新学习
resStartStudyNow(body.teacheList)
return
}
if (body.stdyProgressFlag === 'N') {
step.value = 1
} else {
@@ -207,7 +207,7 @@ const getData = async flag => {
// 继续学习 获取学习历史接口
// 滚动到最下面
scrollToBottomNow()
isContinue.value = "Y"
isContinue.value = 'Y'
sendMessage({
commond: 'STDY',
body: {
@@ -342,7 +342,7 @@ const nextStep = () => {
crsId: crsId.value,
teacherNo: choiceTeacher.value,
studyType: isPreview.value ? 'P' : 'S',
isContinue: isContinue.value
isContinue: isContinue.value
}
})
step.value = 2
@@ -369,7 +369,7 @@ const answerOnlyVoice = computed(() => {
})
const canAnswerText = computed(() => {
return '每个问题最多连续发送五次答案!'
return '每个问题最多连续发送五次答案!'
})
const oldStdyId = ref('')
@@ -380,8 +380,8 @@ const getGraphInfoUnStudy = (flag = 0) => {
crsId: crsId.value,
stdyId: unref(stdyId),
stdyBatch: unref(stdyBatch),
oldStdyId: unref(oldStdyId),
isContinue: isContinue.value
oldStdyId: unref(oldStdyId),
isContinue: isContinue.value
}
if (flag === 1 && !!startPgrphId.value) {
_data.pgrphId = startPgrphId.value
@@ -400,7 +400,7 @@ const getGraphInfoUnStudy = (flag = 0) => {
common
.show('提示', '您已学完全部知识点', false)
.then(res => {
common.navigateBack()
common.navigateBack()
// common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&isPreview=true`)
})
.finally(() => {})
@@ -413,7 +413,7 @@ const getGraphInfoUnStudy = (flag = 0) => {
common.redirectTo(`/pages/courseDetail/submit?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&imgId=${imageId.value}`)
} else {
// 取消
common.navigateBack()
common.navigateBack()
// common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}
})
@@ -525,8 +525,8 @@ const nextQuestionSuccess = (info, type = 'next') => {
stdyId: unref(stdyId),
pgrphId: info?.pgrphId,
logId: info?.logId,
oldStdyId: unref(oldStdyId),
isContinue: isContinue.value
oldStdyId: unref(oldStdyId),
isContinue: isContinue.value
})
}).then(res => {
talkingList.value.push({
@@ -562,9 +562,9 @@ const nextQuestionSuccess = (info, type = 'next') => {
processType: 'NEW-ANSER', //NEW-KNOW
requestBody: JSON.stringify({
stdyId: unref(stdyId),
stdyPgrphId: info.stdyPgrphId,
qnsId: info.qnsId
})
stdyPgrphId: info.stdyPgrphId,
qnsId: info.qnsId
})
}).then(res => {
let _body = res.body || {}
if (!_body.chatBody) {
@@ -603,7 +603,7 @@ const nextQuestionSuccess = (info, type = 'next') => {
requestBody: JSON.stringify({
logId: unref(logId),
pgrphId: info.pgrphId,
stdyId: unref(stdyId)
stdyId: unref(stdyId)
})
}).then(res => {
let _body = res.body || {}
@@ -664,7 +664,7 @@ const initsocketTask = () => {
if (commond === 'STDYBTH' && !stdyId.value) {
stdyId.value = body.stdyId || ''
stdyBatch.value = body.stdyBatch || ''
oldStdyId.value = body.oldStdyId || ''
oldStdyId.value = body.oldStdyId || ''
logId.value = body.logId || ''
getGraphInfoUnStudy(1)
step.value = 2
@@ -722,13 +722,11 @@ const changeAppHeightBottom = height => {
// #endif
}
onHide(() => {
console.log('onHide')
changePlayItemId('')
socketStore.closeSocket()
//#ifdef APP-PLUS
uni.offKeyboardHeightChange(setHeight)
// #endif
// if (watchFlag.value === 1) return
changePlayItemId('')
socketStore.closeSocket()
// common.show('提示信息', '检测到您已离开,即将退出学习页面。',false, '','确认').then((res) => {
// common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
// }).finally(() => {})
@@ -747,11 +745,11 @@ onUnload(() => {
console.log('onUnload')
socketStore.closeSocket()
changePlayItemId('')
console.log(typeof teacherVoiceObj);
try{
teacherVoiceObj?.stop()
teacherVoiceObj.src = ''
// 0910杨航叫我这么改的
console.log(typeof teacherVoiceObj)
try {
teacherVoiceObj?.stop()
teacherVoiceObj.src = ''
// 0910杨航叫我这么改的
} catch {}
})
const testAnswer = computed(() => {
@@ -810,7 +808,7 @@ const uploadRecordNow = voicePath => {
id: _id
})
scrollToBottomNow()
let _path = isPreview.value ? '/trastudy/traStdychat/previewVoiceChart' : '/trastudy/traStdychat/voiceChart'
let _path = isPreview.value ? '/trastudy/traStdychat/previewVoiceChart' : '/trastudy/traStdychat/voiceChart'
commonUploadVoiceFile(voicePath, _path, {
processType: 'ANSER-VOICE',
requestBody: JSON.stringify(_data)
@@ -933,7 +931,7 @@ const withdrawNow = data => {
const loadingExecLogId = ref('')
const answerQuestionNow = data => {
let _data = {
stdyId: unref(stdyId),
stdyId: unref(stdyId),
qnsId: data.qnsId, // 问题ID 必输项:true 类型:String
pgrphId: data.pgrphId, // 段落ID 必输项:true 类型:String
crsId: crsId.value, // 课程ID 必输项:true 类型:String
+7 -3
View File
@@ -28,7 +28,8 @@
</view>
<view class="user-column">
<view class="avatar-box">
<image-preview class="avatar-image" :src="item.ossKey" mode="aspectFit"></image-preview>
<image-preview v-if="item.ossAddr" class="avatar-image" :src="item.ossAddr" mode="aspectFit"></image-preview>
<image v-else class="avatar-image" :src="defaultAvatarSrc"></image>
</view>
<view class="user-name">{{item.userName}}</view>
<view class="user-org">{{item.orgName}}</view>
@@ -48,7 +49,8 @@
</view>
<view class="user-column">
<view class="avatar-box">
<image-preview class="avatar-image" :src="userRankObj.ossKey" mode="aspectFit"></image-preview>
<image-preview v-if="item.ossAddr" class="avatar-image" :src="userRankObj.ossAddr" mode="aspectFit"></image-preview>
<image class="avatar-image" v-else :src="defaultAvatarSrc"></image>
</view>
<view class="user-name">{{userRankObj.userName}}</view>
<view class="user-org">{{userRankObj.orgName}}</view>
@@ -63,6 +65,7 @@
<script>
import { queryTraCrsRankingList } from "@/api/courseDetail.js"
import { queryPaperExamRankingList } from "@/api/examination.js"
import { defaultAvatar } from "@/enum.js"
import common from '@/common/common'
export default {
data() {
@@ -70,7 +73,8 @@
crsId: '',
papersId : '',
userList: [],
userRankObj:{}
userRankObj:{},
defaultAvatarSrc: defaultAvatar
}
},
onLoad(params){
+9 -8
View File
@@ -190,10 +190,9 @@
papersId: '', // 试卷ID
limitTm: 0, // 考试限制时间
papersName: '', // 试卷名称
isCacheExam: '' ,// 是否是缓存试卷(继续答题试卷)
flagQuery: '' ,
flagQueryDetail: '' ,
isCacheExam: '', // 是否是缓存试卷(继续答题试卷)
flagQuery: '',
flagQueryDetail: ''
}); // 试卷信息
const topicList = reactive([]); // 问题列表
const popup_input_bottom = ref('0px');
@@ -304,6 +303,7 @@
const topic = topicList[questionNumber.value];
touchBtnRef.value?.clearinputText(); // 清除发送框数据
if (type === 'voice') {
if(topic.es_status == '00') return;
topic.es_status = '00'; // 00转圈
const voicePath = submitObj;
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
@@ -326,9 +326,11 @@
}
}
})
.catch((err) => {
.catch((error) => {
topic.es_status = ''; // 取消转圈
common.msg('系统异常,请联系管理员');
if (error === 'Other') {
common.msg('系统异常,请联系管理员');
}
});
} else if (type === 'text') {
topic.es_status = '01';
@@ -339,14 +341,13 @@
}
};
const answerCacheList = ref({});
const setAnswerCacheList = (value) => {
console.log('触发变化', value);
answerCacheList.value = value;
common.setValue(examinationAnswerCacheKey, value);
};
// 添加试题答案缓存
const addTopicAnswerCache = () => {
const my_answer = topic.value.my_answer;
+3 -1
View File
@@ -13,7 +13,7 @@
class="img_100"
:src="user_info.imageAddr"
></image-preview>
<image v-else class="img_100" src="/static/images/me/default_user_avatar.png"></image>
<image v-else class="img_100" :src="defaultAvatarSrc"></image>
</view>
<view class="personal_information_data">
<view class="name_sex_div">
@@ -156,6 +156,8 @@
import { uploadFile } from '@/api/common';
import { setMascot } from '@/common/mascot.js';
import { queryCurrentUser } from '@/api/login.js';
import { defaultAvatar } from "@/enum.js"
const defaultAvatarSrc = computed(()=> defaultAvatar)
const badgeList = [
{
name: '黑铁',
+5 -2
View File
@@ -306,6 +306,7 @@
const topic = topicList[questionNumber.value]
touchBtnRef.value?.clearinputText(); //
if (type === 'voice') {
if(topic.es_status == '00') return;
topic.es_status = '00'; // 00
const voicePath = submitObj;
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
@@ -327,9 +328,11 @@
}
}
})
.catch((err) => {
.catch((error) => {
topic.es_status = ''; //
common.msg('系统异常,请联系管理员');
if (error === 'Other') {
common.msg('系统异常,请联系管理员');
}
});
} else if (type === 'text') {
topic.es_status = '01';
+10 -2
View File
@@ -287,18 +287,24 @@
const touchBtnSubmit = (type, submitObj) => {
const topic = topicList[questionNumber.value];
touchBtnRef.value?.clearinputText(); //
console.log('录音组件提交');
if (type === 'voice') {
if(topic.es_status == '00') return;
topic.es_status = '00'; // 00
const voicePath = submitObj;
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
.then((res) => {
console.log('_contentsssss', res);
let _res = JSON.parse(res.data);
if (_res.rtnCode === '0000') {
const _content = _res.body.transContent.trim();
console.log('_content', _content);
if (_content === '') {
topic.es_status = ''; //
console.log('未识别到文字');
return common.msg('未识别到文字');
} else {
console.log('识别到了文字', _content);
topic.es_status = '02';
topic.my_answer = {
anserResult: _res.body.transContent,
@@ -309,9 +315,11 @@
}
}
})
.catch((err) => {
.catch((error) => {
topic.es_status = ''; //
common.msg('系统异常,请联系管理员');
if (error === 'Other') {
common.msg('系统异常,请联系管理员');
}
});
} else if (type === 'text') {
topic.es_status = '01';