refactor(payment): 优化支付相关页面和功能

- 修改支付页面中的价格显示,使用 leftCnyPrice 替代 leftPrice
- 添加用户编号查询功能,在签名前检查用户是否已存在
- 优化直播室侧边按钮的支付逻辑,使用 leftCnyPrice 替代 leftPrice
- 统一支付结果页面的展示逻辑,根据支付状态显示不同图片
- 修复艺术详情页面中的价格显示问题,使用 leftCnyPrice 替代 leftPrice
- 优化个人资料页面中的支付逻辑,使用 leftCnyPrice 替代 leftPrice
This commit is contained in:
xingyy 2025-03-07 19:23:52 +08:00
parent b87e8d3346
commit fae3728f5a
9 changed files with 42 additions and 21 deletions

View File

@ -20,4 +20,11 @@ export async function mobileLogin(data) {
method: 'POST',
data
})
}
export async function sessionUserNo(data) {
return await request( {
url:'/api/v1/auction/sessionUserNo/check',
method: 'POST',
data
})
}

View File

@ -16,13 +16,12 @@ const initData = async () => {
if (res.status === 0) {
detail.value = res.data
detail.value.auctionArtworkInfo.userId=detail.value.userID
console.log('detail.value',detail.value)
}
}
const router = useRouter();
const goPay=()=>{
payment.value.leftPrice=detail.value.leftPrice
payment.value.leftPrice=detail.value.leftCnyPrice
payment.value.leftCurrency=detail.value.leftCurrency
payment.value.buyUid=detail.value.uuid
payment.value.auctionArtworkUuid=detail.value?.auctionArtworkUuid

View File

@ -27,7 +27,8 @@ const goHome=()=>{
<template>
<div class="w-[100vw] h-screen-nav bg-[url('@/static/images/3532@2x.png')] bg-cover grow-1 flex flex-col items-center px-30px">
<div class="flex flex-col items-center mt-150px">
<img class="w-119px h-120px mb-36px" src="@/static/images/5554@2x1.png" alt="">
<img v-if="resData.status===1" class="w-119px h-120px mb-36px" src="@/static/images/5554@2x1.png" alt="">
<img v-else class="w-119px h-120px mb-36px" src="@/static/images/zu6021@2x.png" alt="">
<div class="text-#000 text-16px mb-25px">{{statusLabel[resData.status]}}!</div>
<div class="text-#999 text-16px">{{resData.currency}}{{resData.money}}</div>
</div>

View File

@ -6,6 +6,7 @@ import {codeAuthStore} from "@/stores-collect-code/auth/index.js";
import {message} from "@/components/x-message/useMessage.js";
import countryCode from '@/pages/countryRegion/data/index.js'
import {fddInfo, offlineQrcode} from "~/api-collect-code/goods/index.js";
import {sessionUserNo} from "@/api-collect-code/auth/index.js";
import {signOffline} from "~/api/goods/index.js";
const {formData,number,auctionArtworkUuid,qrUid,qrData}=codeAuthStore()
definePageMeta({
@ -93,9 +94,7 @@ const initData= async ()=>{
}
}
if(!formData.value.countryCode){
console.log('formData.value.countryCode',!!formData.value.countryCode)
const defaultCountry = getDefaultCountry()
console.log('defaultCountry',defaultCountry)
formData.value.countryCode= defaultCountry.zone
}
if (route.query.zone){
@ -109,6 +108,15 @@ const nextClick=async ()=>{
message.warning(t('signature.error.incompleteForm'))
return
}
const res2=await sessionUserNo({
phone:formData.value.phone
})
if (res2.status===0){
if(res2.data.exist){
message.warning(`您的号牌是${res2.data.userInfo.auction_user_no}`)
return
}
}
//
if (formData.value.countryCode==='86'&&formData.value.cardType===1){
const res=await fddInfo({

View File

@ -56,7 +56,7 @@ const paySide = computed(() => {
const goPay = () => {
payment.value.leftCurrency=auctionData.value.needPayBuys?.[0]?.leftCurrency
payment.value.leftPrice=auctionData.value.needPayBuys?.[0]?.leftPrice
payment.value.leftPrice=auctionData.value.needPayBuys?.[0]?.leftCnyPrice
payment.value.buyUid=auctionData.value.needPayBuys?.[0]?.uuid
payment.value.auctionArtworkUuid=auctionData.value.needPayBuys?.[0]?.auctionArtworkUuid
handleCapture()

View File

@ -7,6 +7,7 @@ import {liveStore} from "~/stores/live/index.js";
import {ref} from "vue";
const {pageRef,itemList,getArtworkList, loading: storeLoading,} = goodStore();
const {auctionData} = liveStore()
const {t:$t} = useI18n()
const showDetail=ref(false)
const localState = ref({
finished: false,
@ -71,19 +72,23 @@ watch(()=>{
watch(()=>props.show,async (newValue)=>{
if (newValue){
if(auctionData.value?.artwork?.index>itemList.value?.length+1){
const toast = showLoadingToast({
message: '加载中...',
forbidClick: true,
});
pageRef.value.pageSize=auctionData.value?.artwork?.index-itemList.value?.length
await loadMore()
pageRef.value.pageSize=5
pageRef.value.pageSize = 5;
const targetIndex = auctionData.value?.artwork?.index;
const currentLength = itemList.value?.length || 0;
const needLoadTimes = Math.ceil((targetIndex - currentLength) / pageRef.value.pageSize);
for(let i = 0; i < needLoadTimes; i++) {
pageRef.value.page++;
await getArtworkList();
}
await nextTick();
scrollToCurrentItem();
} else {
nextTick(()=>{
scrollToCurrentItem();
});
}
nextTick(()=>{
scrollToCurrentItem()
toast.close()
})
}
})
</script>

View File

@ -78,7 +78,8 @@ const goHome = () => {
<div
class="w-[100vw] h-screen-nav bg-[url('@/static/images/3532@2x.png')] bg-cover grow-1 flex flex-col items-center px-30px">
<div class="flex flex-col items-center mt-150px">
<img class="w-119px h-120px mb-36px" src="@/static/images/5554@2x1.png" alt="">
<img v-if="resData.status===1" class="w-119px h-120px mb-36px" src="@/static/images/5554@2x1.png" alt="">
<img v-else class="w-119px h-120px mb-36px" src="@/static/images/zu6021@2x.png" alt="">
<div class="text-#000 text-16px mb-25px">{{ statusLabel[resData.status] }}!</div>
<div class="text-#999 text-16px">{{ resData.currency }}{{ resData.money }}</div>
</div>

View File

@ -47,7 +47,7 @@ const onRefresh = async () => {
}
const goPay = (item) => {
payment.value.leftPrice=item.leftPrice
payment.value.leftPrice=item.leftCnyPrice
payment.value.leftCurrency=item.leftCurrency
payment.value.buyUid=item.uuid
payment.value.auctionArtworkUuid=item?.auctionArtworkUuid
@ -137,7 +137,7 @@ fetchData()
<div>
<div class="text-#575757 text-14px line-height-none mb-5px">
{{ $t('home.start_price') }}{{item.auctionArtworkInfo?.startPriceCurrency}} {{item.auctionArtworkInfo?.startPrice}}
</div>
</div>
<div class="text-#B58047 text-14px line-height-none">
{{ $t('home.close_price') }}{{item.baseCurrency}} {{item.baseMoney}}
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB