From e53e33dd46fdf138c851b10f12cdc00131a8d644 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期二, 25 二月 2025 17:12:44 +0800
Subject: [PATCH] fix: bug

---
 packages/components/src/views/electricBillRecharge/electricBillRecharge.vue |   31 +++++--
 packages/services/api/Test.ts                                               |   15 +++
 packages/services/api/typings.d.ts                                          |   60 +++++++++++++++
 packages/core/src/lifeRechargeServices.ts                                   |   39 +++++++++
 packages/components/src/hooks/index.ts                                      |    9 +-
 packages/services/api/LifePay.ts                                            |   23 +++++
 packages/services/api/Account.ts                                            |   15 +++
 7 files changed, 180 insertions(+), 12 deletions(-)

diff --git a/packages/components/src/hooks/index.ts b/packages/components/src/hooks/index.ts
index 5071f6a..1f8861f 100644
--- a/packages/components/src/hooks/index.ts
+++ b/packages/components/src/hooks/index.ts
@@ -6,6 +6,7 @@
   QueryLifePayOrderListInput,
   LifeRechargeConstants,
   ElectricParValueResponse,
+  ElectricSupportAreaResponse,
 } from '@life-payment/core-vue';
 import { useQuery } from '@tanstack/vue-query';
 import { computed, MaybeRef, reactive, unref } from 'vue';
@@ -67,14 +68,14 @@
   const { blLifeRecharge } = useLifeRechargeContext();
 
   const { data: electricParValueList, isLoading } = useQuery({
-    queryKey: ['blLifeRecharge/getElectricParValue'],
+    queryKey: ['blLifeRecharge/getElectricSupportArea'],
     queryFn: async () => {
-      return await blLifeRecharge.services.getElectricParValue({ showLoading: false });
+      return await blLifeRecharge.services.getElectricSupportArea({ showLoading: false });
     },
     select(data) {
-      return data.electricParValue ?? [];
+      return data.electricAreaList ?? [];
     },
-    placeholderData: () => ({} as ElectricParValueResponse),
+    placeholderData: () => ({} as ElectricSupportAreaResponse),
   });
 
   return {
diff --git a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
index bc8a618..20b5478 100644
--- a/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
+++ b/packages/components/src/views/electricBillRecharge/electricBillRecharge.vue
@@ -6,13 +6,22 @@
     label-position="top"
     class="order-bill-recharge electric"
   >
-    <FormItem label="鎵�鍦ㄥ煄甯�" class="bole-form-item" prop="province" required>
+    <FormItem label="鎵�鍦ㄥ尯鍩�" class="bole-form-item" prop="province" required>
       <ChooseInputWithPicker
         v-model="form.province"
-        placeholder="璇烽�夋嫨鍩庡競"
+        placeholder="璇烽�夋嫨鍖哄煙"
         :value-enum="electricParValueList"
-        enum-label-key="areaName"
-        enum-value-key="areaName"
+        enum-label-key="cityName"
+        enum-value-key="cityName"
+      />
+    </FormItem>
+    <FormItem label="鎵�鍦ㄥ煄甯�" class="bole-form-item" prop="city" required v-if="form.province">
+      <ChooseInputWithPicker
+        v-model="form.city"
+        placeholder="璇烽�夋嫨鍩庡競"
+        :value-enum="electricCityList"
+        enum-label-key="cityName"
+        enum-value-key="cityName"
       />
     </FormItem>
     <!-- <FormItem label="鐢电綉绫诲瀷" class="bole-form-item" prop="electricType" required>
@@ -159,6 +168,7 @@
   electricType: '',
   electricAccountType: '',
   province: '',
+  city: '',
   sixID: '',
 });
 
@@ -166,14 +176,18 @@
 const { electricParValueList } = useGetElectricParValue();
 
 const parValueList = computed(
-  () => electricParValueList.value.find((x) => x.areaName === form.province)?.parValue ?? []
+  () => electricParValueList.value.find((x) => x.cityName === form.province)?.parValue ?? []
+);
+
+const electricCityList = computed(
+  () => electricParValueList.value.find((x) => x.cityName === form.province)?.childCityList ?? []
 );
 
 watch(
   () => form.province,
   (provinceName) => {
     const electricParValue = electricParValueList.value.find(
-      (item) => item.areaName === provinceName
+      (item) => item.cityName === provinceName
     );
     form.electricType = electricParValue.electricType;
   }
@@ -187,7 +201,8 @@
 const { blLifeRecharge } = useLifeRechargeContext();
 
 const rules = reactive<FormRules>({
-  province: [{ required: true, message: '璇烽�夋嫨鎵�鍦ㄥ煄甯�' }],
+  province: [{ required: true, message: '璇烽�夋嫨鎵�鍦ㄥ尯鍩�' }],
+  city: [{ required: true, message: '璇烽�夋嫨鎵�鍦ㄥ煄甯�' }],
   electricAccountType: [{ required: true, message: '璇烽�夋嫨鐢佃垂绫诲瀷' }],
   electricAccount: [{ required: true, message: '璇疯緭鍏ョ數缃戞埛鍙�', regex: /^\d{13}$/ }],
   sixID: [
@@ -237,7 +252,7 @@
         electricAccountType: form.electricAccountType,
         electricAccount: form.electricAccount,
         province: form.province,
-        city: '',
+        city: form.city,
         sixID: form.sixID,
       },
     };
diff --git a/packages/core/src/lifeRechargeServices.ts b/packages/core/src/lifeRechargeServices.ts
index cba3e8f..3a52b29 100644
--- a/packages/core/src/lifeRechargeServices.ts
+++ b/packages/core/src/lifeRechargeServices.ts
@@ -53,6 +53,14 @@
     });
   }
 
+  /** 鑾峰彇鐢佃垂鍏呭�煎尯鍩� GET /api/LifePay/GetElectricSupportArea */
+  async getElectricSupportArea(options?: RequestConfig) {
+    return this.request<ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', {
+      method: 'GET',
+      ...(options || {}),
+    });
+  }
+
   /** 鑾峰彇鐢佃垂闈㈠�� GET /api/LifePay/GetElectricParValue */
   async getElectricParValue(options?: RequestConfig) {
     return this.request<ElectricParValueResponse>('/api/LifePay/GetElectricParValue', {
@@ -308,3 +316,34 @@
   /** 閫�娆炬椂闂� */
   refundTime?: string;
 }
+
+export interface ElectricSupportAreaResponse {
+  success?: boolean;
+  requestNo?: string;
+  partnerId?: string;
+  service?: string;
+  version?: string;
+  protocol?: string;
+  context?: string;
+  ext?: any;
+  code?: string;
+  message?: string;
+  detail?: string;
+  electricAreaList?: ElectricSupportAreaListOutput[];
+}
+
+export interface ElectricSupportAreaListOutput {
+  childCityList?: ElectricSupportAreaChildCityListOutput[];
+  cityName?: string;
+  cityParentId?: string;
+  ciytId?: string;
+  electricType?: string;
+  parValue?: string[];
+  rate?: number;
+}
+
+export interface ElectricSupportAreaChildCityListOutput {
+  cityName?: string;
+  cityParentId?: string;
+  ciytId?: string;
+}
diff --git a/packages/services/api/Account.ts b/packages/services/api/Account.ts
index d6cc617..cafe3a1 100644
--- a/packages/services/api/Account.ts
+++ b/packages/services/api/Account.ts
@@ -161,6 +161,21 @@
   });
 }
 
+/** 鑾峰彇鐢熸椿缂磋垂鐢ㄦ埛韬唤浼氳瘽淇℃伅 GET /api/Account/GetLifePayWxIndentity */
+export async function getLifePayWxIndentity(
+  // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+  params: API.APIgetLifePayWxIndentityParams,
+  options?: API.RequestConfig
+) {
+  return request<API.WxMiniAppIndentityInfo>('/api/Account/GetLifePayWxIndentity', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
 /** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/Account/GetOssSTS */
 export async function getOssSTS(options?: API.RequestConfig) {
   return request<API.OssSTSReponse>('/api/Account/GetOssSTS', {
diff --git a/packages/services/api/LifePay.ts b/packages/services/api/LifePay.ts
index 7abf054..1a41c6e 100644
--- a/packages/services/api/LifePay.ts
+++ b/packages/services/api/LifePay.ts
@@ -40,6 +40,14 @@
   });
 }
 
+/** 鑾峰彇鐢佃垂鍏呭�煎尯鍩� GET /api/LifePay/GetElectricSupportArea */
+export async function getElectricSupportArea(options?: API.RequestConfig) {
+  return request<API.ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
 /** 鑾峰彇璁㈠崟鍒嗛〉鏁版嵁 POST /api/LifePay/GetLifePayOrderPage */
 export async function getLifePayOrderPage(
   body: API.QueryLifePayOrderListInput,
@@ -55,6 +63,21 @@
   });
 }
 
+/** 鑾峰彇寰俊鏀粯鐨凧SAPI POST /api/LifePay/GetPayOrderForJsAPI */
+export async function getPayOrderForJsAPI(
+  body: API.GetPayOrderForJsAPIInput,
+  options?: API.RequestConfig
+) {
+  return request<API.ModelPayPrePayId>('/api/LifePay/GetPayOrderForJsAPI', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
 /** 鏍规嵁璁㈠崟鍙疯幏鍙栨敮浠樼姸鎬� GET /api/LifePay/GetPayStatusByOrderNo */
 export async function getPayStatusByOrderNo(
   // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
diff --git a/packages/services/api/Test.ts b/packages/services/api/Test.ts
index 2fd5623..5e6ed93 100644
--- a/packages/services/api/Test.ts
+++ b/packages/services/api/Test.ts
@@ -137,6 +137,21 @@
   });
 }
 
+/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 GET /api/Test/TestH5Pay */
+export async function testH5Pay(
+  // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+  params: API.APItestH5PayParams,
+  options?: API.RequestConfig
+) {
+  return request<string>('/api/Test/TestH5Pay', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
 /** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 GET /api/Test/TestQRCodePay */
 export async function testQRCodePay(
   // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
diff --git a/packages/services/api/typings.d.ts b/packages/services/api/typings.d.ts
index bc3cbf5..e59b986 100644
--- a/packages/services/api/typings.d.ts
+++ b/packages/services/api/typings.d.ts
@@ -1466,6 +1466,11 @@
     id?: string;
   }
 
+  interface APIgetLifePayWxIndentityParams {
+    /** 鐢ㄦ埛鐧诲綍鍑瘉 */
+    code?: string;
+  }
+
   interface APIgetListParams {
     filter?: string;
     clientId?: string;
@@ -1899,6 +1904,14 @@
 
   interface APItestGetPlatformServicePayParams {
     id?: string;
+  }
+
+  interface APItestH5PayParams {
+    payType?: LifePayTypeEnum;
+    outTradeNo?: string;
+    description?: string;
+    amount?: number;
+    h5Type?: string;
   }
 
   interface APItestPayNotifyParams {
@@ -5488,6 +5501,37 @@
     electricParValue?: ElectricParValueOutput[];
   }
 
+  interface ElectricSupportAreaChildCityListOutput {
+    cityName?: string;
+    cityParentId?: string;
+    ciytId?: string;
+  }
+
+  interface ElectricSupportAreaListOutput {
+    childCityList?: ElectricSupportAreaChildCityListOutput[];
+    cityName?: string;
+    cityParentId?: string;
+    ciytId?: string;
+    electricType?: string;
+    parValue?: string[];
+    rate?: number;
+  }
+
+  interface ElectricSupportAreaResponse {
+    success?: boolean;
+    requestNo?: string;
+    partnerId?: string;
+    service?: string;
+    version?: string;
+    protocol?: string;
+    context?: string;
+    ext?: any;
+    code?: string;
+    message?: string;
+    detail?: string;
+    electricAreaList?: ElectricSupportAreaListOutput[];
+  }
+
   interface EnableSearchSettingInput {
     id: string;
     status: boolean;
@@ -7743,6 +7787,13 @@
     status?: ParkRewardStatusEnum;
     /** 濂栧姳鍚嶇О */
     rewardName?: string;
+  }
+
+  interface GetPayOrderForJsAPIInput {
+    orderNo: string;
+    lifePayType?: LifePayTypeEnum;
+    openId?: string;
+    attach?: string;
   }
 
   interface GetPermissionListResultDto {
@@ -12649,6 +12700,12 @@
     defaultValue?: any;
   }
 
+  interface ModelPayPrePayId {
+    prepayId?: string;
+    code?: string;
+    message?: string;
+  }
+
   interface ModuleApiDescriptionModel {
     rootPath?: string;
     remoteServiceName?: string;
@@ -17415,6 +17472,9 @@
   interface SetLifePayOrderPayTypeInput {
     orderNo: string;
     lifePayType?: LifePayTypeEnum;
+    h5Type?: string;
+    openId?: string;
+    attach?: string;
   }
 
   interface SetManyContractTemplateHandSignKeyInput {

--
Gitblit v1.9.1