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.

223 lines
8.6 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 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. <div class="flool tpnavf cl">
  13. <div class="nav_list">
  14. <ul>
  15. <a href="<?php echo route('weixin'); ?>"><li><img src="<?php echo env('APP_URL'); ?>/images/weixin/home_icon.png"><p>首页</p></li></a>
  16. <a href="/Weixin/index.php?m=Store&amp;a=index"><li><img src="<?php echo env('APP_URL'); ?>/images/weixin/brand_icon.png"><p>分类</p></li></a>
  17. <a href="/Weixin/index.php?m=Cart&amp;a=index"><li><img src="<?php echo env('APP_URL'); ?>/images/weixin/car_icon.png"><p>购物车</p></li></a>
  18. <a href="/Weixin/index.php?m=User&amp;a=index"><li><img src="<?php echo env('APP_URL'); ?>/images/weixin/center_icon.png"><p>个人中心</p></li></a></ul>
  19. <div class="cl"></div>
  20. </div>
  21. </div>
  22. <div class="floor">
  23. <ul class="fui-list mt10">
  24. <li>
  25. <div class="ui-list-thumb">
  26. <!-- <span style="background-image:url(<?php echo env('APP_URL'); ?>/images/weixin/no_user.jpg)"></span> -->
  27. <form id="head_img" action="<?php echo env('APP_API_URL').'/image_upload'; ?>" method="post" enctype="multipart/form-data">
  28. <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';} ?>">
  29. <input id="fileupload" type="file" name="file" style="display:none;">
  30. <input type="hidden" name="access_token" value="<?php echo $_SESSION['weixin_user_info']['access_token']; ?>">
  31. </form>
  32. </div>
  33. <div class="ui-list-info">
  34. <h4 class="ui-nowrap">头像</h4>
  35. <div class="ui-reddot ui-reddot-static"></div>
  36. </div>
  37. <i id="avatorright" class="fa fa-angle-right" aria-hidden="true"></i>
  38. </li>
  39. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/layer/mobile/layer.js"></script>
  40. <script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery-form.js"></script>
  41. <script type="text/javascript">
  42. $(function(){
  43. $("#avator,#avatorright").click(function(){
  44. $("#fileupload").trigger("click");
  45. });
  46. $("#fileupload").change(function(){
  47. $("#head_img").ajaxSubmit({
  48. dataType: 'json',
  49. success: function(res) {
  50. var img = res.data;
  51. if(res.code==0)
  52. {
  53. $("#avator").attr("src",img);
  54. $.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)
  55. {
  56. if(res2.code==0)
  57. {
  58. //提示
  59. layer.open({
  60. content: '头像修改成功'
  61. ,skin: 'msg'
  62. ,time: 2 //2秒后自动关闭
  63. });
  64. }
  65. },'json');
  66. }
  67. },
  68. error:function(res){
  69. //files.html(res.responseText);
  70. }
  71. });
  72. });
  73. });
  74. </script>
  75. <a href="javascript:update_username();"><li>
  76. <div class="ui-list-info">
  77. <h4 class="ui-nowrap">用户名</h4>
  78. <div class="ui-txt-info"><?php echo $user_info['user_name']; ?> &nbsp;</div>
  79. </div>
  80. <i class="fa fa-angle-right" aria-hidden="true"></i>
  81. </li></a>
  82. <style>
  83. .adr_add{margin:0 10px;}
  84. .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;}
  85. </style>
  86. <script>
  87. function update_username()
  88. {
  89. //询问框
  90. layer.open({
  91. title: [
  92. '用户名修改',
  93. 'background-color: #FF4351; color:#fff;'
  94. ]
  95. ,content: '<div class="adr-form-group"><input type="text" name="user_name" class="" id="user_name" placeholder="请输入用户名"></div>'
  96. ,btn: ['确定', '取消']
  97. ,yes: function(index){
  98. var user_name = $("#user_name").val();
  99. if(user_name == '')
  100. {
  101. layer.open({
  102. content: '修改失败'
  103. ,skin: 'msg'
  104. ,time: 2 //2秒后自动关闭
  105. });
  106. }
  107. else
  108. {
  109. location.reload();
  110. }
  111. layer.close(index);
  112. }
  113. });
  114. }
  115. </script>
  116. <a href="javascript:update_nickname();"><li>
  117. <div class="ui-list-info">
  118. <h4 class="ui-nowrap">昵称</h4>
  119. <div class="ui-txt-info"><?php echo $user_info['nickname']; ?> &nbsp;</div>
  120. </div>
  121. <i class="fa fa-angle-right" aria-hidden="true"></i>
  122. </li></a>
  123. <script>
  124. function update_nickname()
  125. {
  126. //询问框
  127. layer.open({
  128. title: [
  129. '昵称修改',
  130. 'background-color: #FF4351; color:#fff;'
  131. ]
  132. ,content: '<div class="adr-form-group"><input type="text" name="nickname" class="" id="nickname" placeholder="请输入用户名"></div>'
  133. ,btn: ['确定', '取消']
  134. ,yes: function(index){
  135. var nickname = $("#nickname").val();
  136. if(nickname == '')
  137. {
  138. layer.open({
  139. content: '修改失败'
  140. ,skin: 'msg'
  141. ,time: 2 //2秒后自动关闭
  142. });
  143. }
  144. else
  145. {
  146. location.reload();
  147. }
  148. layer.close(index);
  149. }
  150. });
  151. }
  152. </script>
  153. <a href="javascript:update_sex();"><li>
  154. <div class="ui-list-info">
  155. <h4 class="ui-nowrap">性别</h4>
  156. <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>
  157. </div>
  158. <i class="fa fa-angle-right" aria-hidden="true"></i>
  159. </li></a>
  160. <script>
  161. function update_sex()
  162. {
  163. //询问框
  164. layer.open({
  165. title: [
  166. '性别修改',
  167. 'background-color: #FF4351; color:#fff;'
  168. ]
  169. ,content: '<div class="adr-form-group"><input type="text" name="sex" class="" id="sex" placeholder="请输入用户名"></div>'
  170. ,btn: ['确定', '取消']
  171. ,yes: function(index){
  172. var sex = $("#sex").val();
  173. if(sex == '')
  174. {
  175. layer.open({
  176. content: '修改失败'
  177. ,skin: 'msg'
  178. ,time: 2 //2秒后自动关闭
  179. });
  180. }
  181. else
  182. {
  183. location.reload();
  184. }
  185. layer.close(index);
  186. }
  187. });
  188. }
  189. </script>
  190. </ul>
  191. <ul class="fui-list mt10">
  192. <li>
  193. <div class="ui-list-info">
  194. <h4 class="ui-nowrap">修改密码</h4>
  195. <div class="ui-txt-info"> &nbsp;</div>
  196. </div>
  197. <i class="fa fa-angle-right" aria-hidden="true"></i>
  198. </li>
  199. <li>
  200. <div class="ui-list-info">
  201. <h4 class="ui-nowrap">支付密码</h4>
  202. <div class="ui-txt-info"> &nbsp;</div>
  203. </div>
  204. <i class="fa fa-angle-right" aria-hidden="true"></i>
  205. </li>
  206. </ul>
  207. <div class="setting"><div class="close"><a href="<?php echo route('weixin_user_logout'); ?>" id="logout">安全退出</a></div></div>
  208. </div>
  209. @include('weixin.common.footer')
  210. </body></html>