Bladeren bron

小红点

warrior 3 weken geleden
bovenliggende
commit
de99ff2133

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

@@ -67,6 +67,7 @@ export class NoticeLogComponent implements OnInit {
     if(pass){
       let channel = isAnthor ? `${this.user.id}-${this.list[index].tuid}` : `${this.list[index].tuid}-${this.user.id}`
       res.set('channel', channel)
+      this.aiSer.getFriends(Parse.User.current()?.id);
       this.msgSer.subscribeMessage(channel); //同意好友邀请并且订阅频道
     }
     await res.save();

+ 1 - 1
projects/live-app/src/modules/live/chat/chat.component.ts

@@ -260,7 +260,7 @@ export class ChatComponent implements OnInit {
             if (this.uid && this.friend?.id) {
               let uid = Parse.User.current()?.id!;
               let config = this.friend?.get('config') || {};
-              config[uid] = new Date()?.getTime();
+              config[uid]['deadline'] = new Date()?.getTime();
               this.friend.set('config', config);
               await this.friend.save();
             }

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

@@ -143,7 +143,7 @@
             </div>
           </ion-item>
 
-          @for (item of friends; track $index) {
+          @for (item of aiSer.friends; track $index) {
           <ion-item
             class="li"
             (click)="toUrl('/live/chat/' + item.channel)"
@@ -171,7 +171,7 @@
     <ion-segment-content id="friends">
       <div class="notice-list" (touchmove)="onMousemove($event)">
         <ion-list>
-          @for (item of friends; track $index) {
+          @for (item of aiSer.friends; track $index) {
           <ion-item (click)="toUrl('/live/chat/' + item?.channel)">
             <ion-avatar slot="start">
               <img [src]="item?.avatar" alt="avatar" />

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

@@ -50,7 +50,7 @@ export class NoticeComponent implements OnInit {
       },
     },
   ];
-  friends: Array<any> = [];
+  // friends: Array<any> = [];
   times: number = 0;
   timer: any;
   showModal: boolean = false; //是否长按弹窗
@@ -62,8 +62,8 @@ export class NoticeComponent implements OnInit {
 
   constructor(
     private router: Router,
-    private aiSer: AiChatService,
-    public accServ: AccountService,
+    public aiSer: AiChatService,
+    private accServ: AccountService,
     public msgServe: MessageService,
     private toastController: ToastController,
     public deviceSer: DeviceService
@@ -74,12 +74,8 @@ export class NoticeComponent implements OnInit {
   }
   async refresh() {
     let uid: any = Parse.User.current()?.id;
-    let resultFriends = await this.aiSer.getFriends(uid);
-    this.friends = resultFriends['data'];
-    console.log(this.friends);
-    // resChat?.data && this.noticeList.push(...resChat.data);
+    await this.aiSer.getFriends(uid);
     this.getSetting();
-    // this.getSysNotice()
   }
   async getSetting() {
     let query = new Parse.Query('SiteConfig');
@@ -97,6 +93,8 @@ export class NoticeComponent implements OnInit {
   segmentChanged(e: any) {
     let { value } = e.detail;
     this.active = value;
+    this.value = ''
+    this.aiSer.getFriends(Parse.User.current()?.id);
   }
   /* 手指按下 */
   startPress(item: any) {
@@ -183,10 +181,10 @@ export class NoticeComponent implements OnInit {
 
   value: string = '';
   async toSearch() {
-    this.friends = []
+    // this.friends = []
     let uid: any = Parse.User.current()?.id;
-    let resultFriends = await this.aiSer.getFriends(uid,this.value);
-    console.log(resultFriends);
-    this.friends = resultFriends['data'];
+    this.aiSer.getFriends(uid,this.value);
+    // console.log(resultFriends);
+    // this.aiSer.friends = resultFriends['data'];
   }
 }

+ 20 - 9
projects/live-app/src/modules/tabs/tabs/tabs.component.html

@@ -1,14 +1,25 @@
-<div [ngClass]="{
-  'tabs': true,
-  'pad-but-ios': deviceSer.isIOS
-}">
+<div
+  [ngClass]="{
+    tabs: true,
+    'pad-but-ios': deviceSer.isIOS
+  }"
+>
   @for (item of option; track $index) {
-  <div class="buttom {{ $index == 99 ? 'center' : '' }}" (click)="goTabPage($index, item.url)">
-    <img class="icon-img {{ $index == 99 ? 'box-icon' : '' }}" src="{{ $index == active ? item.active : item.src }}"
-      alt="" />
+  <div
+    class="buttom {{ $index == 99 ? 'center' : '' }}"
+    (click)="goTabPage($index, item.url)"
+  >
+    <img
+      class="icon-img {{ $index == 99 ? 'box-icon' : '' }}"
+      src="{{ $index == active ? item.active : item.src }}"
+      alt=""
+    />
     <ion-label [style.color]="active == $index ? '#FD7884' : '#808080'">{{
       item.name
-      }}</ion-label>
+    }}</ion-label>
+    @if ($index == 1) {
+    <div class="tips">1</div>
+    }
   </div>
   }
 </div>
@@ -42,4 +53,4 @@
   </ion-tab-bar>
 </ion-tabs>
 
-<app-flutter-comp></app-flutter-comp>
+<app-flutter-comp></app-flutter-comp>

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

@@ -21,11 +21,25 @@
     font-size      : 3.2vw;
     font-family    : Source Han Sans CN;
     font-weight    : 400;
-
+    position: relative;
     .icon-img {
       width : 5.3333vw;
       height: 5.3333vw;
     }
+    .tips{
+      position: absolute;
+      right: -8px;
+      width: 4px;
+      height: 4px;
+      top: 4px;
+      background: #dd0000;
+      // width: 16px;
+      // height: 16px;
+      border-radius: 50%;
+      color: white;
+      text-align: center;
+      line-height: 16px;
+    }
   }
 
   .center {

+ 6 - 3
projects/live-app/src/services/aichart.service.ts

@@ -60,6 +60,7 @@ export class AiChatService {
     let profile = JSON.parse(localStorage.getItem('profile') || '{}');
     return profile?.identyType === 'anchor';
   }
+  friends: Array<any> = [];
   constructor(private http: HttpService) {
     this.initEmoji();
   }
@@ -246,9 +247,9 @@ export class AiChatService {
     });
     let sql = `SELECT u.avatar,u.nickname,u."objectId" AS uid,f."channel",
     f.deadline
-     FROM 
+     FROM
       (SELECT (CASE WHEN "friend" = '${uid}' THEN "user" ELSE "friend" END) fid,"channel",
-	     "Friends".config->'l0gF95BPLB' AS deadline --被删除的聊天记录时间
+      ("Friends".config::jsonb ->> '${uid}')::jsonb ->> 'deadline' AS deadline --被删除的聊天记录时间
       FROM "Friends"
       WHERE "isDeleted" IS NOT TRUE
       AND "isPass" = TRUE
@@ -263,7 +264,9 @@ export class AiChatService {
         : where
     }
     `;
-    return this.http.customSQL(sql);
+    let res = await this.http.customSQL(sql);
+    this.friends = res['data'];
+    return res['data']
   }
 
   async getRetFriends(uid: string): Promise<Parse.Object | undefined> {

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

@@ -63,7 +63,7 @@ export class ConnectTaskService {
   async conncetChannels() {
     let uid: any = Parse.User.current()?.id;
     let resultFriends = await this.aiSer.getFriends(uid);
-    resultFriends?.data?.forEach(async (item: any) => {
+    resultFriends?.forEach(async (item: any) => {
       let channelName = item.channel;
       await this.msgSer.subscribeMessage(
         channelName,

+ 3 - 5
projects/live-app/src/services/live.service.ts

@@ -60,7 +60,6 @@ export class LiveService {
   liveLog?: Parse.Object; //直播记录
 
   isOpenEvaluate: boolean = false; //是否开启评价
-  isBeautyExtensionRegistered: boolean = false; //是否注册美颜扩展
   processor: any; //音视频处理
   constructor(
     private http: HttpService,
@@ -98,10 +97,9 @@ export class LiveService {
     this.options['channel'] = '';
     this.user_published_list = [];
     this.client?.leave();
-    this.client = AgoraRTC.createClient({ mode: 'rtc', codec: 'h264' });
-    AgoraRTC.enableLogUpload();
-
-    if (!this.isBeautyExtensionRegistered) {
+    if(!this.client){
+      this.client = AgoraRTC.createClient({ mode: 'rtc', codec: 'h264' });
+      AgoraRTC.enableLogUpload();
       // 创建 BeautyExtension 实例
       const extension: any = new BeautyExtension();
       // 注册插件