|
@@ -0,0 +1,65 @@
|
|
|
|
+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 { ionicStandaloneModules } from '../../ionic-standalone.modules';
|
|
|
|
+@Component({
|
|
|
|
+ selector: 'app-records',
|
|
|
|
+ templateUrl: './records.component.html',
|
|
|
|
+ styleUrls: ['./records.component.scss'],
|
|
|
|
+ standalone: true,
|
|
|
|
+ imports: [...ionicStandaloneModules, NavComponent],
|
|
|
|
+})
|
|
|
|
+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 {
|
|
|
|
+ let obj: any = {
|
|
|
|
+ recharge: '充值',
|
|
|
|
+ used: '消费',
|
|
|
|
+ };
|
|
|
|
+ return obj[s];
|
|
|
|
+ }
|
|
|
|
+ constructor(private aiServ: AiChatService) {}
|
|
|
|
+
|
|
|
|
+ async ngOnInit() {
|
|
|
|
+ this.list = await this.aiServ.getAccountLog();
|
|
|
|
+ console.log(this.list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async getWithdraw(){
|
|
|
|
+ let query = new Parse.Query('UserAgentWithdraw');
|
|
|
|
+ query.equalTo('user', this.user?.id);
|
|
|
|
+ query.notEqualTo('isDeleted',true)
|
|
|
|
+ query.descending('createdAt')
|
|
|
|
+ query.limit(20)
|
|
|
|
+ query.skip(this.list.length)
|
|
|
|
+ let r = await query.find();
|
|
|
|
+ this.list.push(...r)
|
|
|
|
+ return r
|
|
|
|
+ }
|
|
|
|
+ async onIonInfinite(ev: any) {
|
|
|
|
+ let result = await this.getWithdraw();
|
|
|
|
+ if (result.length == 0) {
|
|
|
|
+ (ev as InfiniteScrollCustomEvent).target.disabled = true;
|
|
|
|
+ }
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ (ev as InfiniteScrollCustomEvent).target.complete();
|
|
|
|
+ }, 500);
|
|
|
|
+ }
|
|
|
|
+}
|