feat(payment): 优化艺术品详情和用户主页的支付流程
- 在艺术品详情页添加支付相关数据的存储和处理 - 根据艺术品状态跳转到不同的支付页面 - 在用户主页添加拍卖艺术品UUID的存储 - 优化页面布局,确保元素不被压缩
This commit is contained in:
parent
e0e40d45e7
commit
911aa9ce1f
@ -2,9 +2,11 @@
|
||||
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
|
||||
@ -48,8 +50,18 @@ const stopDrag = () => {
|
||||
isDragging.value = false
|
||||
}
|
||||
const goPay=()=>{
|
||||
payment.value.leftPrice=detail.value.leftPrice
|
||||
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')
|
||||
}
|
||||
console.log('detail',detail.value)
|
||||
//router.push('/payment')
|
||||
}
|
||||
onMounted(() => {
|
||||
document.addEventListener('mousemove', onDrag)
|
||||
document.addEventListener('mouseup', stopDrag)
|
||||
@ -72,7 +84,7 @@ initData()
|
||||
<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">
|
||||
<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>
|
||||
@ -88,7 +100,7 @@ initData()
|
||||
>
|
||||
<img src="@/static/images/zd5530@2x.png" class="w-full h-full" alt="">
|
||||
<div
|
||||
class="flex flex-col items-center absolute bottom-25px text-14px text-#B58047 left-1/2 transform translate-x--1/2 whitespace-nowrap">
|
||||
class="flex flex-col items-center absolute bottom-25px text-14px text-#B58047 left-1/2 transform translate-x--1/2 whitespace-nowrap shrink-0">
|
||||
<div>{{ $t('art_detail_page.prompt_title')}}</div>
|
||||
<div>{{ $t('art_detail_page.prompt_desc')}}</div>
|
||||
</div>
|
||||
|
@ -51,6 +51,7 @@ const goPay = (item) => {
|
||||
payment.value.leftPrice=item.leftPrice
|
||||
payment.value.leftCurrency=item.leftCurrency
|
||||
payment.value.buyUid=item.uuid
|
||||
payment.value.auctionArtworkUuid=item?.auctionArtworkUuid
|
||||
if (item.status===1){
|
||||
router.push('/signature/protocol')
|
||||
}else if (item.status===4){
|
||||
|
Loading…
Reference in New Issue
Block a user