zhengyiming
2025-03-24 21b418f4ffb8e76d72819e8d489b3179154cb0c1
fix: 三期需求
5个文件已修改
108 ■■■■ 已修改文件
apps/taro/src/hooks/user.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/hooks/index.ts 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeServices.ts 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/LifePay.ts 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/typings.d.ts 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/hooks/user.ts
@@ -95,7 +95,7 @@
      }
      if (!!code && !wxCode.value) {
        userStore.setWxCode(router.params.code ?? '');
        getLifePayWxIndentity(code);
        // getLifePayWxIndentity(code);
      }
    } catch (error) {}
  });
@@ -113,7 +113,9 @@
      let res = await blLifeRecharge.services.getLifePayWxIndentity(params, {
        showLoading: false,
      });
      userStore.setWxOpenId(res.openId);
      if (res.openId) {
        userStore.setWxOpenId(res.openId);
      }
      return res;
    } catch (error) {}
  }
@@ -126,11 +128,11 @@
  const { getLifePayWxIndentity } = useLifePayWxIndentity();
  async function ensureOpenId() {
    if (wxOpenId) {
    if (wxOpenId.value) {
      return wxOpenId.value;
    } else {
      let rea = await getLifePayWxIndentity(wxCode.value);
      return rea.openId;
      return rea.openId ? rea.openId : wxOpenId.value;
    }
  }
packages/components/src/hooks/index.ts
@@ -11,7 +11,7 @@
  UserAccountListOutput,
  AddUpdateUserAccountInput,
  GasParValueResponse,
  GasParValueOutput,
  ChannelRateOutput,
} from '@life-payment/core-vue';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import { computed, MaybeRef, reactive, unref } from 'vue';
@@ -30,26 +30,54 @@
    placeholderData: () => [] as LifePayRateListOutput[],
  });
  const lifePayPhoneRate = computed(
    () =>
  const hasChannel = computed(() => !!blLifeRecharge.accountModel.channlesNum);
  const { data: channelRate } = useQuery({
    queryKey: ['blLifeRecharge/getChannelRate', blLifeRecharge.accountModel.channlesNum],
    queryFn: async () => {
      return await blLifeRecharge.services.getChannelRate(
        {
          checkChannelId: blLifeRecharge.accountModel.channlesNum,
        },
        { showLoading: false }
      );
    },
    placeholderData: () => ({} as ChannelRateOutput),
    enabled: hasChannel,
  });
  const lifePayPhoneRate = computed(() => {
    if (hasChannel.value && channelRate.value.channlesRate) {
      return channelRate.value.channlesRate;
    }
    return (
      lifePayRateList.value.find(
        (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.默认话费折扣
      )?.rate ?? 100
  );
    );
  });
  const lifePayElectricRate = computed(
    () =>
  const lifePayElectricRate = computed(() => {
    if (hasChannel.value && channelRate.value.channlesRate) {
      return channelRate.value.channlesRate;
    }
    return (
      lifePayRateList.value.find(
        (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.默认电费折扣
      )?.rate ?? 100
  );
    );
  });
  const lifePayGasRate = computed(
    () =>
  const lifePayGasRate = computed(() => {
    if (hasChannel.value && channelRate.value.channlesRate) {
      return channelRate.value.channlesRate;
    }
    return (
      lifePayRateList.value.find(
        (x) => x.rateType === blLifeRecharge.constants.LifePayRateTypeEnum.默认燃气折扣
      )?.rate ?? 100
  );
    );
  });
  return {
    lifePayRateList,
packages/core/src/lifeRechargeServices.ts
@@ -326,6 +326,18 @@
      ...(options || {}),
    });
  }
  /** 获取渠道折扣 GET /api/LifePay/GetChannelRate */
  async getChannelRate(body: ChannelsBaseInput, options?: RequestConfig) {
    return this.request<ChannelRateOutput>('/api/LifePay/GetChannelRate', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
}
export interface PhoneMesssageCodeLoginInput {
@@ -757,3 +769,7 @@
}
export type IntroInfoTypeEnum = 0 | 1 | 2 | 3 | 4;
export interface ChannelRateOutput {
  channlesRate?: number;
}
packages/services/api/LifePay.ts
@@ -176,6 +176,18 @@
  });
}
/** 获取渠道折扣 POST /api/LifePay/GetChannelRate */
export async function getChannelRate(body: API.ChannelsBaseInput, options?: API.RequestConfig) {
  return request<API.ChannelRateOutput>('/api/LifePay/GetChannelRate', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取电费面值 POST /api/LifePay/GetElectricParValue */
export async function getElectricParValue(
  body: API.ChannelsBaseInput,
@@ -325,6 +337,21 @@
  });
}
/** 导出退款订单Excel POST /api/LifePay/GetLifePayRefudOrderPageExport */
export async function getLifePayRefudOrderPageExport(
  body: API.QueryLifePayRefundOrderListInput,
  options?: API.RequestConfig
) {
  return request<any>('/api/LifePay/GetLifePayRefudOrderPageExport', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取退款订单详情 GET /api/LifePay/GetLifePayRefundOrderDetail */
export async function getLifePayRefundOrderDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
packages/services/api/typings.d.ts
@@ -426,6 +426,10 @@
    type?: number;
  }
  interface ChannelRateOutput {
    channlesRate?: number;
  }
  interface ChannelsBaseInput {
    pageModel?: Pagination;
    checkChannelId?: string;
@@ -458,6 +462,7 @@
    name?: string;
    /** 手机号 */
    phoneNumber?: string;
    /** 密码 */
    password?: string;
    /** 账户 */
    userName?: string;
@@ -1629,6 +1634,7 @@
    payStatus?: LifePayStatusEnum;
    acoolyStatus?: ACOOLYStatusEnum;
    lifePayOrderStatus?: LifePayOrderStatusEnum;
    lifePayRefundStatus?: LifePayRefundStatusEnum;
    /** 用户Id */
    userId?: string;
    /** 搜索关键词 */
@@ -1891,6 +1897,7 @@
    name?: string;
    /** 手机号 */
    phoneNumber?: string;
    /** 密码 */
    password?: string;
    /** 账户 */
    userName?: string;