修改业务逻辑处理
parent
4150f122f4
commit
60b40209da
|
|
@ -324,6 +324,8 @@
|
|||
* 组件挂载后执行初始化操作
|
||||
*/
|
||||
mounted() {
|
||||
console.log('1111');
|
||||
|
||||
// 初始化窗口信息和滚动条高度
|
||||
this.init_window_info();
|
||||
// 滚动到评论区底部
|
||||
|
|
@ -337,6 +339,8 @@
|
|||
* 组件销毁前清理资源
|
||||
*/
|
||||
beforeDestroy() {
|
||||
console.log('222');
|
||||
|
||||
// 清理socket连接
|
||||
this.clear_interval_task();
|
||||
this.unbind_keyboard_listener();
|
||||
|
|
@ -592,7 +596,7 @@
|
|||
user_name: data.content,
|
||||
text: '',
|
||||
});
|
||||
}
|
||||
}
|
||||
// 添加内容之后,需要滚动到最后
|
||||
this.scroll_to_lower();
|
||||
break;
|
||||
|
|
@ -603,15 +607,18 @@
|
|||
if (this.bulletins.length > 0 && this.bulletins[this.bulletins.length - 1].type == 'go') {
|
||||
this.bulletins.splice(this.bulletins.length - 1, 1);
|
||||
}
|
||||
this.bulletins.push({
|
||||
id: Math.random(),
|
||||
type: 'user',
|
||||
user_avatar: data.data.user.avatar,
|
||||
user_name: data.data.user.nickname,
|
||||
text: data.content,
|
||||
this.$nextTick(() => {
|
||||
this.bulletins.push({
|
||||
id: Math.random(),
|
||||
type: 'user',
|
||||
user_avatar: data.data.user.avatar,
|
||||
user_name: data.data.user.nickname,
|
||||
text: data.content,
|
||||
});
|
||||
console.log(this.bulletins);
|
||||
// 添加内容之后,需要滚动到最后
|
||||
this.scroll_to_lower();
|
||||
});
|
||||
// 添加内容之后,需要滚动到最后
|
||||
this.scroll_to_lower();
|
||||
break;
|
||||
case 'live-status':
|
||||
console.log(data.content, 'live-status');
|
||||
|
|
|
|||
|
|
@ -6,17 +6,19 @@
|
|||
<!-- 简化版点赞效果组件 -->
|
||||
<full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'"></full-screen-like-effect>
|
||||
</view>
|
||||
<view v-if="!is_loading" class="live-content" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></live-content>
|
||||
</view>
|
||||
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<view class="flex-col align-c">
|
||||
<text class="live-ended-text">{{live_end_msg}}</text>
|
||||
<button plain size="mini" class="mt-10 live-ended-button" @tap="live_back">
|
||||
<text class="cr-f pa-5">退出直播间</text>
|
||||
</button>
|
||||
<template v-if="!is_loading">
|
||||
<view class="live-content" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @handleDoubleClick="handle_double_click" @handleTouchEnd="handle_touch_end" @liveStatus="socket_live_status"></live-content>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c" :style="'width:' + windowWidth + 'px;height:' + windowHeight + 'px;'">
|
||||
<view class="flex-col align-c">
|
||||
<text class="live-ended-text">{{live_end_msg}}</text>
|
||||
<button plain size="mini" class="mt-10 live-ended-button" @tap="live_back">
|
||||
<text class="cr-f pa-5">退出直播间</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -5,23 +5,25 @@
|
|||
<!-- 简化版点赞效果组件 -->
|
||||
<full-screen-like-effect ref="fullScreenLikeEffect" :propCustomImages="like_show_imgs"></full-screen-like-effect>
|
||||
</view>
|
||||
<view v-if="!is_loading" :class="'live-content ' + (!is_live_ended ? 'pointer-events-none' : '')">
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @liveStatus="socket_live_status"></live-content>
|
||||
</view>
|
||||
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c">
|
||||
<view class="flex-col align-c">
|
||||
<text class="live-ended-text">{{live_end_msg}}</text>
|
||||
<button plain size="mini" class="mt-10 live-ended-button" @tap="live_back">
|
||||
<text class="cr-f pa-5">退出直播间</text>
|
||||
</button>
|
||||
<template v-if="!is_loading">
|
||||
<view class="live-content pointer-events-none">
|
||||
<live-content ref="liveContent" :propLiveConfig="live_config" :propLiveShowImgs="like_show_imgs" @liveBack="live_back" @liveStatus="socket_live_status"></live-content>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 静音提示 -->
|
||||
<view v-if="!is_loading && !is_live_ended && is_muted_auto_play_success" class="live-muted flex-row align-c jc-c">
|
||||
<view class="live-muted-tips">
|
||||
因浏览器限制静音,<text class="ml-5 cr-f live-muted-text" @tap="muted_tap">请点击打开声音</text>
|
||||
<view v-if="is_live_ended" class="live-ended flex-row align-c jc-c">
|
||||
<view class="flex-col align-c">
|
||||
<text class="live-ended-text">{{live_end_msg}}</text>
|
||||
<button plain size="mini" class="mt-10 live-ended-button" @tap.stop="live_back">
|
||||
<text class="cr-f pa-5">退出直播间</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 静音提示 -->
|
||||
<view v-if="!is_live_ended && is_muted_auto_play_success" class="live-muted flex-row align-c jc-c">
|
||||
<view class="live-muted-tips">
|
||||
因浏览器限制静音,<text class="ml-5 cr-f live-muted-text" @tap="muted_tap">请点击打开声音</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue