diff --git a/app/pages/artDetail/index.vue b/app/pages/artDetail/index.vue index 8576f79..219db6f 100644 --- a/app/pages/artDetail/index.vue +++ b/app/pages/artDetail/index.vue @@ -1,6 +1,7 @@ @@ -64,8 +73,8 @@ initData()
- - {{ $t('art_detail_page.button') }} RMB10,000 + + {{ $t('art_detail_page.button') }} {{detail.leftCurrency}}{{formatThousands(detail.leftPrice)}}
{ }else { router.push('/collectCode/signature/panel') } - } diff --git a/app/pages/liveRoom/components/Broadcast/index.vue b/app/pages/liveRoom/components/Broadcast/index.vue index a6cf92a..ef889d3 100644 --- a/app/pages/liveRoom/components/Broadcast/index.vue +++ b/app/pages/liveRoom/components/Broadcast/index.vue @@ -4,6 +4,10 @@ import {authStore} from "~/stores/auth/index.js"; import {useI18n} from 'vue-i18n' const {auctionData} = liveStore() const {userInfo}= authStore() +function formatThousands(num) { + + return Number(num).toLocaleString(); +} const headList=[ { label:useI18n().t('live_room.head'), @@ -40,7 +44,7 @@ const headItem=(statusCode)=>{
{{ headItem(item.statusCode).label }}
{{ item.auctionType==='local'? $t('live_room.spot'):$t('live_room.network') }}
{{ item.createdAt }}
-
{{item.baseCurrency}}{{ item.baseMoney }}
+
{{item.baseCurrency}}{{ formatThousands(item.baseMoney) }}
{{ item.userId===userInfo.ID?$t('live_room.me'):'' }}
diff --git a/app/pages/liveRoom/components/SideButton/index.vue b/app/pages/liveRoom/components/SideButton/index.vue index 7ea0e32..00b3505 100644 --- a/app/pages/liveRoom/components/SideButton/index.vue +++ b/app/pages/liveRoom/components/SideButton/index.vue @@ -11,7 +11,7 @@ import {showMinWindow} from "~/components/liveMinWindow/createMinWindow.js"; const { quoteStatus, changeStatus, show, auctionData, getSocketData ,lastSnapshot,fullLive} = liveStore() const { pageRef } = goodStore() -const { userInfo } = authStore() +const { userInfo ,payment} = authStore() const showTang = ref(false) const router = useRouter() // 拖动相关状态 @@ -168,7 +168,7 @@ const openOne = () => { const paySide = computed(() => { //当前是否已成交,以及成交人是当前登录用户 - if (auctionData.value.artwork?.isSoled && auctionData.value.artwork?.buyInfo.userID === userInfo.value.ID) { + if (auctionData.value.artwork?.isSoled && auctionData.value.artwork?.buyInfo?.userID === userInfo.value.ID) { return true } else { return false @@ -176,6 +176,9 @@ const paySide = computed(() => { }) const goPay = () => { + payment.value.leftCurrency=auctionData.value?.nowAuctionPrice?.currency + payment.value.leftPrice=auctionData.value?.nowAuctionPrice?.successPrice + payment.value.buyUid=auctionData.value?.nowAuctionPrice?.successBuyUuid handleCapture() router.push('/signature/protocol') } diff --git a/app/pages/liveRoom/components/SideButton/tangPopup.vue b/app/pages/liveRoom/components/SideButton/tangPopup.vue index 01a1385..676a500 100644 --- a/app/pages/liveRoom/components/SideButton/tangPopup.vue +++ b/app/pages/liveRoom/components/SideButton/tangPopup.vue @@ -63,6 +63,11 @@ const loadMore = async () => { const { finished } = await getArtworkList() localState.value.finished = finished } +watch(()=>{ + return auctionData.value?.artwork?.index +},(newValue)=>{ + console.log('newValue',newValue) +}) watch(()=>props.show,(newValue)=>{ if (newValue){ nextTick(()=>{ @@ -113,7 +118,7 @@ watch(()=>props.show,(newValue)=>{ loading="lazy" />
LOT{{item.index}}
- +
diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue index d3c0c1a..d652c08 100644 --- a/app/pages/liveRoom/index.client.vue +++ b/app/pages/liveRoom/index.client.vue @@ -181,15 +181,15 @@ const tipOpen = () => {
{{ t('live_room.lower_price') }}:{{ auctionData?.nowAuctionPrice?.currency }}
-
+
{{ - `${t('live_room.confirm')} ${auctionData?.nowAuctionPrice?.currency} ${auctionData?.nowAuctionPrice?.nextPrice ?? 0}` + `${t('live_room.confirm')} ${auctionData?.nowAuctionPrice?.currency} ${auctionData?.nowAuctionPrice?.nowPrice ?? 0}` }}
-
+
{{ t('live_room.button') }}
diff --git a/app/pages/payment/index.vue b/app/pages/payment/index.vue index c2ffe17..9feaffc 100644 --- a/app/pages/payment/index.vue +++ b/app/pages/payment/index.vue @@ -4,45 +4,60 @@ import {createBuyOrder} from "~/api/goods/index.js"; import {goodStore} from "~/stores/goods/index.js"; import { showLoadingToast ,closeToast} from 'vant'; import {authStore} from "~/stores/auth/index.js"; -const {checkoutSessionUrl}= authStore() +import {message} from "~/components/x-message/useMessage.js"; +const {checkoutSessionUrl,payment}= authStore() const payStatus=ref(0) +definePageMeta({ + title: '支付' +}) const changePayStatus=()=>{ payStatus.value=payStatus.value===0?1:0 } const { auctionData} = liveStore() -const validateInput = (e) => { - const value = e.target.value - const char = String.fromCharCode(e.charCode) - - if (!/[\d.]/.test(char)) { - e.preventDefault() - return - } - - if (char === '.' && (value.includes('.') || !value)) { - e.preventDefault() - return - } - - if (value.includes('.') && value.split('.')[1]?.length >= 2) { - e.preventDefault() - return - } -} +const amount=ref('') const confirmPay=async ()=>{ + if (payStatus.value===1&&!amount.value){ + message.warning('请输入金额') + return + } + if (Number(payment.value.leftPrice) { + // 只允许数字和小数点,且只保留两位小数 + const value = e.target.value + // 清除非数字和小数点 + let newValue = value.replace(/[^\d.]/g, '') + // 确保只有一个小数点 + newValue = newValue.replace(/\.{2,}/g, '.') + // 只保留第一个小数点 + newValue = newValue.replace(/^(\d*\.\d*)\./, '$1') + // 保留两位小数 + if (newValue.indexOf('.') > 0) { + newValue = newValue.slice(0, newValue.indexOf('.') + 3) + } + // 禁止输入以0开头的多位整数 + newValue = newValue.replace(/^0+(\d)/, '$1') + + amount.value = newValue +}