zhengyiming
2025-03-24 c7ab8c4fca1c690f3e5536dff520eaa9c4010fd1
fix: 三期bug
6个文件已修改
35 ■■■■ 已修改文件
apps/taro/src/hooks/user.ts 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/hooks/selectPayType.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/SelectPayTypeView/SelectPayTypeView.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/taro/src/hooks/user.ts
@@ -6,7 +6,11 @@
import { useRefeshDidShow } from './infiniteLoading';
import { LoginFormTabs } from '@/subpackages/login/constants';
import { useLoginedJump } from './login';
import { useLifeRechargeContext, APIgetLifePayWxIndentityParams } from '@life-payment/core-vue';
import {
  useLifeRechargeContext,
  APIgetLifePayWxIndentityParams,
  WxMiniAppIndentityInfo,
} from '@life-payment/core-vue';
import { isInWeChat } from '@/utils/env';
export function useUser() {
@@ -101,6 +105,8 @@
  });
}
let wxIndentityPromise: Promise<WxMiniAppIndentityInfo>;
export function useLifePayWxIndentity() {
  const { blLifeRecharge } = useLifeRechargeContext();
  const userStore = useUserStore();
@@ -110,9 +116,17 @@
      let params: APIgetLifePayWxIndentityParams = {
        code: code,
      };
      let res = await blLifeRecharge.services.getLifePayWxIndentity(params, {
        showLoading: false,
      });
      if (!wxIndentityPromise) {
        wxIndentityPromise = blLifeRecharge.services
          .getLifePayWxIndentity(params, {
            showLoading: false,
          })
          .finally(() => {
            wxIndentityPromise = undefined;
          });
      }
      let res = await wxIndentityPromise;
      if (res.openId) {
        userStore.setWxOpenId(res.openId);
      }
packages/components/src/hooks/selectPayType.ts
@@ -12,7 +12,7 @@
  isInWeChat?: MaybeRef<boolean>;
  isH5?: MaybeRef<boolean>;
  appId?: MaybeRef<string>;
  getOpenId?: () => Promise<string>;
  getOpenId?: MaybeRef<() => Promise<string>>;
};
export function useSelectPayType(options: UseSelectPayTypeOptions = {}) {
@@ -98,7 +98,8 @@
  async function getPayOrderForJsAPI(orderNo: string) {
    try {
      const openId = await getOpenId();
      const _getOpenId = unref(getOpenId);
      const openId = await _getOpenId();
      let params: GetPayOrderForJsAPIInput = {
        orderNo: orderNo,
        lifePayType: blLifeRecharge.constants.LifePayTypeEnum.WxPay,
packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue
@@ -220,7 +220,7 @@
}
const { state, invokeAliPay, invokeWeixinPay } = useSelectPayType({
  getOpenId: props.getOpenId,
  getOpenId: toRef(props, 'getOpenId'),
  isInWeChat: toRef(props, 'isInWeChat'),
  isH5: toRef(props, 'isH5'),
  appId: toRef(props, 'appId'),
packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue
@@ -216,7 +216,7 @@
}
const { state, invokeAliPay, invokeWeixinPay } = useSelectPayType({
  getOpenId: props.getOpenId,
  getOpenId: toRef(props, 'getOpenId'),
  isInWeChat: toRef(props, 'isInWeChat'),
  isH5: toRef(props, 'isH5'),
  appId: toRef(props, 'appId'),
packages/components/src/views/SelectPayTypeView/SelectPayTypeView.vue
@@ -51,7 +51,7 @@
}>();
const { state, invokeAliPay, invokeWeixinPay } = useSelectPayType({
  getOpenId: props.getOpenId,
  getOpenId: toRef(props, 'getOpenId'),
  isInWeChat: toRef(props, 'isInWeChat'),
  isH5: toRef(props, 'isH5'),
  appId: toRef(props, 'appId'),
packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue
@@ -231,7 +231,7 @@
  isInWeChat: toRef(props, 'isInWeChat'),
  isH5: toRef(props, 'isH5'),
  appId: toRef(props, 'appId'),
  getOpenId: props.getOpenId,
  getOpenId: toRef(props, 'getOpenId'),
});
const currentOrderNo = ref('');