ForgetPasswordValidationAccount.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <template>
  2. <div class="validation">
  3. <div class="container">
  4. <div class="content">
  5. <div class="content-top">
  6. <h3>密码重置</h3>
  7. </div>
  8. <div>
  9. <el-form :model="valid" :rules="rules" ref="valid" label-width="100px" class="demo-ruleForm">
  10. <el-form-item prop="mobile">
  11. <el-input v-model="valid.mobile" placeholder="原手机号"></el-input>
  12. </el-form-item>
  13. <el-form-item prop="captcha">
  14. <el-input type="text" v-model="valid.captcha"
  15. auto-complete="off"
  16. class="msg"
  17. placeholder="验证码"></el-input>
  18. <img src="/sso/resetPwd/checkCaptcha" class="msg" id="captchaImage" @click="changeCaptcha"/>
  19. </el-form-item>
  20. <el-form-item>
  21. <a class="btn finish"
  22. :disabled="!mobileChecked || !captchaChecked"
  23. @click="sureAccount">下一步</a>
  24. </el-form-item>
  25. </el-form>
  26. </div>
  27. </div>
  28. <loading v-show="isShowLoading"/>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. import Loading from '~components/common/loading/Loading.vue'
  34. export default {
  35. name: 'reset',
  36. components: {
  37. Loading
  38. },
  39. data () {
  40. var validateMobile = (rule, value, callback) => {
  41. if (value === '') {
  42. callback(new Error('请填写正确的手机号'))
  43. this.mobileChecked = false
  44. } else {
  45. if (this.valid.mobile !== '') {
  46. var reg = /^1[0-9]{10}$/
  47. if (!reg.test(value)) {
  48. callback(new Error('请填写正确的手机号'))
  49. this.mobileChecked = false
  50. } else {
  51. this.mobileChecked = true
  52. }
  53. }
  54. callback()
  55. }
  56. }
  57. var validateCode = (rule, value, callback) => {
  58. if (value === '') {
  59. callback(new Error('请填写正确的验证码'))
  60. this.captchaChecked = false
  61. } else {
  62. if (this.valid.captcha !== '') {
  63. this.captchaChecked = true
  64. }
  65. callback()
  66. }
  67. }
  68. return {
  69. valid: {
  70. mobile: '',
  71. captcha: ''
  72. },
  73. isShowLoading: false,
  74. mobileChecked: false,
  75. captchaChecked: false,
  76. rules: {
  77. mobile: [
  78. {validator: validateMobile, trigger: 'blur'}
  79. ],
  80. captcha: [
  81. {validator: validateCode, trigger: 'blur'}
  82. ]
  83. }
  84. }
  85. },
  86. methods: {
  87. sureAccount () {
  88. if (this.mobileChecked && this.captchaChecked) {
  89. this.isShowLoading = true
  90. let param = new FormData()
  91. param.append('mobile', this.valid.mobile)
  92. param.append('captcha', this.valid.captcha)
  93. let config = {
  94. headers: {'Content-Type': 'multipart/form-data'}
  95. }
  96. this.$http.post(`/sso/resetPwd/checkCaptcha`, param, config)
  97. .then(response => {
  98. if (response.data.success) {
  99. this.isShowLoading = false
  100. this.$router.push({ path: '/reset/forgetPasswordChooseStyle' })
  101. } else {
  102. this.changeCaptcha()
  103. return Promise.reject(response.data)
  104. }
  105. }).catch(err => {
  106. this.isShowLoading = false
  107. this.$message.error(err.errMsg)
  108. })
  109. }
  110. },
  111. changeCaptcha () {
  112. var imgSrc = document.getElementById('captchaImage')
  113. imgSrc.setAttribute('src', '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf())
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .validation {
  120. margin: 0 auto;
  121. width: 100%;
  122. background: #eee;
  123. .container{
  124. padding-top: 50px;
  125. margin: 0 auto;
  126. width: 980px;
  127. text-align: center;
  128. .content{
  129. padding: 0 50px;
  130. margin: 50px auto 0;
  131. width: 100%;
  132. /*height: 540px;*/
  133. text-align: center;
  134. background: #fff;
  135. .content-top{
  136. height: 80px;
  137. line-height: 80px;
  138. h3{
  139. margin-bottom: 0;
  140. font-size: 24px;
  141. color: #000;
  142. border-bottom: 1px solid #dcdcdc;
  143. }
  144. .step{
  145. position: relative;
  146. margin-top: 10px;
  147. img{
  148. width: 315px;
  149. height: 46px;
  150. }
  151. .step-item{
  152. position: absolute;
  153. top: 45px;
  154. left: 265px;
  155. span{
  156. margin-right: 85px;
  157. font-size: 14px;
  158. color: #b4b4b4;
  159. }
  160. span.active {
  161. color: #0076ad;
  162. }
  163. }
  164. }
  165. }
  166. form {
  167. padding-bottom: 44px;
  168. margin-top: 36px;
  169. input{
  170. padding: 0 0 0 18px;
  171. width: 360px;
  172. height: 44px;
  173. line-height: 44px;
  174. font-size: 14px;
  175. color: #000;
  176. border-radius: 0;
  177. }
  178. input.msg{
  179. float: left;
  180. width: 210px;
  181. padding: 0 0 0 18px;
  182. height: 44px;
  183. line-height: 44px;
  184. font-size: 14px;
  185. color: #000;
  186. border-radius: 0;
  187. }
  188. img.msg{
  189. float: right;
  190. margin: 0;
  191. width: 130px;
  192. height: 44px;
  193. line-height: 44px;
  194. text-align: center ;
  195. font-size: 14px;
  196. border: 1px solid #dcdcdc;
  197. cursor: pointer;
  198. }
  199. input.answer {
  200. background: url("/images/all/more.png") no-repeat 325px center;
  201. cursor: pointer;
  202. }
  203. ul{
  204. display: none;
  205. position: absolute;
  206. top: 44px;
  207. left: 0;
  208. width: 360px;
  209. background: #fff;
  210. box-shadow: 0 0 5px rgba(0,0,0,.5);
  211. -moz-box-shadow: 0 0 5px rgba(0,0,0,.5);
  212. -o-box-shadow: 0 0 5px rgba(0,0,0,.5);
  213. -webkit-box-shadow: 0 0 5px rgba(0,0,0,.5);
  214. z-index: 10;
  215. li{
  216. padding-left: 18px;
  217. width: 100%;
  218. height: 30px;
  219. line-height: 30px;
  220. text-align: left;
  221. font-size: 14px;
  222. color: #000;
  223. cursor: pointer;
  224. &:hover{
  225. background: #0076ad;
  226. color: #fff;
  227. }
  228. }
  229. }
  230. span.tip{
  231. position: absolute;
  232. top: 0;
  233. right: -238px;
  234. font-size: 13px;
  235. color: #8c8c8c;
  236. a{
  237. font-size: 13px;
  238. color: #0076ad;
  239. }
  240. }
  241. i{
  242. position: absolute;
  243. top: 13px;
  244. left: 20px;
  245. font-size: 20px;
  246. color: #a0a0a0;
  247. }
  248. .btn {
  249. margin: 34px 0 16px 0;
  250. width: 360px;
  251. height: 44px;
  252. line-height: 44px;
  253. font-size: 16px;
  254. color: #fff;
  255. background: #0076AD;
  256. border-radius: 3px;
  257. }
  258. }
  259. .forms{
  260. margin-top: 37px;
  261. }
  262. .content-bottom{
  263. margin: 155px auto 0;
  264. padding-bottom: 50px;
  265. width: 360px;
  266. div.warp{
  267. padding-bottom: 65px;
  268. }
  269. p{
  270. font-size: 24px;
  271. color: #323232;
  272. img{
  273. margin-right: 20px;
  274. width: 30px;
  275. height: 28px;
  276. }
  277. }
  278. p.pass{
  279. font-size: 24px;
  280. color: #e77405;
  281. img{
  282. height: 30px;
  283. }
  284. }
  285. p.passed {
  286. color: #2ab300;
  287. img{
  288. height: 30px;
  289. }
  290. }
  291. span{
  292. display: inline-block;
  293. margin: 15px 0 140px 0;
  294. font-size: 14px;
  295. color: #8b8b8b;
  296. }
  297. .close-btn{
  298. margin: 0 auto;
  299. width: 200px;
  300. height: 36px;
  301. line-height: 36px;
  302. font-size: 14px;
  303. text-align: center;
  304. color: #323232;
  305. border: 1px solid #d2d2d2;
  306. border-radius: 3px;
  307. cursor: pointer ;
  308. }
  309. span.use{
  310. display: inline-block;
  311. margin-bottom: 30px;
  312. width: 360px;
  313. font-size: 14px;
  314. color: #000;
  315. text-align: left;
  316. em{
  317. font-size: 14px;
  318. font-style: normal;
  319. color: #000;
  320. }
  321. }
  322. .form-group {
  323. margin: 0 auto 16px;
  324. position: relative;
  325. width: 360px;
  326. height: 44px;
  327. line-height: 44px;
  328. input{
  329. padding: 0 0 0 18px;
  330. width: 360px;
  331. height: 44px;
  332. line-height: 44px;
  333. font-size: 14px;
  334. color: #000;
  335. border-radius: 0;
  336. }
  337. input.msg{
  338. float: left;
  339. width: 210px;
  340. padding: 0 0 0 18px;
  341. height: 44px;
  342. line-height: 44px;
  343. font-size: 14px;
  344. color: #000;
  345. border-radius: 0;
  346. }
  347. span.msg{
  348. float: right;
  349. margin: 0;
  350. width: 130px;
  351. height: 44px;
  352. line-height: 44px;
  353. text-align: center ;
  354. font-size: 14px;
  355. color: #5a5a5a;
  356. background: #f4f4f4;
  357. border: 1px solid #dcdcdc;
  358. cursor: pointer;
  359. }
  360. span.msg.send{
  361. background: #d2d2d2;
  362. color: #fff;
  363. }
  364. }
  365. .btn {
  366. margin: 34px 0 10px 0;
  367. width: 360px;
  368. height: 44px;
  369. line-height: 4px;
  370. font-size: 16px;
  371. color: #fff;
  372. background: #0076AD;
  373. border-radius: 3px;
  374. }
  375. }
  376. .choose{
  377. margin: 155px auto 0;
  378. padding-bottom: 44px;
  379. div{
  380. padding: 0 15px;
  381. margin: 0 auto 16px;
  382. width: 360px;
  383. height: 60px;
  384. line-height: 60px;
  385. text-align: left;
  386. overflow: hidden;
  387. border: 1px solid #d2d2d2;
  388. cursor: pointer;
  389. &:hover,&.active{
  390. border-color: #0076ad;
  391. span{
  392. color: #0076ad;
  393. }
  394. i.second {
  395. color: #0076ad;
  396. }
  397. }
  398. img.first{
  399. float: left;
  400. margin: 24px 20px 0 0;
  401. font-size: 20px;
  402. color: #323232;
  403. }
  404. img.first.mob{
  405. margin: 22px 20px 0 5px;
  406. font-size: 28px;
  407. }
  408. i.second {
  409. float: right;
  410. margin: 20px 0 0 5px;
  411. font-size: 20px;
  412. color: #323232;
  413. }
  414. span{
  415. float: left;
  416. font-size: 14px;
  417. color: #323232;
  418. }
  419. }
  420. }
  421. a.return{
  422. position: absolute;
  423. left: 0;
  424. top: -15px;
  425. img{
  426. width: 34px !important;
  427. height: 34px !important;
  428. }
  429. }
  430. }
  431. }
  432. }
  433. </style>