2025-01-20 08:17:49 +00:00
|
|
|
import {createGlobalState} from '@vueuse/core'
|
2025-01-20 03:42:25 +00:00
|
|
|
import {artworkList, defaultDetail} from "~/api/goods/index.js";
|
2025-01-20 08:17:49 +00:00
|
|
|
|
|
|
|
export const goodStore = createGlobalState(() => {
|
|
|
|
const actionDetails = ref({})
|
|
|
|
const fullLive = ref(false)
|
|
|
|
const liveRef = ref(null);
|
2025-01-21 03:43:27 +00:00
|
|
|
const currentItem=ref({})
|
2025-01-21 06:16:54 +00:00
|
|
|
const myArtWorks=ref([])
|
2025-01-20 08:17:49 +00:00
|
|
|
const pageRef = ref({
|
|
|
|
page: 1,
|
|
|
|
pageSize: 5,
|
|
|
|
itemCount: 0
|
|
|
|
})
|
2025-01-21 03:43:27 +00:00
|
|
|
const artWorkDetail=ref(null)
|
2025-01-20 08:17:49 +00:00
|
|
|
const itemList = ref([])
|
|
|
|
const auctionDetail = ref({})
|
|
|
|
const getAuctionDetail = async () => {
|
|
|
|
const res = await defaultDetail({})
|
|
|
|
if (res.status === 0) {
|
|
|
|
auctionDetail.value = res.data
|
2025-01-20 03:42:25 +00:00
|
|
|
}
|
|
|
|
}
|
2025-01-20 08:17:49 +00:00
|
|
|
const getArtworkList = async (page = pageRef.value) => {
|
|
|
|
return artworkList({auctionUuid: auctionDetail.value.uuid, ...page})
|
2025-01-20 03:42:25 +00:00
|
|
|
}
|
2025-01-20 08:17:49 +00:00
|
|
|
return {
|
2025-01-21 06:16:54 +00:00
|
|
|
myArtWorks,
|
2025-01-21 03:43:27 +00:00
|
|
|
currentItem,
|
|
|
|
artWorkDetail,
|
2025-01-20 08:17:49 +00:00
|
|
|
liveRef,
|
|
|
|
pageRef,
|
2025-01-20 03:42:25 +00:00
|
|
|
getArtworkList,
|
|
|
|
auctionDetail,
|
|
|
|
getAuctionDetail,
|
2025-01-17 08:56:13 +00:00
|
|
|
actionDetails,
|
|
|
|
itemList,
|
2025-01-13 12:59:25 +00:00
|
|
|
fullLive
|
|
|
|
}
|
|
|
|
})
|