{
        template: '${tmpl}',
                data: function() {
                        return {
                                telphone: '',
                                /**用户成功获取验证码的手机号 */
                                mobilePhone: '',
                                /**用户输入的biz */
                                code: '',
                                /**短信返回的biz */
                                rcode: '',
                                time: '获取验证码',
                                disabled: false,
                                showLoading: false,
                        }
                },
        mounted: function() {
                /**先请求数据 */
                this.$root.hidemenu();
                /**标题 */
                console.log(this.$route.query, '12321321312');

                $('mobilelogin input').on('blur', () => {
                        window.scroll(0, 0);
                        /*
                        let top = document.documentElement.scrollTop;
                        */

                })
        },
        created: function() {

        },
        computed: {

        },
        watch: {
                telphone(n, o){
                        console.log(n, o);
                        if (n.length > 11) {
                                this.telphone = n.slice(0, 11);
                        }
                }
        },
        methods: {
                bindPhone(){

                        let { rcode } = this;
                        console.log(rcode,this);
                        if (!rcode) {
                                this.$alert('请先获取验证码', '提示', {
                                        confirmButtonText: '确定',
                                        callback: action => {

                                        }
                                });
                                return;
                        }
                        if (this.code == rcode) {
                                let obj = {};
                                obj.mobile = this.mobilePhone;
                                if (localStorage.WxUser || localStorage.WxUser != "") {
                                        this.$root.postReq("/wxop/empowerWxop/wxuserBindMobile", obj).then((res) => {
                                                this.showLoading = true;
                                                if (res.code == 1) {
                                                        this.$store.state.userInfo = res.data;
                                                        this.showLoading = false;
                                                        this.$root.checkAndLogin();
                                                        this.$alert('绑定成功', '提示', {
                                                                confirmButtonText: '确定',
                                                                callback: action => {
                                                                        this.$router.push('/mobilemy');
                                                                }
                                                        });
                                                } else {
                                                        this.$alert('绑定失败请重新绑定', '提示', {
                                                                confirmButtonText: '确定',
                                                                callback: action => {
                                                                        this.showLoading = false;
                                                                }
                                                        });
                                                        return;
                                                }
                                                console.log(res);
                                        });
                                } else {
                                        this.$alert('请先绑定您的微信帐号', '提示', {
                                                confirmButtonText: '确定',
                                                callback: action => {
                                                        this.$root.getOauthUrl();
                                                }
                                        });

                                }

                        } else {
                                this.$alert('请输入正确的验证码', '提示', {
                                        confirmButtonText: '确定',
                                        callback: action => {

                                        }
                                });
                        }
                },
                getVerify(){



                        let { telphone } = this;
                        console.log(telphone);

                        if (/^1[23456789]\d{9}$/.test(telphone) == false) {
                                this.$alert('请输入正确格式的手机号码', '提示', {
                                        confirmButtonText: '确定',
                                        callback: action => {

                                        }
                                });
                                return;
                        };

                        this.$root.postReq("/web/userCtl/fetchVcode", { mobile: telphone }).then((d) => {
                                console.log(d);
                                this.mobilePhone = telphone;
                                if (d.status == 0) {
                                        this.rcode = d.data.vcodestr;
                                }
                        });
                        this.time = 59;
                        this.disabled = !this.disabled;
                        let count = setInterval(() => {
                                this.time--;
                                if (this.time == 0) {
                                        this.time = "获取验证码";
                                        clearInterval(count);
                                        this.disabled = !this.disabled;
                                }
                        }, 1000);



                }

        },
        vname: "gsb-mobilelog"
}
