2025-01-22 07:44:50 +00:00
|
|
|
|
<script setup>
|
2025-03-04 11:11:52 +00:00
|
|
|
|
import xPopup from "@/components/x-popup/index.vue";
|
|
|
|
|
import { goodStore } from "@/stores/goods/index.js";
|
|
|
|
|
import xImage from "@/components/x-image/index.vue";
|
|
|
|
|
import { liveStore } from "~/stores/live/index.js";
|
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
const {
|
|
|
|
|
pageRef,
|
|
|
|
|
itemList,
|
|
|
|
|
getArtworkList,
|
|
|
|
|
loading: storeLoading,
|
|
|
|
|
} = goodStore();
|
|
|
|
|
const { auctionData } = liveStore();
|
|
|
|
|
const showDetail = ref(false);
|
2025-02-06 08:29:17 +00:00
|
|
|
|
const localState = ref({
|
|
|
|
|
finished: false,
|
|
|
|
|
refreshing: false,
|
|
|
|
|
showDetail: false,
|
2025-03-04 11:11:52 +00:00
|
|
|
|
showHeight: "",
|
|
|
|
|
});
|
2025-02-06 08:29:17 +00:00
|
|
|
|
const onRefresh = async () => {
|
|
|
|
|
try {
|
2025-03-04 11:11:52 +00:00
|
|
|
|
localState.value.refreshing = true;
|
|
|
|
|
localState.value.finished = false;
|
|
|
|
|
const { finished } = await getArtworkList(true);
|
|
|
|
|
localState.value.finished = finished;
|
2025-02-06 08:29:17 +00:00
|
|
|
|
} finally {
|
2025-03-04 11:11:52 +00:00
|
|
|
|
localState.value.refreshing = false;
|
2025-02-06 08:29:17 +00:00
|
|
|
|
}
|
2025-03-04 11:11:52 +00:00
|
|
|
|
};
|
2025-01-22 07:44:50 +00:00
|
|
|
|
const props = defineProps({
|
|
|
|
|
show: Boolean,
|
|
|
|
|
title: {
|
|
|
|
|
type: String,
|
2025-03-04 11:11:52 +00:00
|
|
|
|
default: "",
|
|
|
|
|
},
|
|
|
|
|
});
|
2025-02-08 09:00:09 +00:00
|
|
|
|
const scrollToCurrentItem = () => {
|
2025-03-04 11:11:52 +00:00
|
|
|
|
if (!itemList.value?.length) return;
|
2025-02-08 09:10:23 +00:00
|
|
|
|
const currentIndex = itemList.value.findIndex(
|
2025-03-04 11:11:52 +00:00
|
|
|
|
(item) => auctionData.value.artwork.index === item?.index
|
|
|
|
|
);
|
2025-02-08 09:10:23 +00:00
|
|
|
|
if (currentIndex > -1) {
|
2025-03-04 11:11:52 +00:00
|
|
|
|
const container = document.querySelector(".list-container");
|
|
|
|
|
const targetElement =
|
|
|
|
|
document.querySelectorAll(".item-wrapper")[currentIndex];
|
2025-02-08 09:10:23 +00:00
|
|
|
|
if (targetElement && container) {
|
2025-03-04 11:11:52 +00:00
|
|
|
|
const containerTop = container.getBoundingClientRect().top;
|
|
|
|
|
const elementTop = targetElement.getBoundingClientRect().top;
|
|
|
|
|
const scrollTop = elementTop - containerTop + container.scrollTop;
|
2025-02-08 09:10:23 +00:00
|
|
|
|
container.scrollTo({
|
|
|
|
|
top: scrollTop,
|
2025-03-04 11:11:52 +00:00
|
|
|
|
behavior: "smooth",
|
|
|
|
|
});
|
2025-02-08 09:00:09 +00:00
|
|
|
|
}
|
2025-02-08 09:10:23 +00:00
|
|
|
|
}
|
2025-03-04 11:11:52 +00:00
|
|
|
|
};
|
|
|
|
|
const emit = defineEmits(["update:show"]);
|
|
|
|
|
const showDetailInfo = ref(null);
|
|
|
|
|
const close = () => emit("update:show", false);
|
|
|
|
|
const openShow = (item) => {
|
|
|
|
|
showDetailInfo.value = item;
|
|
|
|
|
showDetail.value = true;
|
|
|
|
|
};
|
2025-02-06 08:29:17 +00:00
|
|
|
|
const loadMore = async () => {
|
2025-03-04 11:11:52 +00:00
|
|
|
|
pageRef.value.page++;
|
|
|
|
|
const { finished } = await getArtworkList();
|
|
|
|
|
localState.value.finished = finished;
|
|
|
|
|
};
|
|
|
|
|
watch(
|
|
|
|
|
() => {
|
|
|
|
|
return auctionData.value?.artwork?.index;
|
|
|
|
|
},
|
|
|
|
|
(newValue) => {}
|
|
|
|
|
);
|
|
|
|
|
watch(
|
|
|
|
|
() => props.show,
|
|
|
|
|
(newValue) => {
|
|
|
|
|
if (newValue) {
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
scrollToCurrentItem();
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-02-08 09:00:09 +00:00
|
|
|
|
}
|
2025-03-04 11:11:52 +00:00
|
|
|
|
);
|
2025-01-22 07:44:50 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-02-05 09:00:22 +00:00
|
|
|
|
<div>
|
|
|
|
|
<x-popup :show="show" @update:show="close">
|
|
|
|
|
<template #title>
|
2025-03-04 11:11:52 +00:00
|
|
|
|
<div class="text-#000 text-16px">{{ $t("home.tab1") }}</div>
|
|
|
|
|
<div class="text-#939393 text-16px ml-14px">
|
|
|
|
|
{{ $t("live_room.total") }}{{ pageRef.itemCount
|
|
|
|
|
}}{{ $t("live_room.lots_num") }}
|
|
|
|
|
</div>
|
2025-02-05 09:00:22 +00:00
|
|
|
|
</template>
|
|
|
|
|
<div>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
<van-pull-refresh
|
2025-03-04 11:11:52 +00:00
|
|
|
|
v-model="localState.refreshing"
|
|
|
|
|
:success-text="$t('home.refresh_show')"
|
|
|
|
|
:success-duration="700"
|
|
|
|
|
@refresh="onRefresh"
|
2025-01-22 07:44:50 +00:00
|
|
|
|
>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
<template #success>
|
2025-03-04 11:11:52 +00:00
|
|
|
|
<van-icon name="success" />
|
|
|
|
|
<span>{{ $t("home.refresh_show") }}</span>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
</template>
|
|
|
|
|
<van-list
|
2025-03-04 11:11:52 +00:00
|
|
|
|
v-model:loading="storeLoading"
|
|
|
|
|
:finished="localState.finished"
|
|
|
|
|
:finished-text="$t('home.finished_text')"
|
|
|
|
|
@load="loadMore"
|
2025-02-05 09:00:22 +00:00
|
|
|
|
>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
<div
|
2025-03-04 11:11:52 +00:00
|
|
|
|
v-for="(item, index) of itemList"
|
|
|
|
|
:key="item.uuid"
|
|
|
|
|
class="flex mb-21px item-wrapper"
|
|
|
|
|
@click="openShow(item)"
|
2025-02-06 08:29:17 +00:00
|
|
|
|
>
|
|
|
|
|
<div
|
2025-03-04 11:11:52 +00:00
|
|
|
|
class="mr-10px flex-shrink-0 rounded-4px overflow-hidden cursor-pointer relative"
|
2025-02-06 08:29:17 +00:00
|
|
|
|
>
|
|
|
|
|
<xImage
|
2025-03-04 11:11:52 +00:00
|
|
|
|
:preview="false"
|
|
|
|
|
class="w-80px h-80px"
|
|
|
|
|
:src="item.artwork?.hdPic"
|
|
|
|
|
:alt="item?.artworkTitle"
|
|
|
|
|
loading="lazy"
|
2025-02-06 08:29:17 +00:00
|
|
|
|
/>
|
2025-03-04 11:11:52 +00:00
|
|
|
|
<div
|
|
|
|
|
class="w-45px h-17px bg-#2B53AC text-12px line-height-none flex justify-center items-center absolute top-2px left-2px text-#fff"
|
|
|
|
|
>
|
|
|
|
|
LOT{{ item.index }}
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-show="auctionData?.artwork?.index === item?.index"
|
|
|
|
|
class="w-80px h-20px bg-#B58047 flex line-height-none justify-center items-center text-#fff text-12px bottom-0 absolute blink"
|
|
|
|
|
>
|
|
|
|
|
{{ $t("live_room.cast") }}
|
|
|
|
|
</div>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2025-03-04 11:11:52 +00:00
|
|
|
|
<div
|
|
|
|
|
class="ellipsis line-height-20px text-16px font-600 min-h-40px"
|
|
|
|
|
>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
{{ item.artworkTitle }}
|
|
|
|
|
</div>
|
2025-03-04 11:11:52 +00:00
|
|
|
|
<div class="text-14px text-#575757">
|
|
|
|
|
{{ $t("home.start_price") }}:{{ item?.startPriceCurrency }}
|
|
|
|
|
{{ item?.startPrice }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-14px text-#B58047" v-if="item.soldPrice">
|
|
|
|
|
{{ $t("home.close_price") }}:{{ item.soldPrice }}
|
|
|
|
|
</div>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
</div>
|
2025-02-05 09:00:22 +00:00
|
|
|
|
</div>
|
2025-02-06 08:29:17 +00:00
|
|
|
|
</van-list>
|
|
|
|
|
</van-pull-refresh>
|
2025-01-22 07:44:50 +00:00
|
|
|
|
</div>
|
2025-02-05 09:00:22 +00:00
|
|
|
|
</x-popup>
|
|
|
|
|
</div>
|
2025-01-22 07:44:50 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.ellipsis {
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
2025-02-08 07:31:02 +00:00
|
|
|
|
.blink {
|
2025-02-08 09:40:54 +00:00
|
|
|
|
animation: fade 1s linear infinite;
|
2025-02-08 07:31:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes fade {
|
2025-03-04 11:11:52 +00:00
|
|
|
|
0%,
|
|
|
|
|
100% {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
50% {
|
|
|
|
|
opacity: 0.5;
|
|
|
|
|
}
|
2025-02-08 07:31:02 +00:00
|
|
|
|
}
|
2025-03-04 11:11:52 +00:00
|
|
|
|
</style>
|