From e0316f82b9ec66b19fb510250e05d7584bec26ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Tue, 2 Sep 2025 13:44:24 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 10 +++--- src/pages/course/study.vue | 63 ++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/.env.development b/.env.development index 44372854..7ddd909a 100644 --- a/.env.development +++ b/.env.development @@ -15,18 +15,18 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' # h5专用地址 -VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002' +# VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002' #VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002' -# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001' +VITE_APP_BASE_H5_API_Url = 'http://25.18.122.67:7001' #VITE_APP_BASE_H5_API_Url = 'http://25.18.122.116:7001' # 任东 -# 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_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_TRAEXAM = 'http://25.64.16.130:9604' # 张建成 # VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605' -VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.144:9602' +# VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.144:9602' # 王洋洋 # VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604' # 于嘉文 diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 4ff2eea2..77821c3c 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -35,7 +35,7 @@ 开启学习之旅 - + {{ chooseRate }}倍 @@ -80,7 +80,7 @@ :isLoading="isUploadingVoice" :onlyVoice="answerOnlyVoice" :canAnswer="testAnswer" - :adjustPosition="true" + :adjustPosition="true" :canAnswerText="'每个问题最多连续发送五次答案!'" :isDisabled="(lastTalkingInfo.type || 0) !== 4" /> @@ -124,7 +124,7 @@ import { reactive, ref, computed, unref, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue' import { onLoad, onShow, onUnload, onHide } from '@dcloudio/uni-app' import { previewFile, downloadFile, commonUploadVoiceFile, downloadVoiceFile, uploadVoiceFile } from '@/api/common.js' -import { getToken } from '@/common/common.js' +import { getToken, getPhoneEnvBool } from '@/common/common.js' import { get_base_url, goto_login_fun } from '@/api/request' import { getCourseStudyInfoApi, afreshStudyCourseApi, queryQuestionEvalateApi, textChartApi, setStudyTeacherApi, textChartPreviewApi, previewAfreshStudyCourse } from '@/api/study.js' import common from '@/common/common' @@ -155,6 +155,7 @@ const inputRef = ref('') const flagVal = ref('1') const isUploadingVoice = ref(false) const isPreview = ref(false) +const IsAndEnv = ref(getPhoneEnvBool('AND')) const ajaxApi = computed(() => (isPreview.value ? textChartPreviewApi : textChartApi)) @@ -348,7 +349,7 @@ const showOrder = ref(0) const isLastPgrph = ref(false) const backRouter = () => { // common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`) - uni.$emit('refresh_course_list'); + uni.$emit('refresh_course_list') common.navigateBack() } @@ -397,7 +398,7 @@ const getGraphInfoUnStudy = (flag = 0) => { }) .finally(() => {}) } - uni.$emit('refresh_course_list'); + uni.$emit('refresh_course_list') return } lastTalkingInfo.value = { @@ -667,7 +668,7 @@ const sendMessage = data => { const startPgrphId = ref('') const imageId = ref('') onLoad(params => { - changeAppHeightBottom() + changeAppHeightBottom() watchFlag.value = 1 isPreview.value = params.isPreview === 'preview' crsId.value = params.crsId || '' @@ -687,21 +688,21 @@ const setHeight = res => { // scrollToBottomNow() } - const keyBoardIsHide = computed(() => { - return parseInt(keyboardHeight.value) == 0 - }) - const bottomHeight = ref('0px') - const totalBotHeight = computed(()=> { - return keyBoardIsHide.value ? 0 + 'px': parseInt(keyboardHeight.value) - parseInt(bottomHeight.value) + 'px' - }) - const changeAppHeightBottom = (height) => { - //#ifdef APP-PLUS - // 获取系统信息 - const systemInfo = uni.getSystemInfoSync(); - // 计算安全区域底部高度 - bottomHeight.value = systemInfo.screenHeight - systemInfo.safeArea.bottom + 'px' - // #endif - } +const keyBoardIsHide = computed(() => { + return parseInt(keyboardHeight.value) == 0 +}) +const bottomHeight = ref('0px') +const totalBotHeight = computed(() => { + return keyBoardIsHide.value ? 0 + 'px' : parseInt(keyboardHeight.value) - parseInt(bottomHeight.value) + 'px' +}) +const changeAppHeightBottom = height => { + //#ifdef APP-PLUS + // 获取系统信息 + const systemInfo = uni.getSystemInfoSync() + // 计算安全区域底部高度 + bottomHeight.value = systemInfo.screenHeight - systemInfo.safeArea.bottom + 'px' + // #endif +} onHide(() => { //#ifdef APP-PLUS uni.offKeyboardHeightChange(setHeight) @@ -788,7 +789,7 @@ const uploadRecordNow = voicePath => { }) .then(res => { let _res = JSON.parse(res.data) - console.log(_res) + console.log(_res) if (_res.rtnCode === '0000') { talkingList.value = talkingList.value.map(t => { if (t.id === _id) { @@ -800,8 +801,8 @@ const uploadRecordNow = voicePath => { talkingContent: '', talkingVoice: voicePath, recordId: _res.body.chatBody.recordId, - asrStartTm: unref(lastTalkingInfo).asrStartTm, - stdyPgrphId: _res.body.chatBody.stdyPgrphId, + asrStartTm: unref(lastTalkingInfo).asrStartTm, + stdyPgrphId: _res.body.chatBody.stdyPgrphId, type: 1, userInfo: { ...choiceTeacherInfo.value @@ -812,18 +813,18 @@ const uploadRecordNow = voicePath => { return t } }) - console.log(11111,_res.body.chatBody) + console.log(11111, _res.body.chatBody) scrollToBottomNow() } else { } setIsUploadingVoice() }) .catch(err => { - console.log('err',err) + console.log('err', err) setIsUploadingVoice() talkingList.value = talkingList.value.filter(t => t.id !== _id) uni.showToast({ - title: '系统异常,请联系管理员', + title: err.message || '系统异常,请联系管理员', icon: 'none', duration: 1000 }) @@ -1057,7 +1058,7 @@ const chooseRateNow = item => { } -