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
+14 -2
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('')
@@ -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 {
+16 -3
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
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)
@@ -296,6 +307,7 @@
display: inline-block;
width: 50%;
margin-bottom: 15rpx;
&.full {
width: 100%;
}
@@ -361,6 +373,7 @@
margin-left: 36rpx;
background: #06f;
color: #fff;
&.no-margin {
margin-left: 0;
}