中鑫之宝5.0前端

Index-Personal.html 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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. <meta name="renderer" content="webkit|ie-comp|ie-stand" />
  7. <meta http-equiv="Cache-Control" content="no-siteapp" />
  8. <title>华谊科技呼叫中心管理系统</title>
  9. <script src="./Script/Common/huayi.load.js"></script>
  10. <script src="./Script/Common/huayi.config.js"></script>
  11. <link rel="shortcut icon" href="img/32.ico" />
  12. <link href="./css/wh.css" rel="stylesheet">
  13. <link rel="stylesheet" href="./css/personal.css" />
  14. <link href="./css/plugins/cropper/cropper.min.css" rel="stylesheet">
  15. <link href="./css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
  16. <title></title>
  17. </head>
  18. <body>
  19. <div class="personal">
  20. <div class="ptop clearFix">
  21. <p class="ptl">个人中心</p>
  22. <p class="ptr" title="关闭">x</p>
  23. </div>
  24. <div class="perBox " style="height:500px;">
  25. <ul class="perTab clearFix">
  26. <li class="sel">个人资料</li>
  27. <li>修改头像</li>
  28. </ul>
  29. <div class="perTab_con">
  30. <div class="geRen" style="display: block;">
  31. <div class="grt clearFix">
  32. <p class="grtl">基本资料</p>
  33. <p class="grtr">
  34. <i class="grqx" title="取消编辑"></i>
  35. <i class="grbj" title="编辑资料"></i>
  36. </p>
  37. </div>
  38. <table class="table grzl">
  39. <tr>
  40. <th>我的工号:</th>
  41. <td><input type="text" class="mgh" readonly="readonly" /></td>
  42. </tr>
  43. <tr>
  44. <th>我的姓名:</th>
  45. <td><input type="text" class="mn" readonly="readonly" /></td>
  46. </tr>
  47. <tr>
  48. <th>分机号:</th>
  49. <td><input type="text" class="fenji" readonly="readonly" /></td>
  50. </tr>
  51. <!--<tr>
  52. <th>外线号码:</th>
  53. <td><input type="text" class="wxno" readonly="readonly" /></td>
  54. </tr>-->
  55. <tr>
  56. <th>原密码:</th>
  57. <td><input type="password" class="spwd zhidu" /></td>
  58. </tr>
  59. <tr>
  60. <th>新密码:</th>
  61. <td><input type="password" class="npwd zhidu" /></td>
  62. </tr>
  63. <tr>
  64. <th>确认密码:</th>
  65. <td><input type="password" class="epwd zhidu" /><span class="wrong">*密码不一致</span></td>
  66. </tr>
  67. <tr>
  68. <th>手机号:</th>
  69. <td><input type="text" class="mobile zhidu" /></td>
  70. </tr>
  71. <tr>
  72. <th></th>
  73. <td><button class="btnn grbtn">保存修改</button></td>
  74. </tr>
  75. </table>
  76. </div>
  77. <div class="crop ">
  78. <div class="clearFix" style="margin-top: 45px;">
  79. <div class="crop_left">
  80. <div class="image-crop">
  81. <img src="./img/gaga.jpg">
  82. </div>
  83. </div>
  84. <div class="crop_right">
  85. <h4>图片预览:</h4>
  86. <div class="img-preview img-preview-sm"></div>
  87. </div>
  88. </div>
  89. <!--<div class="btn-group">
  90. <label title="上传图片" for="inputImage" class="btn btn-primary">
  91. <input type="file" accept="image/*" name="file" id="inputImage" class="hide"> 本地上传
  92. </label>-->
  93. <!--<label title="下载图片" id="download" class="btn btn-primary">下载</label>-->
  94. <!--</div>
  95. <div class="btn-group">-->
  96. <!--<button class="btn btn-white" id="zoomIn" type="button">放大</button>-->
  97. <!--<button class="btn btn-white" id="zoomOut" type="button">缩小</button>-->
  98. <!--<button class="btn btn-white" id="rotateLeft" type="button">左旋转</button>-->
  99. <!--<button class="btn btn-white" id="rotateRight" type="button">右旋转</button>-->
  100. <!--<button class="btn btn-warning " id="setDrag" type="button">裁剪</button>
  101. </div>-->
  102. <div class="anniu" style="margin-top: 75px;text-align: center;">
  103. <label title="上传图片" for="inputImage" class="btnn" style="margin-right: 100px;">
  104. <input type="file" accept="image/jpeg,image/jpg,image/png" name="file" id="inputImage" class="hide"> 本地上传
  105. </label>
  106. <!--<button class="btn btn-warning " id="setDrag" type="button">裁剪</button>-->
  107. <button class="btnn" id="zoomIn" type="button">放大</button>
  108. <button class="btnn" id="zoomOut" type="button">缩小</button>
  109. <button class="btnn" id="rotateLeft" type="button">左旋转</button>
  110. <button class="btnn" id="rotateRight" type="button">右旋转</button>
  111. <button class="btnn" id="setDrag" type="button">确定保存</button>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <script src="./js/plugins/pace/pace.min.js"></script>
  118. <script src="./js/plugins/iCheck/icheck.min.js"></script>
  119. <script src="./css/laydate/laydate.js"></script>
  120. <script src="./js/main.js?v=1.5"></script>
  121. <script src="./js/zTree/jquery.ztree.core.js"></script>
  122. <script src="./js/plugins/datapicker/bootstrap-datepicker.js"></script>
  123. <script src="./js/plugins/cropper/cropper.min.js"></script>
  124. <script src="./js/guid.js"></script>
  125. <script>
  126. $('.shezhi').click(function() {
  127. $('.personal').show();
  128. $.ajax({
  129. type: "get",
  130. url: huayi.config.callcenter_url + "UserAccount/GetNowUser",
  131. async: true,
  132. dataType: 'json',
  133. data: {
  134. token: $.cookie("token")
  135. },
  136. success: function(result) {
  137. if(result.state.toLowerCase() == "success") {
  138. var con = result.data.user;
  139. console.log(con)
  140. $('.mgh').val(con.F_UserId);
  141. $('.mn').val(con.F_UserName);
  142. $('.mobile').val(con.F_Mobile);
  143. $('.fenji').val($.cookie("extno"));
  144. //$('.wxno').val(con.F_WXNo);
  145. // $('.spwd').val(con.F_Password);
  146. }
  147. }
  148. });
  149. })
  150. //tab切换
  151. $('.perTab li').click(function() {
  152. $(this).addClass('sel').siblings().removeClass('sel');
  153. var index = $(this).index();
  154. $('.perTab_con').children('div').eq(index).show().siblings().hide();
  155. })
  156. //编辑个人资料
  157. $('.grzl tbody>tr>td input.zhidu').attr('readonly', true);
  158. $('.grbj').click(function() {
  159. $('.grzl tbody>tr>td input.zhidu').attr('readonly', false);
  160. $('.grzl tbody>tr>td input.zhidu').css('border-bottom', "1px solid #b3b3b3");
  161. })
  162. //取消编辑
  163. $('.grqx').click(function() {
  164. $('.grzl tbody>tr>td input.zhidu').attr('readonly', true);
  165. $('.grzl tbody>tr>td input.zhidu').css('border-bottom', "none");
  166. })
  167. //关闭按钮
  168. $('.ptr').click(function() {
  169. $('.personal').hide();
  170. })
  171. //修改密码
  172. $('.grbtn').click(function() {
  173. var gh = $('.mgh').val();
  174. var xm = $('.mn').val();
  175. var ymm = $('.spwd').val();
  176. var xmm = $('.npwd').val();
  177. var qmm = $('.epwd').val();
  178. if(xmm !== qmm) {
  179. $('.wrong').show();
  180. $('.npwd').val('')
  181. $('.epwd').val('')
  182. } else if(xmm == '') {
  183. layer.msg("密码不允许为空!");
  184. } else {
  185. $('.wrong').hide();
  186. $('.grzl tbody>tr>td input').attr('readonly', true);
  187. $('.grzl tbody>tr>td input').css('border-bottom', "none");
  188. $.ajax({
  189. type: "post",
  190. url: huayi.config.callcenter_url + "UserAccount/UpdatePwd",
  191. async: true,
  192. dataType: 'json',
  193. data: {
  194. token: $.cookie("token"),
  195. usercode: gh,
  196. pwd: xmm,
  197. oldpwd: ymm,
  198. mobile: $('.mobile').val()
  199. },
  200. success: function(result) {
  201. // result = $.parseJSON(result);
  202. if(result.state.toLowerCase() == "success") {
  203. layer.msg("修改成功!");
  204. $(".personal").hide();
  205. $('.spwd').val('');
  206. $('.npwd').val('');
  207. $('.epwd').val('')
  208. }
  209. }
  210. });
  211. }
  212. })
  213. //图片裁剪
  214. var o = $(".image-crop > img");
  215. $(o).cropper({
  216. aspectRatio: 1 / 1,
  217. resizable: false,
  218. dragCrop: false,
  219. preview: ".img-preview",
  220. done: function() {}
  221. });
  222. var r = $("#inputImage");
  223. if(window.FileReader) {
  224. r.change(function() {
  225. var e, i = new FileReader,
  226. t = this.files;
  227. if(t.length && (e = t[0], /^image\/\w+$/.test(e.type))) {
  228. i.readAsDataURL(e);
  229. i.onload = function() {
  230. r.val("");
  231. o.cropper("reset", !0).cropper("replace", this.result);
  232. }
  233. } else {
  234. alert("请选择图片文件");
  235. }
  236. });
  237. $("#setDrag").click(function() {
  238. o.cropper("setDragMode", "crop");
  239. var img = o.cropper("getDataURL");
  240. $.post(huayi.config.callcenter_url + "Index/UploadTX64", {
  241. dataurl: encodeURIComponent(img),
  242. "token": $.cookie("token")
  243. }, function(result) {
  244. result = $.parseJSON(result);
  245. if(result.state.toLowerCase() == "success") {
  246. $(".yhtx").attr("src", huayi.config.callcenter_url.substr(0, huayi.config.callcenter_url.length - 1) + result.data);
  247. layer.msg("上传成功");
  248. $('.personal').hide();
  249. }
  250. })
  251. });
  252. $("#zoomIn").click(function() {
  253. o.cropper("zoom", .1)
  254. });
  255. $("#zoomOut").click(function() {
  256. o.cropper("zoom", -.1)
  257. });
  258. $("#rotateLeft").click(function() {
  259. o.cropper("rotate", 45)
  260. });
  261. $("#rotateRight").click(function() {
  262. o.cropper("rotate", -45)
  263. });
  264. } else {
  265. r.addClass("hide");
  266. }
  267. </script>
  268. </body>
  269. </html>