diff --git a/src/pages/preview/components/previewAiSparring.vue b/src/pages/preview/components/previewAiSparring.vue index 37273b71..5d4e91b3 100644 --- a/src/pages/preview/components/previewAiSparring.vue +++ b/src/pages/preview/components/previewAiSparring.vue @@ -1,8 +1,19 @@ @@ -13,7 +24,9 @@ reactive, onMounted, nextTick, - watch + watch, + unref, + computed } from 'vue'; import { queryTraListPreviewPaging @@ -33,6 +46,18 @@ fetchFunction: queryTraListPreviewPaging }); const props = defineProps(['tabIndex', 'currentIndex']); + + + const sparringList = computed(() => { + return unref(data_list) + }) + const leftsparringList = computed(() => { + return sparringList.value.filter((t, index) => index % 2 === 0) + }) + const rightsparringList = computed(() => { + return sparringList.value.filter((t, index) => index % 2 === 1) + }) + const toSparringDetail = (item) => { if (item.traId) { checkTraPartnerInfoById({ @@ -64,15 +89,34 @@ border-radius: 16rpx; } - .sparring-item-box { + // .sparring-item-box { + // width: 50%; + // float: left; + // margin-top: 24rpx; + // margin-bottom: -24rpx; + // // background-color: #f1f1f1; + // // margin-bottom: 16rpx; + // &:nth-child(2n-1) { + // // margin-right: 16rpx; + // } + // } + + .left-items { width: 50%; float: left; - margin-top: 24rpx; - margin-bottom: -24rpx; - // background-color: #f1f1f1; - // margin-bottom: 16rpx; - &:nth-child(2n-1) { - // margin-right: 16rpx; - } + overflow: hidden; + } + + .right-items { + width: 50%; + float: left; + overflow: hidden; + } + + .sparring-item-box { + // width: 50%; + width: 100%; + float: left; + } \ No newline at end of file diff --git a/src/pages/sparring/components/sparring-item.vue b/src/pages/sparring/components/sparring-item.vue index 3d498b07..8f2e64a6 100644 --- a/src/pages/sparring/components/sparring-item.vue +++ b/src/pages/sparring/components/sparring-item.vue @@ -13,7 +13,7 @@ {{itemInfo.traName}} - + {{item.tagName}}