refactor(liveRoom): 优化直播室组件和支付功能
- 移除 paymentInput 组件中的冗余属性 - 在 liveMinWindow 组件中添加路由监听,实现自动关闭功能 - 删除 PaymentInput 组件中的无用日志输出
This commit is contained in:
parent
def6a6b71e
commit
50fe1248e3
@ -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)
|
||||
|
@ -19,7 +19,6 @@ const changePayStatus=()=>{
|
||||
payStatus.value=payStatus.value===0?1:0
|
||||
}
|
||||
const close=()=>{
|
||||
console.log('close')
|
||||
emit('update:show',false)
|
||||
}
|
||||
const confirm=()=>{
|
||||
|
@ -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"/>
|
||||
|
Loading…
Reference in New Issue
Block a user