sms_modify.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. </div>
  63. <div id="store-attr" class="mp-form" v-cloak="">
  64. <div class="p-m m-t-sm">
  65. <i-Form :label-width="80" style="width: 100%">
  66. <template>
  67. <template>
  68. <Form-Item>
  69. <Row>
  70. <i-Col span="20">
  71. <i-Input placeholder="短信签名" v-model="form.sign" style="width: 80%"
  72. type="text" ></i-Input>
  73. </i-Col>
  74. </Row>
  75. </Form-Item>
  76. <Form-Item>
  77. <Row>
  78. <i-Col span="20">
  79. <i-Input placeholder="注册手机号" v-model="form.phone"
  80. style="width: 80%"></i-Input>
  81. </i-Col>
  82. </Row>
  83. </Form-Item>
  84. <Form-Item>
  85. <Row>
  86. <i-Col span="20">
  87. <i-Input placeholder="验证码" v-model="form.verify_code" style="width: 80%">
  88. <span slot="append" @click="sendCode" v-text="codeMsg"
  89. class="code-send"></span>
  90. </i-Input>
  91. </i-Col>
  92. </Row>
  93. </Form-Item>
  94. </template>
  95. <Form-Item>
  96. <Row>
  97. <i-Col span="8" offset="6">
  98. <i-Button type="primary" @click="submit">提交</i-Button>
  99. </i-Col>
  100. </Row>
  101. </Form-Item>
  102. </template>
  103. </i-Form>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <script>
  111. var _vm;
  112. var account = "<?php echo $account;?>";
  113. mpFrame.start(function (Vue) {
  114. new Vue({
  115. data() {
  116. return {
  117. codeUrl: "{:Url('verify')}",
  118. codeMsg: "发送验证码",
  119. form: {
  120. sign: '',
  121. phone: '',
  122. verify_code: '',
  123. },
  124. isSend: true,
  125. }
  126. },
  127. methods: {
  128. isPhone: function (test) {
  129. var reg = /^1[3456789]\d{9}$/;
  130. return reg.test(test);
  131. },
  132. sendCode: function () {
  133. var that = this;
  134. if (!that.isSend) return;
  135. if (!that.form.phone.length) {
  136. $eb.message('error', '请填写手机号');
  137. return false;
  138. }
  139. if (!that.isPhone(that.form.phone)) {
  140. $eb.message('error', '手机号格式错误');
  141. return false;
  142. }
  143. that.isSend = false;
  144. $eb.axios.post(that.codeUrl, {phone: that.form.phone}).then(function (res) {
  145. if (res.data.code == 200) {
  146. var cd = 60;
  147. var timeClone = setInterval(function () {
  148. cd--;
  149. if (cd <= 0) {
  150. that.codeMsg = '重新发送';
  151. clearInterval(timeClone);
  152. that.isSend = true;
  153. } else {
  154. that.isSend = false;
  155. that.codeMsg = '剩余' + cd + 's';
  156. }
  157. }, 1000);
  158. $eb.message('success', res.data.msg || '发送成功');
  159. } else {
  160. $eb.message('error', res.data.msg || '发送失败');
  161. }
  162. return false;
  163. }).catch(function (err) {
  164. that.isSend = false;
  165. $eb.message('error', err);
  166. })
  167. },
  168. submit() {
  169. var that = this;
  170. $eb.axios.post("{:Url('go_sms_modify')}", that.form).then(function (res) {
  171. if (res.status == 200 && res.data.code == 200) {
  172. $eb.message('success', res.data.msg || '提交成功!');
  173. $eb.closeModalFrame(window.name);
  174. window.location.href = "{:url('setting.systemPlat/index')}";
  175. } else {
  176. $eb.message('error', res.data.msg || '请求失败!');
  177. }
  178. }).catch(function (err) {
  179. $eb.message('error', err);
  180. })
  181. },
  182. },
  183. mounted() {
  184. }
  185. }).$mount(document.getElementById('store-attr'));
  186. });
  187. </script>
  188. </body>