chore(components): diy组件部分添加点击事件句柄重新处理

This commit is contained in:
2025-10-30 18:09:57 +08:00
parent fc232ad938
commit 55ebc174b9
15 changed files with 180 additions and 70 deletions

View File

@@ -1,6 +1,6 @@
<template>
<x-skeleton data-component-name="diy-live" type="banner" :loading="loading" :configs="skeletonConfig">
<view class="live-wrap" @click="entryRoom(liveInfo.roomid)" v-if="liveInfo">
<view class="live-wrap" @click="handlerClick(liveInfo.roomid)" @tap="handlerClick(liveInfo.roomid)" v-if="liveInfo">
<view class="banner-wrap">
<image :src="liveInfo.banner != '' ? $util.img(liveInfo.banner) : $util.img('public/uniapp/live/live_default_banner.png')"
mode="widthFix" @error="liveInfo.banner = $util.img('public/uniapp/live/live_default_banner.png')"/>
@@ -32,6 +32,7 @@
<script>
// 直播
import DiyMinx from './minx.js'
export default {
components: {},
name: 'diy-live',
@@ -59,6 +60,7 @@
created() {
this.getLiveInfo();
},
mixins: [DiyMinx],
watch: {
// 组件刷新监听
componentRefresh: function(nval) {
@@ -136,7 +138,13 @@
}
}
});
}
},
async handlerClick(roomid) {
await this.__$emitEvent({eventName: 'live-tap', data: roomid, promiseCallback: (event, handler, awaitedResult) => {
if (!awaitedResult) return;
this.entryRoom(roomid);
}})
},
}
};
</script>