{
        template: '${tmpl}',
                data: function() {
                        return {
                                name:null,
                                phone:null,
                                email:null,
                                address:null,
                                money:null,
                                count:1,
                                num:12500,
                                fapiao:"代开普通发票",
                                fapiaoList: ["代开普通发票","代开专用发票"],
                                type: "按次购买",
                                typeList: ["按次购买","按年购买"],
                                dailog1:false,
                                dailog2:false,
                                dailog3:false
                        }
                },
        mounted: function() {
                
        },
        created: function() {
                this.money = this.num; 
        },
        methods: {
                addCount(){
                        this.count++;
                        this.money = this.count * this.num;
                },
                reduceCount(){
                        if(this.count <= 1)return;
                        this.count--;
                        this.money = this.count * this.num;
                },
                fapiaoChange(){
                        this.dailog1 = true;
                },
                fapiaoListCheckout(fapiao){
                        this.dailog1 = false;
                        this.fapiao = fapiao;
                },
                fapiaoShow(){
                        this.dailog1 = false;
                },
                typeChange(){
                        this.dailog2 = true;
                },
                typeShow(){
                        this.dailog2 = false;
                },
                typeListCheckout(type){
                        this.dailog2 = false;
                        this.type = type;
                        this.count = 1;
                        this.money = this.count * this.num;
                },
                submitShow(){
                        this.dailog3 = false;
                },
                submit(){
                        let resPhone = /^1[3456789]\d{9}$/;
                        let resEmail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
                        if(!resPhone.test(this.phone)){
                                this.$message({
                                        message: '手机号输入不正确',
                                        type: 'warning'
                                });
                                return;
                        }
                        if(!resEmail.test(this.email)){
                                this.$message({
                                        message: '邮箱输入不正确',
                                        type: 'warning'
                                });
                                return;
                        }
                        this.dailog3 = true;
                }
        },
        vname: "gsb-invoice"
}
