fenghe-auction/app/pages/artDetail/index.vue
2025-04-10 15:47:40 +08:00

60 lines
1.7 KiB
Vue

<script setup>
import itemDetail from '@/components/itemDetail/index.vue'
import {userArtwork} from "~/api/goods/index.js";
import {useRouter} from "#vue-router";
import {authStore} from "~/stores/auth/index.js";
definePageMeta({
i18n: 'detail.text8'
})
const { userInfo, payment } = authStore()
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
detail.value.auctionArtworkInfo.userId=detail.value.userID
}
}
const router = useRouter();
const goPay=()=>{
payment.value.leftPrice=detail.value.leftCnyPrice
payment.value.leftCurrency=detail.value.leftCurrency
payment.value.buyUid=detail.value.uuid
payment.value.auctionArtworkUuid=detail.value?.auctionArtworkUuid
if (detail.value.status===1){
router.push('/signature/protocol')
}else if (detail.value.status===4){
router.push('/payment')
}
//router.push('/payment')
}
function formatThousands(num) {
return Number(num).toLocaleString();
}
initData()
</script>
<template>
<div class="relative h-screen-nav flex flex-col">
<itemDetail class="grow-1" :detail-info="detail.auctionArtworkInfo"/>
<div v-if="[1,3,4].includes(detail.status)" class="h-81px bg-#fff flex justify-center pt-7px shrink-0">
<van-button class="w-213px !h-38px" type="primary" @click="goPay">
<span class="text-#fff text-14px">{{ $t('art_detail_page.button') }} {{detail.leftCurrency}}{{formatThousands(detail.leftPrice)}}</span>
</van-button>
</div>
</div>
</template>
<style scoped>
.cursor-move {
touch-action: none;
user-select: none;
}
</style>