zhengyiming
2025-03-12 8525b5c780d8855eca89c46790627c00b3d83c79
packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue
@@ -21,7 +21,7 @@
      <AccountCard
        v-if="userAccountAllList.length > 0"
        title="充值户号"
        :content="`${form.city} ${form.gasAccount}`"
        :content="`${form.areaList?.[1] ?? ''} ${form.gasAccount}`"
        :remark="form.remark"
      >
        <template #action>
@@ -31,19 +31,13 @@
      <AccountAddCard text="新增户号" v-else @click="handleAddUserAccount" />
    </NutFormItem>
    <NutFormItem
      v-if="!!form.province"
      label="选择充值金额"
      class="bole-form-item"
      prop="parValue"
      required
    >
    <NutFormItem label="选择充值金额" class="bole-form-item" prop="parValue" required>
      <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group">
        <!-- <NutRadio
        <NutRadio
          :label="Number(item)"
          :key="item"
          shape="button"
          v-for="item in parValueList"
          v-for="item in gasValueList"
          class="parValue-item"
        >
          <div class="parValue-item-inner">
@@ -59,13 +53,13 @@
            </div>
            <div class="discountTag">{{ lifePayGasRate }}折</div>
          </div>
        </NutRadio> -->
        </NutRadio>
      </NutRadioGroup>
    </NutFormItem>
    <div class="common-content">
      <nut-button class="recharge-button" type="primary" @click="handleSubmit">
        <div class="recharge-button-inner">
          <!-- <div>¥{{ realParValue }}</div> -->
          <div>¥{{ realParValue }}</div>
          <div class="recharge-button-text">立即充值</div>
        </div>
      </nut-button>
@@ -82,7 +76,7 @@
      <template #info>
        <ConfirmDialogInfoItem
          label="燃气类型"
          :content="blLifeRecharge.constants.GasOrgCodeEnumText[form.gasOrgType]"
          :content="currentGasParValueItem?.gasOrgName ?? ''"
        />
        <ConfirmDialogInfoItem :label-width="96" label="户号" :content="form.gasAccount" />
        <ConfirmDialogInfoItem label="充值金额" :content="`¥${form.parValue.toFixed(2)}`" danger />
@@ -143,15 +137,17 @@
const { blLifeRecharge } = useLifeRechargeContext();
const { lifePayGasRate } = useGetRate();
const { gasParValueList } = useGetGasParValue();
const form = reactive({
  parValue: 0,
  province: '',
  city: '',
  // province: '',
  // city: '',
  gasOrgType: '',
  gasAccount: '',
  currentUserAccountId: '',
  remark: '',
  areaList: [] as string[],
});
const { userAccountAllList, handleUserAccountChange } = useSetUserAccountBySelect({
@@ -160,30 +156,31 @@
    const currentUserAccountExtraProperties = JSON.parse(
      currentUserAccount.extraProperties
    ) as GasUserAccountExtraProperties;
    // form.currentUserAccountId = currentUserAccount.id;
    // form.electricAccount = currentUserAccount.content;
    // form.province = currentUserAccount.province;
    // form.city = currentUserAccount.city;
    form.currentUserAccountId = currentUserAccount.id;
    form.gasAccount = currentUserAccount.content;
    form.areaList = [currentUserAccount.province, currentUserAccount.city];
    form.gasOrgType = currentUserAccount.operators;
    // form.electricType = currentUserAccountExtraProperties.electricType;
    // form.electricAccountType = currentUserAccountExtraProperties.electricAccountType;
    // form.sixID = currentUserAccountExtraProperties.sixID;
    // form.remark = currentUserAccount.remark;
    // const electricParValueItem = electricParValueList.value.find(
    //   (x) => x.cityName === form.province
    // );
    // if (
    //   electricParValueItem &&
    //   electricParValueItem.parValue.every((x) => Number(x) !== form.parValue)
    // ) {
    //   form.parValue = 0;
    // }
    form.remark = currentUserAccount.remark;
    const gasParValueItem = gasParValueList.value.find((x) => x.gasOrgCode === form.gasOrgType);
    if (gasParValueItem && gasParValueItem.parValue.every((x) => Number(x) !== form.parValue)) {
      form.parValue = 0;
    }
  },
});
function handleAddUserAccount() {
  goTo('step1');
}
const currentGasParValueItem = computed(() =>
  gasParValueList.value.find((x) => x.gasOrgCode === form.gasOrgType)
);
const gasValueList = computed(() => {
  const gasValueList = currentGasParValueItem.value?.parValue ?? [];
  return blLifeRecharge.filterParValueList(gasValueList);
});
const realParValue = computed(() =>
  blLifeRecharge.getRechargeParValue(form.parValue, lifePayGasRate.value)
@@ -229,12 +226,13 @@
  try {
    let params: LifeGasDataCreateLifePayOrderInput = {
      userId: blLifeRecharge.accountModel.userId,
      channelId: blLifeRecharge.accountModel.channlesNum,
      productData: {
        parValue: props.isDev ? 0.1 : form.parValue,
        gasOrgType: form.gasOrgType,
        gasAccount: form.gasAccount,
        province: form.province,
        city: form.city,
        province: form.areaList?.[0] ?? '',
        city: form.areaList?.[1] ?? '',
      },
    };
    let res = await blLifeRecharge.services.createLifePayGasOrder(params);