modify.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. {include file="public/head"}
  5. <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  6. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  7. <title>{$title|default=''}</title>
  8. <style>
  9. .check {
  10. color: #f00
  11. }
  12. .demo-upload {
  13. display: block;
  14. height: 33px;
  15. text-align: center;
  16. border: 1px solid transparent;
  17. border-radius: 4px;
  18. overflow: hidden;
  19. background: #fff;
  20. position: relative;
  21. box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
  22. margin-right: 4px;
  23. }
  24. .demo-upload img {
  25. width: 100%;
  26. height: 100%;
  27. display: block;
  28. }
  29. .demo-upload-cover {
  30. display: none;
  31. position: absolute;
  32. top: 0;
  33. bottom: 0;
  34. left: 0;
  35. right: 0;
  36. background: rgba(0, 0, 0, .6);
  37. }
  38. .demo-upload:hover .demo-upload-cover {
  39. display: block;
  40. }
  41. .demo-upload-cover i {
  42. color: #fff;
  43. font-size: 20px;
  44. cursor: pointer;
  45. margin: 0 2px;
  46. }
  47. .code-send {
  48. cursor: pointer;
  49. }
  50. </style>
  51. <script>
  52. window.test = 1;
  53. </script>
  54. </head>
  55. <body>
  56. <div class="wrapper wrapper-content">
  57. <div class="row">
  58. <div class="col-sm-12">
  59. <div class="ibox float-e-margins">
  60. <div class="ibox-title">
  61. <h5>忘记密码</h5>
  62. <a style="margin-left: 10px;display: inline-block;" href="{:Url('setting.systemPlat/index?out=1')}">返回</a>
  63. </div>
  64. <div id="store-attr" class="mp-form" v-cloak="">
  65. <div class="p-m m-t-sm">
  66. <i-Form :label-width="80" style="width: 100%">
  67. <template>
  68. <template>
  69. <Form-Item>
  70. <Row>
  71. <i-Col span="13">
  72. <i-Input placeholder="账号" v-model="form.account" style="width: 80%"
  73. type="text" value="{{ account }}"></i-Input>
  74. </i-Col>
  75. </Row>
  76. </Form-Item>
  77. <Form-Item>
  78. <Row>
  79. <i-Col span="13">
  80. <i-Input placeholder="平台新密码" v-model="form.password"
  81. style="width: 80%" type="password"></i-Input>
  82. </i-Col>
  83. </Row>
  84. </Form-Item>
  85. <Form-Item>
  86. <Row>
  87. <i-Col span="13">
  88. <i-Input placeholder="注册手机号" v-model="form.phone"
  89. style="width: 80%"></i-Input>
  90. </i-Col>
  91. </Row>
  92. </Form-Item>
  93. <Form-Item>
  94. <Row>
  95. <i-Col span="13">
  96. <i-Input placeholder="验证码" v-model="form.verify_code" style="width: 80%">
  97. <span slot="append" @click="sendCode" v-text="codeMsg"
  98. class="code-send"></span>
  99. </i-Input>
  100. </i-Col>
  101. </Row>
  102. </Form-Item>
  103. </template>
  104. <Form-Item>
  105. <Row>
  106. <i-Col span="8" offset="6">
  107. <i-Button type="primary" @click="submit">提交</i-Button>
  108. </i-Col>
  109. </Row>
  110. </Form-Item>
  111. </template>
  112. </i-Form>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <script>
  120. var _vm;
  121. var account = "<?php echo $account;?>";
  122. mpFrame.start(function (Vue) {
  123. new Vue({
  124. data() {
  125. return {
  126. codeUrl: "{:Url('verify')}",
  127. codeMsg: "发送验证码",
  128. form: {
  129. account: account,
  130. password: '',
  131. phone: '',
  132. verify_code: '',
  133. },
  134. isSend: true,
  135. }
  136. },
  137. methods: {
  138. isPhone: function (test) {
  139. var reg = /^1[3456789]\d{9}$/;
  140. return reg.test(test);
  141. },
  142. sendCode: function () {
  143. var that = this;
  144. if (!that.isSend) return;
  145. if (!that.form.phone.length) {
  146. $eb.message('error', '请填写手机号');
  147. return false;
  148. }
  149. if (!that.isPhone(that.form.phone)) {
  150. $eb.message('error', '手机号格式错误');
  151. return false;
  152. }
  153. that.isSend = false;
  154. $eb.axios.post(that.codeUrl, {phone: that.form.phone}).then(function (res) {
  155. if (res.data.code == 200) {
  156. var cd = 60;
  157. var timeClone = setInterval(function () {
  158. cd--;
  159. if (cd <= 0) {
  160. that.codeMsg = '重新发送';
  161. clearInterval(timeClone);
  162. that.isSend = true;
  163. } else {
  164. that.isSend = false;
  165. that.codeMsg = '剩余' + cd + 's';
  166. }
  167. }, 1000);
  168. $eb.message('success', res.data.msg || '发送成功');
  169. } else {
  170. $eb.message('error', res.data.msg || '发送失败');
  171. }
  172. return false;
  173. }).catch(function (err) {
  174. that.isSend = false;
  175. $eb.message('error', err);
  176. })
  177. },
  178. submit() {
  179. var that = this;
  180. $eb.axios.post("{:Url('go_register')}", that.form).then(function (res) {
  181. if (res.status == 200 && res.data.code == 200) {
  182. $eb.message('success', res.data.msg || '提交成功!');
  183. $eb.closeModalFrame(window.name);
  184. location.href = "{:url('setting.systemPlat/index')}";
  185. } else {
  186. $eb.message('error', res.data.msg || '请求失败!');
  187. }
  188. }).catch(function (err) {
  189. $eb.message('error', err);
  190. })
  191. },
  192. },
  193. mounted() {
  194. }
  195. }).$mount(document.getElementById('store-attr'));
  196. });
  197. </script>
  198. </body>