diff --git a/.env.development b/.env.development index 0d147a26..7ba07e60 100644 --- a/.env.development +++ b/.env.development @@ -7,10 +7,12 @@ ENV = 'development' VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001' + # 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' diff --git a/src/api/common.js b/src/api/common.js index 60856621..1bc5e8e7 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -99,7 +99,7 @@ export const commonUploadVoiceFile = (file, url, data = {}, fileKey = 'voice') = } else if (res.rtnCode === '0004') { return reject('N'); } - return reject('Other'); + return reject(res); } catch (error) { reject(error); } diff --git a/src/pages/course/components/touchBtn.vue b/src/pages/course/components/touchBtn.vue index 2644c7ff..0655014d 100644 --- a/src/pages/course/components/touchBtn.vue +++ b/src/pages/course/components/touchBtn.vue @@ -164,13 +164,13 @@ // 录音 const audioPath = ref(''); const audioObj = uni.createInnerAudioContext(); + const isGettingPermission = ref(false) //#ifdef APP-PLUS // app端 const recordObjCom = ref({}); const IsAndEnv = getPhoneEnvBool('AND'); const isStartNum = ref(0); const isStopNum = ref(0); - const isGettingPermission = ref(false) const initRecord = () => { recordObjCom.value = uni.getRecorderManager(); unref(recordObjCom)?.onStop((res, duration) => { @@ -302,6 +302,7 @@ const getRecordPermission = async (obj) => { if (isDisabled.value) return; + //#ifdef APP-PLUS if (isTalking.value) { common.msg('操作频繁,请稍后重试!'); setTimeout(() => { @@ -309,7 +310,6 @@ }, 500); return; } - //#ifdef APP-PLUS if (!hasPermission.value) { let _res = await getPermission() if (_res) { @@ -326,6 +326,9 @@ showOverlayTalking(obj); } // #endif + //#ifdef H5 + showOverlayTalking(obj); + // #endif }; const getPermission = async () => { //#ifdef APP-PLUS @@ -380,7 +383,9 @@ const showOverlayTalking = (obj) => { if (showTalkingModel.value) return; if (isGettingPermission.value) { + //#ifdef APP-PLUS stopRecord() + // #endif isGettingPermission.value = false return } @@ -416,6 +421,9 @@ // canStart.value = false startRecord(); // #endif + //#ifdef H5 + showTalkingModel.value = true + // #endif setTimeout(() => { if (_recnum === recNum.value) { hideOverlayTalking(recNum.value); @@ -436,15 +444,18 @@ //#ifdef APP-PLUS stopRecord(); // #endif + //#ifdef H5 + showTalkingModel.value = false + // #endif }; const handleMove = (obj) => { if (isMoving.value) { touchX.value = obj.changedTouches[0].pageX; touchY.value = obj.changedTouches[0].pageY; - if (outScreen.value) { - hideOverlayTalking(obj); - } + // if (outScreen.value) { + // hideOverlayTalking(obj); + // } } }; // 发送文本 diff --git a/src/pages/sparring/tip.vue b/src/pages/sparring/tip.vue index fec97659..048d7499 100644 --- a/src/pages/sparring/tip.vue +++ b/src/pages/sparring/tip.vue @@ -213,7 +213,7 @@ const uploadRecordNow = (voicePath, voiceTime) => { answerIsOver.value = true talkingList.value.pop() uni.showToast({ - title: '系统异常,请联系管理员', + title: err?.message || '网络异常,请联系管理员', icon: 'none', duration: 1000 })