<?php if(!defined('IN_SDCMS')) exit;?>
{php $self_name='会员中心'}
{include file="mobile/include/top.php"}
<title>{$self_name}_{sdcms[web_name]}</title>
<meta name="keywords" content="{sdcms[seo_key]}">
<meta name="description" content="{sdcms[seo_desc]}">
</head>

<body>
	
	{include file="mobile/include/head.php"}
	{sdcms:rs top="1" table="sd_user left join sd_user_group on sd_user.uid=sd_user_group.gid" where="id=$userid"}
	<div class="mwidth">
		<div class="bg-white p-15">
			<ul class="media-list media-border-none">
				<li class="media">
					<div class="media-img mr-20 radius">
						<img src="{if !isempty($rs[uface])}{$rs[uface]}{else}{WEB_ROOT}upfile/noface.gif{/if}" class="dropzone" id="uface" config="uface" url="{U('face','','',1)}" maxsize="{sdcms[upload_image_max]}" width="64" height="64">
					</div>
					<div class="media-body">
						<div class="media-header mt-sm">{get_user_info('uname')}</div>
						<div class="media-text text-gray">{$rs[gname]}</div>
					</div>
				</li>
			</ul>
		</div>
	</div>
	
	<div class="mwidth bg-white mt">
		<ul class="list">
			<li><a href="javascript:;"><i class="ui-icon-moneycollect text-blue ml-sm mr-sm"></i> 账户余额</a><div class="list-right"><span class="badge badge-red">{$rs[umoney]}</span><span class="arrow"></span></div></li>
			<li><a href="{N('mymoney')}"><i class="ui-icon-pay text-blue ml-sm mr-sm"></i> 财务明细</a><div class="list-right"><a href="{N('pay')}" class="btn btn-sm btn-blue">充值</a><span class="arrow"></span></div></li>
			
		</ul>
	</div>
	
	<div class="mwidth bg-white mt">
		<ul class="list">
			<li><a href="{N('myorder')}"><i class="ui-icon-cart text-blue ml-sm mr-sm"></i> 我的订单</a><div class="list-right"><span class="arrow"></span></div></li>
			<li><a href="{N('editemail')}"><i class="ui-icon-mail text-blue ml-sm mr-sm"></i> 修改邮箱</a><div class="list-right"><span class="arrow"></span></div></li>
			<li><a href="{N('editpass')}"><i class="ui-icon-lock text-blue ml-sm mr-sm"></i> 修改密码</a><div class="list-right"><span class="arrow"></span></div></li>
		</ul>
	</div>
	
	{if !(isweixin() && C('api_wx_open')==1)}
	<div class="mwidth bg-white mt">
		<ul class="list">
			<li><a href="{N('out')}"><i class="ui-icon-logout text-blue ml-sm mr-sm"></i> 退出登录</a><div class="list-right"><span class="arrow"></span></div></li>
		</ul>
	</div>
	{/if}
	
	{/sdcms:rs}
	<div class="pt-15 mt"></div>
	{include file="mobile/include/foot.php"}
	<script src="{WEB_ROOT}public/js/dropzone.js"></script>
	<script>
    $(function()
    {
		$("#bar_user").addClass("active");
		$(".topbar-title").html("{$self_name}");
	});
	$(".dropzone").dropzone(
	{
		maxFiles:1,
		success:function(file,data,that)
		{
			data=jQuery.parseJSON(data);
			this.removeFile(file);
			if(data.state=="success")
			{
				sdcms.success("上传成功");
				$(that).attr("src",data.msg);
				$("#face").attr("src",data.msg);
			}
			else
			{
				sdcms.error("上传失败："+data.msg);
			}
		},
		sending:function(file)
		{
			sdcms.loading("正在上传，请稍等");
		},
		totaluploadprogress:function(progress)
		{
			$.progress((Math.round(progress*100)/100)+"%");
		},
		queuecomplete:function(progress)
		{
			$.progress('close');
		},
		error:function(file,msg)
		{
			sdcms.error(msg);
		}
	});
    </script>
	
</body>
</html>
