2025-01-10 08:47:27 +00:00
|
|
|
|
<script setup>
|
2025-01-23 11:43:45 +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-08 02:06:21 +00:00
|
|
|
|
import {goodStore} from "~/stores/goods/index.js";
|
2025-01-08 05:26:12 +00:00
|
|
|
|
definePageMeta({
|
|
|
|
|
layout: 'default',
|
|
|
|
|
title: '我的',
|
|
|
|
|
i18n: 'menu.profile',
|
|
|
|
|
})
|
2025-02-08 02:06:21 +00:00
|
|
|
|
const {artWorkDetail} = goodStore()
|
2025-01-22 07:44:50 +00:00
|
|
|
|
const myList=ref([])
|
2025-01-22 08:23:48 +00:00
|
|
|
|
const showMyList=ref([])
|
2025-01-21 06:16:54 +00:00
|
|
|
|
const {userInfo}= authStore()
|
2025-01-22 08:23:48 +00:00
|
|
|
|
const groupAndSortByDate=(data)=> {
|
|
|
|
|
if (!Array.isArray(data)) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return Object.values(data.reduce((acc, curr) => {
|
|
|
|
|
if (!acc[curr.userCreatedAt]) {
|
|
|
|
|
acc[curr.userCreatedAt] = {
|
|
|
|
|
userCreatedAt: curr.userCreatedAt,
|
|
|
|
|
list: []
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
acc[curr.userCreatedAt].list.push(curr);
|
|
|
|
|
return acc;
|
|
|
|
|
}, {}))
|
|
|
|
|
.sort((a, b) => new Date(b.userCreatedAt) - new Date(a.userCreatedAt));
|
|
|
|
|
}
|
2025-01-21 06:16:54 +00:00
|
|
|
|
const initData=async ()=>{
|
|
|
|
|
const res=await userArtworks({})
|
|
|
|
|
if (res.status===0){
|
2025-01-22 07:44:50 +00:00
|
|
|
|
myList.value=res.data.data
|
2025-01-22 08:23:48 +00:00
|
|
|
|
showMyList.value=groupAndSortByDate(myList.value)
|
2025-01-21 06:16:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-08 02:06:21 +00:00
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
2025-01-21 06:16:54 +00:00
|
|
|
|
initData()
|
2025-02-08 02:06:21 +00:00
|
|
|
|
const goPay=()=>{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const goDetail=(item)=>{
|
2025-02-08 02:16:54 +00:00
|
|
|
|
router.push({
|
|
|
|
|
path:'/artDetail',
|
|
|
|
|
query:{
|
|
|
|
|
uuid:item.uuid
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-02-08 02:06:21 +00:00
|
|
|
|
}
|
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-01-13 02:55:10 +00:00
|
|
|
|
<div class="flex items-center px-16px mb-43px">
|
|
|
|
|
<div class="mr-23px">
|
|
|
|
|
<img class="w-57px h-57px" src="@/static/images/5514@2x.png" alt="">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex flex-col">
|
2025-01-21 06:16:54 +00:00
|
|
|
|
<div class="text-18px text-#181818">{{userInfo.realName}}</div>
|
|
|
|
|
<div class="text-#575757 text-14px">{{userInfo.telNum}}</div>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-01-22 08:23:48 +00:00
|
|
|
|
<div class="flex-grow-1 ">
|
2025-01-13 02:55:10 +00:00
|
|
|
|
<div class="border-b-1px border-b-#D3D3D3 px-16px flex">
|
2025-01-13 03:12:11 +00:00
|
|
|
|
<div class="text-#000 text-16px border-b-3 border-b-#2B53AC h-36px">我的拍品</div>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</div>
|
2025-01-22 08:23:48 +00:00
|
|
|
|
<van-pull-refresh @refresh="initData">
|
2025-01-13 02:55:10 +00:00
|
|
|
|
<van-list
|
|
|
|
|
finished-text="没有更多了"
|
|
|
|
|
>
|
2025-02-08 02:06:21 +00:00
|
|
|
|
<div class="px-16px pt-14px" v-for="(item,index) of showMyList" >
|
2025-01-22 08:23:48 +00:00
|
|
|
|
<div class="text-#575757 text-14px mb-3px">{{item.userCreatedAt}}</div>
|
2025-02-08 02:06:21 +00:00
|
|
|
|
<div class="flex mb-22px" v-for="(item1,index1) of item.list" @click="goDetail(item1)">
|
2025-01-22 08:23:48 +00:00
|
|
|
|
<div class="flex-shrink-0 mr-10px rounded-4px overflow-hidden">
|
|
|
|
|
<x-image class="w-80px h-80px" :src="item1?.auctionArtworkInfo?.artwork?.hdPic" alt=""/>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</div>
|
2025-02-08 02:06:21 +00:00
|
|
|
|
<div class="flex flex-col justify-between grow-1">
|
|
|
|
|
<div class="text-#000 text-16px ellipsis line-height-21px">{{item1?.auctionArtworkInfo?.artworkTitle}}{{item1?.auctionArtworkInfo?.artworkTitle}}{{item1?.auctionArtworkInfo?.artworkTitle}}</div>
|
|
|
|
|
<div class="flex justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="text-#575757 text-14px line-height-none mb-5px">起拍价:RMB 1,000</div>
|
|
|
|
|
<div class="text-#B58047 text-14px line-height-none">成交价:RMB 10,000</div>
|
|
|
|
|
</div>
|
2025-02-08 02:16:54 +00:00
|
|
|
|
<div v-if="[1,3,4].includes(item1.status)" @click="goPay">
|
2025-02-08 02:06:21 +00:00
|
|
|
|
<van-button class="w-73px van-btn-h-30px" type="primary"><span class="text-12px">去支付</span></van-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-01-13 02:55:10 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</van-list>
|
|
|
|
|
</van-pull-refresh>
|
|
|
|
|
</div>
|
2025-01-08 05:26:12 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
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;
|
|
|
|
|
}
|
|
|
|
|
</style>
|