/**
 * 调用组件
 */
var KS_Components = new KS_GetCompoents()
var getUserInfo = KS_Components.getUserInfo;
var addToCourseCart = KS_Components.addToCourseCart;
var gotozan = KS_Components.gotozan;
var getzan = KS_Components.getzan;
var getcollect = KS_Components.getcollect;
var collect = KS_Components.collect;
var replaceDefaultImg = KS_Components.replaceDefaultImg;
var imagesZoomIn = KS_Components.imagesZoomIn;
var getArtTemplate = KS_Components.getArtTemplate;
var popup = KS_Components.popup;

getUserInfo(function(res){
	var str = '<div class="haed-user"><img src="/UploadFiles/avatar/' + res.userid + '.jpg" class="m-avatar" type="user"/>' + (res.realname || res.username) + '<div class="u-navdropmenu"><span><a href="'+res.url_home+'" target="_blank"><i class="iconfont eduicon-shouye"></i>我的主页</a></span><span><a href="'+res.url_edit+'" target="_blank"><i class="iconfont eduicon-bianji"></i>修改资料</a></span><span><a href="'+res.url_loginout+'" target="_blank"><i class="iconfont eduicon-web-quit"></i>退出</a></span></div></div>';
	$("#PopLoginTips").html(str);
	$('.haed-user').hover(function () {
		$(this).find('.u-navdropmenu').show();
	}, function () {
		$(this).find('.u-navdropmenu').hide();
	});
	dealingWithAnErrorPicture($('#PopLoginTips').find('img'))
},function(res){
	//用户未登录
	var str = '<div class="top-bar-user" id="PopLoginTips"><a href="'+res.url_login+'" class="login-icon">登录</a><a href="'+res.url_reg+'" target="_blank" class="reg-icon">注册</a></div>';
	$("#PopLoginTips").html(str);
});

