<template>
    <div class="content">
        <div class="header">
            <u-navbar
                :background="{backgroundColor: '#ffcb57'}"
                :border-bottom="false"
                title="拒绝申请"
                title-color="#472d21"
            ></u-navbar>
        </div>
        <view class="wrap">
            <u-input v-model="content" type="textarea" height="240"></u-input>
            <view class="mc-btn">
                <u-button
                    :custom-style="{margin: '0 30rpx',backgroundColor: '#ffcb57',color: '#472d21'}"
                    hover-class="defaultBtnhover"
                    @click="refuse"
                >立即提交</u-button>
            </view>
        </view>
        <u-toast ref="uToast" />
    </div>
</template>

<script>
import request from '../../../common/service';
export default {
    data() {
        return {
            content: '',
            billNo: '',
        };
    },
    onLoad(options) {
        this.billNo = options.billNo;
    },
    computed: {},
    methods: {
        async refuse() {
            if (!this.content) {
                this.$refs.uToast.show({
                    title: '请完善信息后再提交！',
                });
                return;
            }
            const response = await request.post('/api/Business/ApplyJoinAudit', {
                FNumber: this.billNo,
                FCheckResult: 'BTG',
                FRefuseDesc: this.content
            });
            const { code, message, result } = response;
            if (code === 0) {
                this.$refs.uToast.show({
                    title: '已拒绝',
                });
                uni.navigateBack();
            } else {
                this.$refs.uToast.show({
                    title: message,
                });
            }
        },
    },
};
</script>

<style lang="scss" scoped>
.content {
    .header {
        background-color: #ffcb57;
    }
    .wrap {
        display: flex;
        flex-direction: column;
        height: calc(100vh - var(--window-top));
        width: 100%;
        /deep/.u-input {
            margin: 30rpx 32rpx;
            background-color: #fff;
            border-radius: 10rpx;
            .u-input__textarea {
                padding: 10rpx;
            }
        }
    }
}
</style>
