ForgetPasswordValidationAccount.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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. this.isShowLoading = true
  89. if (this.mobileChecked && this.captchaChecked) {
  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.$message.error(err.errMsg)
  107. })
  108. }
  109. },
  110. changeCaptcha () {
  111. var imgSrc = document.getElementById('captchaImage')
  112. imgSrc.setAttribute('src', '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf())
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .validation {
  119. margin: 0 auto;
  120. width: 100%;
  121. background: #eee;
  122. .container{
  123. padding-top: 50px;
  124. margin: 0 auto;
  125. width: 980px;
  126. text-align: center;
  127. .content{
  128. padding: 0 50px;
  129. margin: 50px auto 0;
  130. width: 100%;
  131. /*height: 540px;*/
  132. text-align: center;
  133. background: #fff;
  134. .content-top{
  135. height: 80px;
  136. line-height: 80px;
  137. h3{
  138. margin-bottom: 0;
  139. font-size: 24px;
  140. color: #000;
  141. border-bottom: 1px solid #dcdcdc;
  142. }
  143. .step{
  144. position: relative;
  145. margin-top: 10px;
  146. img{
  147. width: 315px;
  148. height: 46px;
  149. }
  150. .step-item{
  151. position: absolute;
  152. top: 45px;
  153. left: 265px;
  154. span{
  155. margin-right: 85px;
  156. font-size: 14px;
  157. color: #b4b4b4;
  158. }
  159. span.active {
  160. color: #0076ad;
  161. }
  162. }
  163. }
  164. }
  165. form {
  166. padding-bottom: 44px;
  167. margin-top: 36px;
  168. input{
  169. padding: 0 0 0 18px;
  170. width: 360px;
  171. height: 44px;
  172. line-height: 44px;
  173. font-size: 14px;
  174. color: #000;
  175. border-radius: 0;
  176. }
  177. input.msg{
  178. float: left;
  179. width: 210px;
  180. padding: 0 0 0 18px;
  181. height: 44px;
  182. line-height: 44px;
  183. font-size: 14px;
  184. color: #000;
  185. border-radius: 0;
  186. }
  187. img.msg{
  188. float: right;
  189. margin: 0;
  190. width: 130px;
  191. height: 44px;
  192. line-height: 44px;
  193. text-align: center ;
  194. font-size: 14px;
  195. border: 1px solid #dcdcdc;
  196. cursor: pointer;
  197. }
  198. input.answer {
  199. background: url("/images/all/more.png") no-repeat 325px center;
  200. cursor: pointer;
  201. }
  202. ul{
  203. display: none;
  204. position: absolute;
  205. top: 44px;
  206. left: 0;
  207. width: 360px;
  208. background: #fff;
  209. box-shadow: 0 0 5px rgba(0,0,0,.5);
  210. -moz-box-shadow: 0 0 5px rgba(0,0,0,.5);
  211. -o-box-shadow: 0 0 5px rgba(0,0,0,.5);
  212. -webkit-box-shadow: 0 0 5px rgba(0,0,0,.5);
  213. z-index: 10;
  214. li{
  215. padding-left: 18px;
  216. width: 100%;
  217. height: 30px;
  218. line-height: 30px;
  219. text-align: left;
  220. font-size: 14px;
  221. color: #000;
  222. cursor: pointer;
  223. &:hover{
  224. background: #0076ad;
  225. color: #fff;
  226. }
  227. }
  228. }
  229. span.tip{
  230. position: absolute;
  231. top: 0;
  232. right: -238px;
  233. font-size: 13px;
  234. color: #8c8c8c;
  235. a{
  236. font-size: 13px;
  237. color: #0076ad;
  238. }
  239. }
  240. i{
  241. position: absolute;
  242. top: 13px;
  243. left: 20px;
  244. font-size: 20px;
  245. color: #a0a0a0;
  246. }
  247. .btn {
  248. margin: 34px 0 16px 0;
  249. width: 360px;
  250. height: 44px;
  251. line-height: 44px;
  252. font-size: 16px;
  253. color: #fff;
  254. background: #0076AD;
  255. border-radius: 3px;
  256. }
  257. }
  258. .forms{
  259. margin-top: 37px;
  260. }
  261. .content-bottom{
  262. margin: 155px auto 0;
  263. padding-bottom: 50px;
  264. width: 360px;
  265. div.warp{
  266. padding-bottom: 65px;
  267. }
  268. p{
  269. font-size: 24px;
  270. color: #323232;
  271. img{
  272. margin-right: 20px;
  273. width: 30px;
  274. height: 28px;
  275. }
  276. }
  277. p.pass{
  278. font-size: 24px;
  279. color: #e77405;
  280. img{
  281. height: 30px;
  282. }
  283. }
  284. p.passed {
  285. color: #2ab300;
  286. img{
  287. height: 30px;
  288. }
  289. }
  290. span{
  291. display: inline-block;
  292. margin: 15px 0 140px 0;
  293. font-size: 14px;
  294. color: #8b8b8b;
  295. }
  296. .close-btn{
  297. margin: 0 auto;
  298. width: 200px;
  299. height: 36px;
  300. line-height: 36px;
  301. font-size: 14px;
  302. text-align: center;
  303. color: #323232;
  304. border: 1px solid #d2d2d2;
  305. border-radius: 3px;
  306. cursor: pointer ;
  307. }
  308. span.use{
  309. display: inline-block;
  310. margin-bottom: 30px;
  311. width: 360px;
  312. font-size: 14px;
  313. color: #000;
  314. text-align: left;
  315. em{
  316. font-size: 14px;
  317. font-style: normal;
  318. color: #000;
  319. }
  320. }
  321. .form-group {
  322. margin: 0 auto 16px;
  323. position: relative;
  324. width: 360px;
  325. height: 44px;
  326. line-height: 44px;
  327. input{
  328. padding: 0 0 0 18px;
  329. width: 360px;
  330. height: 44px;
  331. line-height: 44px;
  332. font-size: 14px;
  333. color: #000;
  334. border-radius: 0;
  335. }
  336. input.msg{
  337. float: left;
  338. width: 210px;
  339. padding: 0 0 0 18px;
  340. height: 44px;
  341. line-height: 44px;
  342. font-size: 14px;
  343. color: #000;
  344. border-radius: 0;
  345. }
  346. span.msg{
  347. float: right;
  348. margin: 0;
  349. width: 130px;
  350. height: 44px;
  351. line-height: 44px;
  352. text-align: center ;
  353. font-size: 14px;
  354. color: #5a5a5a;
  355. background: #f4f4f4;
  356. border: 1px solid #dcdcdc;
  357. cursor: pointer;
  358. }
  359. span.msg.send{
  360. background: #d2d2d2;
  361. color: #fff;
  362. }
  363. }
  364. .btn {
  365. margin: 34px 0 10px 0;
  366. width: 360px;
  367. height: 44px;
  368. line-height: 4px;
  369. font-size: 16px;
  370. color: #fff;
  371. background: #0076AD;
  372. border-radius: 3px;
  373. }
  374. }
  375. .choose{
  376. margin: 155px auto 0;
  377. padding-bottom: 44px;
  378. div{
  379. padding: 0 15px;
  380. margin: 0 auto 16px;
  381. width: 360px;
  382. height: 60px;
  383. line-height: 60px;
  384. text-align: left;
  385. overflow: hidden;
  386. border: 1px solid #d2d2d2;
  387. cursor: pointer;
  388. &:hover,&.active{
  389. border-color: #0076ad;
  390. span{
  391. color: #0076ad;
  392. }
  393. i.second {
  394. color: #0076ad;
  395. }
  396. }
  397. img.first{
  398. float: left;
  399. margin: 24px 20px 0 0;
  400. font-size: 20px;
  401. color: #323232;
  402. }
  403. img.first.mob{
  404. margin: 22px 20px 0 5px;
  405. font-size: 28px;
  406. }
  407. i.second {
  408. float: right;
  409. margin: 20px 0 0 5px;
  410. font-size: 20px;
  411. color: #323232;
  412. }
  413. span{
  414. float: left;
  415. font-size: 14px;
  416. color: #323232;
  417. }
  418. }
  419. }
  420. a.return{
  421. position: absolute;
  422. left: 0;
  423. top: -15px;
  424. img{
  425. width: 34px !important;
  426. height: 34px !important;
  427. }
  428. }
  429. }
  430. }
  431. }
  432. </style>