sms_modify.php 7.1 KB

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