<template>
|
<div></div>
|
</template>
|
|
<script setup lang="ts">
|
import {
|
Form as NutForm,
|
FormItem as NutFormItem,
|
Input as NutInput,
|
Textarea as NutTextarea,
|
} from '@nutui/nutui-taro';
|
import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
|
import { reactive, ref, computed } from 'vue';
|
import {
|
useLifeRechargeContext,
|
LifeRechargeConstants,
|
RefundUserLifePayOrderInput,
|
} from '@life-payment/core-vue';
|
import { useQueryClient } from '@tanstack/vue-query';
|
|
defineOptions({
|
name: 'ApplyAgentView',
|
});
|
|
const emit = defineEmits<{
|
(e: 'submit'): void;
|
}>();
|
|
const form = reactive({
|
refundApplyRemark: '',
|
});
|
|
const rules = reactive<FormRules>({
|
refundApplyRemark: [{ required: true, message: '请输入退款原因' }],
|
});
|
|
const { blLifeRecharge } = useLifeRechargeContext();
|
|
const formRef = ref<any>(null);
|
|
function handleSubmit() {
|
if (!formRef.value) return;
|
formRef.value.validate().then(({ valid, errors }: any) => {
|
if (valid) {
|
refundUserLifePayOrder();
|
}
|
});
|
}
|
|
const queryClient = useQueryClient();
|
|
async function refundUserLifePayOrder() {
|
try {
|
let params = {
|
userId: blLifeRecharge.accountModel.userId,
|
refundApplyRemark: form.refundApplyRemark,
|
};
|
let res = await blLifeRecharge.services.refundUserLifePayOrder(params);
|
emit('submit');
|
} catch (error) {}
|
}
|
|
defineExpose({
|
handleSubmit,
|
});
|
</script>
|