This commit is contained in:
杨航
2025-09-18 09:36:13 +08:00
parent 08aa896325
commit d6e7efc870
2 changed files with 754 additions and 777 deletions
+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