You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

443 lines
17 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/>
  2. <title>编辑资料</title><meta name="keywords" content="关键词"><meta name="description" content="描述"><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
  3. <link href="<?php echo env('APP_URL'); ?>/css/weixin/style.css" type="text/css" rel="stylesheet">
  4. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script>
  5. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/weixin/mobile.js"></script>
  6. <link href="<?php echo env('APP_URL'); ?>/css/font-awesome.min.css" type="text/css" rel="stylesheet"></head><body style="background-color:#f1f1f1;">
  7. <div class="classreturn loginsignup">
  8. <div class="ds-in-bl return"><a href="javascript:history.back(-1);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/return.png" alt="返回"></a></div>
  9. <div class="ds-in-bl tit center"><span>编辑资料</span></div>
  10. <div class="ds-in-bl nav_menu"><a href="javascript:void(0);"><img src="<?php echo env('APP_URL'); ?>/images/weixin/class1.png" alt="菜单"></a></div>
  11. </div>
  12. @include('weixin.common.headerNav')
  13. <div class="floor">
  14. <ul class="fui-list mt10">
  15. <a href="javascript:update_avator();"><li>
  16. <div class="ui-list-thumb">
  17. <!-- <span style="background-image:url(<?php echo env('APP_URL'); ?>/images/weixin/no_user.jpg)"></span> -->
  18. <form id="head_img" action="<?php echo env('APP_API_URL').'/image_upload'; ?>" method="post" enctype="multipart/form-data">
  19. <img id="avator" src="<?php if($user_info['head_img']!=''){echo $user_info['head_img'];}else{echo env('APP_URL').'/images/weixin/no_user.jpg';} ?>">
  20. <input id="fileupload" type="file" name="file" style="display:none;">
  21. <input type="hidden" name="access_token" value="<?php echo $_SESSION['weixin_user_info']['access_token']; ?>">
  22. </form>
  23. </div>
  24. <div class="ui-list-info">
  25. <h4 class="ui-nowrap">头像</h4>
  26. <div class="ui-reddot ui-reddot-static"></div>
  27. </div>
  28. <i class="fa fa-angle-right" aria-hidden="true"></i>
  29. </li></a>
  30. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/md5.min.js"></script>
  31. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script>
  32. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery-form.js"></script>
  33. <script type="text/javascript">
  34. function update_avator()
  35. {
  36. $("#fileupload").trigger("click");
  37. }
  38. $(function(){
  39. $("#fileupload").change(function(){
  40. $("#head_img").ajaxSubmit({
  41. dataType: 'json',
  42. success: function(res) {
  43. var img = res.data;
  44. if(res.code==0)
  45. {
  46. $("#avator").attr("src",img);
  47. $.post('<?php echo env('APP_API_URL').'/user_info_update'; ?>',{access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>',head_img:img},function(res2)
  48. {
  49. if(res2.code==0)
  50. {
  51. //提示
  52. layer.open({
  53. content: '头像修改成功'
  54. ,skin: 'msg'
  55. ,time: 2 //2秒后自动关闭
  56. });
  57. }
  58. },'json');
  59. }
  60. },
  61. error:function(res){
  62. //files.html(res.responseText);
  63. }
  64. });
  65. });
  66. });
  67. </script>
  68. <a href="javascript:update_username();"><li>
  69. <div class="ui-list-info">
  70. <h4 class="ui-nowrap">用户名</h4>
  71. <div class="ui-txt-info"><?php echo $user_info['user_name']; ?> &nbsp;</div>
  72. </div>
  73. <i class="fa fa-angle-right" aria-hidden="true"></i>
  74. </li></a>
  75. <style>
  76. .adr_add{margin:0 10px;}
  77. .adr-form-group input[type=text],.adr-form-group input[type=password]{display:block;width:100%;font-size:16px;padding:12px;color:#777;vertical-align:middle;background-color:#fff;background-image:none;border:1px solid #ddd;border-radius:0;box-sizing:border-box;}
  78. .bottoma{display:block;font-size:18px;padding:10px;border-radius:2px;}
  79. </style>
  80. <script>
  81. function update_username()
  82. {
  83. //询问框
  84. layer.open({
  85. title: [
  86. '用户名修改',
  87. 'background-color: #FF4351; color:#fff;'
  88. ]
  89. ,content: '<div class="adr-form-group"><input type="text" name="user_name" class="" id="user_name" placeholder="请输入用户名"></div>'
  90. ,btn: ['确定', '取消']
  91. ,yes: function(index){
  92. var user_name = $("#user_name").val();
  93. if(user_name == '')
  94. {
  95. layer.open({
  96. content: '修改失败'
  97. ,skin: 'msg'
  98. ,time: 2 //2秒后自动关闭
  99. });
  100. }
  101. else
  102. {
  103. $.post('<?php echo env('APP_API_URL').'/user_info_update'; ?>',{user_name:user_name,access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>'},function(res)
  104. {
  105. if(res.code==0)
  106. {
  107. //提示
  108. layer.open({
  109. content: '修改成功'
  110. ,skin: 'msg'
  111. ,time: 2 //2秒后自动关闭
  112. });
  113. }
  114. else
  115. {
  116. layer.open({
  117. content: res.msg
  118. ,skin: 'msg'
  119. ,time: 2 //2秒后自动关闭
  120. });
  121. }
  122. },'json');
  123. window.location.reload();
  124. }
  125. layer.close(index);
  126. }
  127. });
  128. }
  129. </script>
  130. <a href="javascript:update_nickname();"><li>
  131. <div class="ui-list-info">
  132. <h4 class="ui-nowrap">昵称</h4>
  133. <div class="ui-txt-info"><?php echo $user_info['nickname']; ?> &nbsp;</div>
  134. </div>
  135. <i class="fa fa-angle-right" aria-hidden="true"></i>
  136. </li></a>
  137. <script>
  138. function update_nickname()
  139. {
  140. //询问框
  141. layer.open({
  142. title: [
  143. '昵称修改',
  144. 'background-color: #FF4351; color:#fff;'
  145. ]
  146. ,content: '<div class="adr-form-group"><input type="text" name="nickname" class="" id="nickname" placeholder="请输入昵称"></div>'
  147. ,btn: ['确定', '取消']
  148. ,yes: function(index){
  149. var nickname = $("#nickname").val();
  150. if(nickname == '')
  151. {
  152. layer.open({
  153. content: '修改失败'
  154. ,skin: 'msg'
  155. ,time: 2 //2秒后自动关闭
  156. });
  157. }
  158. else
  159. {
  160. $.post('<?php echo env('APP_API_URL').'/user_info_update'; ?>',{nickname:nickname,access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>'},function(res)
  161. {
  162. if(res.code==0)
  163. {
  164. //提示
  165. layer.open({
  166. content: '修改成功'
  167. ,skin: 'msg'
  168. ,time: 2 //2秒后自动关闭
  169. });
  170. }
  171. else
  172. {
  173. layer.open({
  174. content: res.msg
  175. ,skin: 'msg'
  176. ,time: 2 //2秒后自动关闭
  177. });
  178. }
  179. },'json');
  180. window.location.reload();
  181. }
  182. layer.close(index);
  183. }
  184. });
  185. }
  186. </script>
  187. <a href="javascript:update_sex_layer();"><li>
  188. <div class="ui-list-info">
  189. <h4 class="ui-nowrap">性别</h4>
  190. <div class="ui-txt-info"><?php if($user_info['sex']==0){echo '未知';}elseif($user_info['sex']==1){echo '男';}elseif($user_info['sex']==2){echo '女';} ?> &nbsp;</div>
  191. </div>
  192. <i class="fa fa-angle-right" aria-hidden="true"></i>
  193. </li></a>
  194. <script>
  195. function update_sex_layer()
  196. {
  197. //询问框
  198. layer.open({
  199. content: '<div style="padding:15px;"><a style="margin-bottom:10px;background-color:#1aad19;text-align:center;color:white;border:1px solid #179e16;" class="bottoma" onclick="layer.closeAll();" href="javascript:update_sex(1);">男</a><a style="margin-bottom:10px;background-color:#ea5a3d;text-align:center;color:white;border:1px solid #dd2727;" class="bottoma" onclick="layer.closeAll();" href="javascript:update_sex(2);">女</a></div>'
  200. });
  201. }
  202. function update_sex(sex)
  203. {
  204. $.post('<?php echo env('APP_API_URL').'/user_info_update'; ?>',{sex:sex,access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>'},function(res)
  205. {
  206. if(res.code==0)
  207. {
  208. //提示
  209. layer.open({
  210. content: '修改成功'
  211. ,skin: 'msg'
  212. ,time: 2 //2秒后自动关闭
  213. });
  214. }
  215. else
  216. {
  217. layer.open({
  218. content: res.msg
  219. ,skin: 'msg'
  220. ,time: 2 //2秒后自动关闭
  221. });
  222. }
  223. },'json');
  224. window.location.reload();
  225. }
  226. </script>
  227. </ul>
  228. <ul class="fui-list mt10">
  229. <a href="javascript:update_password();"><li>
  230. <div class="ui-list-info">
  231. <h4 class="ui-nowrap">修改密码</h4>
  232. <div class="ui-txt-info"> &nbsp;</div>
  233. </div>
  234. <i class="fa fa-angle-right" aria-hidden="true"></i>
  235. </li></a>
  236. <script>
  237. function update_password()
  238. {
  239. //询问框
  240. layer.open({
  241. title: [
  242. '修改密码',
  243. 'background-color: #FF4351; color:#fff;'
  244. ]
  245. ,content: '<div class="adr-form-group"><input style="margin-bottom:10px;" type="password" name="old_password" class="" id="old_password" placeholder="请输入旧密码"><input type="password" name="password" class="" id="password" placeholder="请输入新密码"></div>'
  246. ,btn: ['确定', '取消']
  247. ,yes: function(index){
  248. var old_password = $("#old_password").val();
  249. var password = $("#password").val();
  250. if(password == '' || old_password=='')
  251. {
  252. layer.open({
  253. content: '修改失败'
  254. ,skin: 'msg'
  255. ,time: 2 //2秒后自动关闭
  256. });
  257. }
  258. else
  259. {
  260. if(password == old_password)
  261. {
  262. layer.open({
  263. content: '新旧密码一样'
  264. ,skin: 'msg'
  265. ,time: 2 //2秒后自动关闭
  266. });
  267. return false;
  268. }
  269. $.post('<?php echo env('APP_API_URL').'/user_password_update'; ?>',{password:md5(password),old_password:md5(old_password),access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>'},function(res)
  270. {
  271. if(res.code==0)
  272. {
  273. //提示
  274. layer.open({
  275. content: '修改成功'
  276. ,skin: 'msg'
  277. ,time: 2 //2秒后自动关闭
  278. });
  279. }
  280. else
  281. {
  282. layer.open({
  283. content: res.msg
  284. ,skin: 'msg'
  285. ,time: 2 //2秒后自动关闭
  286. });
  287. }
  288. },'json');
  289. window.location.reload();
  290. }
  291. layer.close(index);
  292. }
  293. });
  294. }
  295. </script>
  296. <a href="javascript:<?php if($user_info['pay_password']){echo 'update_pay_password()';}else{echo 'set_pay_password()';} ?>;"><li>
  297. <div class="ui-list-info">
  298. <h4 class="ui-nowrap">支付密码</h4>
  299. <div class="ui-txt-info"> &nbsp;</div>
  300. </div>
  301. <i class="fa fa-angle-right" aria-hidden="true"></i>
  302. </li></a>
  303. <script>
  304. //设置支付密码
  305. function set_pay_password()
  306. {
  307. //询问框
  308. layer.open({
  309. title: [
  310. '设置支付密码',
  311. 'background-color: #FF4351; color:#fff;'
  312. ]
  313. ,content: '<div class="adr-form-group"><input type="password" name="pay_password" class="" id="pay_password" placeholder="请输入新支付密码"></div>'
  314. ,btn: ['确定', '取消']
  315. ,yes: function(index){
  316. var pay_password = $("#pay_password").val();
  317. if(pay_password == '')
  318. {
  319. layer.open({
  320. content: '设置失败'
  321. ,skin: 'msg'
  322. ,time: 2 //2秒后自动关闭
  323. });
  324. }
  325. else
  326. {
  327. $.post('<?php echo env('APP_API_URL').'/user_password_update'; ?>',{pay_password:md5(pay_password),old_pay_password:'',access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>'},function(res)
  328. {
  329. if(res.code==0)
  330. {
  331. //提示
  332. layer.open({
  333. content: '设置成功'
  334. ,skin: 'msg'
  335. ,time: 2 //2秒后自动关闭
  336. });
  337. }
  338. else
  339. {
  340. layer.open({
  341. content: res.msg
  342. ,skin: 'msg'
  343. ,time: 2 //2秒后自动关闭
  344. });
  345. }
  346. },'json');
  347. window.location.reload();
  348. }
  349. layer.close(index);
  350. }
  351. });
  352. }
  353. //修改支付密码
  354. function update_pay_password()
  355. {
  356. //询问框
  357. layer.open({
  358. title: [
  359. '修改支付密码',
  360. 'background-color: #FF4351; color:#fff;'
  361. ]
  362. ,content: '<div class="adr-form-group"><input style="margin-bottom:10px;" type="password" name="old_pay_password" class="" id="old_pay_password" placeholder="请输入旧支付密码"><input type="password" name="pay_password" class="" id="pay_password" placeholder="请输入新支付密码"></div>'
  363. ,btn: ['确定', '取消']
  364. ,yes: function(index){
  365. var old_pay_password = $("#old_pay_password").val();
  366. var pay_password = $("#pay_password").val();
  367. if(pay_password == '' || old_pay_password == '')
  368. {
  369. layer.open({
  370. content: '修改失败'
  371. ,skin: 'msg'
  372. ,time: 2 //2秒后自动关闭
  373. });
  374. }
  375. else
  376. {
  377. if(pay_password == old_pay_password)
  378. {
  379. layer.open({
  380. content: '新旧密码一样'
  381. ,skin: 'msg'
  382. ,time: 2 //2秒后自动关闭
  383. });
  384. return false;
  385. }
  386. $.post('<?php echo env('APP_API_URL').'/user_password_update'; ?>',{pay_password:md5(pay_password),old_pay_password:md5(old_pay_password),access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>'},function(res)
  387. {
  388. if(res.code==0)
  389. {
  390. //提示
  391. layer.open({
  392. content: '修改成功'
  393. ,skin: 'msg'
  394. ,time: 2 //2秒后自动关闭
  395. });
  396. }
  397. else
  398. {
  399. layer.open({
  400. content: res.msg
  401. ,skin: 'msg'
  402. ,time: 2 //2秒后自动关闭
  403. });
  404. }
  405. },'json');
  406. window.location.reload();
  407. }
  408. layer.close(index);
  409. }
  410. });
  411. }
  412. </script>
  413. </ul>
  414. <div class="setting"><div class="close"><a href="<?php echo route('weixin_user_logout'); ?>" id="logout">安全退出</a></div></div>
  415. </div>
  416. @include('weixin.common.footer')
  417. </body></html>