(function(KDApi,$){

    function MyComponent(model){
        this._setModel(model);
    }

    MyComponent.prototype = {
        _setModel: function(model) {
            this.model = model;
        },
        init:function(props){
          setHtml(this.model,props);
        },
        update:function(props){
        },
        destoryed:function(){
        }

    }

    var setHtml = function(model,props){
        KDApi.loadFile('./css/loginOffer.css',model,() => {
            KDApi.templateFilePath('./html/loginOffer.html',model,null).then(result => {
                model.dom.innerHTML = result
                initEvent(model,props);
            })
        })                
    }
    var initEvent = function(model,props){
		$('#login', model.dom).click(function(){
			// 调用登录offer接口
            model.invoke('loginOffer',"");

        })
    }   
	
    KDApi.register('loginOffer', MyComponent)
})(window.KDApi,jQuery);