From 5cd618c9523ad30dccf858a00ff6d99a28de4187 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期四, 11 九月 2025 10:24:35 +0800 Subject: [PATCH] feat: 公告 --- packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue | 37 ++++++++++++++++++++++++++++++------- 1 files changed, 30 insertions(+), 7 deletions(-) diff --git a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue b/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue index 9cc85e9..a5508c1 100644 --- a/packages/components/src/views/PhoneBillRecharge/PhoneBillRechargeStep2.vue +++ b/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> @@ -132,6 +132,7 @@ import { RechargeProps } from './types'; import Chunk from '../../components/Layout/Chunk.vue'; import IconSelect from '../../assets/recharge/icon-select.png'; +import { useCheckCanRecharge } from '../../hooks/rate'; defineOptions({ name: 'PhoneBillRechargeStep2', @@ -163,12 +164,31 @@ form.phone = currentUserAccount.content; form.ispCode = currentUserAccountExtraProperties.ispCode; form.name = currentUserAccountExtraProperties.name; - form.remark = currentUserAccount.remark; - changeIspCode(form.ispCode as any); }, + async getDefaultUserAccount(userAccountList) { + await ensureLifePayRateChannelAllList(); + 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 +264,14 @@ const currentOrderNo = ref(''); +const { isCanRecharge, checkCanRecharge, ensureLifePayRateChannelAllList } = useCheckCanRecharge({ + msg: toRef(state, 'msg'), + show: toRef(state, 'show'), +}); + async function goPay() { try { - if (form.ispCode === blLifeRecharge.constants.IspCode.yidong) { - state.msg = '鏆備笉鏀寔绉诲姩鍙风爜鍏呭��'; - state.show = true; + if (!checkCanRecharge(form.ispCode)) { return; } let params: LifePhoneDataCreateLifePayOrderInput = { -- Gitblit v1.9.1