<template>
    <div class="mainTextPage main-content12">
        <h3 class="pageTitle">启用开关</h3>
        <div class="flex-between flex-common" id="mainTextTitle">
            <el-form>
                <div class="left-pay-list ">
                    <div class="left-pay-item flex-between">
                        <div class="column">
                            <span>模板启用</span>
                            <p>中国人民大学-硕士-通用</p>
                        </div>
                        <GuipSwitch v-model="is_use_templete" :active-value="1" :inactive-value="0"  activeText="开启" inactiveText="关闭" @change="updatePayAutoRefund"></GuipSwitch>
                    </div>
                </div>
            </el-form>
        </div>
       
    </div>
</template>
<script>
import GuipSwitch from '@/components/GuipSwitch.vue';
export default {
    components: {
        GuipSwitch
    },
    data() {
        return {
            is_use_templete:1
        };
    },
    methods: {
        updatePayAutoRefund() {
            this.$http('POST', '/agentnew/ajax_setting_auto_refund', {
                status: this.is_use_templete,
            }).then(response => {
                this.$nextTick(() => {
                    if (response.status) {
                        this.$Message.success(response.info);
                    } else {
                        this.$Message.error(response.info);
                    }
                })
            }).catch(error => {
                console.error(error, 'error')
            })
        },
    },
};
</script>
<style lang="scss" scoped>
.flex-common {
    align-items: flex-start;
    padding: 24px 32px;
}
.left-pay-list {
        width: 438px;
        border-radius: 4px;
        opacity: 1;

        .left-pay-item {
            padding: 24px;
            color: #23242B;
            background: #FAFAFA;
            p {
                text-align: left;
                margin-top: 9px;
                /* caption/caption_regular */
                font-size: 12px;
                font-weight: normal;
                line-height: 13px;
                letter-spacing: 0.08em;
                color: #626573;
            }

            .el-form-item {
                margin-bottom: 0;
            }
        }
    }
</style>