Browse Source

主播端首页

warrior 2 months ago
parent
commit
e2e6039419

+ 14 - 0
projects/live-app/src/app/components/avatar/avatar.component.html

@@ -0,0 +1,14 @@
+<div
+  class="pendant"
+  [style.background-image]="'url(' + frame + ')'"
+  [style.height]="frameWt + 'px'"
+  [style.width]="frameWt + 'px'"
+>
+  <img
+    [style.height]="avatarWt + 'px'"
+    [style.width]="avatarWt + 'px'"
+    class="avatar"
+    [src]="avatar"
+    alt=""
+  />
+</div>

+ 14 - 0
projects/live-app/src/app/components/avatar/avatar.component.scss

@@ -0,0 +1,14 @@
+.pendant {
+  width: 80px;
+  height: 80px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-size: 100% 100%;
+  .avatar {
+    width: 60px;
+    height: 60px;
+    z-index: 1;
+    border-radius: 50%;
+  }
+}

+ 28 - 0
projects/live-app/src/app/components/avatar/avatar.component.spec.ts

@@ -0,0 +1,28 @@
+/* tslint:disable:no-unused-variable */
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
+import { DebugElement } from '@angular/core';
+
+import { AvatarComponent } from './avatar.component';
+
+describe('AvatarComponent', () => {
+  let component: AvatarComponent;
+  let fixture: ComponentFixture<AvatarComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ AvatarComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(AvatarComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 20 - 0
projects/live-app/src/app/components/avatar/avatar.component.ts

@@ -0,0 +1,20 @@
+import { Component, Input, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-avatar',
+  templateUrl: './avatar.component.html',
+  styleUrls: ['./avatar.component.scss'],
+  standalone: true,
+})
+export class AvatarComponent implements OnInit {
+  @Input('avatar') avatar: string = 'https://file-cloud.fmode.cn/DXNgcD6zo6/20221202/j6p8kb034039.png' //头像
+  @Input('frame') frame: string = 'https://file-cloud.fmode.cn/Qje9D4bqol/20241109/vv1tvb032259054.png' //头像框
+  @Input('frameWt') frameWt: number = 80 //外框大小
+  @Input('avatarWt') avatarWt: number = 60 //头像大小
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}

+ 1 - 1
projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.html

@@ -67,7 +67,7 @@
   </div>
   <div class="list">
     @for (item of userList; track $index) {
-    <div class="list-item" (click)="toUrl(item?.get('url'))">
+    <div class="list-item">
       <div class="list-item-left">
         <img [src]="item.avatar" alt="" class="avatar" />
       </div>

+ 30 - 8
projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.ts

@@ -14,6 +14,7 @@ import { CommonModule, DatePipe } from '@angular/common';
 import { province } from '../../../services/address';
 import { FormsModule } from '@angular/forms';
 import { InfiniteScrollCustomEvent } from '@ionic/core';
+import { MessageService } from '../../../services/message.service';
 province.unshift({
   provinceName: '全部',
   citys: [
@@ -66,9 +67,9 @@ export class AnthorhomeComponent implements OnInit {
     '你好,一起吃饭怎么样?',
     '嘿,很高兴能和你聊天!',
   ];
-  checkUser:any //当前选择的用户
-
+  checkUser: any; //当前选择的用户
   disbable: boolean = true;
+  pushUserMap = new Set(); // 在线用户列表
 
   constructor(
     private loadingCtrl: LoadingController,
@@ -78,6 +79,7 @@ export class AnthorhomeComponent implements OnInit {
     private router: Router,
     public toastController: ToastController,
     private aiServ: AiChatService,
+    private msgSer: MessageService,
     private datePipe: DatePipe
   ) {}
 
@@ -91,7 +93,7 @@ export class AnthorhomeComponent implements OnInit {
       message: '正在加载',
     });
     loading.present();
-    // await this.connectTask.init();
+    await this.connectTask.init();
     await this.getBanner();
     await this.getNotice();
     await this.getUserList();
@@ -245,18 +247,38 @@ export class AnthorhomeComponent implements OnInit {
       (ev as InfiniteScrollCustomEvent).target.complete();
     }, 500);
   }
-  onOpenGreetingPhrase(user:any){
-    this.checkUser = user
-    this.isOpen = true
+  onOpenGreetingPhrase(user: any) {
+    this.checkUser = user;
+    this.isOpen = true;
   }
-  async changeGreetingPhrase(msg:string){
+  async changeGreetingPhrase(msg: string) {
+    const userStatus = await this.connectTask.getState(
+      this.checkUser.uid,
+      this.checkUser.uid
+    );
+    if (userStatus !== 'ONLINE') {
+      const toast = await this.toastController.create({
+        message: '对方不在线或忙线中',
+        color: 'warning',
+        duration: 1500,
+      });
+      toast.present();
+      return;
+    }
+    if(!this.pushUserMap.has(this.checkUser.uid!)){
+      await this.msgSer.subscribeMessage(this.checkUser.uid!, {
+        presence: true,
+      }); //进入对方主播频道发送聊天邀请
+    }
+    this.msgSer.publishMessage('USERGREETING_' + msg, this.checkUser.uid!);
     console.log(msg);
+    this.pushUserMap.add(this.checkUser.uid!);
     const toast = await this.toastController.create({
       message: '已发送',
       duration: 1000,
       color: 'success',
     });
     toast.present();
-    this.isOpen = false
+    this.isOpen = false;
   }
 }

+ 1 - 8
projects/live-app/src/modules/tabs/my/my.component.html

@@ -1,14 +1,7 @@
 <ion-content class="content">
   <div class="header" [style.background-image]="'url(img/bg.png)'">
     <div class="user-dateil">
-      <div
-        class="pendant"
-        [style.background-image]="
-          'url(https://file-cloud.fmode.cn/Qje9D4bqol/20241109/vv1tvb032259054.png)'
-        "
-      >
-        <img [src]="user.get('avatar')" alt="" class="avatar" />
-      </div>
+      <app-avatar [avatar]="user.get('avatar')" />
       <div class="user-right">
         <div class="user-name">
           {{

+ 0 - 15
projects/live-app/src/modules/tabs/my/my.component.scss

@@ -12,21 +12,6 @@
       color: white;
       font-size: 14px;
       padding: 10px;
-      .pendant {
-        width: 80px;
-        height: 80px;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-        background-size: 100% 100%;
-        .avatar {
-          width: 60px;
-          height: 60px;
-          // margin-right: 10px;
-          border-radius: 50%;
-        }
-      }
-
       .user-right {
         flex: 1;
         .user-name {

+ 2 - 1
projects/live-app/src/modules/tabs/my/my.component.ts

@@ -9,12 +9,13 @@ import { AiChatService } from '../../../services/aichart.service';
 import { AccountService } from '../../../services/account.service';
 import { ionicStandaloneModules } from '../../ionic-standalone.modules';
 import { DatePipe, CommonModule } from '@angular/common';
+import { AvatarComponent } from '../../../app/components/avatar/avatar.component';
 @Component({
   selector: 'app-my',
   templateUrl: './my.component.html',
   styleUrls: ['./my.component.scss'],
   standalone: true,
-  imports: [...ionicStandaloneModules, CommonModule],
+  imports: [...ionicStandaloneModules, CommonModule,AvatarComponent],
   providers: [DatePipe],
 })
 export class MyComponent implements OnInit {

+ 52 - 3
projects/live-app/src/modules/user/browse/browse.component.html

@@ -4,14 +4,63 @@
     [scrollable]="true"
     (ionChange)="segmentChanged($event)"
     layout="icon-bottom"
-    value="notice"
+    value="from"
     mode="md"
   >
-    <ion-segment-button value="notice" class="tabs" content-id="0">
+    <ion-segment-button value="from" class="tabs" content-id="from">
       <ion-label>我看过谁</ion-label>
     </ion-segment-button>
-    <ion-segment-button value="friends" class="tabs" content-id="1">
+    <ion-segment-button value="to" class="tabs" content-id="to">
       <ion-label>谁看过我</ion-label>
     </ion-segment-button>
   </ion-segment>
+
+  <div class="list">
+    @for (item of list; track $index) { @if (active === 'from') {
+    <div class="li" (click)="toUrl(item.get('toUser')?.id)">
+      <div class="li-left">
+        <img [src]="item.get('toUser')?.get('avatar')" class="avatar" />
+      </div>
+      <div class="li-right">
+        <div class="li-right-user">
+          <div class="user-name">
+            {{
+              item.get("toUser")?.get("nickname") ||
+                item.get("toUser")?.get("name")
+            }}
+          </div>
+          <div class="time">
+            {{ item.createdAt | showDate }}
+          </div>
+        </div>
+        <ion-icon name="chevron-forward"></ion-icon>
+      </div>
+    </div>
+    }@else {
+    <div class="li" (click)="toUrl(item.get('fromUser')?.id)">
+      <div class="li-left">
+        <img [src]="item.get('fromUser')?.get('avatar')" class="avatar" />
+      </div>
+      <div class="li-right">
+        <div class="li-right-user">
+          <div class="user-name">
+            {{
+              item.get("fromUser")?.get("nickname") ||
+                item.get("fromUser")?.get("name")
+            }}
+          </div>
+          <div class="time">
+            {{ item.createdAt | showDate }}
+          </div>
+        </div>
+        <ion-icon name="chevron-forward"></ion-icon>
+      </div>
+    </div>
+    } }
+  </div>
+  @if (disbable) {
+  <ion-infinite-scroll (ionInfinite)="onIonInfinite($event)">
+    <ion-infinite-scroll-content></ion-infinite-scroll-content>
+  </ion-infinite-scroll>
+  }
 </ion-content>

+ 38 - 1
projects/live-app/src/modules/user/browse/browse.component.scss

@@ -12,4 +12,41 @@
     // top: 0;
     border-bottom: 1px solid #e5e5e5;
   }
-}
+  .list {
+    .li {
+      display: flex;
+      justify-content: space-between;
+      padding: 4px 10px;
+      background: white;
+      border-bottom: 1px solid #e5e5e5;
+      .li-left {
+        flex-shrink: 0;
+        width: 40px;
+        .avatar {
+          width: 36px;
+          height: 36px;
+          border-radius: 50%;
+        }
+      }
+      .li-right {
+        display: flex;
+        flex: 1;
+        margin-left: 10px;
+        justify-content: space-between;
+        align-items: center;
+        .li-right-user {
+          display: flex;
+          flex-direction: column;
+          .user-name{
+            font-size: 14px;
+            margin-bottom: 6px;
+          }
+          .time {
+            font-size: 12px;
+            color: #7d7d7d;
+          }
+        }
+      }
+    }
+  }
+}

+ 39 - 4
projects/live-app/src/modules/user/browse/browse.component.ts

@@ -1,25 +1,60 @@
 import { Component, OnInit } from '@angular/core';
 import { NavComponent } from '../../../app/components/nav/nav.component';
-import { ToastController } from '@ionic/angular';
+import { InfiniteScrollCustomEvent, ToastController } from '@ionic/angular';
 import * as Parse from 'parse';
 import { ionicStandaloneModules } from '../../ionic-standalone.modules';
+import { SharedModule } from '../../shared.module';
+import { Router } from '@angular/router';
 
 @Component({
   selector: 'app-browse',
   templateUrl: './browse.component.html',
   styleUrls: ['./browse.component.scss'],
   standalone: true,
-  imports: [...ionicStandaloneModules, NavComponent],
+  imports: [...ionicStandaloneModules, NavComponent,SharedModule],
 })
 export class BrowseComponent implements OnInit {
-  active: number = 0;
+  active: string = 'from';
+  list:Array<Parse.Object> = []
+  disbable:boolean = true
 
-  constructor() { }
+  constructor(private router: Router) { }
 
   ngOnInit() {
+    this.getBrowseHistory()
   }
   segmentChanged(e: any) {
     let { value } = e.detail;
     this.active = value;
+    // console.log(this.active);
+    this.list = []
+    this.disbable = true;
+    this.getBrowseHistory()
+  }
+  
+  async getBrowseHistory(){
+    let query = new Parse.Query('ProfileRadar');
+    query.equalTo('name', '查看');
+    query.equalTo(this.active == 'from' ? 'fromUser' : 'toUser', Parse.User.current());
+    query.descending('createdAt');
+    query.limit(20);
+    query.skip(this.list.length)
+    query.include('fromUser','toUser')
+    let r = await query.find()
+    this.list.push(...r)
+    return r
+  }
+
+  async onIonInfinite(ev: any) {
+    let result = await this.getBrowseHistory();
+    if (result.length == 0) {
+      this.disbable = false;
+    }
+    setTimeout(() => {
+      (ev as InfiniteScrollCustomEvent).target.complete();
+    }, 500);
+  }
+  toUrl(id:string){
+    this.router.navigate(['/user/profile/'+id])
   }
 }

+ 12 - 5
projects/live-app/src/modules/user/profile/profile.component.html

@@ -8,11 +8,18 @@
     <div class="user-dateil">
       <div class="pendant">
         <div class="top">
-          <img
-            class="avatar"
-            [src]="profile?.get('user')?.get('avatar')"
-            alt=""
-          />
+          <div
+            class="pendant"
+            [style.background-image]="
+              'url(https://file-cloud.fmode.cn/Qje9D4bqol/20241109/vv1tvb032259054.png)'
+            "
+          >
+            <img
+              class="avatar"
+              [src]="profile?.get('user')?.get('avatar')"
+              alt=""
+            />
+          </div>
           <div class="top-right-block">
             <div class="top-left-title">{{ profile?.get("name") }}</div>
             @if (user?.get('sex') == '男') {

+ 19 - 7
projects/live-app/src/modules/user/profile/profile.component.scss

@@ -38,12 +38,20 @@
         .top {
           display: flex;
           align-items: self-end;
-          .avatar {
-            width: 60px;
-            height: 60px;
+          .pendant {
             margin-top: -38px;
-            z-index: 1;
-            border-radius: 50%;
+            width: 80px;
+            height: 80px;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            background-size: 100% 100%;
+            .avatar {
+              width: 60px;
+              height: 60px;
+              z-index: 1;
+              border-radius: 50%;
+            }
           }
           .top-right-block {
             display: flex;
@@ -83,8 +91,12 @@
                 margin-right: 4px;
               }
             }
-            .gril{
-              background: linear-gradient(to right, #fe454e, #f5a7ab) !important;
+            .gril {
+              background: linear-gradient(
+                to right,
+                #fe454e,
+                #f5a7ab
+              ) !important;
             }
           }
         }

+ 61 - 10
projects/live-app/src/modules/user/profile/profile.component.ts

@@ -10,7 +10,7 @@ import { UploadComponent } from '../../../app/components/upload/upload.component
 import { GiftModalComponent } from '../../../app/components/gift-modal/gift-modal.component';
 // import { MessageService } from '../../../services/message.service';
 import { ConnectTaskService } from '../../../services/connectTask.service';
-import { getBirthdatByIdNo,getConstellation } from '../../../services/utils';
+import { getBirthdatByIdNo, getConstellation } from '../../../services/utils';
 import {
   ionicStandaloneModules,
   // AlertController,
@@ -34,7 +34,7 @@ import { CallModalComponent } from '../../../app/components/call-modal/call-moda
     ImagePreviewComponent,
     UploadComponent,
     GiftModalComponent,
-    CallModalComponent
+    CallModalComponent,
   ],
   providers: [DatePipe],
 })
@@ -72,12 +72,11 @@ export class ProfileComponent implements OnInit {
     // private alertController: AlertController,
     // private msgSer: MessageService,
     private connectTask: ConnectTaskService,
-    public accServ: AccountService,
-  ) {
-  }
+    public accServ: AccountService
+  ) {}
   get state() {
     let map: any = {
-      REFUSE:{
+      REFUSE: {
         val: '勿扰',
         color: '#f1ac16',
       },
@@ -101,8 +100,8 @@ export class ProfileComponent implements OnInit {
     return map?.[this.userStatus] || map['OFFLINE'];
   }
 
-  birthdat?:string
-  constellation?:string
+  birthdat?: string;
+  constellation?: string;
   ngOnInit() {
     this.activateRoute.paramMap.subscribe(async (params) => {
       let id: any = params.get('id');
@@ -113,8 +112,8 @@ export class ProfileComponent implements OnInit {
       } else {
         this.userStatus = 'ONLINE';
       }
-      if(this.profile?.get('isCheck') && this.userStatus == 'ONLINE'){
-        this.userStatus = 'REFUSE'
+      if (this.profile?.get('isCheck') && this.userStatus == 'ONLINE') {
+        this.userStatus = 'REFUSE';
       }
     });
   }
@@ -138,6 +137,7 @@ export class ProfileComponent implements OnInit {
     let res1 = await this.aiChatServ.getGiftLogCount(this.uid);
     this.numsObject.gift = res1.data[0].gift ?? 0;
     this.giftList = await this.aiChatServ.getGiftList(this.uid, 16);
+    this.browseLog()
     // this.getRoom();
     loading.dismiss();
   }
@@ -180,6 +180,57 @@ export class ProfileComponent implements OnInit {
     let r = await query.first();
     this.isFollow = r?.id ? true : false;
   }
+
+  // 生成浏览产品的浏览记录
+  async browseLog() {
+    let result = await this.judgeIsBrowse();
+    let ProfileRadar, tool;
+    if (result) {
+      return;
+    } else {
+      // 创建一条浏览记录
+      ProfileRadar = Parse.Object.extend('ProfileRadar');
+      tool = new ProfileRadar();
+      tool.set('name', '查看');
+      tool.set('fromUser', {
+        __type: 'Pointer',
+        className: '_User',
+        objectId: Parse.User.current()?.id,
+      });
+      tool.set('toUser', {
+        __type: 'Pointer',
+        className: '_User',
+        objectId: this.user?.id,
+      });
+      tool.set('company', {
+        __type: 'Pointer',
+        className: 'Company',
+        objectId: this.aiChatServ.company,
+      });
+      await tool.save();
+      console.log('---创建了浏览历史记录---');
+    }
+  }
+  // 根据点击查看记录半小时内是否有此浏览记录
+  async judgeIsBrowse() {
+    let ProfileRadar = new Parse.Query('ProfileRadar');
+    ProfileRadar.equalTo('company', this.aiChatServ.company);
+    ProfileRadar.equalTo('fromUser', Parse.User.current()?.id!);
+    ProfileRadar.equalTo('toUser', this.user?.id,);
+    ProfileRadar.greaterThanOrEqualTo(
+      'createdAt',
+      new Date(new Date().getTime() - 1000 * 60 * 30)
+    );
+    ProfileRadar.equalTo('name', '查看');
+    ProfileRadar.select('objectId');
+    let result = await ProfileRadar.first();
+    if (result) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
   // async getRoom() {
   //   let query = new Parse.Query('Room');
   //   query.equalTo('company', this.aiChatServ.company);

+ 2 - 2
projects/live-app/src/modules/user/setting/setting.component.ts

@@ -6,7 +6,7 @@ import {
 } from '@ionic/angular';
 import { NavComponent } from '../../../app/components/nav/nav.component';
 import * as Parse from 'parse';
-import { Router } from '@angular/router';
+// import { Router } from '@angular/router';
 import { UploadComponent } from '../../../app/components/upload/upload.component';
 import { AuthService } from '../../../services/auth.service';
 import { ionicStandaloneModules } from '../../ionic-standalone.modules';
@@ -106,7 +106,7 @@ export class SettingComponent implements OnInit {
     public loadingCtrl: LoadingController,
     public toastController: ToastController,
     private authServ: AuthService,
-    private router: Router
+    // private router: Router
   ) {}
 
   ngOnInit() {

+ 7 - 7
projects/live-app/src/services/connectTask.service.ts

@@ -35,6 +35,7 @@ export class ConnectTaskService {
     const uid = Parse.User.current()?.id!;
     let nowChannes = await this.getWhereNow(uid);
     console.log('用户已订阅频道:', nowChannes);
+    await this.msgSer.setConnectState(uid, 'ONLINE'); //主播开启并订阅自己的聊天频道
     if (profile?.identyType == 'anchor' && !this.isSubscribe) {
       // if (!nowChannes.includes(this.msChannelName)) {
       console.log('订阅成功');
@@ -42,7 +43,6 @@ export class ConnectTaskService {
       await this.msgSer.subscribeMessage(this.msChannelName);
       // }
       // if (!nowChannes.includes(uid)) {
-      await this.msgSer.setConnectState(uid, 'ONLINE'); //主播开启并订阅自己的聊天频道
       await this.msgSer.subscribeMessage(uid, {
         //开启并订阅自己的聊天频道
         message: true,
@@ -50,13 +50,13 @@ export class ConnectTaskService {
       });
       // }
       this.isSubscribe = true;
+    }else{
+      await this.msgSer.subscribeMessage(uid, {
+        //开启自己聊天频道用来接受招呼消息
+        message: true,
+        // presence: true,
+      });
     }
-    await this.msgSer.setConnectState(uid, 'ONLINE'); //开启并订阅自己的聊天频道获取其他用户发起的通知
-    await this.msgSer.subscribeMessage(uid, {
-      //开启并订阅自己的聊天频道
-      message: true,
-      presence: true,
-    });
   }
 
   /* 订阅好友频道 */

+ 57 - 24
projects/live-app/src/services/message.service.ts

@@ -28,12 +28,12 @@ export class MessageService {
   alert: any; // 弹窗
   messageMapList: any = {};
   giftLogMap: any = [];
-  giftList: Array<any> = [];//礼物列表
-  timeg:any
+  giftList: Array<any> = []; //礼物列表
+  timeg: any;
 
   reset() {
-    this.options  = {connectState: false};
-    this.rtmClient = null
+    this.options = { connectState: false };
+    this.rtmClient = null;
     this.channelNameList = {};
     this.messageMapList = {};
   }
@@ -86,6 +86,7 @@ export class MessageService {
    *@'CLOASEINVITATION': 取消通话邀请
    *@'REFUSEINVITATION_' + uid: 拒绝通话邀请
    *@'RESPONSEINVITOIN_' + uid: 接受邀请
+   *@'USERGREETING_' + '': 问候
    */
   joinReady() {
     this.rtmClient?.addEventListener('message', async (event: any) => {
@@ -101,7 +102,11 @@ export class MessageService {
       const message = JSON.parse(event.message);
       let is_self = event.publisher == this.userId;
       console.log('自己发出的消息:', is_self, message.text);
-      if (states.includes(message.text) || message.text.indexOf('ONUSERSENDGIFT_') > -1) {
+      if (
+        states.includes(message.text) ||
+        message.text.indexOf('ONUSERSENDGIFT_') > -1 ||
+        message.text.indexOf('USERGREETING_') > -1
+      ) {
         if (!is_self) {
           this.callPresence(message.text, event.publisher, event.channelName);
         }
@@ -143,18 +148,44 @@ export class MessageService {
   /* 呼叫事件 */
   async callPresence(message: string, publisher: string, channelName: string) {
     let userData = await this.getUserMetadata(publisher);
-    console.log('发出消息用户:',userData);
+    console.log('发出消息用户:', userData);
     let toast;
-    if(message.indexOf('ONUSERSENDGIFT_') > -1){
-      let arr = message.split('_')
+    if (message.indexOf('ONUSERSENDGIFT_') > -1) {
+      let arr = message.split('_');
       let gift = this.giftList.find((item: any) => item.id == arr[1]);
       this.giftLogMap.push({
         gift,
-        count:arr?.[2],
-        user:userData
-      })
-      !this.timeg && this.showGiftDecrement()
-      return
+        count: arr?.[2],
+        user: userData,
+      });
+      !this.timeg && this.showGiftDecrement();
+      return;
+    }
+    if (message.indexOf('USERGREETING_') > -1) {
+      let arr = message.split('_');
+      this.alert = await this.alertController.create({
+        cssClass: 'my-custom-class',
+        header: '收到打招呼消息',
+        message: `${userData?.nickname?.value ?? '未知用户'}:${arr[1]}`,
+        backdropDismiss: false,
+        buttons: [
+          {
+            text: '关闭',
+            role: 'cancel',
+            handler: async (blah) => {
+            },
+          },
+          {
+            text: '查看主页',
+            cssClass: 'secondary',
+            handler: async () => {
+              this.router.navigate(['user/profile/' + publisher]);
+            },
+          },
+        ],
+      });
+      await this.alert.present();
+      return;
     }
     switch (message) {
       case 'USERCALLINVITATION':
@@ -217,18 +248,17 @@ export class MessageService {
         this.eventSource.next(true);
         break;
     }
-
   }
 
   // 礼物消息
-  showGiftDecrement(){
+  showGiftDecrement() {
     this.timeg = setTimeout(() => {
       this.giftLogMap.shift();
-      if(this.giftLogMap.length > 0){
+      if (this.giftLogMap.length > 0) {
         this.showGiftDecrement();
-      }else{
+      } else {
         clearTimeout(this.timeg);
-        this.timeg = null
+        this.timeg = null;
       }
     }, 5000);
   }
@@ -303,7 +333,7 @@ export class MessageService {
     });
   }
   /* 订阅消息 */
-  subscribeMessage(channelName: string, param?: any,deadline?: number) {
+  subscribeMessage(channelName: string, param?: any, deadline?: number) {
     if (this.channelNameList[channelName]) return;
     return new Promise((resolve, reject) => {
       const options = {
@@ -321,8 +351,8 @@ export class MessageService {
           this.channelNameList[channelName] = true;
           if (!this.messageMapList[channelName]) {
             this.messageMapList[channelName] = [];
-            if(channelName.indexOf('-') > -1 || channelName == 'global_room'){
-              this.getHistoryMessage(channelName,deadline);
+            if (channelName.indexOf('-') > -1 || channelName == 'global_room') {
+              this.getHistoryMessage(channelName, deadline);
             }
           }
           this.pageFun?.();
@@ -335,7 +365,7 @@ export class MessageService {
     });
   }
 
-  async getHistoryMessage(channelName: string,deadline?:number) {
+  async getHistoryMessage(channelName: string, deadline?: number) {
     let query = new Parse.Query('MessageLog');
     query.equalTo('channel', channelName);
     query.descending('createdAt');
@@ -467,8 +497,11 @@ export class MessageService {
     }
   }
 
-  delMsg(channelName: string, index?: number,limit?: number) {
-    this.messageMapList[channelName].splice(index ?? 0, limit ?? this.messageMapList[channelName].length);
+  delMsg(channelName: string, index?: number, limit?: number) {
+    this.messageMapList[channelName].splice(
+      index ?? 0,
+      limit ?? this.messageMapList[channelName].length
+    );
     console.log(this.messageMapList[channelName]);
   }
 }