<template>
    <div class="bindError">
        <div class="fixed-box">
            <el-alert :title="text" type="error" :closable="false" center show-icon>
            </el-alert>
            <a :href="hrefs" class="reloadBind">重新绑定</a>

        </div>


    </div>
</template>
<script>
    import Vue from 'vue';
    import {

        Button,
        Alert
    } from 'element-ui'

    Vue.use(Button).use(Alert)

    export default {
        name: "bindError",
        data() {
            return {
                text: "错误提示的文案",
                hrefs: "",
            };
        },
        watch: {},
        created() {
            this.getData();
            var code_=this.$route.query.err_type
            if(code_==1){
                this.text='微信授权失败'
            }else if(code_==2){
                this.text='云芯token校验失败'
            }
            else if(code_==3){
                this.text='请求access_token失败'
            }
            else if(code_==4){
                this.text='open_id已绑定其他账号,不能重复绑定'
            }
            else if(code_==5){
                this.text='更新绑定关系失败'
            }
            else if(code_==6){
                this.text='添加绑定关系失败'
            }
            else if(code_==7){
                this.text='获取微信信息失败'
            }
            
        },
        computed: {},
        methods: {
            getData() {
                this.$http('get', "/api/login/getwxqrcode").then(res => {
                    if (res.code === 0) {
                        this.hrefs = res.data.wx_login_url;
                    } 
                })
            }

        }
    };
</script>
<style lang="less">
    .fixed-box {
        position: fixed;
        height: 300px;
        width: 500px;
        border-radius: 6px;
        top: 50%;
        left: 50%;
        margin-left: -250px;
        margin-top: -150px;

        .reloadBind {
            display: block;
            margin: 0 auto;
            cursor: pointer;
            width: 76px;
            height: 37px;
            line-height: 37px;
            background: #1969F9;
            border-radius: 2px;
            font-size: 14px;
            color: #fff;
            text-align: center;
            border-radius: 3px;
            margin-top: 100px;

            &:hover {
                background: #0050E0;
            }
        }


    }
</style>