(function(){
    X.pageLogic['addproduct'] = {
        init : function(parms){
            var me = this;
            this.parms = parms;
            this.callback = parms.callback; //选择后执行的回调
           
            $(document).off('click','.newwenjian-qd').on('click','.newwenjian-qd',function(){
                if($("#game").val() == "" && $("#name").val() == ""){
                    layer.msg('标题，路径为必填项');
                    return;
                }
                var arr = {
                    "name": $("#name").val(),
                    "game": $("#game").val(),
                }
                X.api('project/create','post',arr,function(d){
                    layer.closeAll();
                    me.callback && me.callback();
                });
             
                
            });

            $(document).off('click','.newwenjian-qx').on('click','.newwenjian-qx',function(){
                layer.closeAll();
            });

            $(document).off('click','.newwenjian-cha').on('click','.newwenjian-cha',function(){
                layer.closeAll();
            });
            
        
        }
    };
})();