| | |
| | | <template> |
| | | <Form |
| | | <NutForm |
| | | :model-value="form" |
| | | ref="formRef" |
| | | :rules="rules" |
| | | label-position="top" |
| | | class="order-bill-recharge electric" |
| | | > |
| | | <FormItem label="所在城市" class="bole-form-item" prop="province" required> |
| | | <FormItem label="所在区域" class="bole-form-item" prop="province" required> |
| | | <ChooseInputWithPicker |
| | | v-model="form.province" |
| | | placeholder="请选择城市" |
| | | placeholder="请选择区域" |
| | | :value-enum="electricParValueList" |
| | | enum-label-key="areaName" |
| | | enum-value-key="areaName" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="所在城市" class="bole-form-item" prop="city" required v-if="form.province"> |
| | | <ChooseInputWithPicker |
| | | v-model="form.city" |
| | | placeholder="请选择城市" |
| | | :value-enum="electricCityList" |
| | | enum-label-key="cityName" |
| | | enum-value-key="cityName" |
| | | /> |
| | | </FormItem> |
| | | <!-- <FormItem label="电网类型" class="bole-form-item" prop="electricType" required> |
| | |
| | | /> |
| | | </FormItem> |
| | | <FormItem label="电网户号" class="bole-form-item" prop="electricAccount" required> |
| | | <Input |
| | | <NumberInput |
| | | v-model.trim="form.electricAccount" |
| | | class="bole-input-text" |
| | | placeholder="请输入13位数字编号" |
| | | type="text" |
| | | max-length="13" |
| | | /> |
| | | </FormItem> |
| | | <FormItem |
| | |
| | | prop="sixID" |
| | | required |
| | | > |
| | | <Input |
| | | <NutInput |
| | | v-model.trim="form.sixID" |
| | | class="bole-input-text" |
| | | placeholder="请输入身份证后六位" |
| | | type="text" |
| | | max-length="6" |
| | | /> |
| | | </FormItem> |
| | | <FormItem |
| | |
| | | prop="parValue" |
| | | required |
| | | > |
| | | <RadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> |
| | | <Radio |
| | | <NutRadioGroup v-model="form.parValue" direction="horizontal" class="parValue-radio-group"> |
| | | <NutRadio |
| | | :label="Number(item)" |
| | | :key="item" |
| | | shape="button" |
| | |
| | | </div> |
| | | <div class="discountTag">{{ lifePayElectricRate * 100 }}折</div> |
| | | </div> |
| | | </Radio> |
| | | </RadioGroup> |
| | | </NutRadio> |
| | | </NutRadioGroup> |
| | | </FormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleSubmit"> |
| | | <div class="recharge-button-inner"> |
| | | <div>¥{{ form.parValue }}</div> |
| | | <div>¥{{ realParValue }}</div> |
| | | <div class="recharge-button-text">立即充值</div> |
| | | </div> |
| | | </nut-button> |
| | |
| | | 该产品为慢充模式,0-72小时内到账,介意请勿付款!充值前请仔细阅读充值须知! |
| | | </template> |
| | | <template #info> |
| | | <ConfirmDialogInfoItem label="电网类型" content="国家电网" /> |
| | | <ConfirmDialogInfoItem label="电费类型" content="住宅" /> |
| | | <ConfirmDialogInfoItem |
| | | label="电网类型" |
| | | :content="blLifeRecharge.constants.ElectricTypeText[form.electricType]" |
| | | /> |
| | | <ConfirmDialogInfoItem :label-width="96" label="户号" :content="form.electricAccount" /> |
| | | <ConfirmDialogInfoItem label="充值金额" :content="`¥${form.parValue.toFixed(2)}`" danger /> |
| | | <ConfirmDialogInfoItem label="优惠金额" :content="`¥${discountParValue.toFixed(2)}`" /> |
| | | <ConfirmDialogInfoItem label="实付金额" :content="`¥${realParValue}`" danger /> |
| | |
| | | 同一电费账户在充值期间,未到账前切勿在其他任何平台再次充值。因此造成的资金损失须用户自行承担!!! |
| | | </template> |
| | | </ConfirmDialog> |
| | | </Form> |
| | | </NutForm> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { Form, FormItem, RadioGroup, Radio, Input, Button as NutButton } from '@nutui/nutui-taro'; |
| | | import { |
| | | Form as NutForm, |
| | | FormItem, |
| | | RadioGroup as NutRadioGroup, |
| | | Radio as NutRadio, |
| | | Input as NutInput, |
| | | Button as NutButton, |
| | | } from '@nutui/nutui-taro'; |
| | | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; |
| | | import { reactive, ref, computed, watch } from 'vue'; |
| | | import { |
| | |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | import ChooseInputWithPicker from '../../components/Input/ChooseInputWithPicker.vue'; |
| | | import NumberInput from '../../components/Input/NumberInput.vue'; |
| | | import { useGetRate, useGetElectricParValue } from '../../hooks'; |
| | | import { FormValidator } from '../../utils'; |
| | | import { CustomerServiceTips } from '../../constants'; |
| | | |
| | | defineOptions({ |
| | | name: 'electricBillRecharge', |
| | |
| | | electricType: '', |
| | | electricAccountType: '', |
| | | province: '', |
| | | city: '', |
| | | sixID: '', |
| | | }); |
| | | |
| | | const { lifePayElectricRate } = useGetRate(); |
| | | const { electricParValueList } = useGetElectricParValue(); |
| | | |
| | | const parValueList = computed( |
| | | () => electricParValueList.value.find((x) => x.areaName === form.province)?.parValue ?? [] |
| | | const parValueList = computed(() => { |
| | | const parValueList = |
| | | electricParValueList.value.find((x) => x.cityName === form.province)?.parValue ?? []; |
| | | return blLifeRecharge.filterParValueList(parValueList); |
| | | }); |
| | | |
| | | const electricCityList = computed( |
| | | () => electricParValueList.value.find((x) => x.cityName === form.province)?.childCityList ?? [] |
| | | ); |
| | | |
| | | watch( |
| | | () => form.province, |
| | | (provinceName) => { |
| | | const electricParValue = electricParValueList.value.find( |
| | | (item) => item.areaName === provinceName |
| | | (item) => item.cityName === provinceName |
| | | ); |
| | | form.electricType = electricParValue.electricType; |
| | | } |
| | |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | province: [{ required: true, message: '请选择所在区域' }], |
| | | city: [{ required: true, message: '请选择所在城市' }], |
| | | electricAccountType: [{ required: true, message: '请选择电费类型' }], |
| | | electricAccount: [{ required: true, message: '请输入电网户号' }], |
| | | sixID: [{ required: true, message: '请输入身份证后六位' }], |
| | | electricAccount: [{ required: true, message: '请输入电网户号', regex: /^\d{13}$/ }], |
| | | sixID: [ |
| | | { |
| | | required: true, |
| | | message: '请输入身份证后六位', |
| | | validator: FormValidator.validatorIDNumberSix, |
| | | }, |
| | | ], |
| | | parValue: [ |
| | | { required: true, message: '请选择充值金额', validator: FormValidator.validatorNumberNotNull }, |
| | | ], |
| | |
| | | '为确保充值顺利进行,目前平台不支持对欠款金额超过1000元的账户进行充值,且每次充值金额必须高于欠费总额。', |
| | | '如接到陌生来电,对方以缴费或误操作等理由要求处理款项,务必立即拉黑,谨防诈骗。', |
| | | '下单时,请您务必准确填写完整的省市及户号信息。充值完成后,发票由运营商提供,您可登录网上营业厅下载对应的电子发票。', |
| | | CustomerServiceTips, |
| | | ]; |
| | | |
| | | const confirmDialogVisible = ref(false); |
| | |
| | | electricAccountType: form.electricAccountType, |
| | | electricAccount: form.electricAccount, |
| | | province: form.province, |
| | | city: '', |
| | | city: form.city, |
| | | sixID: form.sixID, |
| | | }, |
| | | }; |