|
@@ -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;
|