Browse Source

主播端首页

warrior 2 months ago
parent
commit
9ef3d0f0e3
24 changed files with 1039 additions and 114 deletions
  1. 47 55
      projects/live-app/src/modules/account/bankcard/bankcard.component.ts
  2. 7 2
      projects/live-app/src/modules/account/wattle/wattle.component.html
  3. 7 0
      projects/live-app/src/modules/account/wattle/wattle.component.ts
  4. 1 1
      projects/live-app/src/modules/account/withdrawal/withdrawal.component.html
  5. 2 0
      projects/live-app/src/modules/account/withdrawal/withdrawal.component.ts
  6. 159 0
      projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.html
  7. 210 0
      projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.scss
  8. 28 0
      projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.spec.ts
  9. 262 0
      projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.ts
  10. 43 0
      projects/live-app/src/modules/tabs/auth.guard.ts
  11. 0 5
      projects/live-app/src/modules/tabs/home/home.component.ts
  12. 2 2
      projects/live-app/src/modules/tabs/my/my.component.html
  13. 5 0
      projects/live-app/src/modules/tabs/my/my.component.ts
  14. 0 1
      projects/live-app/src/modules/tabs/notice/notice.component.ts
  15. 9 1
      projects/live-app/src/modules/tabs/tabs.modules.routes.ts
  16. 12 4
      projects/live-app/src/modules/tabs/tabs/tabs.component.ts
  17. 44 3
      projects/live-app/src/modules/user/setting/setting.component.html
  18. 42 3
      projects/live-app/src/modules/user/setting/setting.component.scss
  19. 82 6
      projects/live-app/src/modules/user/setting/setting.component.ts
  20. 35 23
      projects/live-app/src/services/aichart.service.ts
  21. 1 0
      projects/live-app/src/services/auth.service.ts
  22. 18 8
      projects/live-app/src/services/connectTask.service.ts
  23. 16 0
      projects/live-app/src/services/http.service.ts
  24. 7 0
      projects/live-app/src/services/message.service.ts

+ 47 - 55
projects/live-app/src/modules/account/bankcard/bankcard.component.ts

@@ -2,21 +2,21 @@ import { Component, OnInit } from '@angular/core';
 import { NavComponent } from '../../../app/components/nav/nav.component';
 
 import * as Parse from 'parse';
-import { HttpClient } from '@angular/common/http';
 import { ToastController } from '@ionic/angular';
 import { ionicStandaloneModules } from '../../ionic-standalone.modules';
 import { CommonModule } from '@angular/common';
 import { FormsModule } from '@angular/forms';
+import { HttpService } from '../../../services/http.service';
 @Component({
   selector: 'app-bankcard',
   templateUrl: './bankcard.component.html',
   styleUrls: ['./bankcard.component.scss'],
-	standalone: true,
-  imports: [...ionicStandaloneModules,NavComponent,CommonModule, FormsModule],
+  standalone: true,
+  imports: [...ionicStandaloneModules, NavComponent, CommonModule, FormsModule],
 })
 export class BankcardComponent implements OnInit {
   constructor(
-    private http: HttpClient,
+    private http: HttpService,
     private toastController: ToastController
   ) {}
   company: string = localStorage.getItem('company') || '';
@@ -58,24 +58,51 @@ export class BankcardComponent implements OnInit {
         return;
       }
     }
-    this.verifyCard().then(async (res: any) => {
-      if (res.data.code == 200) {
-        if (res.data.data.result == 0 || res.data.data.result == 1) {
-          this.bankinfo.bankname = res.data.data.bank_info.bank;
-          this.bankinfo.logo = res.data.data.bank_info.logo;
-          if (this.account.bank && this.account.bank.length > 0) {
-            this.account.bank.push(this.bankinfo);
+    this.http
+      .verifyCard({
+        company: this.company,
+        bankcard: this.bankinfo.bankcard,
+        name: this.bankinfo.name,
+        idcard: this.bankinfo.idcard,
+        mobile: this.bankinfo.mobile,
+      })
+      .then(async (res: any) => {
+        if (res.data.code == 200) {
+          if (res.data.data.result == 0 || res.data.data.result == 1) {
+            this.bankinfo.bankname = res.data.data.bank_info.bank;
+            this.bankinfo.logo = res.data.data.bank_info.logo;
+            if (this.account.bank && this.account.bank.length > 0) {
+              this.account.bank.push(this.bankinfo);
+            } else {
+              this.account.bank = [this.bankinfo];
+            }
+            this.updateAccount();
+            this.isModalOpen = false;
+            setTimeout(() => {
+              this.adding = false;
+            }, 800);
           } else {
-            this.account.bank = [this.bankinfo];
-          }
-          this.updateAccount();
-          this.isModalOpen = false;
-          setTimeout(() => {
+            const toast = await this.toastController.create({
+              message: '卡状态异常,请更换卡',
+              color: 'warning',
+              duration: 1500,
+            });
+            toast.present();
             this.adding = false;
-          }, 800);
+            return;
+          }
+        } else if (res.data.code == 400) {
+          const toast = await this.toastController.create({
+            message: res.data.msg,
+            color: 'warning',
+            duration: 1500,
+          });
+          toast.present();
+          this.adding = false;
+          return;
         } else {
           const toast = await this.toastController.create({
-            message: '卡状态异常,请更换卡',
+            message: '服务错误请稍后重试',
             color: 'warning',
             duration: 1500,
           });
@@ -83,42 +110,7 @@ export class BankcardComponent implements OnInit {
           this.adding = false;
           return;
         }
-      } else if (res.data.code == 400) {
-        const toast = await this.toastController.create({
-          message: res.data.msg,
-          color: 'warning',
-          duration: 1500,
-        });
-        toast.present();
-        this.adding = false;
-        return;
-      } else {
-        const toast = await this.toastController.create({
-          message: '服务错误请稍后重试',
-          color: 'warning',
-          duration: 1500,
-        });
-        toast.present();
-        this.adding = false;
-        return;
-      }
-    });
-  }
-  async verifyCard() {
-    return new Promise((resolve, reject) => {
-      this.http
-        .post('https://test.fmode.cn/api/apig/bankcard', {
-          company: this.company,
-          bankcard: this.bankinfo.bankcard,
-          name: this.bankinfo.name,
-          idcard: this.bankinfo.idcard,
-          mobile: this.bankinfo.mobile,
-        })
-        .subscribe((res: any) => {
-          console.log(res);
-          resolve(res);
-        });
-    });
+      });
   }
 
   async updateAccount() {
@@ -131,7 +123,7 @@ export class BankcardComponent implements OnInit {
   }
   changeCityCancel(type: string) {
     if (type === 'confirm') {
-      this.confirm()
+      this.confirm();
     }
     this.isModalOpen = false;
   }

+ 7 - 2
projects/live-app/src/modules/account/wattle/wattle.component.html

@@ -7,17 +7,21 @@
           <div class="count">{{ account?.balance?.toFixed(2) || 0 }}</div>
           <div class="title">钻石余额</div>
         </div>
+        @if (isAnthor) {
         <div class="balance">
-          <div class="count">{{ account?.balance?.toFixed(2) || 0 }}</div>
+          <div class="count">{{ anthorWallet?.balance || 0 }}</div>
           <div class="title">可提现</div>
         </div>
+        }
       </div>
       <div class="figure">
         <div class="recharge" (click)="recharge()">充值</div>
+        @if (isAnthor) {
         <div class="recharges" (click)="withdrawal()">提现</div>
+        }
       </div>
     </div>
-
+    @if (isAnthor) {
     <div class="install" (click)="toBank()">
       <div class="install-to">
         <div class="name">我的银行卡</div>
@@ -27,6 +31,7 @@
         src="https://file-cloud.fmode.cn/uiZD6NisQm/20220808/9sq3d1093746.png"
       />
     </div>
+    }
     <div class="install" (click)="record()">
       <div class="install-to">
         <div class="name">动账记录</div>

+ 7 - 0
projects/live-app/src/modules/account/wattle/wattle.component.ts

@@ -15,6 +15,8 @@ import { AiChatService } from '../../../services/aichart.service';
 export class WattleComponent implements OnInit {
   company: any = localStorage.getItem('company');
   wallet:number = 0
+  isAnthor:boolean = false
+  anthorWallet:any
   constructor(
     private activatRoute: ActivatedRoute,
     private aiServ: AiChatService,
@@ -34,6 +36,11 @@ export class WattleComponent implements OnInit {
     let id = Parse.User.current()?.id;
     this.account = await this.aiServ.getWallet(id!)
     console.log(this.account);
+    this.isAnthor = this.aiServ.identity
+    if(this.aiServ.identity){
+      this.anthorWallet = await this.aiServ.getAuthorWallet(id!)
+      console.log(this.anthorWallet);
+    }
   }
 
   // showBalance(balance:number) {

+ 1 - 1
projects/live-app/src/modules/account/withdrawal/withdrawal.component.html

@@ -62,7 +62,7 @@
   </div>
   <div class="way">
     <div class="icon"></div>
-    提现金额
+    提现金额(可提现:¥{{ balance || 0 }})
   </div>
   <div class="chooses">
     <div>¥</div>

+ 2 - 0
projects/live-app/src/modules/account/withdrawal/withdrawal.component.ts

@@ -46,6 +46,8 @@ export class WithdrawalComponent implements OnInit {
       this.bankinfo = this.account?.get('bank')[0];
     }
     console.log(this.account);
+    let anthorWallet = await this.aiServ.getAuthorWallet(id!)
+    this.balance = anthorWallet.balance
   }
   async withdrawal() {
     if (!this.bankinfo.name || !this.bankinfo.bankcard || !this.bankinfo.mobile) {

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

@@ -0,0 +1,159 @@
+<ion-content class="content">
+  <div class="header" [style.background-image]="'url(img/bg.png)'">
+    <div class="top">
+      <ion-searchbar
+        animated="true"
+        [(ngModel)]="value"
+        (keyup.enter)="toSearch()"
+        placeholder="搜索"
+        color="light"
+      ></ion-searchbar>
+    </div>
+  </div>
+  <div class="banner">
+    <div class="swiper mySwiper1">
+      <div class="swiper-wrapper">
+        @for (item of banner; track $index) {
+        <div class="swiper-slide" (click)="toUrl(item?.get('url'))">
+          <img [src]="item?.get('image')" alt="" />
+        </div>
+        }
+      </div>
+      <div class="swiper-pagination"></div>
+    </div>
+  </div>
+  <div class="notice">
+    <img src="img/通知广播.png" alt="" class="notice-icon" />
+    <div class="swiper swiper-notice1">
+      <div class="swiper-wrapper">
+        @for (item of notices; track $index) {
+        <div class="swiper-slide notice-item" (click)="presentAlert(item)">
+          <div class="notice-item-title">
+            <div class="notice-item-text">【{{ item?.get("title") }}】</div>
+            <div class="notice-item-content">
+              {{ item?.get("content") }}
+            </div>
+          </div>
+          <div class="notice-item-time">
+            {{ item?.createdAt | date : "yyyy-MM-dd HH:mm" }}
+          </div>
+        </div>
+        }
+      </div>
+    </div>
+  </div>
+  <div class="bar">
+    <ion-select
+      label="用户列表"
+      [placeholder]="sex"
+      cancelText="关闭"
+      okText="确定"
+      (ionChange)="onChangeSex($event)"
+      interface="action-sheet"
+    >
+      <ion-select-option value="女">女</ion-select-option>
+      <ion-select-option value="男">男</ion-select-option>
+    </ion-select>
+    <div class="bar-right">
+      <div class="city" (click)="isOpenCity = true">
+        <ion-icon name="location-outline"></ion-icon>{{ city ? city : "全部" }}
+      </div>
+      <!-- <ion-icon
+        (click)="isColumn = !isColumn"
+        [name]="!isColumn ? 'grid' : 'list'"
+        style="font-size: 24px; color: #fe4d53"
+      ></ion-icon> -->
+    </div>
+  </div>
+  <div class="list">
+    @for (item of userList; track $index) {
+    <div class="list-item" (click)="toUrl(item?.get('url'))">
+      <div class="list-item-left">
+        <img [src]="item.avatar" alt="" class="avatar" />
+      </div>
+      <div class="list-item-right">
+        <div class="user-detail">
+          <div class="user-name">
+            {{ item.nickname || item.name || item.uid }}
+          </div>
+          <div class="user-tp">
+            {{ item.remark }}
+            <span>{{ item.birthdate }}</span>
+            <span>
+              <ion-icon name="location-outline"></ion-icon>
+              {{ item.city || "未知" }}</span
+            >
+          </div>
+        </div>
+        <div class="user-btn" (click)="onOpenGreetingPhrase(item)">
+          <ion-icon name="chatbubble"></ion-icon>打招呼
+        </div>
+      </div>
+    </div>
+    }
+  </div>
+  @if (disbable) {
+  <ion-infinite-scroll (ionInfinite)="onIonInfinite($event)">
+    <ion-infinite-scroll-content></ion-infinite-scroll-content>
+  </ion-infinite-scroll>
+  }
+
+  <ion-modal
+    #modal
+    trigger="open-modal-check"
+    [isOpen]="isOpen"
+    (didDismiss)="isOpen = false"
+    [initialBreakpoint]="1" 
+    [breakpoints]="[0, 0.5,1]"
+  >
+    <ng-template>
+      <div class="msg-modal">
+        @for (item of greetingPhrases; track $index) {
+          <div class="msg-modal-item" (click)="changeGreetingPhrase(item)">
+            {{ item }}
+            <ion-icon name="send"></ion-icon>
+          </div>
+        }
+      </div>
+    </ng-template>
+  </ion-modal>
+</ion-content>
+<ion-modal
+  #modal
+  trigger="open-modal"
+  [isOpen]="isOpenCity"
+  backdropDismiss="false"
+>
+  <ng-template>
+    <ion-toolbar>
+      <ion-buttons slot="start">
+        <ion-button (click)="changeCityCancel('cancel')">取消</ion-button>
+      </ion-buttons>
+      <ion-buttons slot="end">
+        <ion-button (click)="changeCityCancel('confirm')">确定</ion-button>
+      </ion-buttons>
+    </ion-toolbar>
+    <ion-picker>
+      <ion-picker-column
+        [value]="province"
+        (ionChange)="onIonChangeCity($event, 'province')"
+      >
+        @for (item of provinceColumns; track $index) {
+        <ion-picker-column-option value="{{ item }}">{{
+          item
+        }}</ion-picker-column-option>
+        }
+      </ion-picker-column>
+      <ion-picker-column
+        [value]="city"
+        (ionChange)="onIonChangeCity($event, 'city')"
+      >
+        @for (item of cityColumns; track $index) {
+        <ion-picker-column-option value="{{ item }}">{{
+          item
+        }}</ion-picker-column-option>
+        }
+      </ion-picker-column>
+    </ion-picker>
+  </ng-template>
+</ion-modal>

+ 210 - 0
projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.scss

@@ -0,0 +1,210 @@
+.content {
+  --padding-bottom: 100px;
+  --background: #f8f8f8;
+  .header {
+    padding: 20px 10px 10px;
+    height: 160px;
+    // border-radius: 0 0 50px 50px;
+    background-size: 100% 100%;
+    .top {
+      display: flex;
+      .search {
+        --background: #353c4d;
+        --cancel-button-color: #cccccc;
+        --color: #cccccc;
+      }
+      // ion-segment {
+      //   justify-content: start;
+      //   padding: 0 3.2vw;
+      //   position: sticky;
+      //   top: 0;
+      //   background: #fd6f6a00;
+      // }
+      // ion-segment-button {
+      //   color: white;
+      //   --indicator-color: white;
+      // }
+      // ::-webkit-scrollbar {
+      //   display: none; /* Chrome Safari */
+      // }
+      // .more {
+      //   width: 100px;
+      //   margin: 0 10px;
+      //   display: flex;
+      //   align-items: center;
+      //   justify-content: space-around;
+      //   img {
+      //     width: 20px;
+      //     height: 20px;
+      //   }
+      // }
+    }
+  }
+  .banner {
+    height: 180px;
+    // width: calc(100% - 20px);
+    padding: 10px;
+    margin-top: -80px;
+    img {
+      width: 100%;
+      height: 150px;
+      object-fit: cover;
+    }
+  }
+  .swiper {
+    width: 100%;
+    height: 160px;
+    .swiper-slide {
+      text-align: center;
+      font-size: 18px;
+      background: #fff;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      img {
+        display: block;
+        width: 100%;
+        height: 100%;
+        object-fit: cover;
+      }
+    }
+  }
+  .notice {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    border-bottom: 1px solid #dbdbdb;
+    padding: 10px;
+    .notice-icon {
+      width: 20px;
+      height: 20px;
+    }
+    .swiper-notice1 {
+      width: 100%;
+      height: 20px;
+    }
+    .swiper-wrapper {
+      flex: 1;
+      height: 20px;
+      flex-shrink: 0;
+      .notice-item {
+        display: flex;
+        justify-content: space-between;
+        font-size: 14px;
+        background: #ffffff00;
+        .notice-item-title {
+          display: flex;
+          justify-content: start;
+          .notice-item-text {
+            flex-shrink: 0;
+          }
+          .notice-item-content {
+            display: -webkit-box; //对象作为弹性伸缩盒子模型显示
+            overflow: hidden; //溢出隐藏
+            -webkit-box-orient: vertical; //设置伸缩盒子对象的子元素的排列方式
+            -webkit-line-clamp: 1; //设置 块元素包含的文本行数
+            margin: 0 6px 0 0;
+            text-align: left;
+          }
+        }
+        .notice-item-time {
+          flex-shrink: 0;
+          color: #cccccc;
+        }
+      }
+    }
+  }
+  .bar {
+    padding: 0 10px;
+    font-size: 14px;
+    display: flex;
+    justify-content: space-between;
+    ion-select {
+      width: 130px;
+    }
+    label-text-wrapper {
+      margin-right: 0 !important;
+    }
+    .bar-right {
+      flex: 1;
+      display: flex;
+      align-items: center;
+      justify-content: flex-end;
+      .city {
+        margin-right: 10px;
+        display: flex;
+        align-items: center;
+      }
+    }
+  }
+  .list {
+    .list-item {
+      background-color: white;
+      display: flex;
+      align-items: center;
+      margin-bottom: 6px;
+      padding: 4px 6px;
+      .list-item-left {
+        flex-shrink: 0;
+        .avatar {
+          width: 40px;
+          height: 40px;
+          border-radius: 50%;
+        }
+      }
+      .list-item-right {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        margin-left: 10px;
+        flex: 1;
+        .user-detail {
+          .user-name {
+            font-size: 14px;
+          }
+          .user-tp {
+            display: flex;
+            align-items: center;
+            margin-top: 4px;
+            font-size: 12px;
+            color: #7d7d7d;
+            span {
+              margin-left: 4px;
+            }
+          }
+        }
+        .user-btn {
+          font-size: 14px;
+          color: #0054e9;
+          display: flex;
+          align-items: center;
+        }
+      }
+    }
+  }
+}
+ion-modal {
+  --height: auto;
+  align-items: end;
+}
+
+ion-picker {
+  margin-bottom: var(--ion-safe-area-bottom);
+}
+
+.msg-modal {
+  padding: 20px 0;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  .msg-modal-item {
+    margin-bottom: 14px;
+    display: flex;
+    align-items: center;
+    color: #797979;
+  }
+  .msg-modal-item:active{
+    color: #0054e9 !important;
+  }
+}

+ 28 - 0
projects/live-app/src/modules/tabs/anthorhome/anthorhome.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 { AnthorhomeComponent } from './anthorhome.component';
+
+describe('AnthorhomeComponent', () => {
+  let component: AnthorhomeComponent;
+  let fixture: ComponentFixture<AnthorhomeComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ AnthorhomeComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(AnthorhomeComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 262 - 0
projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.ts

@@ -0,0 +1,262 @@
+import { Component, OnInit } from '@angular/core';
+import * as Parse from 'parse';
+import { ActivatedRoute, Router } from '@angular/router';
+import { Swiper } from 'swiper';
+import { AiChatService } from '../../../services/aichart.service';
+import { ConnectTaskService } from '../../../services/connectTask.service';
+import {
+  ionicStandaloneModules,
+  AlertController,
+  LoadingController,
+  ToastController,
+} from '../../ionic-standalone.modules';
+import { CommonModule, DatePipe } from '@angular/common';
+import { province } from '../../../services/address';
+import { FormsModule } from '@angular/forms';
+import { InfiniteScrollCustomEvent } from '@ionic/core';
+province.unshift({
+  provinceName: '全部',
+  citys: [
+    {
+      cityName: '',
+      cityType: '',
+    },
+  ],
+});
+@Component({
+  selector: 'app-anthorhome',
+  templateUrl: './anthorhome.component.html',
+  styleUrls: ['./anthorhome.component.scss'],
+  standalone: true,
+  imports: [...ionicStandaloneModules, CommonModule, FormsModule],
+  providers: [DatePipe],
+})
+export class AnthorhomeComponent implements OnInit {
+  value: string = '';
+  banner: Array<Parse.Object> = [];
+  notices: Array<any> = [];
+  viewAnchor: string = localStorage.getItem('sex') || '女';
+  get sex(): string {
+    const map: any = {
+      男: '男',
+      女: '女',
+    };
+    return map[this.viewAnchor];
+  }
+  isOpenCity: boolean = false;
+  provinceColumns = province.map((item) => item.provinceName);
+  cityColumns = province[0].citys.map((item) => item.cityName);
+  province: string = ''; //省份
+  city: string = ''; //市
+  old_province: string = ''; //省份
+  old_city: string = ''; //市
+  // isColumn: boolean = false; //单排
+  userList: Array<string> | any = [];
+
+  isOpen: boolean = false;
+  greetingPhrases: Array<string> = [
+    '你好,很高兴认识你!',
+    '嘿,最近怎么样?',
+    '你好,有什么共同的兴趣吗?',
+    '嗨,一起聊点什么吧!',
+    '你好,最近在忙什么呢?',
+    '嘿,很高兴看到你!',
+    '你好,有什么推荐的吗?',
+    '嗨,最近有啥新鲜事儿?',
+    '你好,一起吃饭怎么样?',
+    '嘿,很高兴能和你聊天!',
+  ];
+  checkUser:any //当前选择的用户
+
+  disbable: boolean = true;
+
+  constructor(
+    private loadingCtrl: LoadingController,
+    private alertController: AlertController,
+    private activateRoute: ActivatedRoute,
+    private connectTask: ConnectTaskService,
+    private router: Router,
+    public toastController: ToastController,
+    private aiServ: AiChatService,
+    private datePipe: DatePipe
+  ) {}
+
+  ngOnInit() {
+    // this.activateRoute.paramMap.subscribe(async (params) => {
+    this.refresh();
+    // });
+  }
+  async refresh() {
+    const loading = await this.loadingCtrl.create({
+      message: '正在加载',
+    });
+    loading.present();
+    // await this.connectTask.init();
+    await this.getBanner();
+    await this.getNotice();
+    await this.getUserList();
+    setTimeout(() => {
+      this.initSwiperTimeEvent();
+      loading.dismiss();
+    }, 100);
+  }
+  async getBanner() {
+    let query = new Parse.Query('Banner');
+    query.equalTo('company', this.aiServ.company);
+    query.descending('index');
+    query.equalTo('isEnabled', true);
+    query.notEqualTo('isDeleted', true);
+    let banner = await query.find();
+    this.banner = banner;
+  }
+  async getNotice() {
+    let query = new Parse.Query('Notice');
+    query.equalTo('company', this.aiServ.company);
+    query.notEqualTo('isDeleted', true);
+    query.equalTo('type', 'application');
+    query.select('title', 'content');
+    query.descending('createdAt');
+    this.notices = await query.find();
+  }
+  async getUserList() {
+    let res = await this.aiServ.getLinkUsers({
+      val: this.value ? this.value : '',
+      skip: this.userList.length,
+      // sex: this.viewAnchor,
+      city: this.city,
+    });
+    console.log(res);
+    if (res.length == 0) {
+      const toast = await this.toastController.create({
+        message: '已加载全部内容',
+        duration: 1500,
+        color: 'warning',
+      });
+      toast.present();
+      return res.length;
+    }
+    this.userList.push(...res);
+    return res.length;
+  }
+  initSwiperTimeEvent() {
+    // 初始化轮播图
+    let swiper = new Swiper('.mySwiper1', {
+      loop: true, // 循环模式选项
+      observer: false, //修改swiper自己或子元素时,自动初始化swiper
+      observeParents: true, //修改swiper的父元素时,自动初始化swiper
+      autoplay: {
+        delay: 3000,
+      },
+      pagination: {
+        el: '.swiper-pagination',
+      },
+    });
+    swiper.on('slideChange', function (event: any) {
+      // console.log(event);
+    });
+
+    let swiperNot = new Swiper('.swiper-notice1', {
+      loop: true, // 循环模式选项
+      observer: false, //修改swiper自己或子元素时,自动初始化swiper
+      observeParents: true, //修改swiper的父元素时,自动初始化swiper
+      autoplay: {
+        delay: 5000,
+      },
+      direction: 'vertical',
+    });
+  }
+
+  async presentAlert(item: any) {
+    const alert = await this.alertController.create({
+      header: item?.get('title') || '消息通知',
+      subHeader: this.datePipe.transform(item?.createdAt, 'yyyy-MM-dd HH:mm')!,
+      message: item?.get('content') || '',
+      buttons: item?.get('url')
+        ? [
+            { text: '关闭' },
+            {
+              text: '确定',
+              handler: () => {
+                this.router.navigate([item?.get('url')]);
+              },
+            },
+          ]
+        : [{ text: '关闭' }],
+    });
+    await alert.present();
+  }
+
+  onChangeSex(e: any) {
+    localStorage.setItem('sex', e.detail.value);
+    if (e.detail.value == this.viewAnchor) return;
+    this.viewAnchor = e.detail.value;
+    this.userList = [];
+    this.getUserList();
+    this.disbable = true;
+  }
+
+  toUrl(url: string) {
+    url && this.router.navigate([url]);
+  }
+
+  changeCityCancel(type: string) {
+    if (type === 'confirm') {
+      if (this.city !== this.old_city) {
+        this.userList = [];
+        this.getUserList();
+        this.disbable = true;
+      }
+      this.old_province = this.province;
+      this.old_city = this.city;
+    } else {
+      this.province = this.old_province;
+      this.city = this.old_city;
+    }
+    this.isOpenCity = false;
+  }
+  onIonChangeCity(event: CustomEvent, type: string) {
+    let val = event.detail.value;
+    switch (type) {
+      case 'province':
+        this.province = event.detail.value;
+        this.cityColumns = province
+          .find((item) => item.provinceName === val)
+          ?.citys.map((item) => item.cityName)!;
+        console.log(this.cityColumns);
+        this.city = this.cityColumns[0];
+        break;
+      case 'city':
+        this.city = event.detail.value;
+        break;
+    }
+    console.log(this.province, this.city);
+  }
+  async toSearch() {
+    this.disbable = true;
+    this.userList = [];
+    this.getUserList();
+  }
+  async onIonInfinite(ev: any) {
+    let result = await this.getUserList();
+    if (result == 0) {
+      this.disbable = false;
+    }
+    setTimeout(() => {
+      (ev as InfiniteScrollCustomEvent).target.complete();
+    }, 500);
+  }
+  onOpenGreetingPhrase(user:any){
+    this.checkUser = user
+    this.isOpen = true
+  }
+  async changeGreetingPhrase(msg:string){
+    console.log(msg);
+    const toast = await this.toastController.create({
+      message: '已发送',
+      duration: 1000,
+      color: 'success',
+    });
+    toast.present();
+    this.isOpen = false
+  }
+}

+ 43 - 0
projects/live-app/src/modules/tabs/auth.guard.ts

@@ -0,0 +1,43 @@
+import { Injectable } from '@angular/core';
+import {
+  CanActivate,
+  ActivatedRouteSnapshot,
+  RouterStateSnapshot,
+} from '@angular/router';
+import { Observable } from 'rxjs';
+import { Router } from '@angular/router';
+import Parse from 'parse';
+
+@Injectable({
+  providedIn: 'root',
+})
+export class AuthGuard implements CanActivate {
+  constructor(
+    public router: Router,
+  ) {}
+
+  canActivate(
+    next: ActivatedRouteSnapshot,
+    state: RouterStateSnapshot
+  ): Observable<boolean> | Promise<boolean> | boolean {
+    // 当前路由url
+    let url: string = state.url;
+    return this.checkLogin(url);
+  }
+  checkLogin(url: string): boolean {
+    console.log(url);
+    // 如果已登录,直接跳转当前路由 跳出该函数
+    let p = localStorage.getItem('profile');
+    if(p && JSON.parse(p)?.identyType == 'anchor'){
+      if(url == '/tabs/anthirhome'){
+        return true;
+      }else{
+        this.router.navigate(['/tabs/anthirhome'],{ replaceUrl: true });
+        return false;
+      }
+    }
+    return true;
+  }
+
+}
+export { CanActivate };

+ 0 - 5
projects/live-app/src/modules/tabs/home/home.component.ts

@@ -1,9 +1,5 @@
 import { Component, OnInit } from '@angular/core';
 import * as Parse from 'parse';
-// import {
-//   AlertController,
-//   LoadingController,
-// } from '@ionic/angular';
 import { ActivatedRoute, Router } from '@angular/router';
 import { Swiper } from 'swiper';
 import { AiChatService } from '../../../services/aichart.service';
@@ -31,7 +27,6 @@ province.unshift({
   styleUrls: ['./home.component.scss'],
   standalone: true,
   imports: [...ionicStandaloneModules, CommonModule,FormsModule],
-  // schemas: [CUSTOM_ELEMENTS_SCHEMA],
   providers: [DatePipe],
 })
 export class HomeComponent implements OnInit {

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

@@ -206,12 +206,12 @@
           <ion-icon name="chevron-forward-outline"></ion-icon>
         </div>
       </div>
-      <div class="li">
+      <div class="li" (click)="toService()">
         <div class="li-lable">
           <img src="img/在线客服.png" alt="" class="icon" />
         </div>
         <div class="li-val">
-          在线客服
+          联系客服
           <ion-icon name="chevron-forward-outline"></ion-icon>
         </div>
       </div>

+ 5 - 0
projects/live-app/src/modules/tabs/my/my.component.ts

@@ -220,4 +220,9 @@ export class MyComponent implements OnInit {
     });
     await alert.present();
   }
+
+  toService(){
+    location.href = 'tel:4000-000-000';
+    console.log('拨号');
+  }
 }

+ 0 - 1
projects/live-app/src/modules/tabs/notice/notice.component.ts

@@ -55,7 +55,6 @@ export class NoticeComponent implements OnInit {
     let resultFriends = await this.aiSer.getFriends(uid);
     this.friends = resultFriends['data'];
     console.log(this.friends);
-    // let resChat = await this.aiSer.getLinkUsers(uid);
     // resChat?.data && this.noticeList.push(...resChat.data);
     this.getSetting();
     // this.getSysNotice()

+ 9 - 1
projects/live-app/src/modules/tabs/tabs.modules.routes.ts

@@ -1,5 +1,7 @@
 import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
+import { mapToCanActivate, RouterModule, Routes } from '@angular/router';
+import { AnthorhomeComponent } from './anthorhome/anthorhome.component';
+import { AuthGuard } from './auth.guard';
 import { HomeComponent } from './home/home.component';
 import { LiveReviewComponent } from './live-review/live-review.component';
 import { MyComponent } from './my/my.component';
@@ -14,8 +16,14 @@ const routes: Routes = [
   },
   {
     path: 'home', //首页
+    canActivate: mapToCanActivate([AuthGuard]),
     component: HomeComponent,
   },
+  {
+    path: 'anthirhome', //主播端首页
+    canActivate: mapToCanActivate([AuthGuard]),
+    component: AnthorhomeComponent,
+  },
   {
     path: 'notice', //消息
     component: NoticeComponent,

+ 12 - 4
projects/live-app/src/modules/tabs/tabs/tabs.component.ts

@@ -16,7 +16,7 @@ import { FlutterCompComponent } from '../../../app/components/flutter-comp/flutt
   templateUrl: 'tabs.component.html',
   styleUrls: ['tabs.component.scss'],
   standalone: true,
-  imports: [IonicModule,FlutterCompComponent],
+  imports: [IonicModule, FlutterCompComponent],
 })
 export class TabsComponent implements OnInit {
   @Input('tabsOption') tabsOption: any = {};
@@ -24,9 +24,9 @@ export class TabsComponent implements OnInit {
   constructor(
     private router: Router,
     private alertController: AlertController,
-    private activateRoute: ActivatedRoute,
-    // private connectTask: ConnectTaskService
-  ) {
+    private activateRoute: ActivatedRoute
+  ) // private connectTask: ConnectTaskService
+  {
     this.activateRoute.paramMap.subscribe(async (params) => {
       this.active = Number(localStorage.getItem('active')) ?? 0;
       await this.presentAlert();
@@ -91,6 +91,14 @@ export class TabsComponent implements OnInit {
     let res = await query.first();
     if (res?.id) {
       localStorage.setItem('profile', JSON.stringify(res.toJSON()));
+      if (res?.get('identyType') === 'anchor') {
+        this.option.splice(0, 1, {
+          src: 'img/首页.png',
+          active: 'img/首页_active.png',
+          url: 'tabs/anthirhome',
+          name: '首页',
+        });
+      }
       return;
     }
     // const alert = await this.alertController.create({

+ 44 - 3
projects/live-app/src/modules/user/setting/setting.component.html

@@ -82,12 +82,28 @@
         </div>
       </div>
     </ion-item>
+    <ion-item>
+      <div class="row">
+        <div>社交标签</div>
+        <div class="right tags">
+          @if (getTag.length > 0) { @for (tag of getTag; track
+          $index) {
+          <span class="tag"
+            >{{ tag.val }}<ion-icon class="close" name="close"></ion-icon
+          ></span>
+          }
+          <ion-icon class="add" name="add" (click)="onChangeTag()"></ion-icon>
+          }@else {
+          <span (click)="onChangeTag()">点击选择</span>
+          }
+          <ion-icon name="chevron-forward-outline"></ion-icon>
+        </div>
+      </div>
+    </ion-item>
     <ion-item>
       <div class="row">
         <div>手机号</div>
         <div class="right">
-          <!-- <span>{{ mobile }}</span
-          > -->
           <ion-input
             placeholder="待认证"
             value="{{ mobile }}"
@@ -101,7 +117,9 @@
       <div class="row">
         <div>所在地</div>
         <div class="right">
-          <div class="val" (click)="isOpen = true">{{address ? address : '点击选择所在地'}}</div>
+          <div class="val" (click)="isOpen = true">
+            {{ address ? address : "点击选择所在地" }}
+          </div>
           <ion-icon name="chevron-forward-outline"></ion-icon>
         </div>
       </div>
@@ -148,3 +166,26 @@
     </ion-picker>
   </ng-template>
 </ion-modal>
+<ion-modal
+  #modal
+  trigger="open-modal2"
+  [isOpen]="isOpenTag"
+  (didDismiss)="isOpenTag = false"
+  [initialBreakpoint]="1" 
+  [breakpoints]="[0, 0.5,1]"
+>
+  <ng-template>
+    <div class="tag-modal">
+      <div class="list">
+        @for (item of tags; track $index) {
+        <div
+          (click)="onCheck($index)"
+          [ngClass]="{ active: item.check, li: true }"
+        >
+          {{ item.val }}
+        </div>
+        }
+      </div>
+    </div>
+  </ng-template>
+</ion-modal>

+ 42 - 3
projects/live-app/src/modules/user/setting/setting.component.scss

@@ -34,6 +34,7 @@ ion-content {
     justify-content: space-between;
     align-items: center;
     width: 100%;
+    flex-shrink: 0;
     // padding:0 4vw;
     // border: 0.2667vw solid #f6f6f6;
     .right {
@@ -41,9 +42,26 @@ ion-content {
       align-items: center;
       justify-content: flex-end;
     }
-    span {
-      margin-right: 4vw;
+    .tags {
+      width: 250px;
+      flex-wrap: wrap;
+      .tag {
+        margin-right: 14px;
+        position: relative;
+        .close {
+          font-size: 14px;
+          position: absolute;
+          top: 0;
+          right: -10px;
+          color: #858585;
+        }
+      }
+      .add {
+        font-size: 20px;
+        color: #0054e9;
+      }
     }
+
     ion-input {
       text-align: right;
     }
@@ -68,7 +86,28 @@ ion-content {
     border-radius: 10px;
   }
 }
+.tag-modal {
+  height: 400px;
+  padding: 20px 0;
+  .list {
+    display: flex;
+    flex-wrap: wrap;
+    padding: 4px 0 4px 4px;
+    .li {
+      padding: 2px 6px;
+      border: 1px solid;
+      margin-right: 6px;
+      margin-bottom: 10px;
+      font-size: 14px;
+      border-radius: 4px;
+      color: #858585;
+    }
+    .active{
+      color: #0054e9 !important;
+    }
+  }
+}
 ion-modal {
   --height: auto;
   align-items: end;
-}
+}

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

@@ -11,13 +11,19 @@ import { UploadComponent } from '../../../app/components/upload/upload.component
 import { AuthService } from '../../../services/auth.service';
 import { ionicStandaloneModules } from '../../ionic-standalone.modules';
 import { province } from '../../../services/address';
+import { CommonModule } from '@angular/common';
 
 @Component({
   selector: 'app-setting',
   templateUrl: './setting.component.html',
   styleUrls: ['./setting.component.scss'],
   standalone: true,
-  imports: [...ionicStandaloneModules, NavComponent, UploadComponent],
+  imports: [
+    ...ionicStandaloneModules,
+    NavComponent,
+    UploadComponent,
+    CommonModule,
+  ],
 })
 export class SettingComponent implements OnInit {
   @ViewChild('upload') upload!: UploadComponent;
@@ -40,6 +46,61 @@ export class SettingComponent implements OnInit {
   province: string = ''; //省份
   city: string = ''; //市
 
+  isOpenTag: boolean = false;
+  tags: any[] = [
+    { val: '篮球', check: false },
+    { val: '音乐', check: false },
+    { val: '90后', check: false },
+    { val: '00后', check: false },
+    { val: '可爱', check: false },
+    { val: '旅行', check: false },
+    { val: '摄影', check: false },
+    { val: '电影', check: false },
+    { val: '阅读', check: false },
+    { val: '美食', check: false },
+    { val: '健身', check: false },
+    { val: '游戏', check: false },
+    { val: '编程', check: false },
+    { val: '绘画', check: false },
+    { val: '写作', check: false },
+    { val: '舞蹈', check: false },
+    { val: '时尚', check: false },
+    { val: '宠物', check: false },
+    { val: '手工', check: false },
+    { val: '咖啡', check: false },
+    { val: '动漫', check: false },
+    { val: '历史', check: false },
+    { val: '科技', check: false },
+    { val: '运动', check: false },
+    { val: '瑜伽', check: false },
+    { val: '文学', check: false },
+    { val: '心理学', check: false },
+    { val: '创业', check: false },
+    { val: '投资', check: false },
+    { val: '环保', check: false },
+    { val: '公益', check: false },
+    { val: '书法', check: false },
+    { val: '棋类', check: false },
+    { val: '骑行', check: false },
+    { val: '游泳', check: false },
+    { val: '登山', check: false },
+    { val: '滑板', check: false },
+    { val: '电竞', check: false },
+    { val: '手办', check: false },
+    { val: '汉服', check: false },
+    { val: '古风', check: false },
+    { val: '民谣', check: false },
+    { val: '摇滚', check: false },
+    { val: '街舞', check: false },
+    { val: '爵士', check: false },
+    { val: '古典乐', check: false },
+    { val: '流行乐', check: false },
+    { val: '户外', check: false },
+    { val: '露营', check: false },
+  ];
+  get getTag(){
+    return this.tags.filter(item=>item.check);
+  }
   constructor(
     private alertController: AlertController,
     public loadingCtrl: LoadingController,
@@ -73,16 +134,21 @@ export class SettingComponent implements OnInit {
     this.formData.age = this.profile?.get('birthdate') || '';
     this.formData.remark = this.profile?.get('remark') || '';
     this.loading.dismiss();
-    if(user?.get('city') && user?.get('province')){
-      this.address = user?.get('province') +'-'+user?.get('city');
+    if (user?.get('city') && user?.get('province')) {
+      this.address = user?.get('province') + '-' + user?.get('city');
     }
-    this.province = user?.get('province') || this.provinceColumns[0]
-    this.city = user?.get('city') || this.cityColumns[0]
+    this.province = user?.get('province') || this.provinceColumns[0];
+    this.city = user?.get('city') || this.cityColumns[0];
+    this.tags.map(item=>{
+      item.check = this.profile?.get('tags')?.includes(item.val) || false;
+    })
   }
   onChange(e: any, type: string) {
     this.formData[type] = e.detail.value;
   }
-
+  async onChangeTag() {
+    this.isOpenTag = true;
+  }
   async saveEdit(e: any) {
     this.loading = await this.loadingCtrl.create({
       message: '正在保存修改',
@@ -133,6 +199,8 @@ export class SettingComponent implements OnInit {
     this.profile?.set('birthdate', this.formData.age);
     this.profile?.set('remark', this.formData.remark);
     this.profile?.set('address', this.address);
+    let t = this.tags.filter((x) => x.check)?.map(item=> item.val)
+    this.profile?.set('tag', t);
     await this.profile?.save();
     this.loading.dismiss();
     this.getProfile();
@@ -173,6 +241,14 @@ export class SettingComponent implements OnInit {
     this.isOpen = false;
     console.log(this.address);
   }
+  onCheck(index: number) {
+    let n = this.tags.filter((item) => item.check).length;
+    if (!this.tags[index].check && n > 10) {
+      this.presentToast('最多选择10个标签', 1500, 'warning');
+      return;
+    }
+    this.tags[index].check = !this.tags[index].check;
+  }
   onIonChange(event: CustomEvent, type: string) {
     let val = event.detail.value;
     switch (type) {

+ 35 - 23
projects/live-app/src/services/aichart.service.ts

@@ -138,6 +138,16 @@ export class AiChatService {
     );
     return data['data'];
   }
+  /* 获取主播余额 */
+  async getAuthorWallet(uid: string): Promise<any> {
+    const data = await this.http.httpRequst(
+      'https://server.fmode.cn/api/ailiao/wallet/anthor',
+      { uid: uid },
+      'POST'
+    );
+    return data['data'];
+  }
+
   getFansAndFollow(uid: string): Promise<any> {
     let sql = `SELECT 
     (SELECT COUNT(*) FROM "ProfileRadar" WHERE "fromUser" = '${uid}' AND "name" = '关注' AND "isDeleted" IS NOT TRUE) AS follow,
@@ -240,27 +250,29 @@ export class AiChatService {
     return this.http.customSQL(sql);
   }
 
-  async getLinkUsers(uid: string): Promise<any> {
-    // let date = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
-    let sql = `SELECT * FROM (
-          SELECT row_number() over(partition by tbl."user" order by tbl."createdAt" desc) as "idx",tbl.user, tbl."createdAt", --tbl.content, tbl.appkey,
-          us.avatar,us.nickname,us.mobile,
-          (CASE WHEN DATE(tbl."createdAt") >= now() THEN true ELSE false END) as istoday
-          FROM ( (SELECT * , content:: json ->> 'target_id' AS user 
-            FROM "MessageLog" AS msglog
-            WHERE jsonb_contains(content, '{"from_id": "${uid}"}')
-            ORDER BY msglog."createdAt" DESC)
-            UNION 
-            (SELECT * ,content:: json ->> 'from_id' AS user 
-            FROM "MessageLog" AS msglog 
-            WHERE jsonb_contains(content, '{"target_id": "${uid}"}')
-            )) AS tbl
-            LEFT JOIN "_User" as us
-            ON us."objectId" = tbl.user
-          )as ntbl
-          WHERE ntbl."idx"=1
-        ORDER BY ntbl."createdAt" DESC`;
-    let res = await this.http.customSQL(sql);
+  async getLinkUsers(param: any): Promise<any> {
+    let { val, limit, skip, sex, city } = param;
+    let whereUser = val
+      ? `AND (u.nickname LIKE '%${val}%' OR pf.mobile LIKE '%${val}%' OR pf.name LIKE '%${val}%')`
+      : ``;
+    let whereSex = sex ? `AND pf.sex = '${sex}'` : ``;
+    let whereCity = city ? `AND us."city" = '${city}'` : '';
+    let sql = `SELECT pf.name,pf.mobile,pf.remark,pf.birthdate,
+    u.city,u."avatar",u."objectId" uid,u."nickname"
+    FROM "Profile" pf
+    LEFT JOIN "_User" u
+    ON u."objectId" = pf."user"
+    WHERE pf."company" = 'Qje9D4bqol'
+    ${whereUser}
+    ${whereSex}
+    ${whereCity}
+    AND (pf."identyType" <> 'anchor' OR pf."identyType" IS NULL)
+    AND pf."isCross" = TRUE
+    AND pf."isDeleted" IS NOT TRUE
+    ORDER BY pf."createdAt" DESC
+    OFFSET ${skip || 0} LIMIT ${limit || 20}`;
+    let res: any = await this.http.customSQL(sql);
+    return res.data;
   }
 
   /* 赠送礼物 */
@@ -359,7 +371,7 @@ export class AiChatService {
     return '摩羯座';
   }
 
-  async getPost(limit?: number, skip?: number,uid?: string, ): Promise<any> {
+  async getPost(limit?: number, skip?: number, uid?: string): Promise<any> {
     let sql = `SELECT "DramaPost"."objectId", "DramaPost".content,"DramaPost".images,
     us."objectId" uid, us.avatar,us.nickname,"Profile"."identyType",TO_CHAR("DramaPost"."createdAt", 'YYYY-MM-DD HH24:MI') AS formatted_date,
     (SELECT "isVerify" FROM "DramaPostLog" 
@@ -387,7 +399,7 @@ export class AiChatService {
     AND "DramaPost"."isDeleted" IS NOT TRUE
     ${uid ? `AND "DramaPost"."user" = '${uid}'` : ''}
     ORDER BY "DramaPost"."createdAt" DESC
-    OFFSET ${skip ?? 0} LIMIT ${limit ?? 10}`
+    OFFSET ${skip ?? 0} LIMIT ${limit ?? 10}`;
     let res: any = await this.http.customSQL(sql);
     return res.data;
   }

+ 1 - 0
projects/live-app/src/services/auth.service.ts

@@ -115,6 +115,7 @@ export class AuthService {
     localStorage.clear(); // 清楚过期登录状态,重新登陆
     Parse.User.logOut().then((user) => {
       this.msgSer?.logOutRTM();
+      this.msgSer?.reset();
       this.connectTask?.reset();
       this.router.navigate(['login']);
     });

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

@@ -18,7 +18,7 @@ export class ConnectTaskService {
     await this.msgSer.initRTM();
     await this.anchorOnline();
     this.getOnlieUserList(this.msChannelName, 'MESSAGE');
-    this.conncetChannels()
+    this.conncetChannels();
   }
   reset() {
     this.onlineUserList = new Set();
@@ -33,16 +33,16 @@ export class ConnectTaskService {
       console.log('profile err', err);
     }
     const uid = Parse.User.current()?.id!;
+    let nowChannes = await this.getWhereNow(uid);
+    console.log('用户已订阅频道:', nowChannes);
     if (profile?.identyType == 'anchor' && !this.isSubscribe) {
-      let nowChannes = await this.getWhereNow(uid);
-      console.log('用户已订阅频道:', nowChannes);
       // if (!nowChannes.includes(this.msChannelName)) {
       console.log('订阅成功');
       /* 主播订阅主播频道 */
-      await this.msgSer.subscribeMessage(this.msChannelName); //主播开启并订阅自己的聊天频道
+      await this.msgSer.subscribeMessage(this.msChannelName);
       // }
       // if (!nowChannes.includes(uid)) {
-      await this.msgSer.setConnectState(uid, 'ONLINE'); //默认在线状态
+      await this.msgSer.setConnectState(uid, 'ONLINE'); //主播开启并订阅自己的聊天频道
       await this.msgSer.subscribeMessage(uid, {
         //开启并订阅自己的聊天频道
         message: true,
@@ -51,6 +51,12 @@ export class ConnectTaskService {
       // }
       this.isSubscribe = true;
     }
+    await this.msgSer.setConnectState(uid, 'ONLINE'); //开启并订阅自己的聊天频道获取其他用户发起的通知
+    await this.msgSer.subscribeMessage(uid, {
+      //开启并订阅自己的聊天频道
+      message: true,
+      presence: true,
+    });
   }
 
   /* 订阅好友频道 */
@@ -59,9 +65,13 @@ export class ConnectTaskService {
     let resultFriends = await this.aiSer.getFriends(uid);
     resultFriends?.data?.forEach(async (item: any) => {
       let channelName = item.channel;
-      await this.msgSer.subscribeMessage(channelName, {
-        message: true,
-      },item.deadline);
+      await this.msgSer.subscribeMessage(
+        channelName,
+        {
+          message: true,
+        },
+        item.deadline
+      );
     });
   }
   /* 获取用户当前所在频道 */

+ 16 - 0
projects/live-app/src/services/http.service.ts

@@ -45,6 +45,22 @@ export class HttpService {
         });
     });
   }
+  async verifyCard(param:{
+    company: string,
+    bankcard: string,
+    name: string,
+    idcard: string,
+    mobile: string,
+  }) {
+    return new Promise((resolve, reject) => {
+      this.http
+        .post('https://test.fmode.cn/api/apig/bankcard', param)
+        .subscribe((res: any) => {
+          console.log(res);
+          resolve(res);
+        });
+    });
+  }
 
   // 定义jsonp的方法
   getJsonpMsg(url: string, cb: string) {

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

@@ -30,6 +30,13 @@ export class MessageService {
   giftLogMap: any = [];
   giftList: Array<any> = [];//礼物列表
   timeg:any
+
+  reset() {
+    this.options  = {connectState: false};
+    this.rtmClient = null
+    this.channelNameList = {};
+    this.messageMapList = {};
+  }
   constructor(
     private alertController: AlertController,
     private router: Router,