wupengfei
2025-02-25 e53e33dd46fdf138c851b10f12cdc00131a8d644
fix: bug
7个文件已修改
192 ■■■■■ 已修改文件
packages/components/src/hooks/index.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/electricBillRecharge/electricBillRecharge.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeServices.ts 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/Account.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/LifePay.ts 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/Test.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/typings.d.ts 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 {
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,
      },
    };
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;
}
packages/services/api/Account.ts
@@ -161,6 +161,21 @@
  });
}
/** 获取生活缴费用户身份会话信息 GET /api/Account/GetLifePayWxIndentity */
export async function getLifePayWxIndentity(
  // 叠加生成的Param类型 (非body参数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', {
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 @@
  });
}
/** 获取微信支付的JSAPI 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(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
packages/services/api/Test.ts
@@ -137,6 +137,21 @@
  });
}
/** 此处后端没有提供注释 GET /api/Test/TestH5Pay */
export async function testH5Pay(
  // 叠加生成的Param类型 (非body参数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(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
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 {