diff --git a/.env.development b/.env.development index fa31ca92..546b18a1 100644 --- a/.env.development +++ b/.env.development @@ -6,15 +6,19 @@ 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' # VITE_APP_BASE_API_Url = 'http://192.168.108.129' # dev + #VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' + # sit #VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786' diff --git a/.env.development.yh b/.env.development.yh index 95d4857d..193ce295 100644 --- a/.env.development.yh +++ b/.env.development.yh @@ -4,8 +4,8 @@ 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' diff --git a/src/pages/preview/components/previewAiSparring.vue b/src/pages/preview/components/previewAiSparring.vue index d3ade402..ebd44546 100644 --- a/src/pages/preview/components/previewAiSparring.vue +++ b/src/pages/preview/components/previewAiSparring.vue @@ -60,16 +60,7 @@ const toSparringDetail = (item) => { if (item.traId) { - checkTraPartnerInfoById({ - traId: item.traId - }).then(res=>{ - if(res.body.inRange){ - // todo - common.navigateTo('/pages/sparring/detail?traId=' + item.traId + '&isPreview=1') - }else{ - common.show(res.body.message) - } - }) + common.navigateTo('/pages/sparring/detail?traId=' + item.traId + '&isPreview=1') } }; onMounted(() => { diff --git a/src/pages/sparring/chooseRole.vue b/src/pages/sparring/chooseRole.vue index b32783a6..974c772c 100644 --- a/src/pages/sparring/chooseRole.vue +++ b/src/pages/sparring/chooseRole.vue @@ -33,7 +33,8 @@ import common from '@/common/common'; import ImagePreview from '@/components/image-preview/image-preview.vue'; import { - queryTraPartnerCharacterInfoList + queryTraPartnerCharacterInfoList, + checkTraPartnerInfoById } from "@/api/sparring.js" import CardSwiper from './components/card-swiper.vue'; const traId = ref('') @@ -41,10 +42,10 @@ const detailInfo = ref({}) const roleList = ref([]) const currentIndex = ref(0) - const activeRole = computed(()=>{ - if(roleList.value.length>0){ + const activeRole = computed(() => { + if (roleList.value.length > 0) { return roleList.value[currentIndex.value] - }else{ + } else { return {} } }) @@ -61,7 +62,21 @@ } const isPreview = ref(false) const toTip = () => { - common.navigateTo('/pages/sparring/tip?traId=' + traId.value + '&chaId=' + activeRole.value.chaId + '&type=' + talkingType.value+ '&isPreview=' + (isPreview.value ?'1':'')) + if (isPreview.value) { + common.navigateTo('/pages/sparring/tip?traId=' + traId.value + '&chaId=' + activeRole.value.chaId + + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ? '1' : '')) + return + } + checkTraPartnerInfoById({ + traId: traId.value + }).then(res => { + if (res.body.inRange) { + common.navigateTo('/pages/sparring/tip?traId=' + traId.value + '&chaId=' + activeRole.value.chaId + + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ? '1' : '')) + } else { + common.show('提示', res.body.message, false) + } + }) } onLoad((params) => { traId.value = params.traId; @@ -82,6 +97,7 @@ flex-direction: column; background-image: url(@/static/images/sparring/bg.png); background-size: cover; + .sparring-detail-body { position: absolute; overflow-x: hidden; @@ -169,6 +185,7 @@ overflow: hidden; } } + // .body-card { // flex: 1; // .card { @@ -182,7 +199,7 @@ // transition: all 0.3s ease; // position: relative; // padding: 50rpx 23rpx 23rpx; - + // .img-box { // width: 300rpx; // height: 300rpx; @@ -190,11 +207,11 @@ // overflow: hidden; // margin: 0 auto; // } - + // .card-content { // padding: 24rpx; // } - + // .card-title { // display: flex; // font-size: 29rpx; @@ -207,7 +224,7 @@ // text-align: center; // margin: 33rpx auto; // justify-content: center; - + // &-name{ // margin-right: 20rpx; // line-height: 44rpx; @@ -227,7 +244,7 @@ // width: 30rpx; // } // } - + // .card-item { // width: 100%; // display: block; @@ -254,11 +271,11 @@ // } // } // &-desc{ - + // } // } // } - + // } diff --git a/src/pages/sparring/components/talking-item.vue b/src/pages/sparring/components/talking-item.vue index a5f307cd..5e6b43ba 100644 --- a/src/pages/sparring/components/talking-item.vue +++ b/src/pages/sparring/components/talking-item.vue @@ -18,10 +18,12 @@ 回答提示 + {{tipsContent}} + @@ -92,6 +94,7 @@ const loadingTips = ref(false) const tipsContent = ref('') + const showContent = ref(false) const handleEvents = (type, info = {}) => { emit('handleEvents', { type, @@ -101,24 +104,28 @@ }) } const getTips = () => { - if(tipsContent.value){ - tipsContent.value = '' + if(showContent.value){ + showContent.value = false return } - loadingTips.value = true + showContent.value = true handleEvents('scrollToBottom') - partnerChatPrompt({ - execId: props.execId, - traId: props.traId, - content: props.talkingInfo.talkingText, - chaId: roleInfo.value?.chaId - }).then(res=>{ - tipsContent.value = res.body - loadingTips.value = false + if(!tipsContent.value){ + loadingTips.value = true handleEvents('scrollToBottom') - }).catch(()=> { - loadingTips.value =false - }) + partnerChatPrompt({ + execId: props.execId, + traId: props.traId, + content: props.talkingInfo.talkingText, + chaId: roleInfo.value?.chaId + }).then(res=>{ + tipsContent.value = res.body + loadingTips.value = false + handleEvents('scrollToBottom') + }).catch(()=> { + loadingTips.value =false + }) + } } const changePlay = (id) => { emit('handleEvents', { diff --git a/src/pages/sparring/components/touchBtn.vue b/src/pages/sparring/components/touchBtn.vue index ffb38177..2cc77294 100644 --- a/src/pages/sparring/components/touchBtn.vue +++ b/src/pages/sparring/components/touchBtn.vue @@ -12,8 +12,7 @@ {{'语音对话'}} --> - + @@ -130,6 +129,7 @@ const isStartNum = ref(0); const isStopNum = ref(0); const isGettingPermission = ref(false) + const isHandleClosed = ref(false) const initRecord = () => { recordObjCom.value = uni.getRecorderManager(); unref(recordObjCom)?.onStop((res, duration) => { @@ -173,11 +173,13 @@ setTimeout(() => { startFlag.value = 2; }, 1000); - setRecordTime() - if (isStopNum.value === isStartNum.value) { + if ((isStopNum.value === isStartNum.value) || isHandleClosed.value) { stopRecord(); } else { - showTalkingModel.value = true; + setRecordTime() + if(!showTalkingModel.value){ + showTalkingModel.value = true; + } } }); unref(recordObjCom).onError(() => { @@ -206,6 +208,7 @@ unref(recordObjCom).start({ format: formatType.value }); + // showTalkingModel.value = true; }; const stopRecord = () => { @@ -216,29 +219,33 @@ isGettingPermission.value = false }, 1000) console.log(10, '验证停止方法存在') - closeModel(); + // closeModel(); unref(recordObjCom).stop(); } else { console.log(11, '验证停止方法不存在') isGettingPermission.value = false - closeModel(); + closeModel(); } } catch { console.log(12, '验证错误') isGettingPermission.value = false - closeModel(); + closeModel(); } }; const closeModel = (cb = () => {}) => { console.log(99, '关闭弹窗') isStopNum.value = isStartNum.value; + isHandleClosed.value = true + setTimeout(() => { + if(showTalkingModel.value){ + showTalkingModel.value = false; + } + cb && cb(); + }, 300); setTimeout(() => { isTalking.value = false; - }, 800); - setTimeout(() => { - showTalkingModel.value = false; - cb && cb(); - }, 350); + isHandleClosed.value = false + }, 1000); }; // #endif //#ifndef APP-PLUS @@ -303,7 +310,9 @@ if (IsAndEnv) { let _recordPerm = await permission.requestAndroidPermission('android.permission.RECORD_AUDIO'); if (_recordPerm !== 1) { - showTalkingModel.value = false; + if(showTalkingModel.value){ + showTalkingModel.value = false; + } let res = await common.show('提示信息', '当前页面需要使用的录音权限,是否前往开启?', true, '取消', '确定') if (res) { // 去开启权限 @@ -332,7 +341,6 @@ }); return false } else if (_state === 'not determined') { - // startRecord() return true } else { return true @@ -349,7 +357,9 @@ console.log(3, '权限验证通过,展示录音弹窗') if (showTalkingModel.value) { console.log(4, '默认展开状态关闭,return') - showTalkingModel.value = false + if(showTalkingModel.value){ + showTalkingModel.value = false; + } return }; if (isGettingPermission.value) { @@ -381,7 +391,6 @@ touchY.value = obj.changedTouches[0].pageY; baseY.value = obj.currentTarget.offsetTop; //#ifdef APP-PLUS - // canStart.value = false startRecord(); // #endif setTimeout(() => { @@ -390,7 +399,9 @@ } }, 59 * 1010); } else { - showTalkingModel.value = false; + if(showTalkingModel.value){ + showTalkingModel.value = false; + } uni.showToast({ title: '暂无问题需要回答!', icon: 'none', diff --git a/src/pages/sparring/detail.vue b/src/pages/sparring/detail.vue index e64fb579..11d44505 100644 --- a/src/pages/sparring/detail.vue +++ b/src/pages/sparring/detail.vue @@ -18,7 +18,8 @@ 已陪练次数:{{ detailInfo.practiceTimes }} 类型:{{ detailInfo.traInterTypDesc }} - 截止时间:{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}} + + 截止时间:{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}} 通过分数:{{detailInfo.passGrade || 0}} 分 @@ -89,7 +90,8 @@ import common from '@/common/common' import ImagePreview from '@/components/image-preview/image-preview.vue' import { - queryTraPartnerInfoById + queryTraPartnerInfoById, + checkTraPartnerInfoById } from '@/api/sparring.js' import { previewFileFnc @@ -123,8 +125,23 @@ }) } const toChooseRole = type => { - common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type + '&isPreview=' + (isPreview - .value ? '1' : '')) + if (isPreview.value) { + common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type + '&isPreview=' + ( + isPreview + .value ? '1' : '')) + return + } + checkTraPartnerInfoById({ + traId: traId.value + }).then(res => { + if (res.body.inRange) { + common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type + '&isPreview=' + ( + isPreview + .value ? '1' : '')) + } else { + common.show('提示', res.body.message, false) + } + }) } const isPreview = ref(false) const scrollTop = ref(0) @@ -212,7 +229,7 @@ left: 50rpx; top: 33rpx; transform: translateY(-50%); - z-index: 10; + z-index: 10; } .back-icon::before, @@ -296,7 +313,8 @@ display: inline-block; width: 50%; margin-bottom: 15rpx; - &.full{ + + &.full { width: 100%; } } @@ -361,7 +379,8 @@ margin-left: 36rpx; background: #06f; color: #fff; - &.no-margin{ + + &.no-margin { margin-left: 0; } } @@ -395,7 +414,7 @@ line-height: 52rpx; color: #333; white-space: pre-line; - + &-file { color: #06f; } diff --git a/src/pages/sparring/result.vue b/src/pages/sparring/result.vue index 5e5ea522..6b5751be 100644 --- a/src/pages/sparring/result.vue +++ b/src/pages/sparring/result.vue @@ -316,7 +316,12 @@ canLoad.value = false }) onMounted(() => {}) - onBackPress((res) => res.from === 'backbutton'); + onBackPress((res) => { + if(res.from === 'backbutton'){ + goBack() + return true + } + });