Merge branch 'develop' of http://25.13.9.101:9000/K17_AITS/tra-app into develop

This commit is contained in:
2025-12-08 20:12:12 +08:00
2 changed files with 43 additions and 5 deletions
+3 -3
View File
@@ -4,11 +4,11 @@ ENV = 'development.yh'
# 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.78: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'
# VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.156:9603'
VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.156:9603'
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.32.154:9601'
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.32.158:9601'
# VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.32.154:9602'
+40 -2
View File
@@ -122,7 +122,7 @@
<script setup>
import { ref, unref, onMounted, computed, nextTick } from 'vue';
import { onShow, onLoad, onUnload, onLaunch, onBackPress } from '@dcloudio/uni-app';
import { onShow, onHide, onLoad, onUnload, onLaunch, onBackPress } from '@dcloudio/uni-app';
import common from '@/common/common';
import {getPhoneEnvBool} from '@/common/common';
import TouchBtn from './components/touchBtn.vue';
@@ -293,6 +293,7 @@
const reconcatNum = ref(0);
const answerText = ref('');
const touchBtnCallBack = ref(null);
let isLeave = false
const initsocketTask = () => {
let _src = isPreview.value ? '/trapractice/previewsocket/open' : '/trapractice/partnersocket/open';
socketStore.creatSocket(_src + '?summary=');
@@ -343,6 +344,12 @@
execId: execId.value || ''
}
});
sendMessage({
commond: 'ASK-PING',
body: {
execId: execId.value || ''
}
})
return;
}
if (commond === 'ASK-START') {
@@ -452,6 +459,18 @@
);
return;
}
if (commond === 'ASK-PONG') {
console.log('PONG')
if(isLeave) return
setTimeout(()=>{
sendMessage({
commond: 'ASK-PING',
body: {
execId: execId.value || ''
}
})
}, 30000)
}
} else {
if (['0005', 'QQ0005'].includes(res.rtnCode)) {
goto_login_fun();
@@ -510,9 +529,28 @@
};
const sendMessage = (data) => {
unref(SocketObj).send(data);
if(data.commond == 'ASK-PING'){
console.log('PING')
}
};
// let timer = null
//#ifdef APP-PLUS
onShow(() => {});
onShow(() => {
isLeave = false
// timer = setInterval(() => {
// sendMessage({
// commond: 'ASK-PING',
// body: {
// execId: execId.value || ''
// }
// }, 1000)
// })
});
onHide(() => {
isLeave = true
// clearInterval(timer)
// timer = null
})
// #endif
onLoad((params) => {
traId.value = params.traId;