warrior 2 месяцев назад
Родитель
Сommit
df2ed99982

BIN
projects/live-app/public/img/flutter.gif


+ 16 - 0
projects/live-app/src/app/components/flutter-comp/flutter-comp.component.html

@@ -0,0 +1,16 @@
+@if (msgSerrvice.giftLog) {
+<div
+  class="flutter-container"
+  [style.background-image]="'url(img/flutter.gif)'"
+>
+  <div class="flutter-banner">
+    <div class="text">甜心宝贝送出法拉利</div>
+    <div class="gift-container">
+      <img
+        class="gift-img"
+        src="https://file-cloud.fmode.cn/Qje9D4bqol/20241203/q1f26f111037245.png"
+      />
+    </div>
+  </div>
+</div>
+}

+ 77 - 0
projects/live-app/src/app/components/flutter-comp/flutter-comp.component.scss

@@ -0,0 +1,77 @@
+.flutter-container {
+  width: 100%;
+  height: 200px;
+  position: fixed;
+  top: 0;
+  left: 0;
+
+  .flutter-banner{
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    background: linear-gradient(to bottom, rgb(0 0 0 / 51%), rgb(0 0 0 / 24%), rgb(47 47 47 / 3%));
+  }
+
+  .text {
+    color: #ffffff;
+    margin: 10px auto;
+    // background: #fb475ec7;
+    padding: 6px 20px;
+    width: 80%;
+    text-align: center;
+  }
+  .gift-container {
+    width: 100%;
+    flex: 1;
+    position: relative;
+    display: flex;
+    flex-direction: column;
+    .gift-img {
+      position: absolute;
+      top: 0;
+      width: 100px;
+      height: 100px;
+      animation: scaleUp 3s ease-in-out infinite; /* 使用scaleUp动画,持续3秒 */
+    }
+  }
+}
+
+@keyframes scaleUp {
+  0% {
+    right: 0;
+  }
+  // 30% {
+  //   right: 150px;
+  // }
+  20% {
+    right: 180px;
+  }
+  30% {
+    right: 150px;
+  }
+  40% {
+    right: 150px;
+    transform: rotateZ(300deg);
+  }
+  50% {
+    right: 150px;
+    transform: rotateZ(0deg);
+  }
+  60% {
+    right: 150px;
+    transform: rotateZ(360deg);
+  }
+  70% {
+    right: 150px;
+    transform: rotateZ(0deg);
+  }
+  // 90% {
+  //   right:150px
+  // }
+  100% {
+    right: 390px;
+  }
+}

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

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

@@ -0,0 +1,20 @@
+import { Component, OnInit } from '@angular/core';
+import { MessageService } from '../../../services/message.service';
+
+@Component({
+  selector: 'app-flutter-comp',
+  templateUrl: './flutter-comp.component.html',
+  styleUrls: ['./flutter-comp.component.scss'],
+  standalone: true,
+  imports: []
+})
+export class FlutterCompComponent implements OnInit {
+
+  constructor(
+    public msgSerrvice: MessageService
+  ) { }
+
+  ngOnInit() {
+  }
+
+}

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

@@ -44,3 +44,5 @@
     </ion-tab-button>
   </ion-tab-bar>
 </ion-tabs>
+
+<app-flutter-comp></app-flutter-comp>

+ 25 - 24
projects/live-app/src/modules/tabs/tabs/tabs.component.ts

@@ -7,6 +7,7 @@ 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';
 
@@ -15,7 +16,7 @@ import { AlertController } from '@ionic/angular';
   templateUrl: 'tabs.component.html',
   styleUrls: ['tabs.component.scss'],
   standalone: true,
-  imports: [IonicModule],
+  imports: [IonicModule,FlutterCompComponent],
 })
 export class TabsComponent implements OnInit {
   @Input('tabsOption') tabsOption: any = {};
@@ -86,29 +87,29 @@ export class TabsComponent implements OnInit {
       localStorage.setItem('profile', JSON.stringify(res.toJSON()));
       return;
     }
-    const alert = await this.alertController.create({
-      cssClass: 'my-custom-class',
-      header: '实名认证',
-      message: '根据相关法律法规要求,请先完成实名',
-      backdropDismiss: false,
-      buttons: [
-        // {
-        //   text: '取消',
-        //   role: 'cancel',
-        //   cssClass: 'secondary',
-        //   handler: (blah) => {
-        //     console.log('Confirm Cancel: blah');
-        //   },
-        // },
-        {
-          text: '去认证',
-          handler: () => {
-            this.router.navigate(['user/certification']);
-          },
-        },
-      ],
-    });
-    await alert.present();
+    // const alert = await this.alertController.create({
+    //   cssClass: 'my-custom-class',
+    //   header: '实名认证',
+    //   message: '根据相关法律法规要求,请先完成实名',
+    //   backdropDismiss: false,
+    //   buttons: [
+    //     // {
+    //     //   text: '取消',
+    //     //   role: 'cancel',
+    //     //   cssClass: 'secondary',
+    //     //   handler: (blah) => {
+    //     //     console.log('Confirm Cancel: blah');
+    //     //   },
+    //     // },
+    //     {
+    //       text: '去认证',
+    //       handler: () => {
+    //         this.router.navigate(['user/certification']);
+    //       },
+    //     },
+    //   ],
+    // });
+    // await alert.present();
   }
 
   allowNavi: boolean = true;

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

@@ -136,7 +136,7 @@
     @if (uid !== currentUser?.id && !accServ.userVip?.rights?.['view-profile']) {
       <div class="view-auth">
         <ion-icon name="lock-closed"></ion-icon>
-        <div class="auth-text">开通会员查看更多</div>
+        <div class="auth-text">开通高级会员查看更多</div>
       </div>
     }
   </div>

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

@@ -340,7 +340,7 @@ export class ProfileComponent implements OnInit {
     this.iscall = false;
     const toast = await this.toastController.create({
       message: `对方${event ? '已接受' : '拒绝'}通话邀请`,
-      color: 'warning',
+      color: event ? 'success' : 'warning',
       duration: 1500,
     });
     toast.present();

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

@@ -233,7 +233,7 @@ export class LiveService {
       console.log('remoteUsers', user.uid);
       this.client.subscribe(user, 'audio').then((audioTrack: any) => {
         this.user_published_list.add(user);
-        audioTrack.setVolume(0);
+        audioTrack.setVolume(100);
         audioTrack.play();
       });
       this.client.subscribe(user, 'video').then((videoTrack: any) => {
@@ -334,10 +334,12 @@ export class LiveService {
   async afterJoin() {
     this.timer && clearTimeout(this.timer);
     this.timer_countdown && clearInterval(this.timer_countdown);
-    if (this.client.remoteUsers.length > 0) {
+    const targetUser = this.client.remoteUsers?.find((user: any) => user.uid !== 100001) //排出超管
+    console.log(targetUser);
+    if (this.client.remoteUsers.length > 0 && targetUser) {
       if (this.isAnchor) {
         //如果是主播,进入获取remoteUsers.user获取livelog再获取对方剩余通话时长
-        this.getLiveLog();
+        this.getLiveLog(targetUser.id);
       } else {
         let query = new Parse.Query('LiveLog');
         query.equalTo('objectId', this.liveLog?.id);
@@ -361,11 +363,11 @@ export class LiveService {
       }, 1000);
     }
   }
-  async getLiveLog() {
-    let uid = this.client.remoteUsers[0].uid;
+  async getLiveLog(tarUid:string) {
+    // let uid = this.client.remoteUsers[0].uid;
     this.timer && clearTimeout(this.timer);
     let query = new Parse.Query('LiveLog');
-    query.equalTo('uid', String(uid));
+    query.equalTo('uid', String(tarUid));
     query.equalTo('room', this.room?.id);
     query.notEqualTo('isDeleted', true);
     query.notEqualTo('isLive', true);
@@ -378,7 +380,7 @@ export class LiveService {
       return;
     }
     this.timer = setTimeout(() => {
-      this.getLiveLog();
+      this.getLiveLog(tarUid);
     }, 1000);
   }
   async get_duration() {

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

@@ -26,6 +26,7 @@ export class MessageService {
   pageFun?: Function; //页面传入的方法
   alert: any; // 弹窗
   messageMapList: any = {};
+  giftLog?: string = ''; //当前礼物弹窗
   
   constructor(
     private alertController: AlertController,