Browse Source

update 用户状态

warrior 4 months ago
parent
commit
1bb69a871f
1 changed files with 10 additions and 1 deletions
  1. 10 1
      projects/live-app/src/moduls/user/profile/profile.component.ts

+ 10 - 1
projects/live-app/src/moduls/user/profile/profile.component.ts

@@ -82,7 +82,7 @@ export class ProfileComponent implements OnInit {
         color:'#a1a1a1',
       },
       "CONNECTING":{
-        val:'忙',
+        val:'忙线',
         color:'#cf1b24',
       },
       "":{
@@ -243,6 +243,15 @@ export class ProfileComponent implements OnInit {
   }
   async toLiveContact() {
     this.userStatus = await this.connectTask.getState(this.uid,this.uid)
+    if(this.userStatus !== 'ONLINE'){
+      const toast = await this.toastController.create({
+        message: '对方不在线或忙线中',
+        color: 'warning',
+        duration: 1500,
+      });
+      toast.present();
+      return
+    }
     console.log(this.userStatus);
     const alert = await this.alertController.create({
       cssClass: 'my-custom-class',