Browse Source

直播结束提示退出

zhangli 4 years ago
parent
commit
dad024c057
2 changed files with 17 additions and 16 deletions
  1. 15 14
      pagesGood/liveDetail.vue
  2. 2 2
      pagesGood/trtc-room/trtc-room.vue

+ 15 - 14
pagesGood/liveDetail.vue

@@ -4,7 +4,7 @@
 		<view class="top_box" :style="{ top: btn_top, left: btn_left}">
 			<image class="top_box_img" :src="head_img" mode="aspectFill"></image>
 			<view class="top_box_text">
-				<text class="text_box_top">{{title}}</text><text class="text_box_bottom">{{user_name}}</text>
+				<text class="text_box_top">{{title}}</text><text class="text_box_bottom" style="display:none">{{user_name}}</text>
 			</view>
 		</view>
 		<view class="popup-open" @click="showGoods()">
@@ -231,11 +231,8 @@
 					}
 				}); // 远端用户退出
 				this.trtcComponent.on(TRTC_EVENT.REMOTE_USER_LEAVE, event => {
-					let user_list=this.trtcComponent.getRemoteUserList();
-					this.setData({
-						user_name:user_list.length
-					})
-					if (event.data.userID == this.userID) {
+					
+					//if (event.data.userID == this.userID) {
 						console.log("直播用户退出");
 						this.$refs.uTips.show({
 							title: '直播用户退出',
@@ -243,8 +240,12 @@
 						})
 						setTimeout(() => {
 							uni.navigateBack()
-						}, 1000)
-					}
+						}, 3000)
+					//}
+					let user_list=this.trtcComponent.getRemoteUserList();
+					this.setData({
+						user_name:user_list.length
+					})
 				}); // 远端用户推送视频
 				this.trtcComponent.on(TRTC_EVENT.REMOTE_VIDEO_ADD, event => {
 					console.log('* room REMOTE_VIDEO_ADD', event, this.trtcComponent.getRemoteUserList()); // 订阅视频
@@ -482,12 +483,12 @@
 		  padding-top: 2rpx;
 		}
 		.text_box_top{
-		  font-size: 28rpx;
-		width: 100%;
-		display: block;
-		height: 30rpx;
-		float: left;
-		margin-top: 6rpx;
+		  font-size: 34rpx;
+		  width: 100%;
+		  display: block;
+		  height: 30rpx;
+		  float: left;
+		  margin-top: 19rpx;
 		}
 		.text_box_bottom{
 		  font-size: 22rpx;

+ 2 - 2
pagesGood/trtc-room/trtc-room.vue

@@ -106,7 +106,7 @@
 				</view>
 			</view>
 			<view v-if="template === 'grid'">
-				<view data-type="template" data-is="grid" data-attr="pusher, streamList, debug, panelName">
+				<view style="background: #000" data-type="template" data-is="grid" data-attr="pusher, streamList, debug, panelName">
 					<view :class="'template-grid ' + (streamList.length < 6 ? 'stream-' + streamList.length : 'stream-5')">
 						<view
 							v-for="(item, streamID) in streamList"
@@ -168,7 +168,7 @@
 							</view>
 							<progress class="volume-progress" :percent="item.volume" stroke-width="4"></progress>
 						</view>
-						<view :class="'view-container pusher-container ' + (pusher.isVisible ? '' : 'none')">
+						<view style="display:none" :class="'view-container pusher-container ' + (pusher.isVisible ? '' : 'none')">
 							<live-pusher
 								class="pusher"
 								:url="pusher.url"