Parcourir la source

优化部分问题,新增封禁账号功能

warrior il y a 15 heures
Parent
commit
1c22fadd13

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

@@ -295,7 +295,11 @@ export class HomeComponent implements OnInit {
       toast.present();
       return data.length;
     }
-    this.roomList.push(...data);
+    // 筛选出存在于 userList 中的元素
+    const filteredData = data.sort(
+      (a, b) => this.userList.includes(b.uid) - this.userList.includes(a.uid)
+    );
+    this.roomList.push(...filteredData);
     loading.dismiss();
     return data.length;
   }

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

@@ -60,6 +60,7 @@
             width: 7.6923vw;
             height: 7.6923vw;
             border-radius: 50%;
+            object-fit: cover;
           }
         }
         .user-dateil {

+ 34 - 16
projects/live-app/src/modules/tabs/tabs/tabs.component.ts

@@ -6,7 +6,6 @@ import { IonicModule } from '@ionic/angular';
 
 // 全局消息服务和JIM插件
 import { OnInit } from '@angular/core';
-// import { AlertController } from '@ionic/angular';
 import { FlutterCompComponent } from '../../../app/components/flutter-comp/flutter-comp.component';
 import { MessageService } from '../../../services/message.service';
 // import { ConnectTaskService } from '../../../services/connectTask.service';
@@ -16,31 +15,34 @@ import { Filesystem } from '@capacitor/filesystem';
 import { DeviceService } from '../../../services/device.service';
 import { CommonModule } from '@angular/common';
 import { HttpService } from '../../../services/http.service';
+import { AlertController } from '../../ionic-standalone.modules';
+import { AuthService } from '../../../services/auth.service';
 
 @Component({
   selector: 'live-tabs',
   templateUrl: 'tabs.component.html',
   styleUrls: ['tabs.component.scss'],
   standalone: true,
-  imports: [IonicModule, FlutterCompComponent,CommonModule],
+  imports: [IonicModule, FlutterCompComponent, CommonModule],
 })
 export class TabsComponent implements OnInit {
   @Input('tabsOption') tabsOption: any = {};
   company: any = window.localStorage.getItem('company');
   constructor(
     private router: Router,
-    // private alertController: AlertController,
+    private alertController: AlertController,
     private activateRoute: ActivatedRoute,
     public deviceSer: DeviceService,
     private http: HttpService,
-    public msgServe: MessageService,
-  )
-  {
+    private authServ: AuthService,
+    public msgServe: MessageService
+  ) {
     this.activateRoute.paramMap.subscribe(async (params) => {
       await this.presentAlert();
-      this.active = this.option.findIndex((item: any) => {
-        return item.url == location.pathname.slice(1)
-      }) ?? 0
+      this.active =
+        this.option.findIndex((item: any) => {
+          return item.url == location.pathname.slice(1);
+        }) ?? 0;
     });
   }
 
@@ -86,8 +88,8 @@ export class TabsComponent implements OnInit {
   active: number = 0;
 
   ngOnInit() {
-    this.initDeviceService()
-    this.updateParent()
+    this.initDeviceService();
+    this.updateParent();
   }
 
   async presentAlert() {
@@ -112,6 +114,23 @@ export class TabsComponent implements OnInit {
           name: '首页',
         });
       }
+      if (res.get('auditing')) {
+        const alert = await this.alertController.create({
+          cssClass: 'my-custom-class',
+          header: '账号已被封禁',
+          message: '您的账号已被封禁,请联系客服处理',
+          backdropDismiss: false,
+          buttons: [
+            {
+              text: '退出登录',
+              handler: () => {
+                this.authServ.logout();
+              },
+            },
+          ],
+        });
+        await alert.present();
+      }
       return;
     }
     // const alert = await this.alertController.create({
@@ -170,7 +189,6 @@ export class TabsComponent implements OnInit {
     }, 1000);
   }
 
-
   async initDeviceService() {
     try {
       // 请求相机权限
@@ -188,7 +206,7 @@ export class TabsComponent implements OnInit {
       } else {
         console.log('文件系统权限被拒绝');
       }
-      await this.requestMicrophonePermission()
+      await this.requestMicrophonePermission();
     } catch (error) {
       console.warn('请求权限时出错:', error);
     }
@@ -203,8 +221,8 @@ export class TabsComponent implements OnInit {
     }
   }
 
-  updateParent(){
-    let url = `https://server.fmode.cn/api/user/agent/parent`
-    this.http.httpRequst(url,{uid:Parse.User.current()?.id},'POST')
+  updateParent() {
+    let url = `https://server.fmode.cn/api/user/agent/parent`;
+    this.http.httpRequst(url, { uid: Parse.User.current()?.id }, 'POST');
   }
 }

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

@@ -26,6 +26,7 @@
           width: 9.2308vw;
           height: 9.2308vw;
           border-radius: 50%;
+          object-fit: cover;
         }
       }
       .li-right {

+ 1 - 0
projects/live-app/src/modules/user/certification/certification.component.ts

@@ -207,6 +207,7 @@ export class CertificationComponent implements OnInit {
     this.profile?.set('idcard', this.idCard);
     this.profile?.set('name', this.name);
     this.profile?.set('cardtype', this.cardtype);
+    this.profile?.set('identyType', 'user');
     if (this.cardtype === 'cn') {
       this.profile?.set('sex', sex);
       this.profile?.set('city', city);

+ 1 - 0
projects/live-app/src/modules/user/friends/friends.component.scss

@@ -26,6 +26,7 @@
           width: 9.2308vw;
           height: 9.2308vw;
           border-radius: 50%;
+          object-fit: cover;
         }
       }
       .li-right {

+ 1 - 0
projects/live-app/src/modules/user/profile/profile.component.html

@@ -30,6 +30,7 @@
             style="z-index: 99"
             frameId="profile-avatar-frame"
             [frame]="userVip['rights']['avatar']"
+            (click)="onShowImg(profile?.get('user')?.get('avatar'))"
           />
           }
           <div class="top-right-block">

+ 5 - 1
projects/live-app/src/modules/user/profile/profile.component.ts

@@ -323,7 +323,11 @@ export class ProfileComponent implements OnInit {
     this.preview.show = 'inline-flex';
   }
   onShow() {
-    if (this.uid == this.currentUser?.id) this.isOpen = true;
+    if (this.uid == this.currentUser?.id){
+       this.isOpen = true;
+    }else{
+      this.onShowImg(this.profile?.get('image') || 'img/bg_duf.jpg')
+    }
   }
   async onFriend() {
     if (this.friends?.id && !this.friends?.get('isPass')) {

+ 1 - 0
projects/live-app/src/modules/user/relation/relation.component.scss

@@ -28,6 +28,7 @@
           height: 10.2564vw;
           border-radius: 50%;
           margin-right: 4px;
+          object-fit: cover;
         }
       }
     }

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

@@ -100,7 +100,8 @@ export class LiveService {
     this.user_published_list = [];
     this.client?.leave();
     this.client = AgoraRTC.createClient({ mode: 'rtc', codec: 'h264' });
-    AgoraRTC.enableLogUpload();
+    // AgoraRTC.enableLogUpload();
+    AgoraRTC.setLogLevel(4)
     if (!this.isBeautyExtensionRegistered) {
       // 创建 BeautyExtension 实例
       const extension: any = new BeautyExtension();