updateuserInfo.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <!--#include file="inc/header.html"-->
  2. <style type="text/css">
  3. .window{
  4. background-color: #0F6136;
  5. }
  6. .window, .window .window-body {
  7. border-color: #165634;
  8. }
  9. .combo-arrow {
  10. background-color: #A3CEB7;
  11. }
  12. .window .window-header .panel-tool {
  13. right: 1px;
  14. background: #B8D8A5;
  15. }
  16. .hide{
  17. display: none;
  18. }
  19. .form-left{
  20. width: 500px;
  21. float: left;
  22. }
  23. .form-right{
  24. width: 200px;
  25. min-height: 150px;
  26. float:left;
  27. }
  28. .form-right .pic{
  29. border: 1px solid #CCC;
  30. float: left;
  31. width: 100%;
  32. min-height: 150px;
  33. background: #CCC;
  34. }
  35. #changeInfo{
  36. width: 1200px;
  37. margin: 0 auto;
  38. padding: 20px;
  39. margin-top: 10px;
  40. border: 1px solid rgba(56, 128, 90, 0.14);
  41. min-height: 400px;
  42. }
  43. #changeInfo .item-line{
  44. width: 650px;
  45. display: inline-block;
  46. margin-bottom: 5px;
  47. }
  48. #changeInfo .item-line-t{
  49. width: 100px;
  50. display: inline-block;
  51. margin-bottom: 5px;
  52. }
  53. #changeInfo .item-line-v{
  54. width: 250px;
  55. display: inline-block;
  56. margin-bottom: 5px;
  57. }
  58. #changeInfo input{
  59. width: 200px;
  60. }
  61. div.upload-btn {
  62. width: 100px;
  63. height: 40px;
  64. background: url("/img/upload2.png");
  65. overflow: hidden;
  66. }
  67. div.upload-btn input {
  68. display: block !important;
  69. width: 100px !important;
  70. height: 40px !important;
  71. opacity: 0 !important;
  72. overflow: hidden !important;
  73. }
  74. #upload-info{
  75. color:red;
  76. min-height: 100px;
  77. font-size:16px;
  78. }
  79. </style>
  80. <div class="con-wrap">
  81. <div class="tree-breadcrumb">
  82. <span class="nav-prov">首页</span>&gt;
  83. <span class="nav-prov">个人设置</span>&gt;
  84. <span class="nav-city">修改资料</span>
  85. </div>
  86. <div id="changeInfo" style="padding: 20px;" class="form-left">
  87. <h2>修改资料</h2>
  88. <form class="change-info-form">
  89. <div class="form-left">
  90. <span class="item-line ">
  91. <span class="item-line-t">用户名:</span>
  92. <span class="item-line-v">
  93. <input class="readonly" readonly="true" data-options="required:true" name="name" style="
  94. background-color: #ccc;">
  95. </span>
  96. </span>
  97. <br />
  98. <span class="item-line">
  99. <span class="item-line-t">真实姓名:</span>
  100. <span class="item-line-v"><input class="easyui-textbox" data-options="required:true" name="realname"></span>
  101. </span>
  102. <br />
  103. <span class="item-line">
  104. <span class="item-line-t">生日:</span>
  105. <span class="item-line-v"><input class="easyui-datebox" data-options="required:true" editable="false" name="birthday"></span>
  106. </span>
  107. <br />
  108. <span class="item-line">
  109. <span class="item-line-t">联系电话:</span>
  110. <span class="item-line-v"><input class="easyui-textbox easyui-validatebox" data-options="validType:'length[11,11]',required:true" name="phone">
  111. </span>
  112. </span>
  113. <br />
  114. <span class="item-line">
  115. <span class="item-line-t">地址:</span>
  116. <span class="item-line-v"><input class="easyui-textbox" name="address">
  117. </span>
  118. </span>
  119. <br />
  120. <span class="pf-pitem-li">
  121. <span class="item-line-t">邮箱:</span>
  122. <span class="item-line-v"><input class="easyui-textbox easyui-validatebox" name="email" validType="email" ></span>
  123. </span>
  124. <br />
  125. <a class="easyui-linkbutton bd-add-s userinfo-update-btn" plain="true" style="margin-top: 20px;">确定</a>
  126. </div>
  127. <div class="form-right">
  128. <!--upload start-->
  129. <div class="pic user_pic" id="pic"></div>
  130. <div class="upload-btn">
  131. <input id="upload-file" class="upload" name="file" type="file" >
  132. <input name="avator" id="avator" type="hidden" />
  133. <span class="uploading-bar" id="uploading-bar" ></span>
  134. </div>
  135. <div class="upload-info" id="upload-info"></div>
  136. <!--upload end-->
  137. </div>
  138. </form>
  139. </div>
  140. <div class="bottom-wrap">&copy; 2018 中储粮-单仓档案管理系统 版权所有</div>
  141. <script type="text/javascript">
  142. $(function(){
  143. base.ajaxFunc('get', config.userManage.getCurrentUserInfo, null, function(e){
  144. $('.change-info-form').form('load',e.data);
  145. upload.ajaxFileUpload("#upload-file",".change-info-form","user");
  146. upload.initUploadInfo(".change-info-form",e.data.avator);
  147. // $('#pic').html($("<img />").attr("src", e.data.avator).attr("width", '100%'));
  148. });
  149. $(".userinfo-update-btn").off().on("click",function(e){
  150. e.preventDefault();
  151. var validate = $(".change-info-form").form("validate");
  152. if(!validate){
  153. $.messager.alert('提示', base.tooltip, 'info');
  154. return false;
  155. }
  156. var data = base.filterObjNull($('.change-info-form').serializeArray(), 1);
  157. document.getElementById('avator-img').src = data.avator;
  158. document.getElementById('username').innerText = data.realname;
  159. base.ajaxFunc('post', config.userManage.updateuserinfo, data, function(e) {
  160. //请求成功后的提示
  161. // $(".change-info-form").form('reload');
  162. base.requestTip(e, '#changeInfo', '', 0);
  163. });
  164. });
  165. });
  166. </script>
  167. </body>
  168. </html>