warrior преди 1 месец
родител
ревизия
a87de8f5b4

+ 5 - 0
projects/live-app/src/modules/account/account.modules.routes.ts

@@ -6,6 +6,7 @@ import { NoticeLogComponent } from './notice-log/notice-log.component';
 import { DetailComponent } from './order/detail/detail.component';
 import { OrderComponent } from './order/order.component';
 import { RechargeComponent } from './recharge/recharge.component';
+import { RecordsComponent } from './records/records.component';
 import { WattleComponent } from './wattle/wattle.component';
 import { WithdrawalComponent } from './withdrawal/withdrawal.component';
 const routes: Routes = [
@@ -46,6 +47,10 @@ const routes: Routes = [
     path: 'withdrawal',
     component: WithdrawalComponent,
   },
+  {
+    path: 'records',
+    component: RecordsComponent,
+  },
 ]
 @NgModule({
   imports: [RouterModule.forChild(routes)],

+ 22 - 0
projects/live-app/src/modules/account/records/records.component.html

@@ -0,0 +1,22 @@
+<nav title="提现记录"></nav>
+<ion-content class="content">
+  <ion-list>
+    @for (item of list; track $index) {
+    <ion-item lines="none" class="log-item">
+      <ion-label>
+        <div class="title">{{ getType(item.cate) }}</div>
+        <div class="time">{{ item.time }}</div>
+      </ion-label>
+      <div class="val">
+        <div class="val-num">
+          {{ item.assetCount }}
+        </div>
+        <div class="order-num">{{ item.orderNum }}</div>
+      </div>
+    </ion-item>
+    }
+  </ion-list>
+  <ion-infinite-scroll (ionInfinite)="onIonInfinite($event)">
+    <ion-infinite-scroll-content></ion-infinite-scroll-content>
+  </ion-infinite-scroll>
+</ion-content>

+ 26 - 0
projects/live-app/src/modules/account/records/records.component.scss

@@ -0,0 +1,26 @@
+.content {
+  background-image: url("https://file-cloud.fmode.cn/Qje9D4bqol/20241220/b313ov054708770.png") !important;
+  background-repeat: no-repeat;
+  background-position: center top;
+  background-size: 100% 100%;
+  --background: #ffffff00;
+  .log-item {
+    display: flex;
+    justify-content: space-between;
+		margin-bottom: 1.5385vw;
+    .order-num {
+      font-size: 3.0769vw;
+      color: #7d7d7d;
+    }
+    .val {
+      text-align: right;
+      .val-num {
+        color: red;
+      }
+    }
+    .time {
+      font-size: 3.0769vw;
+      color: #7d7d7d;
+    }
+  }
+}

+ 28 - 0
projects/live-app/src/modules/account/records/records.component.spec.ts

@@ -0,0 +1,28 @@
+/* tslint:disable:no-unused-variable */
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { By } from '@angular/platform-browser';
+import { DebugElement } from '@angular/core';
+
+import { RecordsComponent } from './records.component';
+
+describe('RecordsComponent', () => {
+  let component: RecordsComponent;
+  let fixture: ComponentFixture<RecordsComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ RecordsComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(RecordsComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 65 - 0
projects/live-app/src/modules/account/records/records.component.ts

@@ -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);
+  }
+}

+ 6 - 6
projects/live-app/src/modules/account/wattle/wattle.component.html

@@ -31,24 +31,24 @@
         src="https://file-cloud.fmode.cn/uiZD6NisQm/20220808/9sq3d1093746.png"
       />
     </div>
-    }
-    <div class="install" (click)="record()">
+    <div class="install" (click)="records()">
       <div class="install-to">
-        <div class="name">动账记录</div>
+        <div class="name">提现记录</div>
       </div>
       <img
         class="img"
         src="https://file-cloud.fmode.cn/uiZD6NisQm/20220808/9sq3d1093746.png"
       />
     </div>
-    <!-- <div class="install" (click)="records()">
+    }
+    <div class="install" (click)="record()">
       <div class="install-to">
-        <div class="name">提现记录</div>
+        <div class="name">动账记录</div>
       </div>
       <img
         class="img"
         src="https://file-cloud.fmode.cn/uiZD6NisQm/20220808/9sq3d1093746.png"
       />
-    </div> -->
+    </div>
   </div>
 </ion-content>

+ 7 - 5
projects/live-app/src/modules/tabs/tabs/tabs.component.ts

@@ -1,6 +1,6 @@
 import { Component, ViewChild, Input } from '@angular/core';
-import { ChangeDetectorRef } from '@angular/core';
-import { ActivatedRoute, Router, RouterOutlet } from '@angular/router';
+// import { ChangeDetectorRef } from '@angular/core';
+import { ActivatedRoute, Router } from '@angular/router';
 import * as Parse from 'parse';
 import { IonicModule } from '@ionic/angular';
 
@@ -23,14 +23,16 @@ export class TabsComponent implements OnInit {
   company: any = window.localStorage.getItem('company');
   constructor(
     private router: Router,
-    private alertController: AlertController,
-    private activateRoute: ActivatedRoute
+    // private alertController: AlertController,
+    private activateRoute: ActivatedRoute,
   ) // private connectTask: ConnectTaskService
   {
     this.activateRoute.paramMap.subscribe(async (params) => {
-      this.active = Number(localStorage.getItem('active')) ?? 0;
       await this.presentAlert();
       // this.connectTask.init();
+      this.active = this.option.findIndex((item: any) => {
+        return item.url == location.pathname.slice(1)
+      }) ?? 0
     });
   }