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.

524 lines
20 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
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. <a href="javascript:qrcode_layer();"><li>
  228. <div class="ui-list-info">
  229. <h4 class="ui-nowrap">二维码名片</h4>
  230. <div class="ui-txt-info"> &nbsp;</div>
  231. </div>
  232. <i class="fa fa-qrcode" aria-hidden="true" style="font-size:24px;"></i>
  233. </li></a>
  234. <script>
  235. function qrcode_layer()
  236. {
  237. //询问框
  238. layer.open({
  239. content: '<div><div><img style="width:100%;" class="imgzsy" src="<?php echo get_erweima(route('weixin',array('invite_code'=>$_SESSION['weixin_user_info']['mobile'])),240); ?>"></div><p style="color:#999;">扫一扫,你懂得</p></div>'
  240. });
  241. }
  242. </script>
  243. <a href="javascript:update_refund_account();"><li>
  244. <div class="ui-list-info">
  245. <h4 class="ui-nowrap">退款账户</h4>
  246. <div class="ui-txt-info"> &nbsp;</div>
  247. </div>
  248. <i class="fa fa-angle-right" aria-hidden="true"></i>
  249. </li></a>
  250. <script>
  251. function update_refund_account()
  252. {
  253. //询问框
  254. layer.open({
  255. title: [
  256. '退款账户管理',
  257. 'background-color: #FF4351; color:#fff;'
  258. ]
  259. ,content: '<div class="adr-form-group"><input style="margin-bottom:5px;" type="text" name="refund_account" class="" id="refund_account" placeholder="支付宝账号" value="<?php if($user_info['refund_account']){echo $user_info['refund_account'];} ?>"><input type="text" name="refund_name" class="" id="refund_name" placeholder="姓名" value="<?php if($user_info['refund_name']){echo $user_info['refund_name'];} ?>"></div>'
  260. ,btn: ['确定', '取消']
  261. ,yes: function(index){
  262. var refund_account = $("#refund_account").val();
  263. var refund_name = $("#refund_name").val();
  264. if(refund_account == '' || refund_name == '')
  265. {
  266. /* layer.open({
  267. content: '账户/姓名不能为空'
  268. ,skin: 'msg'
  269. ,time: 2 //2秒后自动关闭
  270. }); */
  271. alert('账户/姓名不能为空');
  272. return false;
  273. }
  274. else
  275. {
  276. $.post('<?php echo env('APP_API_URL').'/user_info_update'; ?>',{refund_account:refund_account,refund_name:refund_name,access_token:'<?php echo $_SESSION['weixin_user_info']['access_token']; ?>'},function(res)
  277. {
  278. if(res.code==0)
  279. {
  280. //提示
  281. layer.open({
  282. content: '操作成功'
  283. ,skin: 'msg'
  284. ,time: 2 //2秒后自动关闭
  285. });
  286. }
  287. else
  288. {
  289. layer.open({
  290. content: res.msg
  291. ,skin: 'msg'
  292. ,time: 2 //2秒后自动关闭
  293. });
  294. }
  295. },'json');
  296. window.location.reload();
  297. }
  298. layer.close(index);
  299. }
  300. });
  301. }
  302. </script>
  303. </ul>
  304. <ul class="fui-list mt10">
  305. <a href="javascript:update_password();"><li>
  306. <div class="ui-list-info">
  307. <h4 class="ui-nowrap">修改密码</h4>
  308. <div class="ui-txt-info"> &nbsp;</div>
  309. </div>
  310. <i class="fa fa-angle-right" aria-hidden="true"></i>
  311. </li></a>
  312. <script>
  313. function update_password()
  314. {
  315. //询问框
  316. layer.open({
  317. title: [
  318. '修改密码',
  319. 'background-color: #FF4351; color:#fff;'
  320. ]
  321. ,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>'
  322. ,btn: ['确定', '取消']
  323. ,yes: function(index){
  324. var old_password = $("#old_password").val();
  325. var password = $("#password").val();
  326. if(password == '' || old_password=='')
  327. {
  328. layer.open({
  329. content: '修改失败'
  330. ,skin: 'msg'
  331. ,time: 2 //2秒后自动关闭
  332. });
  333. }
  334. else
  335. {
  336. if(password == old_password)
  337. {
  338. layer.open({
  339. content: '新旧密码一样'
  340. ,skin: 'msg'
  341. ,time: 2 //2秒后自动关闭
  342. });
  343. return false;
  344. }
  345. $.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)
  346. {
  347. if(res.code==0)
  348. {
  349. //提示
  350. layer.open({
  351. content: '修改成功'
  352. ,skin: 'msg'
  353. ,time: 2 //2秒后自动关闭
  354. });
  355. }
  356. else
  357. {
  358. layer.open({
  359. content: res.msg
  360. ,skin: 'msg'
  361. ,time: 2 //2秒后自动关闭
  362. });
  363. }
  364. },'json');
  365. window.location.reload();
  366. }
  367. layer.close(index);
  368. }
  369. });
  370. }
  371. </script>
  372. <a href="javascript:<?php if($user_info['pay_password']){echo 'update_pay_password()';}else{echo 'set_pay_password()';} ?>;"><li>
  373. <div class="ui-list-info">
  374. <h4 class="ui-nowrap">支付密码</h4>
  375. <div class="ui-txt-info"> &nbsp;</div>
  376. </div>
  377. <i class="fa fa-angle-right" aria-hidden="true"></i>
  378. </li></a>
  379. <script>
  380. //设置支付密码
  381. function set_pay_password()
  382. {
  383. //询问框
  384. layer.open({
  385. title: [
  386. '设置支付密码',
  387. 'background-color: #FF4351; color:#fff;'
  388. ]
  389. ,content: '<div class="adr-form-group"><input type="password" name="pay_password" class="" id="pay_password" placeholder="请输入新支付密码"></div>'
  390. ,btn: ['确定', '取消']
  391. ,yes: function(index){
  392. var pay_password = $("#pay_password").val();
  393. if(pay_password == '')
  394. {
  395. layer.open({
  396. content: '设置失败'
  397. ,skin: 'msg'
  398. ,time: 2 //2秒后自动关闭
  399. });
  400. }
  401. else
  402. {
  403. $.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)
  404. {
  405. if(res.code==0)
  406. {
  407. //提示
  408. layer.open({
  409. content: '设置成功'
  410. ,skin: 'msg'
  411. ,time: 2 //2秒后自动关闭
  412. });
  413. }
  414. else
  415. {
  416. layer.open({
  417. content: res.msg
  418. ,skin: 'msg'
  419. ,time: 2 //2秒后自动关闭
  420. });
  421. }
  422. },'json');
  423. window.location.reload();
  424. }
  425. layer.close(index);
  426. }
  427. });
  428. }
  429. //修改支付密码
  430. function update_pay_password()
  431. {
  432. //询问框
  433. layer.open({
  434. title: [
  435. '修改支付密码',
  436. 'background-color: #FF4351; color:#fff;'
  437. ]
  438. ,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>'
  439. ,btn: ['确定', '取消']
  440. ,yes: function(index){
  441. var old_pay_password = $("#old_pay_password").val();
  442. var pay_password = $("#pay_password").val();
  443. if(pay_password == '' || old_pay_password == '')
  444. {
  445. layer.open({
  446. content: '修改失败'
  447. ,skin: 'msg'
  448. ,time: 2 //2秒后自动关闭
  449. });
  450. }
  451. else
  452. {
  453. if(pay_password == old_pay_password)
  454. {
  455. layer.open({
  456. content: '新旧密码一样'
  457. ,skin: 'msg'
  458. ,time: 2 //2秒后自动关闭
  459. });
  460. return false;
  461. }
  462. $.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)
  463. {
  464. if(res.code==0)
  465. {
  466. //提示
  467. layer.open({
  468. content: '修改成功'
  469. ,skin: 'msg'
  470. ,time: 2 //2秒后自动关闭
  471. });
  472. }
  473. else
  474. {
  475. layer.open({
  476. content: res.msg
  477. ,skin: 'msg'
  478. ,time: 2 //2秒后自动关闭
  479. });
  480. }
  481. },'json');
  482. window.location.reload();
  483. }
  484. layer.close(index);
  485. }
  486. });
  487. }
  488. </script>
  489. </ul>
  490. <div class="setting"><div class="close"><a href="<?php echo route('weixin_user_logout'); ?>" id="logout">安全退出</a></div></div>
  491. </div>
  492. @include('weixin.common.footer')
  493. </body></html>