feat(payment): 优化艺术品详情和用户主页的支付流程
- 在艺术品详情页添加支付相关数据的存储和处理 - 根据艺术品状态跳转到不同的支付页面 - 在用户主页添加拍卖艺术品UUID的存储 - 优化页面布局,确保元素不被压缩
This commit is contained in:
parent
e0e40d45e7
commit
911aa9ce1f
@ -2,9 +2,11 @@
|
|||||||
import itemDetail from '@/components/itemDetail/index.vue'
|
import itemDetail from '@/components/itemDetail/index.vue'
|
||||||
import {userArtwork} from "~/api/goods/index.js";
|
import {userArtwork} from "~/api/goods/index.js";
|
||||||
import {useRouter} from "#vue-router";
|
import {useRouter} from "#vue-router";
|
||||||
|
import {authStore} from "~/stores/auth/index.js";
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
i18n: 'detail.text8'
|
i18n: 'detail.text8'
|
||||||
})
|
})
|
||||||
|
const { userInfo, payment } = authStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const detail = ref({})
|
const detail = ref({})
|
||||||
const uuid = route.query.uuid
|
const uuid = route.query.uuid
|
||||||
@ -48,7 +50,17 @@ const stopDrag = () => {
|
|||||||
isDragging.value = false
|
isDragging.value = false
|
||||||
}
|
}
|
||||||
const goPay=()=>{
|
const goPay=()=>{
|
||||||
router.push('/payment')
|
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(() => {
|
onMounted(() => {
|
||||||
document.addEventListener('mousemove', onDrag)
|
document.addEventListener('mousemove', onDrag)
|
||||||
@ -72,7 +84,7 @@ initData()
|
|||||||
<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="detail.auctionArtworkInfo"/>
|
<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">
|
<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>
|
<span class="text-#fff text-14px">{{ $t('art_detail_page.button') }} {{detail.leftCurrency}}{{formatThousands(detail.leftPrice)}}</span>
|
||||||
</van-button>
|
</van-button>
|
||||||
@ -88,7 +100,7 @@ initData()
|
|||||||
>
|
>
|
||||||
<img src="@/static/images/zd5530@2x.png" class="w-full h-full" alt="">
|
<img src="@/static/images/zd5530@2x.png" class="w-full h-full" alt="">
|
||||||
<div
|
<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_title')}}</div>
|
||||||
<div>{{ $t('art_detail_page.prompt_desc')}}</div>
|
<div>{{ $t('art_detail_page.prompt_desc')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,6 +51,7 @@ const goPay = (item) => {
|
|||||||
payment.value.leftPrice=item.leftPrice
|
payment.value.leftPrice=item.leftPrice
|
||||||
payment.value.leftCurrency=item.leftCurrency
|
payment.value.leftCurrency=item.leftCurrency
|
||||||
payment.value.buyUid=item.uuid
|
payment.value.buyUid=item.uuid
|
||||||
|
payment.value.auctionArtworkUuid=item?.auctionArtworkUuid
|
||||||
if (item.status===1){
|
if (item.status===1){
|
||||||
router.push('/signature/protocol')
|
router.push('/signature/protocol')
|
||||||
}else if (item.status===4){
|
}else if (item.status===4){
|
||||||
|
Loading…
Reference in New Issue
Block a user