fix: 添加跳转验证逻辑
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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,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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user