ranking.component.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Component, OnInit } from '@angular/core';
  2. import { IonicModule } from '@ionic/angular';
  3. import * as Parse from 'parse';
  4. import { NavComponent } from '../../../app/components/nav/nav.component';
  5. import { AiChatService } from '../../../services/aichart.service';
  6. @Component({
  7. selector: 'app-ranking',
  8. templateUrl: './ranking.component.html',
  9. styleUrls: ['./ranking.component.scss'],
  10. standalone: true,
  11. imports: [IonicModule,NavComponent],
  12. })
  13. export class RankingComponent implements OnInit {
  14. user?: Parse.Object = Parse.User.current();
  15. orderList: Array<any> = [];
  16. active: string = 'anchor';
  17. disbable:boolean = true
  18. constructor(
  19. private aiServ: AiChatService
  20. ) {}
  21. async ngOnInit() {
  22. this.orderList = await this.aiServ.getOrderAnchor()
  23. console.log(this.orderList);
  24. }
  25. async segmentChanged(e: any) {
  26. let { value } = e.detail;
  27. this.active = value;
  28. console.log(this.active);
  29. // console.log(this.active);
  30. // this.orderList = []
  31. this.orderList = await this.aiServ.getOrderAnchor(this.active)
  32. }
  33. async changeTop(e:any, type?:string){
  34. e.cancelBubble = true;
  35. this.orderList = await this.aiServ.getOrderAnchor(null,null,type);
  36. }
  37. }