From 767e05209c41871fd7e1237755d455f046d76fbc Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Mon, 17 Feb 2025 15:18:55 +0800 Subject: [PATCH 01/11] =?UTF-8?q?feat(live):=20=E4=BC=98=E5=8C=96=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=97=B4=E5=8A=9F=E8=83=BD=E5=92=8C=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改返回逻辑,仅在首页时退出全屏- 优化国际化处理,使用 t 函数替代 $t -调整直播室错误和成功提示信息的显示 - 修复签名面板的确认功能 - --- app/components/AppHeader.vue | 2 +- .../liveRoom/components/SideButton/index.vue | 40 +++++++++++++++++-- app/pages/liveRoom/index.client.vue | 24 +++++------ app/pages/signature/panel/index.vue | 5 ++- app/stores/live/index.js | 2 +- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index 598c472..86c38dc 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -7,7 +7,7 @@ const route = useRoute() const router = useRouter() const {auctionDetail} = goodStore(); function onBack() { - if (fullLive.value){ + if (fullLive.value&&route.name==='index'){ fullLive.value=false return } diff --git a/app/pages/liveRoom/components/SideButton/index.vue b/app/pages/liveRoom/components/SideButton/index.vue index 142dc27..7ddd79f 100644 --- a/app/pages/liveRoom/components/SideButton/index.vue +++ b/app/pages/liveRoom/components/SideButton/index.vue @@ -7,12 +7,13 @@ import xButton from '@/components/x-button/index.vue' import tangPopup from './tangPopup.vue' import { goodStore } from "@/stores/goods/index.js" import { authStore } from "~/stores/auth/index.js" +import {showMinWindow} from "~/components/liveMinWindow/createMinWindow.js"; -const { quoteStatus, changeStatus, show, auctionData, getSocketData } = liveStore() +const { quoteStatus, changeStatus, show, auctionData, getSocketData ,lastSnapshot,fullLive} = liveStore() const { pageRef } = goodStore() const { userInfo } = authStore() const showTang = ref(false) - +const router = useRouter() // 拖动相关状态 const isDragging = ref(false) const startY = ref(0) @@ -74,7 +75,39 @@ const handleTouchMove = (e) => { const handleTouchEnd = () => { isDragging.value = false } +const captureVideoFrame = () => { + try { + const video = document.querySelector('#J_prismPlayer video') + if (!video) { + console.error('未找到视频元素') + return null + } + const canvas = document.createElement('canvas') + canvas.width = video.videoWidth + canvas.height = video.videoHeight + + const ctx = canvas.getContext('2d') + ctx.drawImage(video, 0, 0, canvas.width, canvas.height) + return canvas.toDataURL('image/jpeg', 0.9) + } catch (error) { + console.error('获取视频截图失败:', error) + return null + } +} +const handleCapture = () => { + const imageUrl = captureVideoFrame() + if (imageUrl) { + lastSnapshot.value=imageUrl + showMinWindow(lastSnapshot.value,{ + onClick:()=>{ + router.replace('/') + fullLive.value=true + console.log('执行') + } + }) + } +} // 组件挂载时添加事件监听 onMounted(() => { if (sidebarRef.value) { @@ -102,7 +135,8 @@ const paySide = computed(() => { }) const goPay = () => { - show.value = true + handleCapture() + router.push('/signature/protocol') } diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue index 8a8ce89..b6e193a 100644 --- a/app/pages/liveRoom/index.client.vue +++ b/app/pages/liveRoom/index.client.vue @@ -14,7 +14,7 @@ import {artworkBuy} from "@/api/goods/index.js" import {useI18n} from 'vue-i18n' import gsap from 'gsap' import {CountUp} from 'countup.js' - +const { t } = useI18n() const countUpRef = ref(null) const nextPriceRef = ref(null) @@ -55,7 +55,7 @@ const initializePlayer = async () => { player.value.on('error', handlePlayerError) } catch (error) { showConfirmDialog({ - message: useI18n().t('live_room.error_mess'), + message: t('live_room.error_mess'), showCancelButton: true }).then(() => { @@ -118,12 +118,12 @@ const goBuy = async () => { buyMoney: String(auctionData.value?.nowAuctionPrice?.nextPrice ?? 0) }) if (res.status === 0) { - message.success(useI18n().t('live_room.success_mess')) + message.success(t('live_room.success_mess')) } } const tipOpen = () => { - message.warning(useI18n().t('live_room.warn_mess')) + message.warning(t('live_room.warn_mess')) } @@ -136,24 +136,24 @@ const tipOpen = () => {
-
{{ $t('live_room.now_price') }}:{{ auctionData?.nowAuctionPrice?.currency }}
+
{{ t('live_room.now_price') }}:{{ auctionData?.nowAuctionPrice?.currency }}
-
{{ $t('live_room.lower_price') }}:{{ auctionData?.nowAuctionPrice?.currency }}
+
{{ 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?.nextPrice ?? 0}` }}
-
- -
{{ $t('live_room.button') }}
+
+ +
{{ t('live_room.button') }}
@@ -167,7 +167,7 @@ const tipOpen = () => { class="w-344px h-31px rounded-4px absolute top-9px bg-[#151824]/45 backdrop-blur-[10px] backdrop-saturate-[180%] left-1/2 transform translate-x--1/2 flex text-#fff text-14px items-center px-12px line-height-none">
LOT{{ auctionData.artwork.index }}
{{ auctionData.artwork.name }}
-
{{ $t('live_room.start') }}
+
{{ t('live_room.start') }}
@@ -190,7 +190,7 @@ const tipOpen = () => { /* 定义过渡动画 */ .fade-enter-active { - transition: opacity 1.5s ease; + transition: opacity 1s ease; } .fade-leave-active { diff --git a/app/pages/signature/panel/index.vue b/app/pages/signature/panel/index.vue index 6420047..acbc9ab 100644 --- a/app/pages/signature/panel/index.vue +++ b/app/pages/signature/panel/index.vue @@ -58,10 +58,11 @@ const handleSignatureSubmit = async (data) => { }; const confirm = async () => { const res = await signOffline({ - signImgFileData: data.image + signImgFileData: imgUrl.value }) + if (res.status===0){ - console.log('res', res) + } } const goBack = () => { router.back() diff --git a/app/stores/live/index.js b/app/stores/live/index.js index 8a85533..7d327f1 100644 --- a/app/stores/live/index.js +++ b/app/stores/live/index.js @@ -234,7 +234,7 @@ export const liveStore = createGlobalState(() => { } const changeStatus = () => { if (auctionData.value.artwork.isSelling&&!auctionData.value.artwork.isSoled){ - quoteStatus.value = true + quoteStatus.value = !quoteStatus.value }else { if (quoteStatus.value){ quoteStatus.value = false From 450372ce847c7cfc0cdea7cd782b94eafa29f04f Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:54:11 +0800 Subject: [PATCH 02/11] =?UTF-8?q?feat(payment):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增支付相关页面和功能 - 优化直播室页面,增加静音提示和加载动画 - 修改首页拍卖信息展示逻辑 - 重构侧边按钮组件,支持拖动和吸附功能 --- app/api/goods/index.js | 8 ++ app/components/liveLoading/index.vue | 107 ++++++++++++++++++ app/pages/home/index.vue | 17 ++- .../components/PaymentInput/index.vue | 1 - .../liveRoom/components/SideButton/index.vue | 56 +++++++-- app/pages/liveRoom/index.client.vue | 83 +++++++++++--- app/pages/payment/index.vue | 68 +++++++++++ app/pages/payment/result/index.vue | 20 ++++ app/pages/signature/panel/index.vue | 2 +- app/static/images/5554@2x1.png | Bin 0 -> 10865 bytes app/static/images/z6022@2x.png | Bin 0 -> 496975 bytes app/stores/live/index.js | 5 +- i18n/locales/zh-CN.json | 5 + 13 files changed, 339 insertions(+), 33 deletions(-) create mode 100644 app/components/liveLoading/index.vue create mode 100644 app/pages/payment/index.vue create mode 100644 app/pages/payment/result/index.vue create mode 100644 app/static/images/5554@2x1.png create mode 100644 app/static/images/z6022@2x.png diff --git a/app/api/goods/index.js b/app/api/goods/index.js index 3e2a5e7..4c0fee7 100644 --- a/app/api/goods/index.js +++ b/app/api/goods/index.js @@ -69,4 +69,12 @@ export async function fddCheck(data) { method: 'POST', data }) +} +export async function createBuyOrder(data) { + + return await request( { + url:'/api/v1/m/auction/createBuyOrder', + method: 'POST', + data + }) } \ No newline at end of file diff --git a/app/components/liveLoading/index.vue b/app/components/liveLoading/index.vue new file mode 100644 index 0000000..6381dac --- /dev/null +++ b/app/components/liveLoading/index.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/app/pages/home/index.vue b/app/pages/home/index.vue index e1321df..b0fe5ad 100644 --- a/app/pages/home/index.vue +++ b/app/pages/home/index.vue @@ -9,24 +9,29 @@ import {liveStore} from "~/stores/live/index.js"; const {getAuctionDetail, auctionDetail} = goodStore(); const {fullLive} = liveStore() const changeLive = () => { - fullLive.value = true; -}; -if (!auctionDetail.value.uuid) { - await getAuctionDetail() + if (auctionDetail.value.isLiving===1){ + fullLive.value = true; + } } - +await getAuctionDetail() - - - \ No newline at end of file diff --git a/app/pages/payment/index.vue b/app/pages/payment/index.vue index 931561b..c2ffe17 100644 --- a/app/pages/payment/index.vue +++ b/app/pages/payment/index.vue @@ -3,7 +3,8 @@ import {liveStore} from "~/stores/live/index.js"; 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() const payStatus=ref(0) const changePayStatus=()=>{ payStatus.value=payStatus.value===0?1:0 diff --git a/app/pages/payment/result/index.vue b/app/pages/payment/result/index.vue index 059ca2d..0a5fafc 100644 --- a/app/pages/payment/result/index.vue +++ b/app/pages/payment/result/index.vue @@ -3,6 +3,7 @@ import {orderQuery} from "~/api/goods/index.js"; definePageMeta({ i18n: 'payment.text1', }) +const router = useRouter() const {t}=useI18n(); const route = useRoute(); const resData=ref({}) @@ -18,15 +19,23 @@ const statusLabel={ 3:t('payment.text4'), 4:t('payment.text5'), } +const goHome=()=>{ + router.push('/') +} diff --git a/app/stores/auth/index.js b/app/stores/auth/index.js index f079db1..4fe36c1 100644 --- a/app/stores/auth/index.js +++ b/app/stores/auth/index.js @@ -4,7 +4,9 @@ export const authStore = createGlobalState(() => { const RefreshToken=useLocalStorage('RefreshToken','') const userInfo=useLocalStorage('userInfo',{}) const fingerprint=useLocalStorage('fingerprint','') + const checkoutSessionUrl=useLocalStorage('checkoutSessionUrl','') return{ + checkoutSessionUrl, userInfo, RefreshToken, token, From 62fb1fd2ffaab477c5ad646bd2d5731f8fae630b Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:33:56 +0800 Subject: [PATCH 07/11] =?UTF-8?q?feat(goods):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=AD=BE=E5=90=8D=E5=8A=9F=E8=83=BD=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 signOnline 函数用于在线签名 - 优化 profile 页面,根据订单状态跳转到不同页面- 更新 realAuth 页面,修复跳转链接问题 - 修改 signature 页面,使用新的在线签名函数 - 更新多语言文案,增加部分支付状态描述 --- app/api/goods/index.js | 8 ++++++++ app/pages/profile/index.vue | 22 ++++++++++++++++------ app/pages/realAuth/index.vue | 6 +++--- app/pages/signature/panel/index.vue | 5 +++-- i18n/locales/zh-CN.json | 5 +++-- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/app/api/goods/index.js b/app/api/goods/index.js index 17ef793..5540093 100644 --- a/app/api/goods/index.js +++ b/app/api/goods/index.js @@ -54,6 +54,14 @@ export async function logSendlog(data) { data }) } +export async function signOnline(data) { + + return await request( { + url:'/api/v1/contract/sign-online', + method: 'POST', + data + }) +} export async function signOffline(data) { return await request( { diff --git a/app/pages/profile/index.vue b/app/pages/profile/index.vue index 5bdbdcb..0c25fc1 100644 --- a/app/pages/profile/index.vue +++ b/app/pages/profile/index.vue @@ -8,7 +8,7 @@ definePageMeta({ layout: 'default', i18n: 'menu.profile', }) - +const {t}=useI18n(); const router = useRouter() const { userInfo } = authStore() const showMyList = ref([]) @@ -47,9 +47,19 @@ const onRefresh = async () => { localState.value.refreshing = false } -const goPay = () => router.push('/signature/protocol') +const goPay = (status) => { + if (status===1){ + router.push('/signature/protocol') + }else if (status===4){ + router.push('/payment') + } +} const goDetail = (item) => router.push({ path: '/artDetail', query: { uuid: item.uuid } }) - +const statusLabel={ + 1:t('payment.text4'), + 2:t('payment.text2'), + 4:t('payment.text6'), +} fetchData() @@ -109,17 +119,17 @@ fetchData()
- {{ $t('home.start_price') }}:RMB 1,000 + {{ $t('home.start_price') }}:{{item.auctionArtworkInfo?.soldPriceCurrency}} {{item.auctionArtworkInfo?.soldPrice}}
- {{ $t('home.close_price') }}:RMB 10,000 + {{ $t('home.close_price') }}:{{item.baseCurrency}} {{item.baseMoney}}
{{ $t('art_detail_page.button') }} diff --git a/app/pages/realAuth/index.vue b/app/pages/realAuth/index.vue index bf4edd8..24717b8 100644 --- a/app/pages/realAuth/index.vue +++ b/app/pages/realAuth/index.vue @@ -60,8 +60,8 @@ const confirm=async ()=>{ message.success(t('realAuth.success_mess')) const res1=await fddCheck() if (res1.status===0){ - if (!res1.data.isNeedJump){ - window.open(res1.data.h5Url) + if (res1.data.isNeedJump){ + window.location.href=res1.data.h5Url } } } @@ -146,7 +146,7 @@ const goLogin=()=>{ \ No newline at end of file diff --git a/app/pages/realAuth/index.vue b/app/pages/realAuth/index.vue index 011127d..03e96bf 100644 --- a/app/pages/realAuth/index.vue +++ b/app/pages/realAuth/index.vue @@ -145,9 +145,7 @@ const goLogin=()=>{ \ No newline at end of file From 3be7cec1c2836c3fc3f754137f50b043df374b2f Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:53:38 +0800 Subject: [PATCH 11/11] 12 --- app/app.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.vue b/app/app.vue index 32415d1..a1611f7 100644 --- a/app/app.vue +++ b/app/app.vue @@ -82,7 +82,7 @@ provide('slideDirection', slideDirection) :root { --safe-area-inset-bottom: env(safe-area-inset-bottom); } -.van-cell__title, .van-cell__value{ +.van-cell.van-field .van-cell__title, .van-cell__value{ flex: initial; } \ No newline at end of file