admin_info.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {extend name="public/container"}
  2. {block name="head"}
  3. <style>
  4. label.error{
  5. color: #a94442;
  6. margin-bottom: 0;
  7. display: inline-block;
  8. font: normal normal normal 14px/1 FontAwesome;
  9. font-size: inherit;
  10. text-rendering: auto;
  11. -webkit-font-smoothing: antialiased;
  12. -moz-osx-font-smoothing: grayscale;
  13. transform: translate(0, 0);
  14. }
  15. </style>
  16. <link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
  17. <script src="{__ADMIN_PATH}plug/validate/jquery.validate.js"></script>
  18. <script src="{__ADMIN_PATH}frame/js/plugins/iCheck/icheck.min.js"></script>
  19. <script src="{__ADMIN_PATH}frame/js/ajaxfileupload.js"></script>
  20. {/block}
  21. {block name="content"}
  22. <div class="row">
  23. <div class="col-sm-12">
  24. <div class="ibox">
  25. <div class="ibox-title">
  26. <div class="text-left">个人资料</div>
  27. <div class="ibox-tools">
  28. </div>
  29. </div>
  30. <div class="ibox-content">
  31. <form method="post" class="form-horizontal" id="signupForm" action="">
  32. <input type="hidden" value="{$adminInfo.id}" name="id"/>
  33. <div class="form-group">
  34. <label class="col-sm-2 control-label">账号</label>
  35. <div class="col-sm-10">
  36. <div class="row">
  37. <div class="col-md-6">
  38. <input type="text" class="form-control" name="account" value="{$adminInfo.account}" validate="" disabled/>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="hr-line-dashed"></div>
  44. <div class="form-group">
  45. <label class="col-sm-2 control-label">姓名</label>
  46. <div class="col-sm-10">
  47. <div class="row">
  48. <div class="col-md-6">
  49. <input type="text" class="form-control" name="real_name" value="{$adminInfo.real_name}" validate="required:true" id="real_name"/>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="hr-line-dashed"></div>
  55. <div class="form-group">
  56. <label class="col-sm-2 control-label">原始密码</label>
  57. <div class="col-sm-10">
  58. <div class="row">
  59. <div class="col-md-6">
  60. <input type="password" class="form-control" name="pwd" id="pwd"/>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="hr-line-dashed"></div>
  66. <div class="form-group">
  67. <label class="col-sm-2 control-label">新密码</label>
  68. <div class="col-sm-10">
  69. <div class="row">
  70. <div class="col-md-6">
  71. <input type="password" class="form-control" name="new_pwd" id="new_pwd"/>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="hr-line-dashed"></div>
  77. <div class="form-group">
  78. <label class="col-sm-2 control-label">确认新密码</label>
  79. <div class="col-sm-10">
  80. <div class="row">
  81. <div class="col-md-6">
  82. <input type="password" class="form-control" name="new_pwd_ok" id="new_pwd_ok"/>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="hr-line-dashed"></div>
  88. <div class="form-group" style="text-align: center;">
  89. <div class="col-sm-4 col-sm-offset-2">
  90. <button class="btn btn-primary add" type="button">提交</button>
  91. </div>
  92. </div>
  93. </form>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. {/block}
  99. {block name="script"}
  100. <script>
  101. $eb = parent._mpApi;
  102. $().ready(function() {
  103. $("#signupForm").validate();
  104. })
  105. $('.add').on('click',function (e) {
  106. var list = [];
  107. list.real_name = $('#real_name').val();
  108. list.pwd = $('#pwd').val();
  109. list.new_pwd = $('#new_pwd').val();
  110. list.new_pwd_ok = $('#new_pwd_ok').val();
  111. if(list.real_name.length < 1) return $eb.message('error','请填写姓名');
  112. var url = "{:Url('setAdminInfo')}";
  113. $.ajax({
  114. url:url,
  115. data:{real_name:list.real_name,pwd:list.pwd,new_pwd:list.new_pwd,new_pwd_ok:list.new_pwd_ok},
  116. type:'post',
  117. dataType:'json',
  118. success:function (re) {
  119. if(re.code == 400)
  120. return $eb.message('error',re.msg);
  121. else
  122. return $eb.message('success',re.msg);
  123. }
  124. })
  125. })
  126. </script>
  127. {/block}