<!--
 * @Author: PoJun
 * @Date: 2023-09-28 10:38:11
 * @LastEditors: PoJun
 * @LastEditTime: 2024-01-04 15:02:22
 * @Message: 申述界面
-->
<template>
    <view class="authentication">
        <kirin-form ref="form" :list="list"></kirin-form>
        <view class="uv-m-t-30">
            <uv-button type="primary" text="确定" @click="save"></uv-button>
        </view>
    </view>
</template>

<script>
import { appealMark } from "@/config/http.js";
export default {
    data() {
        return {
            list: [
                {
                    type: "input",
                    label: "申述类型",
                    code: "type",
                    sv: "评分",
                    rv: "评分",
                    canShow: true,
                    canEdit: false,
                },
                {
                    type: "textarea",
                    label: "申述理由",
                    code: "reason",
                    sv: null,
                    rv: null,
                    canShow: true,
                    canEdit: true,
                    required: true,
                },
            ],
        };
    },
    methods: {
        async save() {
            const formData = this.$refs.form.getFormData();
            if (!formData) {
                return;
            }
            uni.showLoading({ mask: true });
            await appealMark(formData.reason);
            await uni.$uv.sleep(200);
            try {
                uni.$uv.route({ type: "back" });
            } finally {
                uni.hideLoading();
            }
        },
    },
};
</script>

<style lang="scss">
.authentication {
    padding: 0rpx 25rpx;
}
</style>
