find.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div class="el-row-wrap find-pass">
  3. <ul>
  4. <li>
  5. <div>
  6. <p class="ns-bg-color">1</p>
  7. <p class="ns-text-color">输入手机号</p>
  8. </div>
  9. <span class="line-2 ns-border-color"></span>
  10. </li>
  11. <li id="current2">
  12. <span class="line-1" :class="step >= 2 ? 'ns-border-color' : 'ns-border-color-gray'"></span>
  13. <div>
  14. <p :class="step >= 2 ? 'ns-bg-color' : 'ns-bg-color-gray'">2</p>
  15. <p :class="step >= 2 ? 'ns-text-color' : 'ns-text-color-gray'">验证身份</p>
  16. </div>
  17. <span class="line-2" :class="step >= 2 ? 'ns-border-color' : 'ns-border-color-gray'"></span>
  18. </li>
  19. <li id="current3">
  20. <span class="line-1" :class="step >= 3 ? 'ns-border-color' : 'ns-border-color-gray'"></span>
  21. <div>
  22. <p :class="step >= 3 ? 'ns-bg-color' : 'ns-bg-color-gray'">3</p>
  23. <p :class="step >= 3 ? 'ns-text-color' : 'ns-text-color-gray'">重置密码</p>
  24. </div>
  25. <span class="line-2" :class="step >= 3 ? 'ns-border-color' : 'ns-border-color-gray'"></span>
  26. </li>
  27. <li id="current4">
  28. <span class="line-1" :class="step >= 4 ? 'ns-border-color' : 'ns-border-color-gray'"></span>
  29. <div>
  30. <p :class="step >= 4 ? 'ns-bg-color' : 'ns-bg-color-gray'">4</p>
  31. <p :class="step >= 4 ? 'ns-text-color' : 'ns-text-color-gray'">完成</p>
  32. </div>
  33. </li>
  34. </ul>
  35. <el-row>
  36. <el-col :span="12" :offset="6">
  37. <div class="grid-content bg-purple">
  38. <el-form :model="formData" :rules="rules" ref="ruleForm" class="ns-forget-pass-form">
  39. <div class="ns-forget-pass">
  40. <template v-if="step == 1">
  41. <el-form-item prop="mobile" key="1">
  42. <el-input v-model="formData.mobile" placeholder="请输入注册手机号">
  43. <template slot="prepend">
  44. <i class="el-icon-mobile-phone"></i>
  45. </template>
  46. </el-input>
  47. </el-form-item>
  48. <el-form-item><el-button type="primary" @click="nextStep('ruleForm')">下一步</el-button></el-form-item>
  49. </template>
  50. <template v-else-if="step == 2">
  51. <el-form-item prop="vercode" key="2">
  52. <el-input v-model="formData.vercode" autocomplete="off" placeholder="请输入验证码" maxlength="4">
  53. <template slot="prepend">
  54. <i class="el-icon-picture-outline"></i>
  55. </template>
  56. <template slot="append">
  57. <img :src="captcha.img" mode class="captcha" @click="getCaptcha" />
  58. </template>
  59. </el-input>
  60. </el-form-item>
  61. <el-form-item prop="dynacode" key="3">
  62. <el-input v-model="formData.dynacode" maxlength="4" autocomplete="off" placeholder="请输入短信动态码">
  63. <template slot="prepend">
  64. <i class="el-icon-mobile"></i>
  65. </template>
  66. <template slot="append">
  67. <div class="dynacode" :class="dynacodeData.seconds == 120 ? 'ns-text-color' : 'ns-text-color-gray'" @click="sendMobileCode('ruleForm')">
  68. {{ dynacodeData.codeText }}
  69. </div>
  70. </template>
  71. </el-input>
  72. </el-form-item>
  73. <el-form-item><el-button type="primary" @click="nextStepToSetPass('ruleForm')">下一步</el-button></el-form-item>
  74. </template>
  75. <template v-else-if="step == 3">
  76. <el-form-item prop="pass" key="4">
  77. <el-input v-model.trim="formData.pass" type="password" autocomplete="off" placeholder="请输入新的登录密码">
  78. <template slot="prepend">
  79. <i class="el-icon-lock"></i>
  80. </template>
  81. </el-input>
  82. </el-form-item>
  83. <el-form-item prop="repass" key="5">
  84. <el-input v-model.trim="formData.repass" type="password" autocomplete="off" placeholder="请再次输入新密码">
  85. <template slot="prepend">
  86. <i class="el-icon-lock"></i>
  87. </template>
  88. </el-input>
  89. </el-form-item>
  90. <el-form-item><el-button type="primary" @click="resetPass('ruleForm')">重置密码</el-button></el-form-item>
  91. </template>
  92. <template v-else-if="step == 4">
  93. <span class="ns-reset-success">重置密码成功</span>
  94. <el-form-item>
  95. <router-link to="/auth/login"><el-button type="primary">重新登录</el-button></router-link>
  96. </el-form-item>
  97. </template>
  98. </div>
  99. </el-form>
  100. </div>
  101. </el-col>
  102. </el-row>
  103. </div>
  104. </template>
  105. <script>
  106. import find from '~/assets/js/auth/find.js';
  107. export default {
  108. name: 'find_pass',
  109. layout: 'login',
  110. mixins: [find]
  111. };
  112. </script>
  113. <style lang="scss" scoped>
  114. .el-row-wrap {
  115. width: $width;
  116. margin: 0 auto;
  117. border: 1px solid #e5e5e5;
  118. ul {
  119. margin: 50px auto 0;
  120. width: 1032px;
  121. height: 51px;
  122. li {
  123. position: relative;
  124. float: left;
  125. width: 258px;
  126. height: 51px;
  127. text-align: center;
  128. div p:first-child {
  129. display: inline-block;
  130. width: 28px;
  131. height: 28px;
  132. line-height: 28px;
  133. color: #fff;
  134. border-radius: 28px;
  135. }
  136. div p:nth-child(2) {
  137. margin-top: 10px;
  138. }
  139. .line-1 {
  140. position: absolute;
  141. left: 0;
  142. top: 14px;
  143. display: inline-block;
  144. width: 100px;
  145. border-top: solid 2px;
  146. }
  147. .line-2 {
  148. position: absolute;
  149. right: 0;
  150. top: 14px;
  151. display: inline-block;
  152. width: 100px;
  153. border-top: solid 2px;
  154. }
  155. .ns-bg-color-gray {
  156. background-color: #b7b7b7;
  157. }
  158. .ns-text-color-gray {
  159. color: #898989;
  160. }
  161. .ns-border-color-gray {
  162. border-color: #e5e5e5 !important;
  163. }
  164. }
  165. }
  166. }
  167. .el-form {
  168. box-sizing: border-box;
  169. padding: 80px 0 50px;
  170. .captcha {
  171. vertical-align: top;
  172. max-width: inherit;
  173. max-height: 38px;
  174. line-height: 38px;
  175. cursor: pointer;
  176. }
  177. .dynacode {
  178. cursor: pointer;
  179. }
  180. [class*=' el-icon-'],
  181. [class^='el-icon-'] {
  182. font-size: 16px;
  183. }
  184. .ns-forget-pass {
  185. width: 60%;
  186. margin: 0 auto;
  187. }
  188. button {
  189. width: 100%;
  190. }
  191. .ns-reset-success {
  192. display: inline-block;
  193. font-size: 16px;
  194. text-align: center;
  195. width: 100%;
  196. height: 50px;
  197. line-height: 50px;
  198. }
  199. }
  200. </style>
  201. <style lang="scss">
  202. .find-pass {
  203. .ns-forget-pass-form {
  204. .el-form-item__error {
  205. /* 错误提示信息 */
  206. padding-left: 57px;
  207. }
  208. .el-tabs__active-bar,
  209. .el-tabs__nav-wrap::after {
  210. /* 清除tab标签底部横线 */
  211. height: 0;
  212. }
  213. /* 立即注册 */
  214. .el-form-item__content {
  215. line-height: 20px;
  216. }
  217. }
  218. }
  219. </style>