Explorar o código

update ioncModules

warrior hai 2 meses
pai
achega
016f28d347

+ 1 - 0
package.json

@@ -24,6 +24,7 @@
     "@ionic/angular-server": "^8.4.0",
     "@ionic/angular-toolkit": "^11.0.1",
     "@ionic/core": "^8.4.0",
+    "ngx-build-plus": "^18.0.0",
     "parse": "^5.3.0",
     "qiniu-js": "^3.1.2",
     "rxjs": "~7.8.0",

+ 11 - 6
projects/live-app/src/app/app.routes.ts

@@ -1,7 +1,12 @@
 import { Routes,mapToCanActivate } from '@angular/router';
-import { TabsComponent } from '../modules/tabs/tabs/tabs.component';
+import { TabsRoutingModule } from '../modules/tabs/tabs.modules.routes';
 import { AuthGuard } from '../services/auth.guard';
 
+import { TabsComponent } from '../modules/tabs/tabs/tabs.component';
+import { UserRoutingModule } from '../modules/user/user.modules.routes';
+import { AccountRoutingModule } from '../modules/account/account.modules.routes';
+import { GoodsRoutingModule } from '../modules/goods/goods.modules.routes';
+import { LiveRoutingModule } from '../modules/live/live.modules.routes';
 export const routes: Routes = [
   { path: '', redirectTo:'tabs', pathMatch: "full",}, // 默认跳转到 ''
   // {
@@ -16,27 +21,27 @@ export const routes: Routes = [
     path: 'tabs', //首页tabs
     component: TabsComponent,
     canActivate: mapToCanActivate([AuthGuard]),
-    loadChildren: () =>import('../modules/tabs/tabs.modules.routes').then((mod) => mod.TabsRoutingModule),
+    loadChildren: () =>TabsRoutingModule,
   },
   {
     path: 'user', 
     canActivate: mapToCanActivate([AuthGuard]),
-    loadChildren: () =>import('../modules/user/user.modules.routes').then((mod) => mod.UserRoutingModule),
+    loadChildren: () =>UserRoutingModule,
   },
   {
     path: 'account', 
     canActivate: mapToCanActivate([AuthGuard]),
-    loadChildren: () =>import('../modules/account/account.modules.routes').then((mod) => mod.AccountRoutingModule),
+    loadChildren: () =>AccountRoutingModule,
   },
   {
     path: 'goods', 
     canActivate: mapToCanActivate([AuthGuard]),
-    loadChildren: () =>import('../modules/goods/goods.modules.routes').then((mod) => mod.GoodsRoutingModule),
+    loadChildren: () =>GoodsRoutingModule,
   },
   {
     path: 'live', 
     canActivate: mapToCanActivate([AuthGuard]),
-    loadChildren: () =>import('../modules/live/live.modules.routes').then((mod) => mod.LiveRoutingModule),
+    loadChildren: () =>LiveRoutingModule,
   },
   
 ];

+ 4 - 2
projects/live-app/src/modules/ionic-standalone.modules.ts

@@ -31,6 +31,7 @@ import {
 
   AlertController,
   ToastController,
+  LoadingController
 } from '@ionic/angular/standalone';
 
 export const ionicStandaloneModules = [
@@ -65,7 +66,8 @@ export const ionicStandaloneModules = [
   IonAlert,
 ];
 
-export const ionicStandaloneController = [
+export {
   AlertController,
   ToastController,
-]
+  LoadingController
+}

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

@@ -1,5 +1,5 @@
 <ion-content class="content">
-  <div class="header">
+  <div class="header" [style.background-image]="'url(img/bg.png)'">
     <div class="top">
       <ion-segment
         [scrollable]="true"

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

@@ -5,7 +5,6 @@
     padding: 20px 10px 10px;
     height: 160px;
     // border-radius: 0 0 50px 50px;
-    background-image: url(/img/bg.png);
     background-size: 100% 100%;
     .top {
       display: flex;

+ 19 - 15
projects/live-app/src/modules/tabs/home/home.component.ts

@@ -1,23 +1,24 @@
 import { Component, OnInit } from '@angular/core';
 import * as Parse from 'parse';
-import {
-  AlertController,
-  // IonicModule,
-  LoadingController,
-} from '@ionic/angular';
+// import {
+//   AlertController,
+//   LoadingController,
+// } from '@ionic/angular';
 import { ActivatedRoute, Router } from '@angular/router';
 import { Swiper } from 'swiper';
 import { AiChatService } from '../../../services/aichart.service';
 import { ConnectTaskService } from '../../../services/connectTask.service';
-import {ionicStandaloneModules} from '../../ionic-standalone.modules'
+import {
+  ionicStandaloneModules,
+  AlertController,
+  LoadingController,
+} from '../../ionic-standalone.modules';
 @Component({
   selector: 'app-home',
   templateUrl: './home.component.html',
   styleUrls: ['./home.component.scss'],
   standalone: true,
-  imports: [
-    ...ionicStandaloneModules
-  ],
+  imports: [...ionicStandaloneModules],
   // schemas: [CUSTOM_ELEMENTS_SCHEMA],
 })
 export class HomeComponent implements OnInit {
@@ -113,7 +114,7 @@ export class HomeComponent implements OnInit {
     await this.getRoom();
     setTimeout(() => {
       this.initSwiperTimeEvent();
-    }, 0);
+    }, 100);
   }
   async getBanner() {
     let query = new Parse.Query('Banner');
@@ -152,21 +153,24 @@ export class HomeComponent implements OnInit {
     });
   }
   async getRoom(type?: string) {
+    console.log(type);
     const loading = await this.loadingCtrl.create({
       message: '正在加载',
     });
     loading.present();
     let data: Array<any> = [];
-    if (type == this.currentValue) {
+    if (type == this.oldCurrentValue) {
+      loading.dismiss();
       return;
     }
+    this.oldCurrentValue = this.currentValue;
     if (!type) type = this.currentValue;
     let uid = Parse.User.current()?.id;
     let sex = this.viewAnchor == 'all' ? null : this.viewAnchor;
-    if(!this.connectTask.onlineUserList.size){
-      await this.connectTask.getOnlieUserList('user_connect_room')
+    if (!this.connectTask.onlineUserList.size) {
+      await this.connectTask.getOnlieUserList('user_connect_room');
     }
-    const userList = Array.from(this.connectTask.onlineUserList)
+    const userList = Array.from(this.connectTask.onlineUserList);
     console.log(userList);
     switch (type) {
       case 'follow':
@@ -241,7 +245,7 @@ export class HomeComponent implements OnInit {
     // console.log(this.currentValue);
   }
   cancel(type: string, value?: string) {
-    // console.log(type, value);
+    console.log(type, value);
     if (type == 'cancel') {
       this.currentValue = this.oldCurrentValue;
       this.isOpen = false;

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

@@ -1,5 +1,5 @@
 <ion-content class="content">
-  <div class="header">
+  <div class="header" [style.background-image]="'url(img/bg.png)'">
     <div class="user-dateil">
       <div
         class="pendant"
@@ -47,7 +47,7 @@
       </div>
     </div>
   </div>
-  <div class="ad">
+  <div class="ad" [style.background-image]="'url(img/ad-banner.png)'">
     <div class="ad-left">
       <div class="text">爱聊 <span>VIP</span></div>
       <p>开通爱聊VIP,解锁海量专属主播聊天。</p>
@@ -66,8 +66,8 @@
     </div>
     }
   </div>
-  <div class="order">
-    <div class="ladder">
+  <div class="order" [style.background-image]="'url(img/用户榜底.png)'">
+    <div class="ladder" [style.background-image]="'url(img/top.png)'">
       <div class="top-block">
         <div class="top2">
           <div class="user-block">

+ 0 - 4
projects/live-app/src/modules/tabs/my/my.component.scss

@@ -3,7 +3,6 @@
   --background: #f8f8f8;
   .header {
     padding: 20px 10px 10px;
-    background-image: url(/img/bg.png);
     background-size: 100% 100%;
     height: 140px;
     // border-radius: 0 0 50px 50px;
@@ -100,7 +99,6 @@
     font-size: 12px;
     border-radius: 2px;
     margin: -4px auto 0;
-    background-image: url(/img/ad-banner.png);
     background-size: 100% 100%;
     width: 360px;
     .ad-left {
@@ -159,7 +157,6 @@
   .order {
     width: 360px;
     margin: 10px auto;
-    background-image: url(/img/用户榜底.png);
     background-size: 100% 100%;
     height: 220px;
     padding: 6px 30px;
@@ -235,7 +232,6 @@
       left: 0;
       width: 100%;
       height: 70px;
-      background-image: url(/img/top.png);
       background-size: 100% 100%;
     }
     .row {

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

@@ -10,8 +10,8 @@
   </ion-toolbar>
 </ion-header>
 <ion-content class="content"> 
-  <div class="order">
-    <div class="ladder">
+  <div class="order" [style.background-image]="'url(img/用户榜底.png)'">
+    <div class="ladder" [style.background-image]="'url(img/top.png)'">
       <div class="top-block">
         <div class="top2">
           <div class="user-block">

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

@@ -2,7 +2,6 @@
   .order {
     width: 360px;
     margin: 10px auto;
-    background-image: url(/img/用户榜底.png);
     background-size: 100% 100%;
     height: 220px;
     padding: 6px 30px;
@@ -78,7 +77,6 @@
       left: 0;
       width: 100%;
       height: 70px;
-      background-image: url(/img/top.png);
       background-size: 100% 100%;
     }
     .row {