Bez popisu

personal.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <script src="Script/Common/huayi.load.js"></script>
  7. <script src="Script/Common/huayi.config.js"></script>
  8. <title>个人中心</title>
  9. <!--[if lt IE 9]>
  10. <meta http-equiv="refresh" content="0;ie.html" />
  11. <![endif]-->
  12. <link href="./css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
  13. <link href="./css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  14. <link href="./css/animate.min.css" rel="stylesheet">
  15. <link href="./css/style.min862f.css?v=4.1.0" rel="stylesheet">
  16. <!--<link rel="stylesheet" href="js/cropper/cropper.css" />-->
  17. <link href="./css/plugins/cropper/cropper.min.css" rel="stylesheet">
  18. <link href="./css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
  19. <style>
  20. .clearFix:after {
  21. content: "";
  22. display: block;
  23. clear: both;
  24. }
  25. .personal {
  26. width: 500px;
  27. margin: 0 auto;
  28. font-size: 14px;
  29. }
  30. .perBox {
  31. border: 1px solid #eeeeee;
  32. height: 400px;
  33. }
  34. .ptop {
  35. height: 35px;
  36. background: #2f4050;
  37. color: #fff;
  38. line-height: 35px;
  39. padding: 0 15px;
  40. border-top-left-radius: 3px;
  41. border-top-right-radius: 3px;
  42. }
  43. .ptop .ptl {
  44. float: left;
  45. margin: 0;
  46. }
  47. .ptop .ptr {
  48. float: right;
  49. font-size: 18px;
  50. cursor: pointer;
  51. margin: 0;
  52. }
  53. .perTab {
  54. width: 100%;
  55. border-bottom: 1px solid #b3b3b3;
  56. list-style: none;
  57. padding: 0 12px;
  58. margin-top: 15px;
  59. }
  60. .perTab li {
  61. float: left;
  62. padding: 7px;
  63. cursor: pointer;
  64. }
  65. .sel {
  66. border-top: 1px solid #b3b3b3;
  67. border-left: 1px solid #b3b3b3;
  68. border-right: 1px solid #b3b3b3;
  69. border-top-left-radius: 3px;
  70. border-top-right-radius: 3px;
  71. }
  72. .grt {
  73. width: 90%;
  74. margin: 0 auto;
  75. border-bottom: 1px solid #999999;
  76. }
  77. .grtl {
  78. float: left;
  79. }
  80. .grtr {
  81. float: right;
  82. }
  83. .grtr i{
  84. display: inline-block;
  85. vertical-align: middle;
  86. width: 18px;
  87. height: 18px;
  88. cursor: pointer;
  89. }
  90. .grqx{
  91. background: url(img/grcx.png) no-repeat;
  92. margin-right: 5px;
  93. }
  94. .grbj{
  95. background: url(img/bjic.png) no-repeat;
  96. }
  97. .grzl {
  98. font-size: 14px;
  99. border: 0;
  100. width: 80%;
  101. margin: 35px auto;
  102. }
  103. .grzl tr {
  104. border: 0;
  105. }
  106. .grzl th {
  107. padding: 5px 8px 5px 0;
  108. text-align: right;
  109. width: 45%;
  110. font-weight: normal;
  111. border: 0;
  112. }
  113. .grzl tbody > tr > td,
  114. .grzl tbody > tr > th {
  115. border: 0;
  116. }
  117. .grzl tbody > tr > td input {
  118. border: 0;
  119. outline: none;
  120. padding-left: 5px;
  121. width: 50%;
  122. }
  123. .crop_left {
  124. width: 40%;
  125. float: left;
  126. }
  127. .image-crop {
  128. width: 100%;
  129. }
  130. .crop_left img {
  131. width: 100%;
  132. }
  133. .crop_right {
  134. width: 30%;
  135. float: right;
  136. margin-right: 25px;
  137. }
  138. .img-preview-sm {
  139. width: 100%;
  140. }
  141. .img-preview-sm img {
  142. width: 100%;
  143. height: 100%;
  144. }
  145. .perTab_con > div {
  146. display: none;
  147. }
  148. .btnn {
  149. background: #2f4050;
  150. color: #fff;
  151. padding: 3px 10px;
  152. border: 0;
  153. border-radius: 3px;
  154. cursor: pointer;
  155. }
  156. .wrong {
  157. color: red;
  158. display: none;
  159. }
  160. </style>
  161. </head>
  162. <body class="gray-bg" style="background: #fefefe;">
  163. <div class="personal">
  164. <div class="ptop clearFix">
  165. <p class="ptl">个人中心</p>
  166. <p class="ptr" title="关闭">x</p>
  167. </div>
  168. <div class="perBox ">
  169. <ul class="perTab clearFix">
  170. <li class="sel">个人资料</li>
  171. <li>修改头像</li>
  172. </ul>
  173. <div class="perTab_con">
  174. <div class="geRen" style="display: block;">
  175. <div class="grt clearFix">
  176. <p class="grtl">基本资料</p>
  177. <p class="grtr">
  178. <i class="grqx" title="取消编辑"></i>
  179. <i class="grbj" title="编辑资料"></i>
  180. </p>
  181. </div>
  182. <table class="table grzl">
  183. <tr>
  184. <th>我的工号:</th>
  185. <td><input type="text" value="00000" class="mgh" /></td>
  186. </tr>
  187. <tr>
  188. <th>我的姓名:</th>
  189. <td><input type="text" value="小白" class="mn" /></td>
  190. </tr>
  191. <tr>
  192. <th>原密码:</th>
  193. <td><input type="password" value="123456" class="spwd" /></td>
  194. </tr>
  195. <tr>
  196. <th>新密码:</th>
  197. <td><input type="password" value="123456" class="npwd" /></td>
  198. </tr>
  199. <tr>
  200. <th>确认密码:</th>
  201. <td><input type="password" value="123456" class="epwd" /><span class="wrong">*密码不一致</span></td>
  202. </tr>
  203. <tr>
  204. <th></th>
  205. <td><button class="btnn grbtn">保存修改</button></td>
  206. </tr>
  207. </table>
  208. </div>
  209. <div class="crop ">
  210. <div class="clearFix" style="margin-top: 45px;">
  211. <div class="crop_left">
  212. <div class="image-crop">
  213. <img src="./img/gaga.jpg">
  214. </div>
  215. </div>
  216. <div class="crop_right">
  217. <h4>图片预览:</h4>
  218. <div class="img-preview img-preview-sm"></div>
  219. </div>
  220. </div>
  221. <!--<div class="btn-group">
  222. <label title="上传图片" for="inputImage" class="btn btn-primary">
  223. <input type="file" accept="image/*" name="file" id="inputImage" class="hide"> 本地上传
  224. </label>-->
  225. <!--<label title="下载图片" id="download" class="btn btn-primary">下载</label>-->
  226. <!--</div>
  227. <div class="btn-group">-->
  228. <!--<button class="btn btn-white" id="zoomIn" type="button">放大</button>-->
  229. <!--<button class="btn btn-white" id="zoomOut" type="button">缩小</button>-->
  230. <!--<button class="btn btn-white" id="rotateLeft" type="button">左旋转</button>-->
  231. <!--<button class="btn btn-white" id="rotateRight" type="button">右旋转</button>-->
  232. <!--<button class="btn btn-warning " id="setDrag" type="button">裁剪</button>
  233. </div>-->
  234. <div class="anniu" style="margin-top: 75px;text-align: center;">
  235. <label title="上传图片" for="inputImage" class="btnn" style="margin-right: 100px;">
  236. <input type="file" accept="image/*" name="file" id="inputImage" class="hide"> 本地上传
  237. </label>
  238. <!--<button class="btn btn-warning " id="setDrag" type="button">裁剪</button>-->
  239. <button class="btnn" id="zoomIn" type="button">放大</button>
  240. <button class="btnn" id="zoomOut" type="button">缩小</button>
  241. <button class="btnn" id="rotateLeft" type="button">左旋转</button>
  242. <button class="btnn" id="rotateRight" type="button">右旋转</button>
  243. <button class="btnn" id="setDrag" type="button">确定保存</button>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. <script src="./js/jquery.min.js"></script>
  250. <script src="./js/bootstrap.min.js?v=3.3.6"></script>
  251. <script src="./js/jquery.cookie.js"></script>
  252. <script src="./js/plugins/datapicker/bootstrap-datepicker.js"></script>
  253. <script src="./js/plugins/cropper/cropper.min.js"></script>
  254. <script>
  255. //tab切换
  256. $('.perTab li').click(function () {
  257. $(this).addClass('sel').siblings().removeClass('sel');
  258. var index = $(this).index();
  259. $('.perTab_con').children('div').eq(index).show().siblings().hide();
  260. })
  261. //编辑个人资料
  262. $('.grzl tbody>tr>td input').attr('readonly', true);
  263. $('.grbj').click(function () {
  264. $('.grzl tbody>tr>td input').attr('readonly', false);
  265. $('.grzl tbody>tr>td input').css('border-bottom', "1px solid #b3b3b3");
  266. })
  267. //取消编辑
  268. $('.grqx').click(function(){
  269. $('.grzl tbody>tr>td input').attr('readonly', true);
  270. $('.grzl tbody>tr>td input').css('border-bottom', "none");
  271. })
  272. //关闭按钮
  273. $('.ptr').click(function () {
  274. $('.personal').hide();
  275. })
  276. $('.grbtn').click(function () {
  277. var gh = $('.mgh').val();
  278. var xm = $('.mn').val();
  279. var ymm = $('.spwd').val();
  280. var xmm = $('.npwd').val();
  281. var qmm = $('.epwd').val();
  282. if (xmm !== qmm) {
  283. $('.wrong').show();
  284. $('.npwd').val('')
  285. $('.epwd').val('')
  286. } else {
  287. $('.wrong').hide();
  288. $('.grzl tbody>tr>td input').attr('readonly', true);
  289. $('.grzl tbody>tr>td input').css('border-bottom', "none");
  290. //console.log("工号:" + gh + "," + "姓名:" + xm + "," + "原密码:" + ymm + "," + "新密码:" + xmm + "," + "确认密码:" + qmm + ",");
  291. }
  292. })
  293. //图片裁剪
  294. var o = $(".image-crop > img");
  295. $(o).cropper({
  296. aspectRatio: 1 / 1,
  297. resizable:false,
  298. preview: ".img-preview",
  299. done: function () { }
  300. });
  301. var r = $("#inputImage");
  302. if (window.FileReader) {
  303. r.change(function () {
  304. var e, i = new FileReader, t = this.files;
  305. if (t.length && (e = t[0], /^image\/\w+$/.test(e.type))) {
  306. i.readAsDataURL(e);
  307. i.onload = function () {
  308. r.val("");
  309. o.cropper("reset", !0).cropper("replace", this.result);
  310. }
  311. } else {
  312. alert("请选择图片文件");
  313. }
  314. });
  315. $("#setDrag").click(function () {
  316. o.cropper("setDragMode", "crop");
  317. var img = o.cropper("getDataURL");
  318. $.post('http://localhost:63662/Index/UploadTX64', { dataurl: encodeURIComponent(img), "token": $.cookie("token") }, function (result) {
  319. result = $.parseJSON(result);
  320. if (result.state.toLowerCase() == "success") {
  321. }
  322. })
  323. });
  324. $("#zoomIn").click(function () {
  325. o.cropper("zoom", .1)
  326. });
  327. $("#zoomOut").click(function () {
  328. o.cropper("zoom", -.1)
  329. });
  330. $("#rotateLeft").click(function () {
  331. o.cropper("rotate", 45)
  332. });
  333. $("#rotateRight").click(function () {
  334. o.cropper("rotate", -45)
  335. });
  336. }
  337. else {
  338. r.addClass("hide");
  339. }
  340. </script>
  341. </body>
  342. </html>