refactor(liveRoom): 优化直播室组件和支付功能

- 移除 paymentInput 组件中的冗余属性
- 在 liveMinWindow 组件中添加路由监听,实现自动关闭功能
- 删除 PaymentInput 组件中的无用日志输出
This commit is contained in:
xingyy 2025-02-11 15:39:22 +08:00
parent def6a6b71e
commit 50fe1248e3
3 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -19,7 +19,6 @@ const changePayStatus=()=>{
payStatus.value=payStatus.value===0?1:0
}
const close=()=>{
console.log('close')
emit('update:show',false)
}
const confirm=()=>{

View File

@ -117,7 +117,7 @@ const updateShow=()=>{
<broadcast></broadcast>
</div>
<paymentInput v-model:show="show" @update:show="updateShow"/>
<paymentInput v-model:show="show"/>
<div>
</div>
<paymentResults v-model:show="show1" type="error"/>