| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <Form |
| | | :model-value="form" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="top" |
| | | class="phone-bill-recharge" |
| | | > |
| | | <FormItem label="å
弿æºå·" class="bole-form-item" prop="phone" required> |
| | | <Input |
| | | v-model.trim="form.phone" |
| | | class="bole-input-text" |
| | | placeholder="è¯·å¡«åæ¨éè¦å
å¼çææºå·ç " |
| | | type="text" |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="éæ©å
å¼éé¢" class="bole-form-item" prop="parValue" required> |
| | | <RadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> |
| | | <Radio |
| | | :label="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, rate) }}å
</div> |
| | | </div> |
| | | <div class="discountTag">{{ rate * 100 }}æ</div> |
| | | </div> |
| | | </Radio> |
| | | </RadioGroup> |
| | | </FormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="recharge"> |
| | | <div class="recharge-button-inner"> |
| | | <div>ï¿¥{{ form.parValue }}</div> |
| | | <div class="recharge-button-text">ç«å³å
å¼</div> |
| | | </div> |
| | | </nut-button> |
| | | <RechargeTipsView :tips="tips" /> |
| | | </div> |
| | | <ConfirmDialog v-model:visible="confirmDialogVisible" @ok="goPay"> |
| | | <template #info> |
| | | <ConfirmDialogInfoItem label="å
å¼è´¦å·" content="18858418480" /> |
| | | <ConfirmDialogInfoItem label="å
å¼éé¢" :content="`ï¿¥${form.parValue}`" danger /> |
| | | <ConfirmDialogInfoItem label="伿 éé¢" :content="`ï¿¥${discountParValue}`" /> |
| | | <ConfirmDialogInfoItem label="å®ä»éé¢" :content="`ï¿¥${realParValue}`" danger /> |
| | | </template> |
| | | </ConfirmDialog> |
| | | </Form> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Form, FormItem, RadioGroup, Radio, Input, Button as NutButton } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed } from 'vue'; |
| | | import BlRadio from '../../components/Radio/Radio.vue'; |
| | | import { IspCodeText, IspCode } from '../../constants'; |
| | | import { useLifeRechargeContext } from '../../utils'; |
| | | import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'electricBillRecharge', |
| | | }); |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'goPay'): void; |
| | | }>(); |
| | | |
| | | const form = reactive({ |
| | | ispCode: IspCode.yidong, |
| | | phone: '', |
| | | parValue: 100, |
| | | }); |
| | | |
| | | const rate = 0.96; |
| | | |
| | | const parValueList = [50, 100, 200]; |
| | | |
| | | const realParValue = computed(() => blLifeRecharge.getRechargeParValue(form.parValue, rate)); |
| | | const discountParValue = computed(() => form.parValue - Number(realParValue.value)); |
| | | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const rules = reactive<FormRules>({}); |
| | | |
| | | const formRef = ref<any>(null); |
| | | |
| | | function handleSubmit() { |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const tips = [ |
| | | '平尿便
¢å
æå¡ï¼è®¢åæäº¤åï¼è¯è´¹å°äº0 - 24å°æ¶å
å°è´¦ãè¥æªè½ææ¶å°è´¦ï¼ç³»ç»å°èªå¨åèµ·éæ¬¾ã', |
| | | 'å
弿é´ï¼è¥åä¸å·ç 款项æªå°è´¦ï¼è¯·å¿å¨å
¶ä»å¹³å°éå¤å
å¼ï¼ä¸»å¯å¡ä¸å¯åæ¶å
å¼ãå ä¸è¿°æä½å¯¼è´çèµéæå¤±ï¼ç±ç¨æ·èªè¡æ¿æ
ã', |
| | | 'æ¬å¹³å°è¯è´¹å
弿å¡ä¸éç¨äºå·²åæºå·ç ãçµä¿¡å·ç è¥ææ¬ è´¹ï¼ä¹æ æ³å®æå
å¼ãçµä¿¡å·²å®æç»´æ¤çåºåå
æ¬ï¼å¹¿ä¸ãæ±èãæ¹åãåå·ãæ±è¥¿ãæ²³åãæ²³åãç¦å»ºãè¾½å®ãå
¶å®åºåæ£å¨åæ¹æ¬¡è¿è¡ç»´æ¤ä¸ï¼å¨æ¤æé´å¯è½ä¼åºç°å
å¼ä¸æåå¹¶èªå¨é款çæ
åµï¼è¯·æ¨è°
è§£ã', |
| | | '妿¥å°éçæ¥çµï¼å¯¹æ¹ä»¥ç¼´è´¹æè¯¯æä½ççç±è¦æ±å¤ç款项ï¼å¡å¿
ç«å³æé»ï¼è°¨é²è¯éªã', |
| | | 'å®åæå¡æä¸ºå
å¼å®æä¹æ¥èµ·3天ãç³è¯·å®åæå¡æ¶ï¼éæä¾å½å±è¯æ®ï¼è¯·ç¡®è®¤æ¥åæ¤è¦æ±ååä¸åï¼é¾æå¹³å°ä¸ååçå®åç³è¯·ã', |
| | | 'å
å¼å票ç±è¿è¥åæä¾ï¼æ¨å¯ç»å½ç½ä¸è¥ä¸å
ä¸è½½çµåå票ã', |
| | | ]; |
| | | |
| | | const confirmDialogVisible = ref(false); |
| | | |
| | | function recharge() { |
| | | confirmDialogVisible.value = true; |
| | | } |
| | | |
| | | function goPay() { |
| | | emit('goPay'); |
| | | } |
| | | </script> |