瀏覽代碼

update 用户状态

warrior 4 月之前
父節點
當前提交
1bb69a871f
共有 1 個文件被更改,包括 10 次插入1 次删除
  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',