warrior 3 months ago
parent
commit
62cf546134

BIN
projects/live-app/public/img/直播.png


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

@@ -20,6 +20,5 @@
     >
       网络不佳
     </div>
-    <!-- <canvas id="canvas" width="100%" height="100%" style="display:none"></canvas> -->
   </div>
 </div>

+ 5 - 0
projects/live-app/src/moduls/live/live.modules.routes.ts

@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
 import { RouterModule, Routes } from '@angular/router';
 import { ChatComponent } from './chat/chat.component';
 import { LinkPageComponent } from './link-page/link-page.component';
+import { RoomManageComponent } from './room-manage/room-manage.component';
 import { SearchComponent } from './search/search.component';
 const routes: Routes = [
   {
@@ -16,6 +17,10 @@ const routes: Routes = [
     path: 'link-room/:rid',//直播页
     component: LinkPageComponent,
   },
+  {
+    path: 'room-manage',//直播房间管理
+    component: RoomManageComponent,
+  },
   
 ]
 @NgModule({

+ 27 - 0
projects/live-app/src/moduls/live/room-manage/room-manage.component.html

@@ -0,0 +1,27 @@
+<nav title="直播房间管理"></nav>
+<ion-content class="content">
+  <div class="edit-room">
+    <div class="row">
+      <div class="title">直播ID</div>
+      <ion-input
+        placeholder="创建房间后自动生成"
+        value="{{ formData.name }}"
+        disabled
+      ></ion-input>
+    </div>
+    <div class="row">
+      <div class="title">标题</div>
+      <ion-input placeholder="待认证" value="{{ formData.name }}"></ion-input>
+    </div>
+    <div class="row">
+      <div class="title">直播封面</div>
+      <ion-input placeholder="待认证" value="{{ formData.name }}"></ion-input>
+    </div>
+    <div class="row">
+      <div class="title">简介</div>
+      <ion-input placeholder="待认证" value="{{ formData.name }}"></ion-input>
+    </div>
+  </div>
+
+</ion-content>
+<button class="submit" (click)="upload.onUpload()">保存修改</button>

+ 35 - 0
projects/live-app/src/moduls/live/room-manage/room-manage.component.scss

@@ -0,0 +1,35 @@
+.content {
+	height: 100vh;
+	width: 100%;
+	background-image: url("https://file-cloud.fmode.cn/uiZD6NisQm/20220831/g1bkbm102855.png") !important;
+	background-repeat: no-repeat;
+	background-position: center top;
+	background-size: 100% 100%;
+  --background:#ffffff00;
+	.edit-room{
+		// padding: 10px;
+		width: 370px;
+		margin: 0 auto;
+		background: white;
+		border-radius: 6px;
+		margin-top: 10px;
+		.row{
+			padding: 6px;
+			margin-bottom: 4px;
+			.title{
+				color: black;
+			}
+		}
+	}
+}
+.submit {
+	position: fixed;
+	bottom: 8vw;
+	width: 80%;
+	height: 10.6667vw;
+	font-size: 4.2667vw;
+	color: white;
+	margin: 0 10%;
+	background-color: #fe4d54;
+	border-radius: 10px;
+}

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

+ 31 - 0
projects/live-app/src/moduls/live/room-manage/room-manage.component.ts

@@ -0,0 +1,31 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { IonicModule, LoadingController, ToastController } from '@ionic/angular';
+import { NavComponent } from '../../../app/components/nav/nav.component';
+import { LiveService } from '../../../services/live.service';
+import { UploadComponent } from '../../../app/components/upload/upload.component';
+import * as Parse from 'parse';
+
+@Component({
+  selector: 'app-room-manage',
+  templateUrl: './room-manage.component.html',
+  styleUrls: ['./room-manage.component.scss'],
+  standalone: true,
+  imports: [IonicModule, NavComponent,UploadComponent],
+})
+export class RoomManageComponent implements OnInit {
+  @ViewChild('upload') upload!: UploadComponent;
+  formData:any = {
+    title: '',
+    cover: '',
+  };
+
+  constructor(
+    public toastController: ToastController,
+    private loadingCtrl: LoadingController,
+    private liveService: LiveService
+  ) { }
+
+  ngOnInit() {
+  }
+
+}

+ 7 - 0
projects/live-app/src/moduls/tabs/my/my.component.html

@@ -148,6 +148,13 @@
         </div>
         <ion-icon name="chevron-forward-outline"></ion-icon>
       </div>
+      <div class="li" (click)="goRoom()">
+        <div class="li-lable">
+          <img src="/img/直播.png" alt="" class="icon" />
+          直播间管理
+        </div>
+        <ion-icon name="chevron-forward-outline"></ion-icon>
+      </div>
       <div class="li" (click)="showAgreement('registerAgreement')">
         <div class="li-lable">
           <img src="/img/隐私.png" alt="" class="icon" />

+ 30 - 1
projects/live-app/src/moduls/tabs/my/my.component.ts

@@ -63,7 +63,7 @@ export class MyComponent implements OnInit {
     let query = new Parse.Query('Profile');
     query.equalTo('user', user?.id);
     query.notEqualTo('isDeleted', true);
-    query.select('isCheck');
+    query.select('isCheck','isCross');
     this.profile = await query.first();
   }
   getAgreement() {
@@ -130,6 +130,35 @@ export class MyComponent implements OnInit {
       return await modal.present();
     }
   }
+  /* 进入直播间 */
+  async goRoom(){
+    if(!this.profile?.get('isCross')){
+      const alert = await this.alertController.create({
+        header: '提示',
+        message: '你还未认证主播身份,请认证后再进入直播间',
+        buttons: [
+          {
+            text: '取消',
+            role: 'cancel',
+            cssClass: 'secondary',
+            handler: (blah) => {
+            },
+          },
+          {
+            text: '去认证',
+            handler: () => {
+              console.log('Confirm Cancel: blah');
+              this.toUrl('/user/idcard')
+            },
+          },
+        ],
+      });
+      await alert.present();
+    }else{
+      this.toUrl('/live/room-manage')
+    }
+  }
+  /* 退出登录 */
   async onLogout() {
     const alert = await this.alertController.create({
       cssClass: 'my-custom-class',

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

@@ -24,7 +24,6 @@ export class TabsComponent implements OnInit {
     private router: Router,
     private alertController: AlertController
   ) {
-    console.log(11);
     this.active = Number(localStorage.getItem('active')) || 0
     this.presentAlert();
   }

+ 5 - 0
projects/live-app/src/moduls/user/album/album.component.scss

@@ -7,6 +7,11 @@
   border-radius: 18px;
 }
 .content {
+  background-image: url("https://file-cloud.fmode.cn/uiZD6NisQm/20220831/g1bkbm102855.png") !important;
+	background-repeat: no-repeat;
+	background-position: center top;
+	background-size: 100% 100%;
+  --background:#ffffff00;
   .upload {
     margin: 10px auto;
   }

+ 7 - 2
projects/live-app/src/moduls/user/certification/certification.component.scss

@@ -15,9 +15,13 @@
 //   }
 // }
 .content {
-  --background: #f8f8f8;
+  // --background: #f8f8f8;
   --padding-bottom: 5.3333vw;
-
+  background-image: url("https://file-cloud.fmode.cn/uiZD6NisQm/20220831/g1bkbm102855.png") !important;
+	background-repeat: no-repeat;
+	background-position: center top;
+	background-size: 100% 100%;
+  --background:#ffffff00;
   .hred {
     width: 350px;
     height: 42.6667vw;
@@ -27,6 +31,7 @@
     justify-content: space-between;
     align-items: center;
     margin: 10px auto;
+    border-radius: 6px;
     .hred-left {
       font-size: 14px;
       font-family: Source Han Sans CN;

+ 9 - 4
projects/live-app/src/moduls/user/feedback/feedback.component.scss

@@ -1,10 +1,15 @@
-.content{
-    padding-bottom: 50px;
+.content {
+  padding-bottom: 50px;
+  background-image: url("https://file-cloud.fmode.cn/uiZD6NisQm/20220831/g1bkbm102855.png") !important;
+  background-repeat: no-repeat;
+  background-position: center top;
+  background-size: 100% 100%;
+  --background: #ffffff00;
 }
 .feedback {
   width: 100%;
-//   height: 100vh;
-  background-color: #fff;
+  //   height: 100vh;
+  //   background-color: #fff;
 
   // 输入框
   .section {

+ 6 - 1
projects/live-app/src/moduls/user/profile/profile.component.scss

@@ -1,6 +1,11 @@
 .content {
   --padding-bottom: 100px;
-  --background: #ffffff;
+  // --background: #ffffff;
+  background-image: url("https://file-cloud.fmode.cn/uiZD6NisQm/20220831/g1bkbm102855.png") !important;
+  background-repeat: no-repeat;
+  background-position: center top;
+  background-size: 100% 100%;
+  --background: #ffffff00;
   .bg {
     height: 160px;
     width: 100%;

+ 8 - 2
projects/live-app/src/moduls/user/setting/setting.component.html

@@ -86,8 +86,14 @@
       <div class="row">
         <div>手机号</div>
         <div class="right">
-          <span>{{ mobile }}</span
-          ><ion-icon name="chevron-forward-outline"></ion-icon>
+          <!-- <span>{{ mobile }}</span
+          > -->
+          <ion-input
+            placeholder="待认证"
+            value="{{ mobile }}"
+            [disabled]="true"
+          ></ion-input>
+          <ion-icon name="chevron-forward-outline"></ion-icon>
         </div>
       </div>
     </ion-item>

+ 5 - 2
projects/live-app/src/moduls/user/setting/setting.component.scss

@@ -3,9 +3,12 @@
 }
 
 ion-content {
-  --background: none;
-  background: #f5f6fa;
   --padding-bottom: 26.6667vw;
+  background-image: url("https://file-cloud.fmode.cn/uiZD6NisQm/20220831/g1bkbm102855.png") !important;
+  background-repeat: no-repeat;
+  background-position: center top;
+  background-size: 100% 100%;
+  --background: #ffffff00;
   .portrait {
     // background-color: white;
     // padding: 1.3333vw 4vw 0 4vw;

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

@@ -22,20 +22,23 @@ export class LiveService {
     videoTrack: null,
   };
   rid?: string; //房间id(channel)
-  profile?: Parse.Object;
+  profile?:any = localStorage.getItem('profile');
   client: any; //客户端
   company: string = '';
   UID:any
   constructor(private http: HttpService, private aiServ: AiChatService) {
+    this.client?.leave();
     this.company = this.aiServ.company;
     this.getProfile();
   }
   async getProfile() {
+    if(this.profile) return
     let queryProfile = new Parse.Query('Profile');
     queryProfile.equalTo('user', Parse.User.current()?.id);
     queryProfile.notEqualTo('isDeleted', true);
     queryProfile.equalTo('isCross', true);
-    this.profile = await queryProfile.first();
+    let r = await queryProfile.first();
+    this.profile = r?.id
   }
   /* 初始化Agora */
   initAgora() {
@@ -70,7 +73,7 @@ export class LiveService {
   }
   async getToken(room: Parse.Object) {
     //获取频道token记录
-    if (room?.get('profile').id == this.profile?.id) {
+    if (room?.get('profile').id == this.profile) {
       this.UID = 111111
       let uid = Parse.User.current()?.id;
       if (!uid) {
@@ -79,8 +82,8 @@ export class LiveService {
       let baseurl = 'https://server.fmode.cn/api/webrtc/build_token';
       let reqBody = {
         company: this.company, // this.aiSer.company,
-        profile: this.profile?.id,
-        channelName: this.profile?.id,
+        profile: this.profile,
+        channelName: this.profile,
       };
       let data: any = await this.http.httpRequst(baseurl, reqBody, 'POST');
       console.log(data);