zhengyiming
2 天以前 e0cb82c8dbf83fabc0cab548abc873926366fb75
apps/taro/src/subpackages/recharge/gasBillRecharge/InnerPage.vue
@@ -1,6 +1,21 @@
<template>
  <ContentScrollView :paddingH="false" style="background-color: #fff">
    <GasBillRecharge @goPay="goPay" :isDev="isDev" />
  <ContentScrollView hasPaddingTop style="background-color: transparent">
    <GasBillRecharge
      @goPay="goPay"
      :isDev="isDev"
      @paySuccess="handePaySuccess"
      :getOpenId="ensureOpenId"
      :isInWeChat="isInWeChat"
      :isInAlipay="isInAlipay"
      :isH5="isWeb"
      :appId="WXPayAppId"
      :isFocus="isFocus"
      :showAliPay="!isInWeChat"
      :showWeixinPay="isInWeChat"
      @missName="handleMissName"
      @editUserAccount="handleEditUserAccount"
      @currentChange="emit('currentChange', $event)"
    />
  </ContentScrollView>
</template>
@@ -8,16 +23,49 @@
import { GasBillRecharge } from '@life-payment/components';
import { BlLifeRecharge } from '@life-payment/core-vue';
import Taro from '@tarojs/taro';
import { isInAlipay, isInWeChat, isH5, isWeb } from '@/utils/env';
import { useUser, useFocus, useEnsureOpenId } from '@/hooks';
import { WXPayAppId } from '@/constants';
import { Message } from '@/utils';
defineOptions({
  name: 'InnerPage',
});
const emit = defineEmits<{
  (e: 'currentChange', current: 'step1' | 'step2' | 'step3'): void;
}>();
const isDev = process.env.NODE_ENV === 'development';
const { wxOpenId } = useUser();
const { ensureOpenId } = useEnsureOpenId();
const { isFocus } = useFocus();
function goPay(orderNo: string) {
  RouteHelper.navigateTo({
    url: `${RouterPath.selectPayType}?orderNo=${orderNo}&lifePayOrderType=${BlLifeRecharge.constants.LifePayOrderTypeEnum.燃气订单}`,
  });
}
function handePaySuccess(orderNo: string) {
  RouteHelper.navigateTo({
    url: `${RouterPath.rechargeResult}?orderNo=${orderNo}&lifePayOrderType=${BlLifeRecharge.constants.LifePayOrderTypeEnum.燃气订单}`,
  });
}
async function handleMissName(userAccountId: string) {
  try {
    await Message.confirm({ message: '请先完善手机号所属机主姓名' });
    RouteHelper.navigateTo({
      url: `${RouterPath.editGasUserAccount}?id=${userAccountId}`,
    });
  } catch (error) {}
}
function handleEditUserAccount(userAccountId: string) {
  RouteHelper.navigateTo({
    url: `${RouterPath.editGasUserAccount}?id=${userAccountId}`,
  });
}
</script>