From 8525b5c780d8855eca89c46790627c00b3d83c79 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 12 三月 2025 17:36:21 +0800 Subject: [PATCH] fix: 二期需求 --- packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue | 66 ++++++++++++++++----------------- 1 files changed, 32 insertions(+), 34 deletions(-) diff --git a/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue b/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue index cc6068c..58b7052 100644 --- a/packages/components/src/views/GasBillRecharge/GasBillRechargeStep3.vue +++ b/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); -- Gitblit v1.9.1