ballotTopBannerZH.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. <template>
  2.  
  3. <div>
  4. <div class="box-bon">
  5. <div class="top-btm-box" v-if="changePassword"></div>
  6. </div>
  7. <div class="tal-top">
  8. <span class="tal-first">欢迎进入会员大会!</span>
  9. <span class="tal-second" @click="goOut">
  10. <img src="@/assets/ballot/退出.png" alt="" />
  11. 退出</span
  12. >
  13. <span class="tal-third">|</span>
  14. <span class="tal-fourc" @click="openChange">
  15. <img src="@/assets/ballot/修改密码.png" alt="" />
  16. 修改密码</span
  17. >
  18. </div>
  19.  
  20. <div class="box-big" v-if="changePassword">
  21. <div class="change-top">
  22. <!-- <div class="change-box">
  23. <el-select v-model="language.value" class="change-change">
  24. <el-option v-for="item in optionsInfoList" :key="item.value" :label="item.label"
  25. :value="item.value">
  26. </el-option>
  27. </el-select>
  28. </div> -->
  29. <div></div>
  30. <div class="change-text">修改密码</div>
  31. <div class="change-pic" @click="closeList">
  32. <img src="@/assets/ballot/close-l.png" alt="" />
  33. </div>
  34. </div>
  35. <div class="change-user-info">
  36. <div class="change-user-id">
  37. <div class="change-title">原密码:</div>
  38. <el-input
  39. v-model="changeList.oldPassword"
  40. placeholder="请输入原密码"
  41. show-password
  42. ></el-input>
  43. </div>
  44. <div class="change-user-pws">
  45. <div class="change-title">新密码:</div>
  46. <el-input
  47. placeholder="请输入新密码"
  48. v-model="changeList.password"
  49. show-password
  50. @blur="getInp"
  51. >
  52. </el-input>
  53. </div>
  54. <div class="change-user-yzm">
  55. <div class="change-title">确认密码:</div>
  56. <el-input
  57. placeholder="请再次输入新密码"
  58. v-model="changeList.newPassword"
  59. show-password
  60. ></el-input>
  61. </div>
  62. <div class="user-change">密码规则:</div>
  63. <div class="user-long">1.&nbsp;&nbsp;密码长度:8-20位</div>
  64. <div class="user-style">
  65. 2.&nbsp;&nbsp;密码格式:大小写英文字母、数字、特殊符号至少三项混合,并且符合安全规定。
  66. </div>
  67. <div class="user-change-pic" @click="sureChange" v-if="getDisabled">
  68. 保 存
  69. </div>
  70. <div class="user-change-pic" @click="sureToChange" v-else>保 存</div>
  71. </div>
  72. <div class="change-btm-pic">
  73. <img src="@/assets/ballot/未标题-2.png" alt="" />
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import { BallotChanges } from '@/api/ballot/ballot'
  80. export default {
  81. name: 'ballotLogin',
  82. data() {
  83. return {
  84. getDisabled: false,
  85. changePassword: false,
  86. optionsInfoList: [
  87. {
  88. value: 'CN',
  89. label: '中文',
  90. },
  91. {
  92. value: 'EN',
  93. label: 'English',
  94. },
  95. {
  96. value: 'FR',
  97. label: 'Français',
  98. },
  99. {
  100. value: 'RU',
  101. label: 'Русский',
  102. },
  103. ],
  104. language: {
  105. value: 'CN',
  106. },
  107. changeList: {
  108. id: undefined,
  109. oldPassword: undefined,
  110. password: undefined,
  111. newPassword: undefined,
  112. },
  113. }
  114. },
  115. mounted() {
  116. let language = sessionStorage.getItem('language')
  117. this.language.value = language
  118. },
  119. methods: {
  120. getInp() {
  121. let value = this.changeList.password
  122. console.log(value)
  123. if (value == '' || value == undefined || value == null) {
  124. this.$message.error(
  125. '请输入8-20位密码,包含大小写字母、数字、特殊符号至少三项'
  126. )
  127. } else {
  128. const reg =
  129. /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*_+\?<>:"\{\}\|\\';/\.,`=-])[^\u4E00-\u9FA5][A-Za-z\d~!@#$%^&*_+\?<>:"\{\}\|\\';/\.,`=-]{7,19}$/
  130. console.log(reg.test(value))
  131. if (!reg.test(value)) {
  132. this.$message.error(
  133. '请输入8-20位密码,包含大小写字母、数字、特殊符号至少三项'
  134. )
  135. } else {
  136. this.$message.success('密码格式正确!')
  137. this.getDisabled = true
  138. }
  139. }
  140. },
  141. goOut() {
  142. sessionStorage.removeItem('language')
  143. sessionStorage.removeItem('mettingUser')
  144. sessionStorage.removeItem('item')
  145. sessionStorage.removeItem('lastList')
  146. localStorage.removeItem('language')
  147. localStorage.removeItem('mettingUser')
  148. localStorage.removeItem('item')
  149. localStorage.removeItem('lastList')
  150. this.$message.success('正在退出,请稍后...')
  151. setTimeout(() => {
  152. this.$router.push({ path: 'home' })
  153. }, 1500)
  154. },
  155. openChange() {
  156. this.changePassword = true
  157. },
  158. closeList() {
  159. this.changeList.oldPassword = ''
  160. this.changeList.password = ''
  161. this.changeList.newPassword = ''
  162. this.changePassword = false
  163. },
  164. sureToChange() {
  165. this.$message.error(
  166. '请输入8-20位密码,包含大小写字母、数字、特殊符号至少三项'
  167. )
  168. },
  169. sureChange() {
  170. console.log(111)
  171. if (this.changeList.password != this.changeList.newPassword) {
  172. this.$message.error('两次密码不一致,请重新输入!')
  173. } else {
  174. let id = JSON.parse(sessionStorage.getItem('mettingUser')).userId
  175. let params = {
  176. id: id,
  177. oldPassword: this.changeList.oldPassword,
  178. password: this.changeList.password,
  179. }
  180. console.log(params)
  181. BallotChanges(params)
  182. .then((res) => {
  183. console.log(res)
  184. this.$message.success('修改成功,请重新登录')
  185. let params = JSON.stringify(params)
  186. sessionStorage.setItem('userPassword', [params])
  187. setTimeout(() => {
  188. this.goOut()
  189. }, 1500)
  190. })
  191. .catch((error) => {
  192. this.$message.error('原密码输入错误,请重新输入')
  193. })
  194. }
  195. },
  196. },
  197. }
  198. </script>
  199. <style scoped>
  200. @media screen and (min-width: 1080px) {
  201. .box-big {
  202. margin: 50px auto;
  203. width: 650px;
  204. height: 570px;
  205. background: linear-gradient(0deg, #00b4ff 0%, #094fc0 100%);
  206. box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.5);
  207. overflow: hidden;
  208. z-index: 999;
  209. position: absolute;
  210. top: 50px;
  211. left: 50%;
  212. transform: translateX(-50%);
  213. }
  214. .tal-top {
  215. width: 100%;
  216. height: 40px;
  217. background-color: #155199;
  218. }
  219. .box-bon {
  220. position: relative;
  221. }
  222. .top-btm-box {
  223. width: 100%;
  224. height: 1298px;
  225. background-color: #000;
  226. opacity: 0.5;
  227. z-index: 998;
  228. position: absolute;
  229. top: -100%;
  230. }
  231. .tal-first {
  232. display: inline-block;
  233. /* width: 140px; */
  234. height: 40px;
  235. font-size: 15px;
  236. text-align: center;
  237. line-height: 40px;
  238. color: #fff;
  239. margin-left: 60%;
  240. margin-right: 3%;
  241. }
  242. .tal-second {
  243. display: inline-block;
  244. height: 40px;
  245. font-size: 15px;
  246. text-align: center;
  247. line-height: 40px;
  248. color: #fff;
  249. cursor: pointer;
  250. font-weight: 600;
  251. }
  252. .tal-second > img {
  253. width: 16px;
  254. height: 16px;
  255. transform: translateY(3px);
  256. }
  257. .tal-third {
  258. display: inline-block;
  259. height: 40px;
  260. text-align: center;
  261. line-height: 40px;
  262. color: #fff;
  263. margin-left: 1%;
  264. margin-right: 1%;
  265. }
  266. .tal-fourc {
  267. display: inline-block;
  268. height: 40px;
  269. font-size: 15px;
  270. text-align: center;
  271. line-height: 40px;
  272. color: #fff;
  273. cursor: pointer;
  274. font-weight: 600;
  275. }
  276. .tal-fourc > img {
  277. width: 20px;
  278. height: 20px;
  279. transform: translateY(5px);
  280. }
  281. .change-top {
  282. width: 650px;
  283. height: 81px;
  284. background: #f5f5f5;
  285. border-radius: 4px 4px 0px 0px;
  286. position: relative;
  287. }
  288. .change-change {
  289. width: 120px;
  290. height: 41px;
  291. line-height: 41px;
  292. font-size: 14px;
  293. transform: translateX(30px) translateY(20px);
  294. }
  295. .change-text {
  296. width: 260px;
  297. height: 20px;
  298. text-align: center;
  299. font-size: 20px;
  300. font-family: PingFangSC-Medium, PingFang SC;
  301. font-weight: 500;
  302. color: #262626;
  303. line-height: 20px;
  304. position: absolute;
  305. top: 32px;
  306. left: 191px;
  307. }
  308. .change-pic {
  309. width: 25px;
  310. height: 24px;
  311. text-align: center;
  312. overflow: hidden;
  313. border-radius: 20px;
  314. cursor: pointer;
  315. position: absolute;
  316. top: 32px;
  317. right: 21px;
  318. }
  319. .change-pic > img {
  320. width: 100%;
  321. height: 100%;
  322. }
  323. .change-user-info {
  324. width: 650px;
  325. height: 508px;
  326. padding: 0 40px;
  327. }
  328. .change-item-id {
  329. width: 570px;
  330. height: 51px;
  331. margin-top: 10px;
  332. position: relative;
  333. }
  334. .change-user-id {
  335. width: 570px;
  336. height: 51px;
  337. margin-top: 10px;
  338. position: relative;
  339. }
  340. .change-user-id {
  341. width: 570px;
  342. height: 51px;
  343. margin-top: 30px;
  344. position: relative;
  345. }
  346. .change-user-pws {
  347. width: 570px;
  348. height: 51px;
  349. margin-top: 30px;
  350. position: relative;
  351. }
  352. .change-user-yzm {
  353. width: 570px;
  354. height: 51px;
  355. margin-top: 30px;
  356. position: relative;
  357. }
  358. .change-title {
  359. height: 39px;
  360. line-height: 39px;
  361. z-index: 997;
  362. width: 120px;
  363. font-size: 13px;
  364. text-align: left;
  365. border-radius: 10px;
  366. position: absolute;
  367. top: 0;
  368. left: 8px;
  369. }
  370. .user-change-pic {
  371. width: 570px;
  372. height: 59px;
  373. text-align: center;
  374. line-height: 59px;
  375. cursor: pointer;
  376. font-size: 24px;
  377. color: #fff;
  378. margin-top: 50px;
  379. background: linear-gradient(177deg, #84e2ff 0%, #30ade8 100%);
  380. box-shadow: 0px 2px 4px 0px #097fb0,
  381. inset 0px 3px 3px 0px rgba(194, 235, 255, 0.63);
  382. border-radius: 8px;
  383. }
  384. .user-change {
  385. width: 570px;
  386. height: 16px;
  387. font-size: 16px;
  388. font-family: PingFangSC-Regular, PingFang SC;
  389. font-weight: 400;
  390. color: #333333;
  391. line-height: 16px;
  392. margin-left: 10px;
  393. }
  394. .user-style {
  395. width: 570px;
  396. height: 24px;
  397. font-size: 16px;
  398. margin-top: 10px;
  399. margin-left: 10px;
  400. font-family: PingFangSC-Regular, PingFang SC;
  401. font-weight: 400;
  402. color: #333333;
  403. line-height: 24px;
  404. }
  405. .user-long {
  406. width: 570px;
  407. height: 20px;
  408. font-size: 16px;
  409. margin-top: 10px;
  410. margin-left: 10px;
  411. font-family: PingFangSC-Regular, PingFang SC;
  412. font-weight: 400;
  413. color: #333333;
  414. line-height: 20px;
  415. }
  416. .change-btm-pic {
  417. width: 100%;
  418. position: absolute;
  419. top: 535px;
  420. }
  421. .change-btm-pic > img {
  422. width: 100%;
  423. }
  424. /deep/.change-user-info .el-input__inner {
  425. padding-left: 130px;
  426. background-color: #f5f5f5;
  427. }
  428. }
  429. @media screen and (max-width: 1079px) {
  430. .box-big {
  431. margin: 50px auto;
  432. width: 650px;
  433. height: 570px;
  434. background: linear-gradient(0deg, #00b4ff 0%, #094fc0 100%);
  435. box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.5);
  436. overflow: hidden;
  437. z-index: 999;
  438. position: absolute;
  439. top: 50px;
  440. left: 200px;
  441. }
  442. .tal-top {
  443. width: 100%;
  444. height: 40px;
  445. background-color: #155199;
  446. }
  447. .box-bon {
  448. position: relative;
  449. }
  450. .top-btm-box {
  451. width: 100%;
  452. height: 1298px;
  453. background-color: #000;
  454. opacity: 0.5;
  455. z-index: 998;
  456. position: absolute;
  457. top: -100%;
  458. }
  459. .tal-first {
  460. display: inline-block;
  461. /* width: 140px; */
  462. height: 40px;
  463. font-size: 15px;
  464. text-align: center;
  465. line-height: 40px;
  466. color: #fff;
  467. margin-left: 60%;
  468. margin-right: 3%;
  469. }
  470. .tal-second {
  471. display: inline-block;
  472. height: 40px;
  473. font-size: 15px;
  474. text-align: center;
  475. line-height: 40px;
  476. color: #fff;
  477. cursor: pointer;
  478. font-weight: 600;
  479. }
  480. .tal-second > img {
  481. width: 16px;
  482. height: 16px;
  483. transform: translateY(3px);
  484. }
  485. .tal-third {
  486. display: inline-block;
  487. height: 40px;
  488. text-align: center;
  489. line-height: 40px;
  490. color: #fff;
  491. margin-left: 1%;
  492. margin-right: 1%;
  493. }
  494. .tal-fourc {
  495. display: inline-block;
  496. height: 40px;
  497. font-size: 15px;
  498. text-align: center;
  499. line-height: 40px;
  500. color: #fff;
  501. cursor: pointer;
  502. font-weight: 600;
  503. }
  504. .tal-fourc > img {
  505. width: 20px;
  506. height: 20px;
  507. transform: translateY(5px);
  508. }
  509. .change-top {
  510. width: 650px;
  511. height: 81px;
  512. background: #f5f5f5;
  513. border-radius: 4px 4px 0px 0px;
  514. position: relative;
  515. }
  516. .change-change {
  517. width: 120px;
  518. height: 41px;
  519. line-height: 41px;
  520. font-size: 14px;
  521. transform: translateX(30px) translateY(20px);
  522. }
  523. .change-text {
  524. width: 260px;
  525. height: 20px;
  526. text-align: center;
  527. font-size: 20px;
  528. font-family: PingFangSC-Medium, PingFang SC;
  529. font-weight: 500;
  530. color: #262626;
  531. line-height: 20px;
  532. position: absolute;
  533. top: 32px;
  534. left: 191px;
  535. }
  536. .change-pic {
  537. width: 25px;
  538. height: 24px;
  539. text-align: center;
  540. overflow: hidden;
  541. border-radius: 20px;
  542. cursor: pointer;
  543. position: absolute;
  544. top: 32px;
  545. right: 21px;
  546. }
  547. .change-pic > img {
  548. width: 100%;
  549. height: 100%;
  550. }
  551. .change-user-info {
  552. width: 650px;
  553. height: 508px;
  554. padding: 0 40px;
  555. }
  556. .change-item-id {
  557. width: 570px;
  558. height: 51px;
  559. margin-top: 10px;
  560. position: relative;
  561. }
  562. .change-user-id {
  563. width: 570px;
  564. height: 51px;
  565. margin-top: 10px;
  566. position: relative;
  567. }
  568. .change-user-id {
  569. width: 570px;
  570. height: 51px;
  571. margin-top: 30px;
  572. position: relative;
  573. }
  574. .change-user-pws {
  575. width: 570px;
  576. height: 51px;
  577. margin-top: 30px;
  578. position: relative;
  579. }
  580. .change-user-yzm {
  581. width: 570px;
  582. height: 51px;
  583. margin-top: 30px;
  584. position: relative;
  585. }
  586. .change-title {
  587. height: 39px;
  588. line-height: 39px;
  589. z-index: 997;
  590. width: 120px;
  591. font-size: 13px;
  592. text-align: left;
  593. border-radius: 10px;
  594. position: absolute;
  595. top: 0;
  596. left: 8px;
  597. }
  598. .user-change-pic {
  599. width: 570px;
  600. height: 59px;
  601. text-align: center;
  602. line-height: 59px;
  603. cursor: pointer;
  604. font-size: 24px;
  605. color: #fff;
  606. margin-top: 50px;
  607. background: linear-gradient(177deg, #84e2ff 0%, #30ade8 100%);
  608. box-shadow: 0px 2px 4px 0px #097fb0,
  609. inset 0px 3px 3px 0px rgba(194, 235, 255, 0.63);
  610. border-radius: 8px;
  611. }
  612. .user-change {
  613. width: 570px;
  614. height: 16px;
  615. font-size: 16px;
  616. font-family: PingFangSC-Regular, PingFang SC;
  617. font-weight: 400;
  618. color: #333333;
  619. line-height: 16px;
  620. margin-left: 10px;
  621. }
  622. .user-style {
  623. width: 570px;
  624. height: 24px;
  625. font-size: 16px;
  626. margin-top: 10px;
  627. margin-left: 10px;
  628. font-family: PingFangSC-Regular, PingFang SC;
  629. font-weight: 400;
  630. color: #333333;
  631. line-height: 24px;
  632. }
  633. .user-long {
  634. width: 570px;
  635. height: 20px;
  636. font-size: 16px;
  637. margin-top: 10px;
  638. margin-left: 10px;
  639. font-family: PingFangSC-Regular, PingFang SC;
  640. font-weight: 400;
  641. color: #333333;
  642. line-height: 20px;
  643. }
  644. .change-btm-pic {
  645. width: 100%;
  646. position: absolute;
  647. top: 535px;
  648. }
  649. .change-btm-pic > img {
  650. width: 100%;
  651. }
  652. /deep/.change-user-info .el-input__inner {
  653. padding-left: 130px;
  654. background-color: #f5f5f5;
  655. }
  656. }
  657. </style>