wupengfei
2 天以前 ddddcf83e7deb9d0a674d2bbead300089530d87e
packages/components/src/hooks/selectPayType.ts
@@ -9,14 +9,14 @@
import Taro from '@tarojs/taro';
type UseSelectPayTypeOptions = {
  openId?: MaybeRef<string>;
  isInWeChat?: MaybeRef<boolean>;
  isH5?: MaybeRef<boolean>;
  appId?: MaybeRef<string>;
  getOpenId?: MaybeRef<() => Promise<string>>;
};
export function useSelectPayType(options: UseSelectPayTypeOptions = {}) {
  const { openId, isInWeChat, isH5, appId } = options;
  const { isInWeChat, isH5, appId, getOpenId } = options;
  const { blLifeRecharge } = useLifeRechargeContext();
@@ -98,10 +98,12 @@
  async function getPayOrderForJsAPI(orderNo: string) {
    try {
      const _getOpenId = unref(getOpenId);
      const openId = await _getOpenId();
      let params: GetPayOrderForJsAPIInput = {
        orderNo: orderNo,
        lifePayType: blLifeRecharge.constants.LifePayTypeEnum.WxPay,
        openId: unref(openId),
        openId: openId,
        attach: Date.now().toString(),
        payAppId: unref(appId),
      };
@@ -167,7 +169,7 @@
  const { blLifeRecharge } = useLifeRechargeContext();
  useQuery({
    queryKey: ['platformServicePayServices/getPayStatusByOrderNo', orderNo],
    queryKey: ['blLifeRecharge/getPayStatusByOrderNo', orderNo],
    queryFn: async () => {
      return await blLifeRecharge.services.getPayStatusByOrderNo(
        {