able99 4 years ago
parent
commit
7412a6f9cf
1 changed files with 16 additions and 3 deletions
  1. 16 3
      pagesMedia/pickVideo.nvue

+ 16 - 3
pagesMedia/pickVideo.nvue

@@ -1,5 +1,5 @@
 <template>
-	<view class="container">
+	<view class="container" :style="'height: '+windowHeight+'px;'">
     <jhlive 
 			ref="jhlive" 
 			class="jhlive"
@@ -12,7 +12,8 @@
 			:avatar="avatar"
 			:num="num"
 			:likes="likes"
-      :name="name" />
+      :name="name"
+      @onRemoteUser="handleRemoteUser" />
 	</view>
 </template>
 
@@ -73,7 +74,19 @@
 			},
 			exitRoom() {
         this.$refs.jhlive&&this.$refs.jhlive.exitRoom();
-			},
+      },
+      handleRemoteUser(users) {
+        this.num = users.length;
+        users.length&&this.request(API.getMainInfo +"?userId="+ users[0], {}, 'GET').then(res => {
+          this.avatar = res.data.headimg;
+          this.name = res.data.nickname;
+        }).catch(error => {
+          uni.showToast({
+            title: error.data.msg,
+            duration: 2000
+          });
+        })
+      }
 		}
 	}
 </script>