- 移除 AppHeader 组件 - 调整页面主体的样式和布局refactor(components): 优化 XMessage 组件样式 - 调整样式属性顺序 - 优化模板结构 refactor(pages):重构首页布局 - 添加新的 LiveBroadcast 组件 - 实现拍品列表的瀑布流布局 - 优化拍品卡片样式 refactor(config): 更新项目配置 - 移除 pages:extend钩子 - 更新兼容性日期
247 lines
6.8 KiB
Vue
247 lines
6.8 KiB
Vue
<script setup>
|
|
import liveBroadcast from '@/components/liveBroadcast/index.vue'
|
|
|
|
const loading = ref(false)
|
|
const finished = ref(false)
|
|
const refreshing = ref(false)
|
|
const list = ref([{
|
|
image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/637d95b4-2ae9-4a74-bd60-a3a9d2ca2ca0.png',
|
|
title: '张天赐 | 日出而作,日落而息',
|
|
startingPrice: 'RMB 1,000',
|
|
transactionPrice: 'RMB 10,000',
|
|
}, {
|
|
image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/f7b65e23-ce21-41b4-8e58-9e6dc6950727.png',
|
|
title: '张天赐 | 日出而作,日落而息',
|
|
startingPrice: 'RMB 1,000',
|
|
transactionPrice: '',
|
|
}, {
|
|
image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/41eceb23-d168-4049-ae8e-48c5328b192f.png',
|
|
title: '张天赐 | 日出而作,日落而息',
|
|
startingPrice: 'RMB 1,000',
|
|
transactionPrice: '',
|
|
}, {
|
|
image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/25c3f03c-9e0b-456b-963f-79b3d812c89a.png',
|
|
title: '张天赐 | 日出而作,日落而息',
|
|
startingPrice: 'RMB 1,000',
|
|
transactionPrice: '',
|
|
}, {
|
|
image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/25c3f03c-9e0b-456b-963f-79b3d812c89a.png',
|
|
title: '张天赐 | 日出而作,日落而息',
|
|
startingPrice: 'RMB 1,000',
|
|
transactionPrice: '',
|
|
}, {
|
|
image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/25c3f03c-9e0b-456b-963f-79b3d812c89a.png',
|
|
title: '张天赐 | 日出而作,日落而息',
|
|
startingPrice: 'RMB 1,000',
|
|
transactionPrice: '',
|
|
}])
|
|
const page = ref(1)
|
|
|
|
// 加载数据
|
|
async function loadData() {
|
|
// try {
|
|
// loading.value = true
|
|
// // 模拟API请求
|
|
// const {data} = await fetchAuctionList({page: page.value})
|
|
//
|
|
// if (refreshing.value) {
|
|
// list.value = []
|
|
// refreshing.value = false
|
|
// }
|
|
//
|
|
// list.value.push(...data)
|
|
// page.value++
|
|
//
|
|
// // 如果没有更多数据了
|
|
// if (data.length < 10) {
|
|
// finished.value = true
|
|
// }
|
|
// } catch (error) {
|
|
// console.error(error)
|
|
// } finally {
|
|
// loading.value = false
|
|
// }
|
|
}
|
|
|
|
// 下拉刷新
|
|
function onRefresh() {
|
|
finished.value = false
|
|
page.value = 1
|
|
refreshing.value = true
|
|
loadData()
|
|
}
|
|
// 分列计算
|
|
const leftColumn = computed(() => {
|
|
return list.value.filter((_, index) => index % 2 === 0)
|
|
})
|
|
|
|
const rightColumn = computed(() => {
|
|
return list.value.filter((_, index) => index % 2 === 1)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<liveBroadcast />
|
|
<van-tabs sticky animated>
|
|
<van-tab title="拍品列表">
|
|
<div class="px-[16px] pt-[16px]">
|
|
<van-pull-refresh>
|
|
<van-list
|
|
v-model:loading="loading"
|
|
:finished="finished"
|
|
finished-text="没有更多了"
|
|
@load="loadData"
|
|
>
|
|
<div class="w-full flex gap-[16px]">
|
|
<div class="flex flex-1 flex-col gap-[16px]">
|
|
<div
|
|
v-for="(item, index) in leftColumn"
|
|
:key="index"
|
|
class="w-full"
|
|
>
|
|
<div class="relative w-full">
|
|
<van-image
|
|
:src="item.image"
|
|
:style="{ aspectRatio: item.ratio }"
|
|
fit="cover"
|
|
class="w-full"
|
|
/>
|
|
<div class="absolute left-[8px] top-[8px] h-[17px] w-[45px] flex items-center justify-center bg-[#2b53ac] text-[12px] text-[#fff]">
|
|
LOT{{ index * 2 + 1 }}
|
|
</div>
|
|
</div>
|
|
<div class="pt-[8px]">
|
|
<div class="text-[14px] text-[#000000] leading-[20px]">
|
|
{{ item.title }}
|
|
</div>
|
|
<div class="mt-[4px] text-[12px] text-[#575757]">
|
|
起拍价:{{ item.startingPrice }}
|
|
</div>
|
|
<div
|
|
v-if="item.transactionPrice"
|
|
class="mt-[4px] text-[12px] text-[#b58047]"
|
|
>
|
|
成交价:{{ item.transactionPrice }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-1 flex-col gap-[16px]">
|
|
<div
|
|
v-for="(item, index) in rightColumn"
|
|
:key="index"
|
|
class="w-full"
|
|
>
|
|
<div class="relative w-full">
|
|
<van-image
|
|
:src="item.image"
|
|
:style="{ aspectRatio: item.ratio }"
|
|
fit="cover"
|
|
class="w-full"
|
|
/>
|
|
<div class="absolute left-[8px] top-[8px] h-[17px] w-[45px] flex items-center justify-center bg-[#2b53ac] text-[12px] text-[#fff]">
|
|
LOT{{ index * 2 + 2 }}
|
|
</div>
|
|
</div>
|
|
<div class="pt-[8px]">
|
|
<div class="text-[14px] text-[#000000] leading-[20px]">
|
|
{{ item.title }}
|
|
</div>
|
|
<div class="mt-[4px] text-[12px] text-[#575757]">
|
|
起拍价:{{ item.startingPrice }}
|
|
</div>
|
|
<div
|
|
v-if="item.transactionPrice"
|
|
class="mt-[4px] text-[12px] text-[#b58047]"
|
|
>
|
|
成交价:{{ item.transactionPrice }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</van-list>
|
|
</van-pull-refresh>
|
|
</div>
|
|
</van-tab>
|
|
<van-tab title="拍卖说明">
|
|
内容 2
|
|
</van-tab>
|
|
</van-tabs>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.masonry-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 16px;
|
|
width: 100%;
|
|
}
|
|
|
|
.masonry-item {
|
|
width: 100%;
|
|
break-inside: avoid;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
/* 偶数项向上偏移 */
|
|
.masonry-item.odd {
|
|
margin-top: 32px;
|
|
}
|
|
|
|
/* 图片样式 */
|
|
:deep(.product-image) {
|
|
width: 100%;
|
|
height: auto;
|
|
aspect-ratio: 1/1;
|
|
}
|
|
|
|
/* LOT标签样式 */
|
|
.lot-tag {
|
|
position: absolute;
|
|
left: 8px;
|
|
top: 8px;
|
|
height: 17px;
|
|
width: 45px;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
background-color: #2b53ac;
|
|
color: #fff;
|
|
font-size: 12px;
|
|
}
|
|
|
|
/* 商品信息样式 */
|
|
.product-info {
|
|
padding-top: 8px;
|
|
}
|
|
|
|
.title {
|
|
font-size: 14px;
|
|
color: #000;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.starting-price {
|
|
font-size: 12px;
|
|
color: #575757;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.transaction-price {
|
|
font-size: 12px;
|
|
color: #b58047;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
/* 确保图片容器响应式 */
|
|
:deep(.van-image) {
|
|
width: 100% !important;
|
|
}
|
|
|
|
:deep(.van-image__img) {
|
|
width: 100% !important;
|
|
height: auto !important;
|
|
}
|
|
</style>
|