2025-01-21 03:43:27 +00:00
|
|
|
|
<script setup>
|
2025-01-22 02:44:43 +00:00
|
|
|
|
import { ref, computed } from 'vue'
|
|
|
|
|
import { useRect } from "@vant/use"
|
|
|
|
|
import { goodStore } from "@/stores/goods"
|
2025-01-22 08:56:44 +00:00
|
|
|
|
import DetailPopup from '../DetailPopup/index.vue'
|
2025-01-23 03:08:54 +00:00
|
|
|
|
import MasonryWall from '@yeger/vue-masonry-wall'
|
2025-01-22 02:44:43 +00:00
|
|
|
|
const {
|
|
|
|
|
itemList,
|
|
|
|
|
pageRef,
|
|
|
|
|
auctionDetail,
|
|
|
|
|
liveRef,
|
|
|
|
|
artWorkDetail,
|
|
|
|
|
currentItem,
|
|
|
|
|
loading: storeLoading,
|
|
|
|
|
getArtworkList,
|
|
|
|
|
getArtworkDetail
|
|
|
|
|
} = goodStore()
|
|
|
|
|
|
|
|
|
|
const localState = ref({
|
|
|
|
|
finished: false,
|
|
|
|
|
refreshing: false,
|
|
|
|
|
showDetail: false,
|
|
|
|
|
showHeight: ''
|
|
|
|
|
})
|
|
|
|
|
// 加载更多
|
|
|
|
|
const loadMore = async () => {
|
|
|
|
|
pageRef.value.page++
|
|
|
|
|
const { finished } = await getArtworkList()
|
|
|
|
|
localState.value.finished = finished
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 刷新
|
|
|
|
|
const onRefresh = async () => {
|
2025-01-22 01:44:44 +00:00
|
|
|
|
try {
|
2025-01-22 02:44:43 +00:00
|
|
|
|
localState.value.refreshing = true
|
|
|
|
|
localState.value.finished = false
|
|
|
|
|
const { finished } = await getArtworkList(true)
|
|
|
|
|
localState.value.finished = finished
|
2025-01-22 01:44:44 +00:00
|
|
|
|
} finally {
|
2025-01-22 02:44:43 +00:00
|
|
|
|
localState.value.refreshing = false
|
2025-01-20 08:17:49 +00:00
|
|
|
|
}
|
2025-01-22 02:44:43 +00:00
|
|
|
|
}
|
|
|
|
|
// 打开详情
|
|
|
|
|
const openShow = async (item) => {
|
2025-01-23 03:08:54 +00:00
|
|
|
|
localState.value.showDetail = true
|
2025-01-22 02:44:43 +00:00
|
|
|
|
currentItem.value = item
|
2025-02-13 03:53:24 +00:00
|
|
|
|
/* getArtworkDetail(item.uuid)*/
|
2025-01-22 02:44:43 +00:00
|
|
|
|
}
|
2025-01-20 05:59:50 +00:00
|
|
|
|
</script>
|
2025-01-22 01:44:44 +00:00
|
|
|
|
|
2025-01-20 05:59:50 +00:00
|
|
|
|
<template>
|
2025-01-20 08:17:49 +00:00
|
|
|
|
<div class="px-[16px] pt-[16px]">
|
2025-01-22 01:44:44 +00:00
|
|
|
|
<van-pull-refresh
|
2025-01-22 02:44:43 +00:00
|
|
|
|
v-model="localState.refreshing"
|
2025-01-23 04:05:13 +00:00
|
|
|
|
:success-duration="700"
|
2025-01-22 02:44:43 +00:00
|
|
|
|
@refresh="onRefresh"
|
2025-01-22 01:44:44 +00:00
|
|
|
|
>
|
2025-01-23 04:05:13 +00:00
|
|
|
|
<template #success>
|
2025-02-12 08:50:52 +00:00
|
|
|
|
<van-icon name="success" /> <span>{{ $t('home.refresh_show') }}</span>
|
2025-01-23 04:05:13 +00:00
|
|
|
|
</template>
|
2025-01-22 01:44:44 +00:00
|
|
|
|
<van-list
|
2025-01-22 02:44:43 +00:00
|
|
|
|
v-model:loading="storeLoading"
|
|
|
|
|
:finished="localState.finished"
|
2025-02-12 06:34:05 +00:00
|
|
|
|
:finished-text="$t('home.finished_text')"
|
2025-01-22 02:44:43 +00:00
|
|
|
|
@load="loadMore"
|
2025-01-22 01:44:44 +00:00
|
|
|
|
>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
<div class="w-full flex gap-[16px]">
|
2025-01-23 03:08:54 +00:00
|
|
|
|
<masonry-wall :items="itemList" :ssr-columns="2" :maxColumns="2" :minColumns="2" :gap="5">
|
|
|
|
|
<template #default="{ item, index }">
|
|
|
|
|
<div
|
|
|
|
|
@click="openShow(item)"
|
|
|
|
|
class="w-full"
|
|
|
|
|
>
|
|
|
|
|
<div class="relative w-full">
|
|
|
|
|
<img
|
|
|
|
|
:src="item.artwork?.hdPic"
|
|
|
|
|
class="w-full object-cover rounded-4px"
|
|
|
|
|
loading="lazy"
|
|
|
|
|
/>
|
|
|
|
|
<div
|
|
|
|
|
class="absolute rounded-2px overflow-hidden line-height-12px left-[8px] top-[8px] h-[17px] w-[45px] flex items-center justify-center bg-[#2b53ac] text-[12px] text-[#fff]"
|
|
|
|
|
>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
LOT{{ item.index }}
|
2025-01-23 03:08:54 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="pt-[8px]">
|
|
|
|
|
<div class="text-[14px] text-[#000000] leading-[20px]">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mt-[4px] text-[12px] text-[#575757]">
|
2025-02-12 06:34:05 +00:00
|
|
|
|
{{ $t('home.start_price') }}:{{ item?.startPrice??0 }}
|
2025-01-23 03:08:54 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-if="item.soldPrice"
|
|
|
|
|
class="mt-[4px] text-[12px] text-[#b58047]"
|
|
|
|
|
>
|
2025-02-12 06:34:05 +00:00
|
|
|
|
{{ $t('home.close_price') }}:{{ item?.startPrice??0 }}
|
2025-01-23 03:08:54 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</masonry-wall>
|
2025-01-20 08:17:49 +00:00
|
|
|
|
</div>
|
|
|
|
|
</van-list>
|
|
|
|
|
</van-pull-refresh>
|
2025-02-13 03:53:24 +00:00
|
|
|
|
<DetailPopup v-model:show="localState.showDetail" :detailInfo="currentItem"></DetailPopup>
|
2025-01-20 08:17:49 +00:00
|
|
|
|
</div>
|
2025-01-22 02:44:43 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.content {
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
|
|
}
|
|
|
|
|
</style>
|