fix: 添加跳转验证逻辑

This commit is contained in:
杨航
2025-12-16 08:42:01 +08:00
parent 34ab7198e9
commit 66ed67f7b2
2 changed files with 45 additions and 20 deletions
+24 -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,16 @@
}
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':''))
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 +92,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 +180,7 @@
overflow: hidden;
}
}
// .body-card {
// flex: 1;
// .card {
@@ -182,7 +194,7 @@
// transition: all 0.3s ease;
// position: relative;
// padding: 50rpx 23rpx 23rpx;
// .img-box {
// width: 300rpx;
// height: 300rpx;
@@ -190,11 +202,11 @@
// overflow: hidden;
// margin: 0 auto;
// }
// .card-content {
// padding: 24rpx;
// }
// .card-title {
// display: flex;
// font-size: 29rpx;
@@ -207,7 +219,7 @@
// text-align: center;
// margin: 33rpx auto;
// justify-content: center;
// &-name{
// margin-right: 20rpx;
// line-height: 44rpx;
@@ -227,7 +239,7 @@
// width: 30rpx;
// }
// }
// .card-item {
// width: 100%;
// display: block;
@@ -254,11 +266,11 @@
// }
// }
// &-desc{
// }
// }
// }
// }
+21 -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,17 @@
})
}
const toChooseRole = type => {
common.navigateTo('/pages/sparring/chooseRole?traId=' + traId.value + '&type=' + type + '&isPreview=' + (isPreview
.value ? '1' : ''))
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 +223,7 @@
left: 50rpx;
top: 33rpx;
transform: translateY(-50%);
z-index: 10;
z-index: 10;
}
.back-icon::before,
@@ -296,7 +307,8 @@
display: inline-block;
width: 50%;
margin-bottom: 15rpx;
&.full{
&.full {
width: 100%;
}
}
@@ -361,7 +373,8 @@
margin-left: 36rpx;
background: #06f;
color: #fff;
&.no-margin{
&.no-margin {
margin-left: 0;
}
}
@@ -395,7 +408,7 @@
line-height: 52rpx;
color: #333;
white-space: pre-line;
&-file {
color: #06f;
}