1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import { Component, OnInit } from '@angular/core';
- import { IonicModule } from '@ionic/angular';
- import * as Parse from 'parse';
- import { NavComponent } from '../../../app/components/nav/nav.component';
- import { AiChatService } from '../../../services/aichart.service';
- @Component({
- selector: 'app-ranking',
- templateUrl: './ranking.component.html',
- styleUrls: ['./ranking.component.scss'],
- standalone: true,
- imports: [IonicModule,NavComponent],
- })
- export class RankingComponent implements OnInit {
- user?: Parse.Object = Parse.User.current();
- orderList: Array<any> = [];
- active: string = 'anchor';
- disbable:boolean = true
- constructor(
- public aiServ: AiChatService
- ) {}
- async ngOnInit() {
- this.orderList = await this.aiServ.getOrderAnchor(null,null,'day')
- // console.log(this.orderList);
- }
- async segmentChanged(e: any) {
- let { value } = e.detail;
- this.active = value;
- console.log(this.active);
- // console.log(this.active);
- // this.orderList = []
- this.orderList = await this.aiServ.getOrderAnchor(this.active,null,'day')
- }
- async changeTop(e:any, type?:string){
- e.cancelBubble = true;
- this.orderList = await this.aiServ.getOrderAnchor(this.active,null,type);
- }
- formatNumber(num1:number,num2:number){
- let n = num1 - num2;
- return Math.round(n * 100) / 100;
- }
- }
|