From 8434c4b22d915ed796f7662cb10817b8e33c47c6 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 17 三月 2025 16:26:37 +0800
Subject: [PATCH] fix: 修改支付方式选择
---
packages/components/src/components/SelectPayTypeFormItem/SelectPayTypeFormItem.vue | 39 +++++++++++++++++++++++++++++----------
1 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/packages/components/src/components/SelectPayTypeFormItem/SelectPayTypeFormItem.vue b/packages/components/src/components/SelectPayTypeFormItem/SelectPayTypeFormItem.vue
index 7a01ca9..855f7e5 100644
--- a/packages/components/src/components/SelectPayTypeFormItem/SelectPayTypeFormItem.vue
+++ b/packages/components/src/components/SelectPayTypeFormItem/SelectPayTypeFormItem.vue
@@ -2,15 +2,29 @@
<NutFormItem label="閫夋嫨鏀粯鏂瑰紡" class="bole-form-item" prop="lifePayType" required>
<NutRadioGroup v-model="lifePayType" direction="horizontal">
<BlRadio
- :label="Number(lifePayTypeEnum)"
- v-for="(lifePayTypeEnumText, lifePayTypeEnum) in LifeRechargeConstants.LifePayTypeEnumText"
- :key="lifePayTypeEnum"
+ :label="LifeRechargeConstants.LifePayTypeEnum.AliPay"
shape="button"
class="select-pay-type-view-form-item-radio"
+ v-if="showAliPay"
>
<div class="select-pay-type-view-form-item">
- <img class="select-pay-type-view-form-item-icon" :src="IconMap[lifePayTypeEnum]" />
- {{ lifePayTypeEnumText }}
+ <img class="select-pay-type-view-form-item-icon" :src="IconAliPay" />
+ {{
+ LifeRechargeConstants.LifePayTypeEnumText[LifeRechargeConstants.LifePayTypeEnum.AliPay]
+ }}
+ </div>
+ </BlRadio>
+ <BlRadio
+ :label="LifeRechargeConstants.LifePayTypeEnum.WxPay"
+ shape="button"
+ class="select-pay-type-view-form-item-radio"
+ v-if="showWeixinPay"
+ >
+ <div class="select-pay-type-view-form-item">
+ <img class="select-pay-type-view-form-item-icon" :src="IconWeixin" />
+ {{
+ LifeRechargeConstants.LifePayTypeEnumText[LifeRechargeConstants.LifePayTypeEnum.WxPay]
+ }}
</div>
</BlRadio>
</NutRadioGroup>
@@ -28,10 +42,15 @@
name: 'SelectPayTypeFormItem',
});
-const lifePayType = defineModel<LifeRechargeConstants.LifePayTypeEnum>();
-
-const IconMap = {
- [LifeRechargeConstants.LifePayTypeEnum.WxPay]: IconWeixin,
- [LifeRechargeConstants.LifePayTypeEnum.AliPay]: IconAliPay,
+type Props = {
+ showAliPay?: boolean;
+ showWeixinPay?: boolean;
};
+
+const props = withDefaults(defineProps<Props>(), {
+ showAliPay: true,
+ showWeixinPay: true,
+});
+
+const lifePayType = defineModel<LifeRechargeConstants.LifePayTypeEnum>();
</script>
--
Gitblit v1.10.0