<template>
    <div class="editPhoneStep1">
        <el-row>
            <div class="content_title">
                <span>变更手机号</span>
            </div>
        </el-row>
        <el-row>
            <div class="step">
                <el-steps :active="active" align-center>
                    <el-step description="验证当前手机号"></el-step>
                    <el-step description="绑定新手机号"></el-step>
                    <el-step description="完成"></el-step>
                </el-steps>
            </div>
        </el-row>
        <el-row style="padding-left:250px">
            <el-form :model="form" status-icon :rules="rules" label-width="100px" class="demo-ruleForm">
                <el-form-item label="当前手机号">
                    <el-input v-model="form.phone" :disabled="true"></el-input>
                </el-form-item>
                <el-form-item label="验证码" prop="code">
                    <el-input placeholder="请输入验证码" class="ipt3 " v-model="form.code"></el-input>
                    <span class="code " @click="authCode()">发送验证码</span>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm" class="btn1">确定</el-button>
                    <el-button type="primary" @click="$router.push({ name: 'account' })" class="btn2">返回</el-button>
                </el-form-item>
            </el-form>
        </el-row>
    </div>
</template>

<script>
export default {
    name: 'editPhoneStep1',

    computed: {
        userInfo() {
            return this.$store.state.userInfo;
        }
    },
    data() {
        var validateCode = (rule, value, callback) => {
            if (value !== this.code) {
                callback(new Error('验证码错误'));
            } else {
                callback();
            }
        };
        return {
            form: {},
            rules: {
                code: [
                    {
                        required: true,
                        message: '请输入验证码',
                        trigger: 'blur'
                    }
                ]
            },
            data: [],
            active: 0
        };
    },
    created() {
        this.form = this.userInfo;
        /*       this.$http
            .get('orgInfo/my')
            .then(res => {
                this.form = res;
            })
            .catch(e => {
                console.log(e);
                this.$message.error(e.error);
            }); */
    },
    methods: {
        submitForm() {
            this.$router.push({ name: 'editPhoneStep2' });
        },
        authCode() {
            // this.$http
            //     .get('/sms/sendVerify', {
            //         phone: this.formData.phone
            //     })
            //     .then(res => {
            //         this.code = res;
            //     })
            //     .catch(e => {
            //         console.log(e);
            //         this.$message.error(e.error);
            //     });
        }
    }
};
</script>
<style lang="less">
.editPhoneStep1 {
    height: 520px;
}
.content_title {
    height: 60px;
    line-height: 60px;
    box-sizing: border-box;
    padding-bottom: 20px;
    border-bottom: #f2f3f5 1px solid;
    > span {
        font-size: 16px;
        color: #000000;
        line-height: 30px;
        font-weight: 700;
    }
}
.step {
    width: 500px;
    margin: 50px auto 0;
    .el-step__icon.is-text {
        border-width: 0px;
        background-color: #c8c9cc;
        color: #fff;
        &:nth-child(0) {
            background-color: #bf1616;
        }
    }
    .el-step__head.is-wait {
        font-size: 14px;
        font-weight: bold;
        color: #0f264d;
    }
    .el-step__head.is-process {
        color: #fff;
        .el-step__icon.is-text {
            background-color: #bf1616;
        }
    }

    .el-step__head.is-finish {
        color: #bf1616;
        .el-step__icon.is-text {
            background-color: #bf1616;
        }
        .el-step__line {
            background-color: #bf1616;
            border-color: #bf1616;
        }
    }
    .el-step__line {
        height: 1px;
    }

    .el-step__description.is-process {
        color: #bf1616;
    }

    .el-step__main {
        margin-top: 15px;
    }
}
.el-form {
    margin-top: 40px;
    position: relative;
    .el-input {
        width: 300px !important;
    }
    .el-form-item {
        margin-bottom: 20px;
    }
    .el-button {
        margin-top: 80px;
    }
}
.el-button {
    border: none;
}
.btn1 {
    width: 110px;
    height: 36px;
    background: #bf1616;
    border-radius: 4px;
}
.btn2 {
    width: 110px;
    height: 36px;
    background: #c4c7cc;
    border-radius: 4px;
}
.code {
    position: absolute;
    top: 0px;
    left: 206px;
    width: 100px;
    height: 34px;
    height: 34px;
    font-size: 13px;
    color: #bf1616;
    cursor: pointer;
}
</style>
