fix :样式调整
This commit is contained in:
@@ -1,8 +1,19 @@
|
||||
<template>
|
||||
<z-paging ref="pagingRef" v-model="data_list" @query="queryList" :auto="false" empty-view-text="暂无数据"
|
||||
paging-class="pagingClass">
|
||||
<view class="sparring-item-box" v-for="item in data_list">
|
||||
<!-- <view class="sparring-item-box" v-for="item in data_list">
|
||||
<SparringItem :itemInfo="item" :activeTag="[]" @clickItem="toSparringDetail(item)" />
|
||||
</view> -->
|
||||
|
||||
<view class="left-items">
|
||||
<view class="sparring-item-box" v-for="item in leftsparringList">
|
||||
<SparringItem :itemInfo="item" :activeTag="[]" @clickItem="toSparringDetail(item)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-items">
|
||||
<view class="sparring-item-box" v-for="item in rightsparringList">
|
||||
<SparringItem :itemInfo="item" :activeTag="[]" @clickItem="toSparringDetail(item)" />
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
</template>
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -13,7 +13,7 @@
|
||||
<ImagePreview class="img-box" :src="itemInfo.ossAddr" :isCache="true" width="225" height="170" mode="widthFix">
|
||||
</ImagePreview>
|
||||
<view class="item-title">{{itemInfo.traName}}</view>
|
||||
<scroll-view class="item-tags" :scroll-x="true" :show-scrollbar="false">
|
||||
<scroll-view class="item-tags" :scroll-x="true" :show-scrollbar="false" v-if="tagsShowList.length > 0">
|
||||
<view class="item-tag-view">
|
||||
<view :class="['item-tag', this.activeTag.includes(item.tagId)?'active-tag':'']" v-for="item in tagsShowList">
|
||||
{{item.tagName}}
|
||||
|
||||
Reference in New Issue
Block a user