diff --git a/src/pages/sparring/chooseRole.vue b/src/pages/sparring/chooseRole.vue index b32783a6..7a2432da 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,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{ - + // } // } // } - + // } diff --git a/src/pages/sparring/detail.vue b/src/pages/sparring/detail.vue index e64fb579..84061a2a 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,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; }