2025-01-10 08:47:27 +00:00
|
|
|
|
<script setup>
|
2025-02-13 05:51:53 +00:00
|
|
|
|
import { userArtworks } from "@/api/goods/index.js"
|
|
|
|
|
import { authStore } from "@/stores/auth/index.js"
|
2025-01-22 08:23:48 +00:00
|
|
|
|
import xImage from '@/components/x-image/index.vue'
|
2025-02-13 05:51:53 +00:00
|
|
|
|
import { ref } from "vue"
|
|
|
|
|
|
2025-01-08 05:26:12 +00:00
|
|
|
|
definePageMeta({
|
|
|
|
|
layout: 'default',
|
|
|
|
|
i18n: 'menu.profile',
|
|
|
|
|
})
|
2025-02-18 08:33:56 +00:00
|
|
|
|
const {t}=useI18n();
|
2025-02-08 02:06:21 +00:00
|
|
|
|
const router = useRouter()
|
2025-02-19 13:03:54 +00:00
|
|
|
|
const { userInfo,payment } = authStore()
|
2025-02-13 05:51:53 +00:00
|
|
|
|
const showMyList = ref([])
|
2025-02-10 02:56:38 +00:00
|
|
|
|
const localState = ref({
|
2025-02-13 05:51:53 +00:00
|
|
|
|
finished: true,
|
|
|
|
|
refreshing: false
|
2025-02-10 02:56:38 +00:00
|
|
|
|
})
|
2025-02-13 05:51:53 +00:00
|
|
|
|
|
|
|
|
|
const groupByDate = (data) => {
|
|
|
|
|
if (!Array.isArray(data)) return []
|
|
|
|
|
|
|
|
|
|
return Object.values(data.reduce((acc, curr) => {
|
|
|
|
|
const date = curr.userCreatedAt
|
|
|
|
|
if (!acc[date]) {
|
|
|
|
|
acc[date] = { userCreatedAt: date, list: [] }
|
2025-02-08 02:16:54 +00:00
|
|
|
|
}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
acc[date].list.push(curr)
|
|
|
|
|
return acc
|
|
|
|
|
}, {})).sort((a, b) => new Date(b.userCreatedAt) - new Date(a.userCreatedAt))
|
2025-02-08 02:06:21 +00:00
|
|
|
|
}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
|
|
|
|
|
const fetchData = async () => {
|
2025-02-10 02:56:38 +00:00
|
|
|
|
try {
|
2025-02-13 05:51:53 +00:00
|
|
|
|
const res = await userArtworks({})
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
showMyList.value = groupByDate(res.data.data)
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
2025-03-02 03:09:06 +00:00
|
|
|
|
}
|
2025-02-10 02:56:38 +00:00
|
|
|
|
}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
|
|
|
|
|
const onRefresh = async () => {
|
|
|
|
|
localState.value.refreshing = true
|
|
|
|
|
await fetchData()
|
|
|
|
|
localState.value.refreshing = false
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-19 13:03:54 +00:00
|
|
|
|
const goPay = (item) => {
|
|
|
|
|
payment.value.leftPrice=item.leftPrice
|
|
|
|
|
payment.value.leftCurrency=item.leftCurrency
|
|
|
|
|
payment.value.buyUid=item.uuid
|
2025-02-24 01:41:21 +00:00
|
|
|
|
payment.value.auctionArtworkUuid=item?.auctionArtworkUuid
|
2025-02-19 13:03:54 +00:00
|
|
|
|
if (item.status===1){
|
2025-02-18 08:33:56 +00:00
|
|
|
|
router.push('/signature/protocol')
|
2025-02-19 13:03:54 +00:00
|
|
|
|
}else if (item.status===4){
|
2025-02-18 08:33:56 +00:00
|
|
|
|
router.push('/payment')
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
const goDetail = (item) => router.push({ path: '/artDetail', query: { uuid: item.uuid } })
|
2025-02-18 08:33:56 +00:00
|
|
|
|
const statusLabel={
|
|
|
|
|
1:t('payment.text4'),
|
|
|
|
|
2:t('payment.text2'),
|
|
|
|
|
4:t('payment.text6'),
|
|
|
|
|
}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
fetchData()
|
2025-01-08 05:26:12 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-01-13 03:12:11 +00:00
|
|
|
|
<div class="w-[100vw] bg-[url('@/static/images/3532@2x.png')] bg-cover pt-43px flex-grow-1 flex flex-col">
|
2025-02-13 05:51:53 +00:00
|
|
|
|
<!-- 用户信息 -->
|
|
|
|
|
<div class="flex items-center px-16px mb-43px">
|
|
|
|
|
<img class="w-57px h-57px mr-23px" src="@/static/images/5514@2x.png" alt="">
|
|
|
|
|
<div class="flex flex-col">
|
|
|
|
|
<div class="text-18px text-#181818">{{ userInfo.realName }}</div>
|
|
|
|
|
<div class="text-#575757 text-14px">{{ userInfo.telNum }}</div>
|
|
|
|
|
</div>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</div>
|
2025-02-13 05:51:53 +00:00
|
|
|
|
|
2025-02-27 06:38:03 +00:00
|
|
|
|
<!-- 设置选项 -->
|
|
|
|
|
<div class="px-16px mb-20px">
|
|
|
|
|
<van-cell-group inset>
|
2025-02-27 07:00:46 +00:00
|
|
|
|
<!-- 移除语言设置入口 -->
|
2025-02-27 06:38:03 +00:00
|
|
|
|
</van-cell-group>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-02-13 05:51:53 +00:00
|
|
|
|
<!-- 列表内容 -->
|
2025-02-13 03:53:24 +00:00
|
|
|
|
<div class="grow-1 flex flex-col">
|
2025-02-13 05:51:53 +00:00
|
|
|
|
<div class="border-b-1px border-b-#D3D3D3 px-16px">
|
|
|
|
|
<div class="text-#000 text-16px border-b-3 border-b-#2B53AC w-80px h-36px">{{ $t('home.my_lots') }}</div>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</div>
|
2025-02-13 05:51:53 +00:00
|
|
|
|
|
|
|
|
|
<van-pull-refresh
|
|
|
|
|
v-model="localState.refreshing"
|
|
|
|
|
:success-duration="700"
|
|
|
|
|
class="h-full grow-1"
|
|
|
|
|
@refresh="onRefresh"
|
|
|
|
|
>
|
2025-02-12 08:50:52 +00:00
|
|
|
|
<template #success>
|
|
|
|
|
<van-icon name="success" /> <span>{{ $t('home.refresh_show') }}</span>
|
|
|
|
|
</template>
|
2025-02-13 05:51:53 +00:00
|
|
|
|
<van-list :finished="localState.finished" :finished-text="$t('home.finished_text')" class="h-full">
|
|
|
|
|
<!-- 空状态 -->
|
|
|
|
|
<div v-if="showMyList?.length < 1" class="flex flex-col items-center pt-100px">
|
2025-02-13 03:53:24 +00:00
|
|
|
|
<img class="w-103px h-88px mb-19px" src="@/static/images/zu5512@2x.png" alt="">
|
2025-02-17 02:52:10 +00:00
|
|
|
|
<div class="text-14px text-#575757">{{$t('profile.text1')}}</div>
|
|
|
|
|
<div class="text-14px text-#575757">{{$t('profile.text2')}}</div>
|
2025-02-13 03:53:24 +00:00
|
|
|
|
</div>
|
2025-02-13 05:51:53 +00:00
|
|
|
|
|
|
|
|
|
<!-- 列表内容 -->
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div v-for="group in showMyList" :key="group.userCreatedAt" class="px-16px pt-14px">
|
|
|
|
|
<div class="text-#575757 text-14px mb-3px">{{ group.userCreatedAt }}</div>
|
|
|
|
|
<div
|
|
|
|
|
v-for="item in group.list"
|
|
|
|
|
:key="item.uuid"
|
|
|
|
|
class="flex mb-22px"
|
|
|
|
|
@click="goDetail(item)"
|
|
|
|
|
>
|
|
|
|
|
<x-image
|
|
|
|
|
class="w-80px h-80px flex-shrink-0 mr-10px rounded-4px overflow-hidden"
|
|
|
|
|
:src="item?.auctionArtworkInfo?.artwork?.hdPic"
|
|
|
|
|
:preview="false"
|
|
|
|
|
/>
|
|
|
|
|
<div class="flex flex-col justify-between grow-1">
|
2025-02-20 12:40:00 +00:00
|
|
|
|
<div class="flex justify-between">
|
|
|
|
|
<div class="text-#000 text-16px ellipsis line-height-21px">
|
|
|
|
|
{{ item?.auctionArtworkInfo?.artworkTitle }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-14px text-right text-#3C55B2 ">
|
|
|
|
|
{{statusLabel[item.status]}}
|
|
|
|
|
</div>
|
2025-02-08 02:06:21 +00:00
|
|
|
|
</div>
|
2025-02-20 12:40:00 +00:00
|
|
|
|
|
|
|
|
|
|
2025-02-13 05:51:53 +00:00
|
|
|
|
<div class="flex justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="text-#575757 text-14px line-height-none mb-5px">
|
2025-02-20 06:47:57 +00:00
|
|
|
|
{{ $t('home.start_price') }}:{{item.auctionArtworkInfo?.startPriceCurrency}} {{item.auctionArtworkInfo?.startPrice}}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="text-#B58047 text-14px line-height-none">
|
2025-02-18 08:33:56 +00:00
|
|
|
|
{{ $t('home.close_price') }}:{{item.baseCurrency}} {{item.baseMoney}}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<van-button
|
|
|
|
|
v-if="[1,3,4].includes(item.status)"
|
|
|
|
|
class="w-73px !h-30px"
|
|
|
|
|
type="primary"
|
2025-02-19 13:03:54 +00:00
|
|
|
|
@click.stop="goPay(item)"
|
2025-02-13 05:51:53 +00:00
|
|
|
|
>
|
|
|
|
|
<span class="text-12px">{{ $t('art_detail_page.button') }}</span>
|
|
|
|
|
</van-button>
|
2025-02-08 02:06:21 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-13 05:51:53 +00:00
|
|
|
|
</template>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</van-list>
|
|
|
|
|
</van-pull-refresh>
|
|
|
|
|
</div>
|
2025-01-08 05:26:12 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2025-02-13 05:51:53 +00:00
|
|
|
|
|
2025-01-13 02:55:10 +00:00
|
|
|
|
<style scoped>
|
|
|
|
|
.ellipsis {
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
2025-02-13 05:51:53 +00:00
|
|
|
|
</style>
|