zhengyiming
8 天以前 c24cdd854e258712408a7904bdb401c49e3f07c1
packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue
@@ -13,7 +13,7 @@
          direction="horizontal"
          class="par-account-list"
          v-if="userAccountAllList.length > 0"
          @change="handleUserAccountChange"
          @change="_handleUserAccountChange"
        >
          <NutRadio
            :label="item.id"
@@ -97,7 +97,7 @@
        <ConfirmDialogInfoItem label="实付金额" :content="`¥${realParValue}`" danger />
      </template>
    </ConfirmDialog>
    <NutToast :msg="state.msg" v-model:visible="state.show" type="warn" cover />
    <NutToast :msg="state.msg" v-model:visible="state.show" type="warn" cover :duration="3000" />
  </NutForm>
</template>
@@ -163,12 +163,30 @@
    form.phone = currentUserAccount.content;
    form.ispCode = currentUserAccountExtraProperties.ispCode;
    form.name = currentUserAccountExtraProperties.name;
    form.remark = currentUserAccount.remark;
    changeIspCode(form.ispCode as any);
  },
  getDefaultUserAccount(userAccountList) {
    const defaultUserAccount = userAccountList.find((x) => {
      const currentUserAccountExtraProperties = JSON.parse(
        x.extraProperties
      ) as PhoneUserAccountExtraProperties;
      return isCanRecharge(currentUserAccountExtraProperties.ispCode);
});
    return defaultUserAccount;
  },
});
function _handleUserAccountChange(userAccountId: string) {
  const currentUserAccount = userAccountAllList.value.find((x) => x.id === userAccountId);
  const currentUserAccountExtraProperties = JSON.parse(
    currentUserAccount.extraProperties
  ) as PhoneUserAccountExtraProperties;
  if (!checkCanRecharge(currentUserAccountExtraProperties.ispCode)) {
    // return;
  }
  handleUserAccountChange(userAccountId);
}
function handleAddUserAccount() {
  goTo('step1');
@@ -244,11 +262,24 @@
const currentOrderNo = ref('');
function isCanRecharge(ispCode: string) {
  return ispCode !== blLifeRecharge.constants.IspCode.yidong;
}
function checkCanRecharge(ispCode: string) {
  if (!isCanRecharge(ispCode)) {
    //通道正在升级,给您带来不便尽情谅解
    state.msg =
      '尊敬的用户,为提供更安全、稳定的充值服务,移动充值通道正在进行升级维护,维护期间暂无法发起充值';
    state.show = true;
    return false;
  }
  return true;
}
async function goPay() {
  try {
    if (form.ispCode === blLifeRecharge.constants.IspCode.yidong) {
      state.msg = '暂不支持移动号码充值';
      state.show = true;
    if (!checkCanRecharge(form.ispCode)) {
      return;
    }
    let params: LifePhoneDataCreateLifePayOrderInput = {