From 10153e2c6b3a1fbeabf9f3b951102754be3dccbc Mon Sep 17 00:00:00 2001 From: zhongzm Date: Thu, 9 Jan 2025 16:19:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=8E=86=E5=8F=B2=E8=B4=A6=E5=8D=95?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=8E=A5=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/auth.ts | 9 ++ src/typings/api.d.ts | 33 +++++ src/views/billing/histories/index.vue | 205 ++++++++++---------------- 3 files changed, 117 insertions(+), 130 deletions(-) diff --git a/src/service/api/auth.ts b/src/service/api/auth.ts index 221ab1d..d936af7 100644 --- a/src/service/api/auth.ts +++ b/src/service/api/auth.ts @@ -136,4 +136,13 @@ export function submitOrder(data: Api.Order.SubmitOrderParams) { data }); } +/** Get bill history records */ +export function fetchBillHistory(params: Api.Bill.BillQueryParams) { + return request({ + url: '/u/bill/page', + method: 'get', + params + }); +} + diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index a956d3e..0361d94 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -629,4 +629,37 @@ declare namespace Api { /** Combined order params type */ type SubmitOrderParams = PackageOrderParams | RechargeOrderParams; } + + + + + /** + * Namespace Bill + * + * Backend api module: "bill" + */ + namespace Bill { + /** Bill record information */ + interface BillRecord { + id: string; + startTime: string | null; + endTime: string | null; + traffic: string | null; + amount: string; + status: number; + createTime: string; + } + + /** Bill list response */ + interface BillListResponse { + rows: BillRecord[]; + total: number; + } + + /** Bill query parameters */ + interface BillQueryParams { + pageNum: number; + pageSize: number; + } + } } diff --git a/src/views/billing/histories/index.vue b/src/views/billing/histories/index.vue index 06f1ed3..d3c7d58 100644 --- a/src/views/billing/histories/index.vue +++ b/src/views/billing/histories/index.vue @@ -1,160 +1,93 @@