<!--{assign var="menu_id" value="cp"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}-->
<div class="oe_ntop">
  <i class="iconfont" onclick="goBack();">&#xe616;</i>
  <p>修改资料</p>
</div>
<div class="oe_img_loading" id="img_loading"> <span> </span> </div>
<div class="oe_pro">
  <dl class="loadhead">
    <dt>
	  <span><img id="img_preview" src="<!--{$login.user.headimgurl}-->" /></span>
      <label class="_uploadbtn"><input style="height:55px;" type="file" name="img" id="img" value="" /></label>
    </dt>
    <dd>
      <p><span>上传头像</span></p>
	  <i class="iconfont">&#xe615;</i>
	</dd>
  </dl>

  <script type="text/javascript">
  $(function(){   
	//上传
	$(document).on("change", "#img", function(){
		oemarryUploadImg("img", "<!--{$oefile}-->&c=<!--{$c}-->&a=uploadavatar");
	});
  });
  </script>


  <dl>
    <dt>地区</dt>
    <dd>
      <p>
        <span>
        <!--{area type='select' name='area' depth='1' child='1' text='选择' value=$login.user.area1}-->
        <em id="json_area2">
          <!--{if $login.user.area1 > 0}-->
          <!--{area type='select' name='area' depth='2' child='1' text='选择' parentid=$login.user.area1 value=$login.user.area2}-->
          <!--{else}-->
          <select name="area2" id="area2"><option value="">选择</option></select>
          <!--{/if}-->
        </em>
        <em id="json_area3">
          <!--{if $login.user.area2 > 0}-->
          <!--{area type='select' name='area' depth='3' child='1' text='=请选择=' parentid=$login.user.area2 value=$login.user.area3}-->
          <!--{else}-->
          <select name="area3" id="area3"><option value="">=请选择=</option></select>
          <!--{/if}-->
        </em>
        <em></em>
        </span>
      </p>
	  <i style="display:none;" class="iconfont">&#xe615;</i>
	</dd>
  </dl>

  <dl>
    <dt>地址</dt>
    <dd>
	  <span><input type="text" name="address" id="address" placeholder="填写地址" value="<!--{$login.user.address}-->" /></span>
	</dd>
  </dl>

  <dl>
    <dt>性别</dt>
    <dd>
      <p>
        <span>
          <select name="gender" id="gender">
          <option value="">请选择</option>
            <option value="1"<!--{if $login.user.gender == '1'}--> checked<!--{/if}-->>男</option>
          <option value="2"<!--{if $login.user.gender == '1'}--> checked<!--{/if}-->>女</option>
          </select>
        </span>
      </p>
	  <i style="display:none;" class="iconfont">&#xe615;</i>
	</dd>
  </dl>

  <dl>
    <dt>联系人</dt>
    <dd>
      <p>
        <span><input type="text" name="realname" id="realname" placeholder="填写联系人" value="<!--{$login.user.realname}-->" /></span>
      </p>
	</dd>
  </dl>
  <dl>
    <dt>个性签名</dt>
    <dd>
      <textarea name="intro" id="intro" style="width:95%;height:80px;"><!--{$login.user.intro}--></textarea>
    </dd>
  </dl>
</div>

<div class="cp_button"><span f="but_submit">提交保存</span></div>

<script type="text/javascript">
$(function(){
	//提交
	$(document).on("click", "[f='but_submit']", function(){
		$area1 = $("#area1").find("option:selected").val();
		$area2 = $("#area2").find("option:selected").val();
		$area3 = $("#area3").find("option:selected").val();
		$address = $("#address").val();
		$gender = $("#gender").find("option:selected").val();
		$realname = $("#realname").val();
		$intro = $("#intro").val();
		
		$_urlitems = "&area1="+encodeURIComponent($area1)+"&area2="+encodeURIComponent($area2)+"&area3="+encodeURIComponent($area3)+"&gender="+encodeURIComponent($gender)+"&address="+encodeURIComponent($address)+"&realname="+encodeURIComponent($realname)+"&intro="+encodeURIComponent($intro)+"";
		$_url = WAP_APPFILE + "&c=<!--{$c}-->&a=saveedit"+$_urlitems;
		$post_json = {"url":$_url, "success_text":"保存成功", "fail_text":"保存失败"};
		_oemarryAjaxPost($post_json);

	});
});
</script>
</body>
</html>