|
@@ -1,45 +1,43 @@
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
import { InfiniteScrollCustomEvent } from '@ionic/core';
|
|
|
import { NavComponent } from '../../../app/components/nav/nav.component';
|
|
|
-import { AiChatService } from '../../../services/aichart.service';
|
|
|
+// import { AiChatService } from '../../../services/aichart.service';
|
|
|
import { ionicStandaloneModules } from '../../ionic-standalone.modules';
|
|
|
+import * as Parse from 'parse';
|
|
|
+import { CommonModule, DatePipe } from '@angular/common';
|
|
|
+import { Router } from '@angular/router';
|
|
|
@Component({
|
|
|
selector: 'app-records',
|
|
|
templateUrl: './records.component.html',
|
|
|
styleUrls: ['./records.component.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [...ionicStandaloneModules, NavComponent],
|
|
|
+ imports: [...ionicStandaloneModules, NavComponent,CommonModule],
|
|
|
+ providers: [DatePipe],
|
|
|
})
|
|
|
export class RecordsComponent implements OnInit {
|
|
|
user:Parse.User = Parse.User.current();
|
|
|
- list: Array<any> = [
|
|
|
- // {
|
|
|
- // title: '会员充值',
|
|
|
- // time: '2022-08-08 12:12:12',
|
|
|
- // num: '1000',
|
|
|
- // orderNum:'C20220808121212',
|
|
|
- // state: '已到账'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // title: '钻石充值',
|
|
|
- // num: '1000',
|
|
|
- // time: '2022-08-08 12:12:12',
|
|
|
- // orderNum:'C20220808121212',
|
|
|
- // money: '1000',
|
|
|
- // }
|
|
|
- ];
|
|
|
- getType(s: string): string {
|
|
|
+ list: Array<any> = [];
|
|
|
+ getType(s: string): {title:string,color:string} {
|
|
|
let obj: any = {
|
|
|
- recharge: '充值',
|
|
|
- used: '消费',
|
|
|
+ '100': {
|
|
|
+ title:'申请中',
|
|
|
+ color:'#ffca22',
|
|
|
+ },
|
|
|
+ '200':{
|
|
|
+ title:'已提现',
|
|
|
+ color:'#42d96b',
|
|
|
+ },
|
|
|
+ '300': {
|
|
|
+ title:'驳回',
|
|
|
+ color:'#cb1a27',
|
|
|
+ },
|
|
|
};
|
|
|
return obj[s];
|
|
|
}
|
|
|
- constructor(private aiServ: AiChatService) {}
|
|
|
+ constructor(private router: Router) {}
|
|
|
|
|
|
async ngOnInit() {
|
|
|
- this.list = await this.aiServ.getAccountLog();
|
|
|
- console.log(this.list);
|
|
|
+ this.getWithdraw()
|
|
|
}
|
|
|
|
|
|
async getWithdraw(){
|
|
@@ -51,6 +49,7 @@ export class RecordsComponent implements OnInit {
|
|
|
query.skip(this.list.length)
|
|
|
let r = await query.find();
|
|
|
this.list.push(...r)
|
|
|
+ console.log(r);
|
|
|
return r
|
|
|
}
|
|
|
async onIonInfinite(ev: any) {
|
|
@@ -61,5 +60,10 @@ export class RecordsComponent implements OnInit {
|
|
|
setTimeout(() => {
|
|
|
(ev as InfiniteScrollCustomEvent).target.complete();
|
|
|
}, 500);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ toUrl(id: string) {
|
|
|
+ this.router.navigate(['account/records/detail/' + id]);
|
|
|
}
|
|
|
}
|