| | |
| | | <template> |
| | | <PhoneBillRechargeBaseForm ref="formRef" v-model:form="form"> |
| | | <NutFormItem label="备注信息" class="bole-form-item" prop="remark"> |
| | | <NutInput |
| | | v-model.trim="form.remark" |
| | | class="bole-input-text" |
| | | placeholder="请输入备注信息" |
| | | type="text" |
| | | max-length="30" |
| | | /> |
| | | </NutFormItem> |
| | | <div class="common-content"> |
| | | <nut-button class="recharge-button" type="primary" @click="handleNext"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">立即充值</div> |
| | | </div> |
| | | </nut-button> |
| | | <nut-button class="recharge-button" type="primary" plain @click="goToNext"> |
| | | <div class="recharge-button-inner"> |
| | | <div class="recharge-button-text">返回</div> |
| | | </div> |
| | | </nut-button> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { |
| | | Form as NutForm, |
| | | FormItem as NutFormItem, |
| | | 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 { Button as NutButton, FormItem as NutFormItem, Input as NutInput } from '@nutui/nutui-taro'; |
| | | import { reactive, ref, computed, provide } from 'vue'; |
| | | import BlRadio from '../../components/Radio/Radio.vue'; |
| | | import { FormValidator } from '../../utils'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | BlLifeRecharge, |
| | | LifePhoneDataCreateLifePayOrderInput, |
| | | LifeRechargeConstants, |
| | | } from '@life-payment/core-vue'; |
| | | import RechargeTipsView from '../../components/RechargeTipsView/RechargeTipsView.vue'; |
| | | import ConfirmDialog from '../../components/Dialog/ConfirmDialog.vue'; |
| | | import ConfirmDialogInfoItem from '../../components/Dialog/ConfirmDialogInfoItem.vue'; |
| | | import { useGetRate, useGetPhoneParValue } from '../../hooks'; |
| | | import PhoneBillRechargeBaseForm from './PhoneBillRechargeBaseForm.vue'; |
| | | import { usePhoneBillRechargeContext } from './context'; |
| | | import { |
| | | useLifeRechargeContext, |
| | | LifeRechargeConstants, |
| | | AddUpdateUserAccountInput, |
| | | } from '@life-payment/core-vue'; |
| | | import { useAddUpdateUserAccount } from '../../hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'PhoneBillRechargeStep1', |
| | |
| | | ispCode: '', |
| | | phone: '', |
| | | name: '', |
| | | remark: '', |
| | | }); |
| | | |
| | | const { goToNext } = usePhoneBillRechargeContext(); |
| | |
| | | if (!formRef.value) return; |
| | | formRef.value.validate().then(({ valid, errors }: any) => { |
| | | if (valid) { |
| | | goToNext(); |
| | | handleAddUpdateUserAccount(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const { addUpdateUserAccount } = useAddUpdateUserAccount(); |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | async function handleAddUpdateUserAccount() { |
| | | try { |
| | | let params: AddUpdateUserAccountInput = { |
| | | userId: blLifeRecharge.accountModel.userId, |
| | | operators: form.ispCode, |
| | | lifePayType: LifeRechargeConstants.LifePayOrderTypeEnum.话费订单, |
| | | content: form.phone, |
| | | extraProperties: JSON.stringify(form), |
| | | remark: form.remark, |
| | | }; |
| | | await addUpdateUserAccount(params); |
| | | goToNext(); |
| | | } catch (error) {} |
| | | } |
| | | </script> |