Browse Source

更新会员权限

warrior 2 months ago
parent
commit
9de4cc600f

BIN
projects/live-app/public/img/1.png


BIN
projects/live-app/public/img/3.png


BIN
projects/live-app/public/img/complete.png


BIN
projects/live-app/public/img/warn.png


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

@@ -2,6 +2,8 @@ import { NgModule } from '@angular/core';
 import { RouterModule, Routes } from '@angular/router';
 import { AccountLogComponent } from './account-log/account-log.component';
 import { BankcardComponent } from './bankcard/bankcard.component';
+import { DetailComponent } from './order/detail/detail.component';
+import { OrderComponent } from './order/order.component';
 import { RechargeComponent } from './recharge/recharge.component';
 import { WattleComponent } from './wattle/wattle.component';
 const routes: Routes = [
@@ -26,7 +28,14 @@ const routes: Routes = [
     path: 'log',
     component: AccountLogComponent,
   },
-  
+  {
+    path: 'order',
+    component: OrderComponent,
+  },
+  {
+    path: 'order/detail/:id',
+    component: DetailComponent,
+  }
 ]
 @NgModule({
   imports: [RouterModule.forChild(routes)],

+ 55 - 0
projects/live-app/src/modules/account/order/detail/detail.component.html

@@ -0,0 +1,55 @@
+<nav title="订单详情"></nav>
+<ion-content class="content">
+  <div class="status-view">
+    <img
+      [src]="
+        order?.get('status') == '200' ? 'img/complete.png' : 'img/warn.png'
+      "
+      alt=""
+      class=""
+    />
+    @switch (order?.get("status")) { @case ('100') {
+    <div class="text">已取消</div>
+    <div class="desc">订单已取消</div>
+    }@case ('200') {
+    <div class="text">已完成</div>
+    <div class="desc">订单已完成</div>
+    } @case ('500') {
+    <div class="text">已退款</div>
+    <div class="desc">订单已退款</div>
+    } }
+  </div>
+  <div class="h3">商品详情</div>
+  <div class="card-container">
+    <div class="row">
+      <div class="label">产品名称:</div>
+      <div class="val">{{ order?.get("targetObject")[0]?.get("name") }}</div>
+    </div>
+    <div class="row">
+      <div class="label">产品周期:</div>
+      <div class="val">
+        {{ order?.get("targetObject")[0]?.get("validity") }}天
+      </div>
+    </div>
+  </div>
+
+  <div class="h3">订单详情</div>
+  <div class="card-container">
+    <div class="row">
+      <div class="label">订单编号:</div>
+      <div class="val">{{ order?.get("orderNum") }}</div>
+    </div>
+    <div class="row">
+      <div class="label">创建时间:</div>
+      <div class="val">
+        {{ order?.get("createdAt") | date : "yyyy-MM-dd HH:ss" }}
+      </div>
+    </div>
+    <div class="row">
+      <div class="label">实付:</div>
+      <div class="val">
+        {{ order?.get("isPay") ? order?.get("price") : "未付款" }}
+      </div>
+    </div>
+  </div>
+</ion-content>

+ 39 - 0
projects/live-app/src/modules/account/order/detail/detail.component.scss

@@ -0,0 +1,39 @@
+.content {
+  --background: #fafafa;
+}
+.status-view {
+  background-color: white;
+  padding: 20px;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  img {
+    width: 50px;
+    margin-bottom: 20px;
+  }
+  .text {
+    font-size: 16px;
+    margin: 10px 0;
+  }
+  .desc {
+    color: #8b8b8b;
+    font-size: 12px;
+  }
+}
+.h3 {
+  padding: 10px;
+}
+.card-container {
+  background: white;
+  padding: 10px;
+  .row {
+    display: flex;
+    margin-bottom: 10px;
+    font-size: 12px;
+    .label {
+      width: 120px;
+      color: #8b8b8b;
+    }
+  }
+}

+ 28 - 0
projects/live-app/src/modules/account/order/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();
+  });
+});

+ 29 - 0
projects/live-app/src/modules/account/order/detail/detail.component.ts

@@ -0,0 +1,29 @@
+import { Component, OnInit } 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';
+@Component({
+  selector: 'app-detail',
+  templateUrl: './detail.component.html',
+  styleUrls: ['./detail.component.scss'],
+  standalone: true,
+  imports: [...ionicStandaloneModules, NavComponent, CommonModule],
+  providers: [DatePipe],
+})
+export class DetailComponent implements OnInit {
+  order?: Parse.Object;
+  constructor(private activateRoute: ActivatedRoute) {}
+
+  ngOnInit() {
+    this.activateRoute.paramMap.subscribe(async (params) => {
+      let id: any = params.get('id');
+      let query = new Parse.Query('Order');
+      query.select('price','isPay', 'orderNum','status', 'targetObject.name','targetObject.validity');
+      query.get(id).then((res) => {
+        this.order = res;
+      });
+    });
+  }
+}

+ 25 - 0
projects/live-app/src/modules/account/order/order.component.html

@@ -0,0 +1,25 @@
+<nav title="充值记录"></nav>
+<ion-content class="content">
+  @for (item of list; track $index) {
+  <div class="log-item" (click)="toUrl(item.id)">
+    <div class="item-col">
+      <div class="title">{{ item?.get("targetObject")[0]?.get("name") }}</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("price") }}</div>
+        <div class="desc">
+          @switch (item?.get("status")) { @case ('100') { 已取消 }@case ('200')
+          {
+          <div class="tag"></div>
+          已完成 } @case ('500') { 已退款 } }
+        </div>
+      </div>
+      <ion-icon name="chevron-forward-outline"></ion-icon>
+    </div>
+  </div>
+  }
+</ion-content>

+ 38 - 0
projects/live-app/src/modules/account/order/order.component.scss

@@ -0,0 +1,38 @@
+.log-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 6px 10px;
+  border-bottom: 1px solid #f3f3f3;
+  font-size: 14px;
+  .item-col {
+    .title{
+      margin-bottom: 4px;
+    }
+  }
+  .item-col-right {
+    display: flex;
+    align-items: center;
+    .row {
+      margin-right: 6px;
+      display: flex;
+      flex-direction: column;
+      align-items: flex-end;
+    }
+  }
+  .desc,
+  ion-icon {
+    color: #8b8b8b;
+  }
+  .desc {
+    display: flex;
+    align-items: center;
+    .tag {
+      width: 6px;
+      height: 6px;
+      background-color: #42d96b;
+      border-radius: 50%;
+      margin-right: 6px;
+    }
+  }
+}

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

+ 37 - 0
projects/live-app/src/modules/account/order/order.component.ts

@@ -0,0 +1,37 @@
+import { Component, OnInit } from '@angular/core';
+import { NavComponent } from '../../../app/components/nav/nav.component';
+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-order',
+  templateUrl: './order.component.html',
+  styleUrls: ['./order.component.scss'],
+  standalone: true,
+  imports: [...ionicStandaloneModules, NavComponent,CommonModule],
+  providers: [DatePipe],
+})
+export class OrderComponent implements OnInit {
+  list: Array<any> = []
+  constructor(
+    private router: Router,
+  ) { }
+
+  ngOnInit() {
+    this.getOrder()
+  }
+  async getOrder(){
+    let query = new Parse.Query('Order');
+    query.notEqualTo('isDeleted', true);
+    query.equalTo('user',Parse.User.current()?.id);
+    query.limit(20)
+    query.skip(this.list.length)
+    query.select('price','status','targetObject.name')
+    query.descending('createdAt')
+    this.list = await query.find();
+  }
+  toUrl(id:string){
+    this.router.navigate(['account/order/detail/'+id]);
+  }
+}

+ 1 - 1
projects/live-app/src/modules/goods/vip/vip.component.html

@@ -19,7 +19,7 @@
         <div class="text-top" style="color:#fff">到期或未开通</div>
         }
       </div>
-      <div class="alink">开通记录</div>
+      <div class="alink" (click)="toUrl('account/order')">开通记录</div>
     </div>
     @for (item of goodsList; track $index) {
     <div

+ 7 - 3
projects/live-app/src/modules/goods/vip/vip.component.ts

@@ -9,6 +9,7 @@ import { AgreementComponent } from '../../login/agreement/agreement.component';
 import { PayCompComponent } from '../../../app/components/pay-comp/pay-comp.component';
 import { AccountService } from '../../../services/account.service';
 import { ionicStandaloneModules } from '../../ionic-standalone.modules';
+import { Router } from '@angular/router';
 
 @Component({
   selector: 'app-vip',
@@ -42,9 +43,9 @@ export class VipComponent implements OnInit {
     private modalController: ModalController,
     public toastController: ToastController,
     private authSer: AuthService,
-    private datePipe: DatePipe,
-    private accServ: AccountService
-  ) {}
+    private accServ: AccountService,
+    private router: Router,
+    ) {}
 
   ngOnInit() {
     this.refresh();
@@ -104,4 +105,7 @@ export class VipComponent implements OnInit {
     this.showPay = true;
     this.paycomp.isOpen = true;
   }
+  toUrl(url: string){
+    this.router.navigate([url]);
+  }
 }

+ 6 - 6
projects/live-app/src/modules/tabs/my/my.component.html

@@ -79,7 +79,7 @@
     }
   </div>
   <div class="order" [style.background-image]="'url(img/用户榜底.png)'">
-    <div class="ladder" [style.background-image]="'url(https://file-cloud.fmode.cn/Qje9D4bqol/20241223/h21am4060212112.png)'">
+    <div class="ladder">
       <div class="top-block">
         <div class="top2">
           <div class="user-block">
@@ -91,7 +91,7 @@
               {{ orderList[1]?.nickname }}
             </div>
           </div>
-          <div class="user-detail">
+          <div class="user-detail user-detail2">
             <div class="num">{{ orderList[1]?.credit }}</div>
             <div class="pm">TOP2</div>
           </div>
@@ -99,14 +99,14 @@
         <div class="top1">
           <div class="user-block">
             <div class="user-avatar">
-              <img src="img/2.png" alt="" class="tag" />
+              <img src="img/1.png" alt="" class="tag" style="transform: rotate(90deg);" />
               <img [src]="orderList[0]?.avatar" class="avatar" alt="" />
             </div>
             <div class="user-name">
               {{ orderList[0]?.nickname }}
             </div>
           </div>
-          <div class="user-detail">
+          <div class="user-detail user-detail1">
             <div class="num">{{ orderList[0]?.credit }}</div>
             <div class="pm">TOP2</div>
           </div>
@@ -114,14 +114,14 @@
         <div class="top3">
           <div class="user-block">
             <div class="user-avatar">
-              <img src="img/2.png" alt="" class="tag" />
+              <img src="img/3.png" alt="" class="tag" />
               <img [src]="orderList[2]?.avatar" class="avatar" alt="" />
             </div>
             <div class="user-name">
               {{ orderList[2]?.nickname }}
             </div>
           </div>
-          <div class="user-detail">
+          <div class="user-detail user-detail3">
             <div class="num">{{ orderList[2]?.credit }}</div>
             <div class="pm">TOP2</div>
           </div>

+ 23 - 3
projects/live-app/src/modules/tabs/my/my.component.scss

@@ -197,7 +197,8 @@
         .top1,
         .top2,
         .top3 {
-          width: 60px;
+          // width: 60px;
+          flex: 1;
           display: flex;
           align-items: center;
           justify-content: center;
@@ -237,11 +238,30 @@
           }
         }
         .top1 {
-          margin-bottom: 20px;
+          // margin-bottom: 20px;
           .num {
-            color: #ffffb9;
+            color: #fd4800;
           }
         }
+        .user-detail2{
+          background: #f9bc66;
+          width: 100%;
+          height: 40px;
+          border-radius: 4px 0 0 4px;
+        }
+        .user-detail1{
+          background: #ffc36f;
+          width: 100%;
+          height: 50px;
+          border-radius: 4px 4px 0 0 ;
+          box-shadow: rgba(17, 12, 46, 0.15) 0px -15px 100px 0px;
+        }
+        .user-detail3{
+          background: #fdd7a2;
+          width: 100%;
+          height: 30px;
+          border-radius: 0 4px 4px 0 ;
+        }
       }
     }
     .ladder::after {

+ 7 - 7
projects/live-app/src/modules/tabs/ranking/ranking.component.html

@@ -11,7 +11,7 @@
 </ion-header>
 <ion-content class="content"> 
   <div class="order" [style.background-image]="'url(img/用户榜底.png)'">
-    <div class="ladder" [style.background-image]="'url(https://file-cloud.fmode.cn/Qje9D4bqol/20241223/h21am4060212112.png)'">
+    <div class="ladder">
       <div class="top-block">
         <div class="top2">
           <div class="user-block">
@@ -23,7 +23,7 @@
               {{ orderList[1]?.nickname }}
             </div>
           </div>
-          <div class="user-detail">
+          <div class="user-detail user-detail2">
             <div class="num">{{ orderList[1]?.credit }}</div>
             <div class="pm">TOP2</div>
           </div>
@@ -31,14 +31,14 @@
         <div class="top1">
           <div class="user-block">
             <div class="user-avatar">
-              <img src="img/2.png" alt="" class="tag" />
+              <img src="img/1.png" alt="" class="tag" style="transform: rotate(90deg);" />
               <img [src]="orderList[0]?.avatar" class="avatar" alt="" />
             </div>
             <div class="user-name">
               {{ orderList[0]?.nickname }}
             </div>
           </div>
-          <div class="user-detail">
+          <div class="user-detail user-detail1">
             <div class="num">{{ orderList[0]?.credit }}</div>
             <div class="pm">TOP2</div>
           </div>
@@ -46,21 +46,21 @@
         <div class="top3">
           <div class="user-block">
             <div class="user-avatar">
-              <img src="img/2.png" alt="" class="tag" />
+              <img src="img/3.png" alt="" class="tag" />
               <img [src]="orderList[2]?.avatar" class="avatar" alt="" />
             </div>
             <div class="user-name">
               {{ orderList[2]?.nickname }}
             </div>
           </div>
-          <div class="user-detail">
+          <div class="user-detail user-detail3">
             <div class="num">{{ orderList[2]?.credit }}</div>
             <div class="pm">TOP2</div>
           </div>
         </div>
       </div>
     </div>
-    @for (item of orderList.slice(2,8); track $index) {
+    @for (item of orderList.slice(2,4); track $index) {
     <div class="row">
       <div class="row-left">
         <span class="row-index">4</span>

+ 23 - 3
projects/live-app/src/modules/tabs/ranking/ranking.component.scss

@@ -23,7 +23,8 @@
         .top1,
         .top2,
         .top3 {
-          width: 60px;
+          // width: 60px;
+          flex: 1;
           display: flex;
           align-items: center;
           justify-content: center;
@@ -63,11 +64,30 @@
           }
         }
         .top1 {
-          margin-bottom: 20px;
+          // margin-bottom: 20px;
           .num {
-            color: #ffffb9;
+            color: #fd4800;
           }
         }
+        .user-detail2{
+          background: #f9bc66;
+          width: 100%;
+          height: 40px;
+          border-radius: 4px 0 0 4px;
+        }
+        .user-detail1{
+          background: #ffc36f;
+          width: 100%;
+          height: 50px;
+          border-radius: 4px 4px 0 0 ;
+          box-shadow: rgba(17, 12, 46, 0.15) 0px -15px 100px 0px;
+        }
+        .user-detail3{
+          background: #fdd7a2;
+          width: 100%;
+          height: 30px;
+          border-radius: 0 4px 4px 0 ;
+        }
       }
     }
     .ladder::after {

+ 1 - 0
projects/live-app/src/modules/user/setting/setting.component.html

@@ -50,6 +50,7 @@
         (ionChange)="onChange($event,'sex')"
         interface="popover"
         placeholder="{{ formData.sex }}"
+        [disabled]="true"
       >
         <ion-select-option value="男">男</ion-select-option>
         <ion-select-option value="女">女</ion-select-option>

+ 1 - 1
projects/live-app/src/services/aichart.service.ts

@@ -30,7 +30,7 @@ export class AiChatService {
     WHERE (alog."targetAccount" = '${account.id}' OR alog."fromAccount" = '${account.id}')
     AND alog."isVerified" IS TRUE
     AND alog."isDeleted" IS NOT TRUE
-    ORDER BY alog."createdAt"`;
+    ORDER BY alog."createdAt" DESC`;
     let data: any = await this.http.customSQL(sql);
     return data?.data;
   }