refactor/artDetail: 重构艺术品详情页面
- 移除 goodStore 的使用,改为直接调用 userArtwork API - 通过路由参数获取艺术品 UUID,动态加载详情数据 - 更新模板,使用新获取的数据渲染页面 - 修改 profile 页面跳转到艺术品详情的方式,传递 UUID 参数
This commit is contained in:
parent
aec3825a3b
commit
47aa573641
@ -1,13 +1,23 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import itemDetail from '@/components/itemDetail/index.vue'
|
import itemDetail from '@/components/itemDetail/index.vue'
|
||||||
import {goodStore} from "~/stores/goods/index.js";
|
import {userArtwork} from "~/api/goods/index.js";
|
||||||
const {artWorkDetail} = goodStore()
|
const route = useRoute()
|
||||||
|
const detail=ref({})
|
||||||
|
const uuid = route.query.uuid
|
||||||
|
const initData=async ()=>{
|
||||||
|
const res=await userArtwork({uuid})
|
||||||
|
if (res.status===0){
|
||||||
|
detail.value=res.data
|
||||||
|
console.log('detail.value',detail.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
initData()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="relative h-screen-nav flex flex-col">
|
<div class="relative h-screen-nav flex flex-col">
|
||||||
<itemDetail class="grow-1" :detail-info="artWorkDetail"/>
|
<itemDetail class="grow-1" :detail-info="detail.auctionArtworkInfo"/>
|
||||||
<div class="h-81px bg-#fff flex justify-center pt-7px">
|
<div v-if="[1,3,4].includes(detail.status)" class="h-81px bg-#fff flex justify-center pt-7px">
|
||||||
<van-button class="w-213px van-btn-h-38px" type="primary">
|
<van-button class="w-213px van-btn-h-38px" type="primary">
|
||||||
<span class="text-#fff text-14px">去支付 RMB10,000</span>
|
<span class="text-#fff text-14px">去支付 RMB10,000</span>
|
||||||
</van-button>
|
</van-button>
|
||||||
|
@ -42,9 +42,12 @@ const goPay=()=>{
|
|||||||
|
|
||||||
}
|
}
|
||||||
const goDetail=(item)=>{
|
const goDetail=(item)=>{
|
||||||
artWorkDetail.value=item.auctionArtworkInfo
|
router.push({
|
||||||
console.log(' artWorkDetail.value', artWorkDetail.value)
|
path:'/artDetail',
|
||||||
router.push('/artDetail')
|
query:{
|
||||||
|
uuid:item.uuid
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -80,7 +83,7 @@ const goDetail=(item)=>{
|
|||||||
<div class="text-#575757 text-14px line-height-none mb-5px">起拍价:RMB 1,000</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 class="text-#B58047 text-14px line-height-none">成交价:RMB 10,000</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="[1,3,4].includes(item.status)" @click="goPay">
|
<div v-if="[1,3,4].includes(item1.status)" @click="goPay">
|
||||||
<van-button class="w-73px van-btn-h-30px" type="primary"><span class="text-12px">去支付</span></van-button>
|
<van-button class="w-73px van-btn-h-30px" type="primary"><span class="text-12px">去支付</span></van-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user