<script setup>
import {ref} from "vue";
import Api from "../../../../../api/index.js";
import {Message} from "@arco-design/web-vue";

const {id} = defineProps({
    id: {
        type: Number,
        default: null,
    }
});
const visible = ref(false);
const emits = defineEmits(['success']);

const remark = ref(null);

const refund = async () => {
    const {msg} = await Api.admin.refund({
        id: id,
        remark: remark.value
    });
    Message.success(msg);
    emits('success');
}
</script>

<template>
    <a-link :hoverable="false" status="danger" @click="visible=true">拒绝</a-link>

    <a-modal
        @ok="refund"
        ok-text="确定拒绝"
        title="推广账号拒绝"
        title-align="start"
        v-model:visible="visible">
        <a-form layout="vertical">
            <a-form-item label="拒绝原因">
                <a-input v-model:model-value="remark" placeholder="请输入拒绝原因"></a-input>
            </a-form-item>
        </a-form>
    </a-modal>
</template>

<style scoped lang="scss">

</style>
