From bd7dd96c732ded6854d47bf77f65e5c64d3d15e2 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期三, 21 五月 2025 13:24:09 +0800 Subject: [PATCH] fix: 修改ui --- packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue | 152 ++++++++++++++++++++++++++++---------------------- 1 files changed, 84 insertions(+), 68 deletions(-) diff --git a/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue index 5984a9f..40844f6 100644 --- a/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue +++ b/packages/components/src/views/electricBillRecharge/ElectricBillRechargeStep2.vue @@ -6,75 +6,90 @@ label-position="top" class="order-bill-recharge electric" > - <NutFormItem class="bole-form-item" prop="currentUserAccountId"> - <NutRadioGroup - v-model="form.currentUserAccountId" - direction="horizontal" - class="par-account-list" - v-if="userAccountAllList.length > 0" - @change="handleUserAccountChange" - > - <NutRadio :label="item.id" shape="button" v-for="item in userAccountAllList" :key="item.id" - >{{ item.city }}-{{ item.content }}</NutRadio + <Chunk borderRadiusSmall :hasPaddingBottom="false"> + <NutFormItem class="bole-form-item user-account-form-item" prop="currentUserAccountId"> + <NutRadioGroup + v-model="form.currentUserAccountId" + direction="horizontal" + class="par-account-list" + v-if="userAccountAllList.length > 0" + @change="handleUserAccountChange" > - </NutRadioGroup> - <AccountCard - v-if="userAccountAllList.length > 0" - title="鍏呭�兼埛鍙�" - :content="`${form.city} ${form.electricAccount}`" - :remark="form.remark" - > - <template #action> - <div class="account-card-action" @click="handleAddUserAccount">鏂板</div> - </template> - </AccountCard> - <AccountAddCard text="鏂板鎴峰彿" v-else @click="handleAddUserAccount" /> - </NutFormItem> + <NutRadio + :label="item.id" + shape="button" + v-for="item in userAccountAllList" + :key="item.id" + >{{ item.city }}-{{ item.content }}</NutRadio + > + </NutRadioGroup> + <AccountCardV2 + v-if="userAccountAllList.length > 0" + :content="`${form.city}-${form.electricAccount}`" + :remark="form.remark" + :showEditBtn="!!form.currentUserAccountId" + @add="handleAddUserAccount" + @edit="emit('editUserAccount', form.currentUserAccountId)" + > + </AccountCardV2> + <AccountAddCardV2 + content="鍘绘坊鍔犲厖鍊兼埛鍙�" + remark="娣诲姞鎴峰彿灏嗕繚瀛樺湪鐢熸椿缂磋垂杩涜绠$悊" + tip="娣诲姞姝g‘鎴峰彿" + v-else + @add="handleAddUserAccount" + /> + </NutFormItem> + </Chunk> - <NutFormItem - v-if="!!form.province" - label="閫夋嫨鍏呭�奸噾棰�" - class="bole-form-item" - prop="parValue" - required - > - <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> - <NutRadio - :label="Number(item)" - :key="item" - shape="button" - v-for="item in parValueList" - class="parValue-item" - > - <div class="parValue-item-inner"> - <div class="amount-wrapper"> - <div class="amount">{{ item }}</div> - <div class="unit">鍏�</div> - </div> - <div class="price-wrapper"> - <div class="price-text">鎶樺悗</div> - <div class="price"> - {{ blLifeRecharge.getRechargeParValue(item, lifePayElectricRate) }}鍏� + <Chunk borderRadiusSmall :hasPaddingBottom="false" title="閫夋嫨鍏呭�奸噾棰�" v-if="!!form.province"> + <NutFormItem class="bole-form-item" prop="parValue" required> + <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> + <NutRadio + :label="Number(item)" + :key="item" + shape="button" + v-for="item in parValueList" + class="parValue-item" + > + <div class="parValue-item-inner"> + <div class="amount-wrapper"> + <div class="amount">{{ item }}</div> + <div class="unit">鍏�</div> </div> + <div class="price-wrapper"> + <div class="price-text">鎶樺悗</div> + <div class="price"> + {{ blLifeRecharge.getRechargeParValue(item, lifePayElectricRate) }}鍏� + </div> + </div> + <div class="discountTag" v-if="lifePayElectricRate > 0"> + {{ lifePayElectricRate }}鎶� + </div> + <img :src="IconSelect" class="discount-icon" /> </div> - <div class="discountTag">{{ lifePayElectricRate }}鎶�</div> - </div> - </NutRadio> - </NutRadioGroup> - </NutFormItem> + </NutRadio> + </NutRadioGroup> + </NutFormItem> + </Chunk> + <SelectPayTypeFormItem v-model="form.lifePayType" :showWeixinPay="showWeixinPay" :showAliPay="showAliPay" ></SelectPayTypeFormItem> <div class="common-content"> - <nut-button class="recharge-button" type="primary" @click="handleSubmit"> + <nut-button + class="recharge-button recharge-button-linear" + type="primary" + @click="handleSubmit" + > <div class="recharge-button-inner"> <div>锟{ realParValue }}</div> <div class="recharge-button-text">绔嬪嵆鍏呭��</div> </div> </nut-button> - <RechargeTipsView :tips="tips" /> + <RechargeTipsView :lifePayOrderType="LifeRechargeConstants.LifePayOrderTypeEnum.鐢佃垂璁㈠崟" /> </div> <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay"> <template #tips> @@ -120,13 +135,14 @@ import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; import { useGetRate, useGetElectricParValue, useSetUserAccountBySelect } from '../../hooks'; import { FormValidator, initLifePayType } from '../../utils'; -import { CustomerServiceTips } from '../../constants'; -import AccountAddCard from '../../components/Card/AccountAddCard.vue'; -import AccountCard from '../../components/Card/AccountCard.vue'; +import AccountAddCardV2 from '../../components/Card/AccountAddCardV2.vue'; +import AccountCardV2 from '../../components/Card/AccountCardV2.vue'; import { useElectricBillRechargeContext, ElectricUserAccountExtraProperties } from './context'; import SelectPayTypeFormItem from '../../components/SelectPayTypeFormItem/SelectPayTypeFormItem.vue'; import { useSelectPayType, useGetPayStatusByOrderNo } from '../../hooks/selectPayType'; import { RechargeProps } from '../PhoneBillRecharge/types'; +import Chunk from '../../components/Layout/Chunk.vue'; +import IconSelect from '../../assets/recharge/icon-select.png'; defineOptions({ name: 'ElectricBillRechargeStep2', @@ -139,6 +155,8 @@ const emit = defineEmits<{ (e: 'goPay', orderNo: string): void; (e: 'paySuccess', orderNo: string): void; + (e: 'missName', userAccountId: string): void; + (e: 'editUserAccount', userAccountId: string): void; }>(); const { goTo } = useElectricBillRechargeContext(); @@ -154,6 +172,7 @@ currentUserAccountId: '', remark: '', lifePayType: initLifePayType(props.isInWeChat, props.isInAlipay), + name: '', }); const { userAccountAllList, handleUserAccountChange } = useSetUserAccountBySelect({ @@ -171,6 +190,7 @@ form.electricAccountType = currentUserAccountExtraProperties.electricAccountType; form.sixID = currentUserAccountExtraProperties.sixID; form.remark = currentUserAccount.remark; + form.name = currentUserAccountExtraProperties.name ?? ''; const electricParValueItem = electricParValueList.value.find( (x) => x.cityName === form.province ); @@ -217,19 +237,14 @@ if (!formRef.value) return; formRef.value.validate().then(({ valid, errors }: any) => { if (valid) { + if (!form.name) { + emit('missName', form.currentUserAccountId); + return; + } recharge(); } }); } - -const tips = [ - '骞冲彴鎻愪緵鎱㈠厖鏈嶅姟锛岃鍗曟彁浜ゅ悗锛岀數璐瑰皢浜�0 - 72 灏忔椂鍐呭埌璐︼紝鑻ユ湭鑳芥寜鏃跺埌璐︼紝绯荤粺灏嗚嚜鍔ㄥ彂璧烽��娆俱��', - '鍏呭�兼湡闂达紝鑻ュ悓涓�璐︽埛鐨勫厖鍊兼鏈埌璐︼紝璇峰嬁鍦ㄥ叾浠栧钩鍙伴噸澶嶅厖鍊硷紝鍥犱笂杩版搷浣滃鑷寸殑璧勯噾鎹熷け锛岀敱鐢ㄦ埛鑷鎵挎媴銆�', - '涓虹‘淇濆厖鍊奸『鍒╄繘琛岋紝鐩墠骞冲彴涓嶆敮鎸佸娆犳閲戦瓒呰繃1000鍏冪殑璐︽埛杩涜鍏呭�硷紝涓旀瘡娆″厖鍊奸噾棰濆繀椤婚珮浜庢瑺璐规�婚銆�', - '濡傛帴鍒伴檶鐢熸潵鐢碉紝瀵规柟浠ョ即璐规垨璇搷浣滅瓑鐞嗙敱瑕佹眰澶勭悊娆鹃」锛屽姟蹇呯珛鍗虫媺榛戯紝璋ㄩ槻璇堥獥銆�', - '涓嬪崟鏃讹紝璇锋偍鍔″繀鍑嗙‘濉啓瀹屾暣鐨勭渷甯傚強鎴峰彿淇℃伅銆傚厖鍊煎畬鎴愬悗锛屽彂绁ㄧ敱杩愯惀鍟嗘彁渚涳紝鎮ㄥ彲鐧诲綍缃戜笂钀ヤ笟鍘呬笅杞藉搴旂殑鐢靛瓙鍙戠エ銆�', - CustomerServiceTips, -]; const confirmDialogVisible = ref(false); @@ -238,10 +253,10 @@ } const { state, invokeAliPay, invokeWeixinPay } = useSelectPayType({ - openId: toRef(props, 'openId'), isInWeChat: toRef(props, 'isInWeChat'), isH5: toRef(props, 'isH5'), appId: toRef(props, 'appId'), + getOpenId: toRef(props, 'getOpenId'), }); const currentOrderNo = ref(''); @@ -252,13 +267,14 @@ userId: blLifeRecharge.accountModel.userId, channelId: blLifeRecharge.accountModel.channlesNum, productData: { - parValue: props.isDev ? 0.1 : form.parValue, + parValue: form.parValue, electricType: form.electricType, electricAccountType: form.electricAccountType, electricAccount: form.electricAccount, province: form.province, city: form.city, sixID: form.sixID, + // name: form.name, }, }; let res = await blLifeRecharge.services.createLifePayElectricOrder(params); -- Gitblit v1.9.1