From 50fe1248e39c402879f1c881faaef66d43eefee5 Mon Sep 17 00:00:00 2001
From: xingyy <64720302+Concur-max@users.noreply.github.com>
Date: Tue, 11 Feb 2025 15:39:22 +0800
Subject: [PATCH] =?UTF-8?q?refactor(liveRoom):=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E7=9B=B4=E6=92=AD=E5=AE=A4=E7=BB=84=E4=BB=B6=E5=92=8C=E6=94=AF?=
=?UTF-8?q?=E4=BB=98=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除 paymentInput 组件中的冗余属性
- 在 liveMinWindow 组件中添加路由监听,实现自动关闭功能
- 删除 PaymentInput 组件中的无用日志输出
---
app/components/liveMinWindow/index.vue | 7 ++++++-
app/pages/liveRoom/components/PaymentInput/index.vue | 1 -
app/pages/liveRoom/index.client.vue | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/app/components/liveMinWindow/index.vue b/app/components/liveMinWindow/index.vue
index ee05842..7cbb252 100644
--- a/app/components/liveMinWindow/index.vue
+++ b/app/components/liveMinWindow/index.vue
@@ -51,7 +51,7 @@ const props = defineProps({
const router = useRouter()
const dragRef = shallowRef(null)
const route = useRoute()
-console.log('route',route)
+
const isDragging = ref(false)
const startX = ref(0)
const startY = ref(0)
@@ -143,6 +143,11 @@ const handleClose = (event) => {
event?.stopPropagation()
props.onClose()
}
+watch(() => route.path, (newVal) => {
+ if (['/','/home'].includes(newVal)){
+ handleClose()
+ }
+})
onBeforeUnmount(() => {
document.removeEventListener('mousemove', handleDragMove)
document.removeEventListener('mouseup', handleDragEnd)
diff --git a/app/pages/liveRoom/components/PaymentInput/index.vue b/app/pages/liveRoom/components/PaymentInput/index.vue
index 9754263..08f89d8 100644
--- a/app/pages/liveRoom/components/PaymentInput/index.vue
+++ b/app/pages/liveRoom/components/PaymentInput/index.vue
@@ -19,7 +19,6 @@ const changePayStatus=()=>{
payStatus.value=payStatus.value===0?1:0
}
const close=()=>{
- console.log('close')
emit('update:show',false)
}
const confirm=()=>{
diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue
index 5649ea5..9a0288d 100644
--- a/app/pages/liveRoom/index.client.vue
+++ b/app/pages/liveRoom/index.client.vue
@@ -117,7 +117,7 @@ const updateShow=()=>{