warrior 1 kuukausi sitten
vanhempi
commit
b837aab052

+ 10 - 4
projects/live-app/src/modules/account/account.modules.routes.ts

@@ -9,11 +9,13 @@ import { RechargeComponent } from './recharge/recharge.component';
 import { RecordsComponent } from './records/records.component';
 import { WattleComponent } from './wattle/wattle.component';
 import { WithdrawalComponent } from './withdrawal/withdrawal.component';
+import { RecDetailComponent } from './records/detail/detail.component';
+
 const routes: Routes = [
   {
     path: '',
-    redirectTo:'wattle',
-    pathMatch: "full",
+    redirectTo: 'wattle',
+    pathMatch: 'full',
   },
   {
     path: 'wattle', //钱包
@@ -51,9 +53,13 @@ const routes: Routes = [
     path: 'records',
     component: RecordsComponent,
   },
-]
+  {
+    path: 'records/detail/:id',
+    component: RecDetailComponent,
+  },
+];
 @NgModule({
   imports: [RouterModule.forChild(routes)],
   exports: [RouterModule],
 })
-export class AccountRoutingModule { }
+export class AccountRoutingModule {}

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

@@ -0,0 +1,48 @@
+<nav title="通话详情"></nav>
+<ion-content class="content">
+  <div class="status-view">
+    <img
+      [src]="
+        withdrawLog?.get('status') == '200' ? 'img/call.png' : 'img/warn.png'
+      "
+      alt=""
+      class=""
+    />
+    @if (withdrawLog?.get('status') == '200') {
+    <div class="text">提现成功</div>
+    <div class="desc">已转账提现成功</div>
+    }@else {
+    <div class="text">{{ getType(withdrawLog?.get("status"))?.title }}</div>
+    }
+  </div>
+  <div class="h3">提现详情</div>
+  <div class="card-container">
+    <div class="row">
+      <div class="label">提现金额:</div>
+      <div class="val">¥{{ withdrawLog?.get("count") }}</div>
+    </div>
+    <div class="row">
+      <div class="label">持卡人:</div>
+      <div class="val">{{ withdrawLog?.get("bank")?.name }}</div>
+    </div>
+    <div class="row">
+      <div class="label">提现银行卡:</div>
+      <div class="val">{{ withdrawLog?.get("bank")?.bankcard }}</div>
+    </div>
+    <div class="row">
+      <div class="label">申请时间:</div>
+      <div class="val">
+        {{ withdrawLog?.get("createdAt") | date : "yyyy-MM-dd HH:ss" }}
+      </div>
+    </div>
+    <div class="row">
+      <div class="label">转账凭证:</div>
+      <div class="val imgs">
+        @for (item of withdrawLog?.get("images"); track $index) {
+        <img (click)="onShowImg(item)" [src]="item" alt="" />
+        }
+      </div>
+    </div>
+  </div>
+</ion-content>
+<app-image-preview [image]="currentImg" #preview></app-image-preview>

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

@@ -0,0 +1,48 @@
+.content {
+  --background: #fafafa;
+}
+.status-view {
+  background-color: white;
+  padding: 5.1282vw;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  img {
+    width: 12.8205vw;
+    margin-bottom: 5.1282vw;
+  }
+  .text {
+    font-size: 4.1026vw;
+    margin: 2.5641vw 0;
+  }
+  .desc {
+    color: #8b8b8b;
+    font-size: 3.0769vw;
+  }
+}
+.h3 {
+  padding: 2.5641vw;
+}
+.card-container {
+  background: white;
+  padding: 2.5641vw;
+  .row {
+    display: flex;
+    margin-bottom: 2.5641vw;
+    font-size: 3.0769vw;
+    .label {
+      width: 30.7692vw;
+      color: #8b8b8b;
+      flex-shrink: 0;
+    }
+    .imgs{
+      display: flex;
+      flex-wrap: wrap;
+      img{
+        width: 120px;
+        height: 120px;
+      }
+    }
+  }
+}

+ 28 - 0
projects/live-app/src/modules/account/records/detail/detail.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 { DetailComponent } from './detail.component';
+
+describe('DetailComponent', () => {
+  let component: DetailComponent;
+  let fixture: ComponentFixture<DetailComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ DetailComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(DetailComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

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

@@ -0,0 +1,59 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { CommonModule, DatePipe } from '@angular/common';
+import { ionicStandaloneModules } from '../../../ionic-standalone.modules';
+import { NavComponent } from '../../../../app/components/nav/nav.component';
+import * as Parse from 'parse';
+import { ActivatedRoute } from '@angular/router';
+import { SharedModule } from '../../../shared.module';
+import { ImagePreviewComponent } from '../../../../app/components/image-preview/image-preview.component';
+@Component({
+  selector: 'app-detail',
+  templateUrl: './detail.component.html',
+  styleUrls: ['./detail.component.scss'],
+  standalone: true,
+  imports: [
+    ...ionicStandaloneModules,
+    NavComponent,
+    ImagePreviewComponent,
+    CommonModule,
+    SharedModule,
+  ],
+  providers: [DatePipe],
+})
+export class RecDetailComponent implements OnInit {
+  withdrawLog?: Parse.Object;
+  @ViewChild('preview') preview!: ImagePreviewComponent;
+  currentImg:string = ''
+  getType(s: string): { title: string; color: string } {
+    let obj: any = {
+      '100': {
+        title: '申请中',
+        color: '#ffca22',
+      },
+      '200': {
+        title: '已提现',
+        color: '#42d96b',
+      },
+      '300': {
+        title: '驳回',
+        color: '#cb1a27',
+      },
+    };
+    return obj[s];
+  }
+  constructor(private activateRoute: ActivatedRoute) {}
+
+  ngOnInit() {
+    this.activateRoute.paramMap.subscribe(async (params) => {
+      let id: any = params.get('id');
+      let query = new Parse.Query('UserAgentWithdraw');
+      query.get(id).then((res) => {
+        this.withdrawLog = res;
+      });
+    });
+  }
+  onShowImg(url: string) {
+    this.currentImg = url;
+    this.preview.show = 'inline-flex';
+  }
+}

+ 18 - 14
projects/live-app/src/modules/account/records/records.component.html

@@ -1,21 +1,25 @@
 <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 }}
+  @for (item of list; track $index) {
+  <div class="log-item" (click)="toUrl(item.id)">
+    <div class="item-col">
+      <div class="title">提现金额:¥{{ item?.get("count") }}</div>
+      <div class="desc">
+        {{ item?.get("createdAt") | date : "yyyy-MM-dd HH:ss" }}
+      </div>
+    </div>
+    <div class="item-col-right">
+      <div class="row">
+        <div class="desc">{{ item?.get("bank")?.bankcard }}</div>
+        <div class="desc">
+          {{ getType(item?.get("status"))?.title }}
+          <div class="tag" [style.background]="getType(item?.get('status'))?.color"></div>
         </div>
-        <div class="order-num">{{ item.orderNum }}</div>
       </div>
-    </ion-item>
-    }
-  </ion-list>
+      <ion-icon name="chevron-forward-outline"></ion-icon>
+    </div>
+  </div>
+  }
   <ion-infinite-scroll (ionInfinite)="onIonInfinite($event)">
     <ion-infinite-scroll-content></ion-infinite-scroll-content>
   </ion-infinite-scroll>

+ 30 - 11
projects/live-app/src/modules/account/records/records.component.scss

@@ -6,21 +6,40 @@
   --background: #ffffff00;
   .log-item {
     display: flex;
+    align-items: center;
     justify-content: space-between;
-		margin-bottom: 1.5385vw;
-    .order-num {
-      font-size: 3.0769vw;
-      color: #7d7d7d;
+    padding: 1.5385vw 2.5641vw;
+    border-bottom: 0.2564vw solid #f3f3f3;
+    font-size: 3.5897vw;
+    .item-col {
+      .title{
+        margin-bottom: 1.0256vw;
+      }
     }
-    .val {
-      text-align: right;
-      .val-num {
-        color: red;
+    .item-col-right {
+      display: flex;
+      align-items: center;
+      .row {
+        margin-right: 1.5385vw;
+        display: flex;
+        flex-direction: column;
+        align-items: flex-end;
       }
     }
-    .time {
-      font-size: 3.0769vw;
-      color: #7d7d7d;
+    .desc,
+    ion-icon {
+      color: #8b8b8b;
+    }
+    .desc {
+      display: flex;
+      align-items: center;
+      .tag {
+        width: 1.5385vw;
+        height: 1.5385vw;
+        // background-color: #42d96b;
+        border-radius: 50%;
+        margin-right: 1.5385vw;
+      }
     }
   }
 }

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

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

+ 1 - 0
projects/live-app/src/modules/account/withdrawal/withdrawal.component.ts

@@ -72,6 +72,7 @@ export class WithdrawalComponent implements OnInit {
     userAgentWithdraw.set('type', 'bank');
     userAgentWithdraw.set('name', this.bankinfo.name);
     userAgentWithdraw.set('count', this.price);
+    userAgentWithdraw.set('status', '100');
     userAgentWithdraw.set('company', {
       __type: 'Pointer',
       className: 'Company',