From 9390aace95cf3404b370976848a1e9eb0123643e Mon Sep 17 00:00:00 2001 From: zhongzm Date: Fri, 10 Jan 2025 14:48:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=85=E5=80=BC=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/langs/en-us.ts | 17 ++ src/locales/langs/zh-cn.ts | 17 ++ src/service/api/auth.ts | 17 +- src/typings/api.d.ts | 138 ++++++++++----- src/typings/auto-imports.d.ts | 3 + src/views/billing/Rechargehistory/index.vue | 175 ++++++++++++-------- 6 files changed, 261 insertions(+), 106 deletions(-) diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index b84d32f..d7f5110 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -10,6 +10,7 @@ const viewEn: any = { "view.billing": "Billing", "view.billing_histories": "Historical", "view.billing_Rechargehistory":"Recharge history", + "view.billing_packagehistories":"Package history", "view.billing_Internetdetails":"Internet details", "view.billing_billservice":"Bill service", "view.set-meal": "Package", @@ -564,6 +565,22 @@ const local: any = { amount:"Amount", Payment:"Payment Method", recharge:"Recharge History", + type:"Type", + status:"Status", + rechargeType:"Recharge", + packageType:"Package", + paid:"Paid", + unpaid:"Unpaid", + }, + packagehistories: { + title: 'Package History', + orderdate: 'Order Date', + amount: 'Amount', + type: 'Type', + status: 'Status', + packageType: 'Package', + paid: 'Paid', + unpaid: 'Unpaid' }, cdrlrecords:{ devicename:"Device name", diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 54e3eb2..1da9bb5 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -11,6 +11,7 @@ const viewZh: any = { "view.billing_billservice":"账单服务", "view.billing_histories": "历史查询", "view.billing_Rechargehistory":"充值记录", + "view.billing_packagehistories":"套餐记录", "view.billing_Internetdetails":"上网详单", "view.set-meal": "套餐", "view.userInfo":"个人信息", @@ -564,6 +565,22 @@ const local:any = { amount:"充值金额", Payment:"充值方式", recharge:"充值记录", + type:"类型", + status:"状态", + rechargeType:"充值", + packageType:"套餐", + paid:"已支付", + unpaid:"未支付", + }, + packagehistories: { + title: '套餐历史', + orderdate: '订单时间', + amount: '金额', + type: '类型', + status: '状态', + packageType: '套餐', + paid: '已支付', + unpaid: '未支付' }, cdrlrecords:{ devicename:"设备名称", diff --git a/src/service/api/auth.ts b/src/service/api/auth.ts index d936af7..28bf84c 100644 --- a/src/service/api/auth.ts +++ b/src/service/api/auth.ts @@ -144,5 +144,20 @@ export function fetchBillHistory(params: Api.Bill.BillQueryParams) { params }); } - +/** Get recharge history records */ +export function fetchRechargeHistory(params: Api.Recharge.RechargeQueryParams) { + return request({ + url: '/u/order/rechargePage', + method: 'get', + params + }); +} +/** Get package history records */ +export function fetchPackageHistory(params: Api.Package.PackageHistoryQueryParams) { + return request({ + url: '/u/order/packagePage', + method: 'get', + params + }); +} diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 0361d94..d093476 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -77,6 +77,7 @@ declare namespace Api { access_token: string; refreshToken: string; } + /** User info */ interface UserInfo { user: User | null; @@ -104,7 +105,7 @@ declare namespace Api { delFlag: string; loginIp: string; loginDate: string; - birthDate:string; + birthDate: string; dept: Department.Dept; roles: Role[]; roleId: string; @@ -139,10 +140,11 @@ declare namespace Api { authType: string; wanfiRedirectParams: any; } - interface RegisterBody{ + + interface RegisterBody { username: string; password: string; - authType:string; + authType: string; email: string; fullName?: string; age: number; @@ -150,24 +152,27 @@ declare namespace Api { sex?: string; phonenumber?: string; } - interface EmailCaptcha{ - email:string; + + interface EmailCaptcha { + email: string; } - interface CheckBody{ + + interface CheckBody { username?: string; email?: string; - phonenumber?:string; + phonenumber?: string; authType: string; } - interface ChangeInfoBody{ - userId:number; + + interface ChangeInfoBody { + userId: number; userName: string; - nickName?: string|undefined; + nickName?: string | undefined; email: string; - phonenumber?: string|undefined; - sex?: string|undefined; - birthDate?:string|undefined; - age?:number; + phonenumber?: string | undefined; + sex?: string | undefined; + birthDate?: string | undefined; + age?: number; } } @@ -259,7 +264,7 @@ declare namespace Api { /** user search params */ type UserSearchParams = Partial< Pick & - CommonSearchParams + CommonSearchParams >; /** user list */ @@ -520,6 +525,7 @@ declare namespace Api { total: number; rows: DeviceInfo[]; } + interface HistoricalDeviceInfo { id: number; clientName: string; @@ -552,6 +558,7 @@ declare namespace Api { /** Last seen time */ last_seen_time: string; } + interface CDRRecord { /** Record ID */ id: number; @@ -599,40 +606,42 @@ declare namespace Api { data: PackageItem[]; total?: number; } + interface OrderSubmitParams { packageId: string; type: 0; // 限定为字面量类型 0 } - } - namespace Order { - /** Order type enum */ - type OrderType = 0 | 1 | 2; // 根据实际需要添加其他类型 - - /** Base order params */ - interface BaseOrderParams { - type: OrderType; - } - - /** Package order params */ - interface PackageOrderParams extends BaseOrderParams { - type: 0; + /** Package history record information */ + interface PackageHistoryRecord { + id: string; + delFlag: boolean; + createBy: number; + createTime: string; + updateBy: number; + updateTime: string; + userId: number; packageId: string; + paymentId: string | null; + orderNo: string | null; + type: number; // 0 表示套餐 + orderAmount: string; + status: number; // 0未支付,1已支付 } - /** Recharge order params */ - interface RechargeOrderParams extends BaseOrderParams { - type: 1; - orderAmount: number; + /** Package history list response */ + interface PackageHistoryListResponse { + rows: PackageHistoryRecord[]; + total: number; } - /** Combined order params type */ - type SubmitOrderParams = PackageOrderParams | RechargeOrderParams; + /** Package history query parameters */ + interface PackageHistoryQueryParams { + pageNum: number; + pageSize: number; + } } - - - /** * Namespace Bill * @@ -662,4 +671,59 @@ declare namespace Api { pageSize: number; } } + namespace Recharge { + /** Recharge record information */ + interface RechargeRecord { + id: string; + delFlag: boolean; + createBy: number; + createTime: string; + updateBy: number; + updateTime: string; + userId: number; + packageId: string | null; + paymentId: string | null; + orderNo: string | null; + type: number; + orderAmount: string; + status: number; + } + + /** Recharge list response */ + interface RechargeListResponse { + rows: RechargeRecord[]; + total: number; + } + + /** Recharge query parameters */ + interface RechargeQueryParams { + pageNum: number; + pageSize: number; + } + } + + namespace Order { + /** Order type enum */ + type OrderType = 0 | 1 | 2; // 根据实际需要添加其他类型 + + /** Base order params */ + interface BaseOrderParams { + type: OrderType; + } + + /** Package order params */ + interface PackageOrderParams extends BaseOrderParams { + type: 0; + packageId: string; + } + + /** Recharge order params */ + interface RechargeOrderParams extends BaseOrderParams { + type: 1; + orderAmount: number; + } + + /** Combined order params type */ + type SubmitOrderParams = PackageOrderParams | RechargeOrderParams; + } } diff --git a/src/typings/auto-imports.d.ts b/src/typings/auto-imports.d.ts index cb75ddd..e9ad4da 100644 --- a/src/typings/auto-imports.d.ts +++ b/src/typings/auto-imports.d.ts @@ -92,6 +92,7 @@ declare global { const expect: typeof import('vitest')['expect'] const extendRef: typeof import('@vueuse/core')['extendRef'] const extractTabsByAllRoutes: typeof import('../store/modules/tab/shared')['extractTabsByAllRoutes'] + const fetchBillHistory: typeof import('../service/api/auth')['fetchBillHistory'] const fetchCDRHistory: typeof import('../service/api/auth')['fetchCDRHistory'] const fetchCurrentDevices: typeof import('../service/api/auth')['fetchCurrentDevices'] const fetchCustomBackendError: typeof import('../service/api/auth')['fetchCustomBackendError'] @@ -102,7 +103,9 @@ declare global { const fetchHistoricalDevices: typeof import('../service/api/auth')['fetchHistoricalDevices'] const fetchIsRouteExist: typeof import('../service/api/route')['fetchIsRouteExist'] const fetchLogin: typeof import('../service/api/auth')['fetchLogin'] + const fetchPackageHistory: typeof import('../service/api/auth')['fetchPackageHistory'] const fetchPackageList: typeof import('../service/api/auth')['fetchPackageList'] + const fetchRechargeHistory: typeof import('../service/api/auth')['fetchRechargeHistory'] const fetchRefreshToken: typeof import('../service/api/auth')['fetchRefreshToken'] const fetchRegister: typeof import('../service/api/auth')['fetchRegister'] const filterAuthRoutesByRoles: typeof import('../store/modules/route/shared')['filterAuthRoutesByRoles'] diff --git a/src/views/billing/Rechargehistory/index.vue b/src/views/billing/Rechargehistory/index.vue index 8fa1957..e0e5a0d 100644 --- a/src/views/billing/Rechargehistory/index.vue +++ b/src/views/billing/Rechargehistory/index.vue @@ -1,100 +1,136 @@ - @@ -111,4 +147,7 @@ const columns: TableColumnsType = [ .font-bold { font-weight: bold; } +.pl-4 { + padding-left: 1rem; +}