;
jqMultipleShow("click", ".navList", ".tab", ".con");

var helpSuggestion = new Vue({
    el: "#suggestion",
    data: {
        btnLoading: false,
        userId: 0,
        suggestion: {
            type: 1,
            title: "",
            content: "",
            name: "",
            phone: ""
        },
        rule:{
            name: '^[a-zA-Z\\u4e00-\\u9fa5]{2,}$',
            phone: '^\\d{6,12}$'
        }
    },
    methods: {
        blurHandle: function(event) { // 失去焦点校验
            var el = event.currentTarget;
            verifyHandle(el);
        },
        postSuggestion: function () {  // 账号登录
            var _self = this;
            var pass = verifyForm();
            if (this.btnLoading) {
                return false;
            }
            this.$nextTick(function () {
                if (!pass) {
                    return false;
                }
                _self.btnLoading = true;
                var params = {
	                suggestionTypeID: _self.suggestion.type,
	                userID: _self.userId,
	                title: _self.suggestion.title,
	                content: _self.suggestion.content,
	                linkMan: _self.suggestion.name,
	                mobile: _self.suggestion.phone
                };
                console.log(JSON.stringify(params));
                $.post("/help/suggestion", params, function(res){
                     alertInfo(res.msg);
                    _self.btnLoading = false;
                });
            });
        }

    },
    mounted: function () {
        if(globalUserData){
            this.userId = globalUserData.userId;
        }
    }
});
