合并冲突

This commit is contained in:
田岩
2025-12-17 10:25:18 +08:00
9 changed files with 163 additions and 70 deletions
+4
View File
@@ -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'
+2 -2
View File
@@ -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'
@@ -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(() => {
+29 -12
View File
@@ -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{
// }
// }
// }
// }
+21 -14
View File
@@ -18,10 +18,12 @@
<view v-else></view>
<view class="talking-tips" v-if="talkingType === 'answer' && !isExam && isLast">
<view class="talking-tips-btn" @click="getTips()">回答提示</view>
<view v-show="showContent">
<view class="talking-tips-loading" v-if="loadingTips">
<CommonLoading color="#06f" />
</view>
<view class="talking-tips-cont" v-else>{{tipsContent}}</view>
</view>
</view>
</view>
</template>
@@ -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', {
+29 -18
View File
@@ -12,8 +12,7 @@
{{'语音对话'}}
</view>
</view> -->
<uni-popup ref="talkModelRef" type="bottom" @click="hideOverlayTalking" @touchend="hideOverlayTalking"
mask-background-color="rgba(0,0,0,0.9)">
<uni-popup ref="talkModelRef" type="bottom" @click="hideOverlayTalking" mask-background-color="rgba(0,0,0,0.9)">
<view class="overlay-box">
<view class="circle-bg-box">
<view class="icon-box">
@@ -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',
+27 -8
View File
@@ -18,7 +18,8 @@
</view>
<view class="body-top-item"> 已陪练次数{{ detailInfo.practiceTimes }} </view>
<view class="body-top-item"> 类型{{ detailInfo.traInterTypDesc }} </view>
<view :class="['body-top-item',detailInfo.limitTyp === '01'?'':'full' ]"> 截止时间{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}}</view>
<view :class="['body-top-item',detailInfo.limitTyp === '01'?'':'full' ]">
截止时间{{detailInfo.limitTyp === '01' ? '不限制' : detailInfo.endTm}}</view>
<view class="body-top-item"> 通过分数{{detailInfo.passGrade || 0}} </view>
<scroll-view class="body-top-tags" :scroll-x="true">
<view class="item-tag-view">
@@ -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;
}
+6 -1
View File
@@ -316,7 +316,12 @@
canLoad.value = false
})
onMounted(() => {})
onBackPress((res) => res.from === 'backbutton');
onBackPress((res) => {
if(res.from === 'backbutton'){
goBack()
return true
}
});
</script>
<style scoped lang="scss">
+44 -5
View File
@@ -103,7 +103,7 @@
v-if="detailInfo.traInterTyp === '01'"
/>
<view class="body-bottom" v-else>
<view class="body-bottom-btn" @click="toTalking">
<view class="body-bottom-btn" @click="beforeToTalking">
<view class="center-text">
<image
class="type-icon"
@@ -134,7 +134,7 @@
import TouchBtn from './components/touchBtn.vue';
import ImagePreview from '@/components/image-preview/image-preview.vue';
import { commonUploadVoiceFile } from '@/api/common.js';
import { queryTraPartnerCharacterInfoById, partnerChatReportTrigger } from '@/api/sparring.js';
import { queryTraPartnerCharacterInfoById, partnerChatReportTrigger, checkTraPartnerInfoById } from '@/api/sparring.js';
import { useSocketStore } from '@/store/socket.js';
import { useStorageStore } from '@/store/storage.js';
import { storeToRefs } from 'pinia';
@@ -142,10 +142,10 @@
import badge from '@/components/points-and-badge/badge';
import points from '@/components/points-and-badge/points';
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
import { initRecord } from '@/composables/useExamSubject.js';
import permissionApi from '@/common/permission';
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
const socketStore = useSocketStore();
const { SocketObj } = storeToRefs(socketStore);
@@ -197,6 +197,24 @@
});
};
const uploadRecordNow = (voicePath, voiceTime) => {
console.log(voicePath, voiceTime);
if (!execId.value) {
common.show('提示', '网络连接失败,请重新加载', false).then((res) => {
if (res) {
common.redirectTo(
'/pages/sparring/tip?traId=' +
traId.value +
'&chaId=' +
chaId.value +
'&type=' +
talkingType.value +
'&isPreview=' +
(isPreview.value ? '1' : '')
);
}
});
return;
}
//#ifndef APP-PLUS
// h5 假数据
// #endif
@@ -246,7 +264,21 @@
});
// #endif
};
const beforeToTalking = () => {
if (isPreview.value) {
toTalking();
return;
}
checkTraPartnerInfoById({
traId: traId.value
}).then((res) => {
if (res.body.inRange) {
toTalking();
} else {
common.show('提示', res.body.message, false);
}
});
};
const toTalking = async () => {
try {
//#ifdef APP-PLUS
@@ -618,7 +650,12 @@
onMounted(() => {
// getDetailInfo()
});
onBackPress((res) => res.from === 'backbutton');
onBackPress((res) => {
if (res.from === 'backbutton') {
goBack();
return true;
}
});
</script>
<style lang="scss" scoped>
@@ -915,8 +952,10 @@
// text-align: center;
color: #999;
}
.talking-box {
padding-top: 24rpx;
.tip-text {
color: #7295cb;
text-align: center;