{js:artTemplate}
{js:areaSelect}
{js:my97date}

<div class="main f_r">
	<div class="uc_title m_10">
		<label class="current"><span>个人资料</span></label>
	</div>

	<div class="form_content m_10">
		<div class="uc_title2 m_10"><strong>会员信息</strong></div>
		<dl class="userinfo_box clearfix">
			<dt>
				{set:$user_ico = $this->userRow['head_ico']}
				<a class="ico" href="javascript:void(0);"><img src="{url:$user_ico}" id="user_ico_img" onerror="this.src='{skin:images/front/user_ico.gif}'" width="96" height="96" alt="个人头像" /></a>
				<a class="blue" href="javascript:select_ico();">修改头像</a>
			</dt>
			<dd>
				<table class="form_table" width="100%" cellpadding="0" cellspacing="0">
					<col width="120px" />
					<col />
					<tr>
						<th>登录名：</th><td>{$this->userRow['username']}</td>
					</tr>
					<tr>
						<th>会员等级：</th><td>{if:$this->memberRow['group_id']}{query:name=user_group where=id eq $this->memberRow['group_id']}{$item['group_name']}{/query}{/if}</td>
					</tr>
				</table>
			</dd>
		</dl>
	</div>

	<div class="form_content m_10">
		<div class="uc_title2 m_10"><strong>个人信息</strong></div>
		<form action='{url:/ucenter/info_edit_act}' method='post' name='user_info'>
			<table class="form_table" width="100%" cellpadding="0" cellspacing="0">
				<col width="120px" />
				<col />

				<tr>
					<th></th>
					<td style="font-size:16px; font-weight: bolder;color:red;">真实姓名、证件号码修改，请联系官方客服</td>
				</tr>

				<!-- add by Scott Chen on 2017-11-03  -->
				<!-- id_type beg -->
				<tr>
					<th>真实姓名：</th>
					<td>
						<input class='normal' type="text" name="true_name" value="{$this->memberRow['true_name']}" readonly style="background-color: #e4e4e4"/>
					</td>
				</tr>
				<tr>
					<th>证件类型：</th>
					<td>
						{if:$this->memberRow['id_type']=='1'}身份证{elseif:$this->memberRow['id_type']==null || empty($this->memberRow['id_type'])}-{else:}其它{/if}
					</td>
				</tr>
				<tr>
					<th>证件号码：</th>
					<td>
						<input class='normal' name='id_code' type="text" value="{$this->memberRow['id_code']}" readonly style="background-color: #e4e4e4">
					</td>
				</tr>
				<!-- id_type end -->

				<tr>
					<th>性别：</th>
					<td>
						<label class='attr'><input type='radio' name='sex' value='1' />男</label>
						<label class='attr'><input type='radio' name='sex' value='2' checked=checked />女</label>
					</td>
				</tr>
				<tr>
					<th>出生日期：</th>
					<td>
						<input type="text" name="birthday" class="Wdate" pattern='date' empty onFocus="WdatePicker()" />
					</td>
				</tr>
				<tr>
					<th>所在地区：</th>
					<td>
						<select name="province" child="city,area"></select>
						<select name="city" child="area"></select>
						<select name="area"></select>
					</td>
				</tr>
				<tr>
					<th>联系地址：</th>
					<td><input type='text' class='normal' name='contact_addr' alt='请填写联系地址' /></td>
				</tr>
				<tr>
					<th>手机号码：</th>
					<td><input class="normal" type="text" name='mobile' pattern='mobi' empty alt='请填写正确的手机号码' /></td>
				</tr>
				<tr>
					<th>邮箱：</th>
					<td>
						<input type='text' class='normal' name='email' pattern='email' empty alt='请填写正确的邮箱地址' />
					</td>
				</tr>
				<tr>
					<th>邮编：</th>
					<td><input type='text' class='normal' name='zip' pattern='zip' empty alt='请填写正确的邮政编码' /></td>
				</tr>
				<tr>
					<th>固定电话：</th>
					<td><input class="normal" type="text" name='telephone' pattern='phone' empty alt='请填写正确的固定电话' /></td>
				</tr>
				<tr>
					<th>QQ：</th>
					<td><input class="normal" type="text" name='qq' pattern='qq' empty alt='请填写正确的QQ号' /></td>
				</tr>
				<tr><th></th><td><label class="btn"><input type="submit" value="保存基本信息" /></label></td></tr>
			</table>
		</form>
	</div>
</div>

<script type='text/javascript'>
//修改头像
function select_ico()
{
	{set:$callback = urlencode(IUrl::creatUrl('/ucenter/user_ico_upload'))}
	art.dialog.open('{url:/block/photo_upload?callback=$callback}',
	{
		'id':'user_ico',
		'title':'设置头像',
		'ok':function(iframeWin, topWin)
		{
			iframeWin.document.forms[0].submit();
			return false;
		}
	});
}

//头像上传回调函数
function callback_user_ico(content)
{
	var content = eval(content);
	if(content.isError == true)
	{
		alert(content.message);
	}
	else
	{
		$('#user_ico_img').prop('src',content.data);
	}
	art.dialog({id:'user_ico'}).close();
}

//表单回填
var areaInstance = new areaSelect('province');
{if:$this->memberRow}
{set:$area = explode(',',trim($this->memberRow['area'],','))}
areaInstance.init({"province":"{$area[0]}","city":"{$area[1]}","area":"{$area[2]}"});
{else:}
areaInstance.init();
{/if}

var formObj = new Form('user_info');
formObj.init({echo:JSON::encode($this->memberRow)});
</script>