EncryptedSelect.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <div class="validation">
  3. <div class="container">
  4. <div class="content">
  5. <div class="content-top">
  6. <h3>添加密保设置</h3>
  7. <div class="step">
  8. <img src="/images/all/step01.png" alt=""/>
  9. <div class="step-item"><span class="active">账号验证</span><span>密保设置</span><span>设置完成</span></div>
  10. </div>
  11. </div>
  12. <div class="choose">
  13. <div v-show="hasValidPhoneWay"
  14. @click="chooseWay('mobile')">
  15. <img src="/images/all/icon01.png" alt="" class="first mob"/>
  16. <span>通过验证手机</span><i class="fa fa-angle-right second"></i>
  17. </div>
  18. <div v-show="hasValidEmailWay"
  19. @click="chooseWay('email')">
  20. <img src="/images/all/icon02.png" alt="" class="first"/>
  21. <span>通过验证邮箱</span><i class="fa fa-angle-right second"></i>
  22. </div>
  23. </div>
  24. </div>
  25. <!--未验证手机弹出框-->
  26. <div>
  27. <el-dialog class="valid-phone"
  28. :visible.sync="goValidPhone"
  29. @click="goValidPhoneStep"
  30. size="tiny">
  31. <div class="set-tip" v-show="goValidPhone">
  32. <p>您的账号未验证手机,请先验证手机号</p>
  33. <a href="/validation/phoneValidation">确定</a>
  34. </div>
  35. </el-dialog>
  36. </div>
  37. <loading v-show="isShowLoading"/>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. import Loading from '~components/common/loading/Loading.vue'
  43. export default {
  44. name: 'validation',
  45. components: {
  46. Loading
  47. },
  48. data () {
  49. return {
  50. isShowLoading: false,
  51. hasValidPhoneWay: false,
  52. hasValidEmailWay: false,
  53. goValidPhone: false,
  54. mobile: '',
  55. email: ''
  56. }
  57. },
  58. mounted () {
  59. // 获取验证方式
  60. this.$nextTick(() => {
  61. this.getVerifyWay()
  62. })
  63. },
  64. methods: {
  65. // 选择跳转方式
  66. chooseWay (type) {
  67. this.$emit('stepEvent', type)
  68. if (type === 'mobile') {
  69. this.$emit('setDataEvent', this.mobile)
  70. }
  71. if (type === 'email') {
  72. this.$emit('setDataEvent', this.email)
  73. }
  74. },
  75. // 获取验证方式
  76. getVerifyWay () {
  77. this.$http.get('/update/user/checkType')
  78. .then(response => {
  79. if (response.data.success) {
  80. if (!response.data.content.mobile) {
  81. this.goValidPhone = true
  82. } else {
  83. if (response.data.content.mobile) {
  84. this.hasValidPhoneWay = true
  85. this.mobile = response.data.content.mobile
  86. }
  87. if (response.data.content.email) {
  88. this.hasValidEmailWay = true
  89. this.email = response.data.content.email
  90. }
  91. this.goValidPhone = false
  92. }
  93. } else {
  94. return Promise.reject(response.data)
  95. }
  96. }).catch(err => {
  97. this.$message.error(err.errMsg)
  98. })
  99. },
  100. // 验证手机页面
  101. goValidPhoneStep () {
  102. this.$router.push({ path: '/validation/phoneValidation' })
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .validation {
  109. margin: 0 auto;
  110. width: 100%;
  111. background: #eee;
  112. .container{
  113. padding-top: 50px;
  114. margin: 0 auto;
  115. width: 980px;
  116. text-align: center;
  117. .content{
  118. padding: 0 50px;
  119. margin: 50px auto 0;
  120. width: 100%;
  121. /*height: 540px;*/
  122. text-align: center;
  123. background: #fff;
  124. .content-top{
  125. height: 80px;
  126. line-height: 80px;
  127. h3{
  128. margin-bottom: 0;
  129. font-size: 24px;
  130. color: #000;
  131. border-bottom: 1px solid #dcdcdc;
  132. }
  133. .step{
  134. position: relative;
  135. margin-top: 10px;
  136. img{
  137. width: 315px;
  138. height: 46px;
  139. }
  140. .step-item{
  141. position: absolute;
  142. top: 45px;
  143. left: 265px;
  144. span{
  145. margin-right: 78px;
  146. font-size: 14px;
  147. color: #b4b4b4;
  148. }
  149. span.active {
  150. color: #0076ad;
  151. }
  152. }
  153. }
  154. }
  155. form {
  156. margin-top: 150px;
  157. padding-bottom: 44px;
  158. input{
  159. padding: 0 0 0 18px;
  160. width: 360px;
  161. height: 44px;
  162. line-height: 44px;
  163. font-size: 14px;
  164. color: #000;
  165. border-radius: 0;
  166. }
  167. input.answer {
  168. background: url("/images/all/more.png") no-repeat 325px center;
  169. cursor: pointer;
  170. }
  171. ul{
  172. display: none;
  173. position: absolute;
  174. top: 44px;
  175. left: 0;
  176. width: 360px;
  177. background: #fff;
  178. box-shadow: 0 0 5px rgba(0,0,0,.5);
  179. -moz-box-shadow: 0 0 5px rgba(0,0,0,.5);
  180. -o-box-shadow: 0 0 5px rgba(0,0,0,.5);
  181. -webkit-box-shadow: 0 0 5px rgba(0,0,0,.5);
  182. z-index: 10;
  183. li{
  184. padding-left: 18px;
  185. width: 100%;
  186. height: 30px;
  187. line-height: 30px;
  188. text-align: left;
  189. font-size: 14px;
  190. color: #000;
  191. cursor: pointer;
  192. &:hover{
  193. background: #0076ad;
  194. color: #fff;
  195. }
  196. }
  197. }
  198. span.tip{
  199. position: absolute;
  200. top: 0;
  201. right: -238px;
  202. font-size: 13px;
  203. color: #8c8c8c;
  204. a{
  205. font-size: 13px;
  206. color: #0076ad;
  207. }
  208. }
  209. span.tip.codeError-tip{
  210. position: absolute;
  211. top: 3px;
  212. left: 378px;
  213. width: 200px;
  214. text-align: left;
  215. color: #ff4949;
  216. font-size: 12px;
  217. }
  218. i{
  219. position: absolute;
  220. top: 13px;
  221. left: 20px;
  222. font-size: 20px;
  223. color: #a0a0a0;
  224. }
  225. .btn {
  226. margin: 34px 0 16px 0;
  227. width: 360px;
  228. height: 44px;
  229. line-height: 44px;
  230. font-size: 16px;
  231. color: #fff;
  232. background: #0076AD;
  233. border-radius: 3px;
  234. }
  235. }
  236. .content-bottom{
  237. margin: 155px auto 0;
  238. padding-bottom: 50px;
  239. width: 360px;
  240. div.warp{
  241. padding-bottom: 65px;
  242. }
  243. p{
  244. font-size: 24px;
  245. color: #323232;
  246. img{
  247. margin-right: 20px;
  248. width: 30px;
  249. height: 28px;
  250. }
  251. }
  252. p.pass{
  253. font-size: 24px;
  254. color: #e77405;
  255. img{
  256. height: 30px;
  257. }
  258. }
  259. p.passed {
  260. color: #2ab300;
  261. img{
  262. height: 30px;
  263. }
  264. }
  265. span{
  266. display: inline-block;
  267. font-size: 14px;
  268. color: #8b8b8b;
  269. }
  270. span.close-tip{
  271. margin: 15px 0 140px 0;
  272. }
  273. .close-btn{
  274. margin: 0 auto;
  275. width: 200px;
  276. height: 36px;
  277. line-height: 36px;
  278. font-size: 14px;
  279. text-align: center;
  280. color: #323232;
  281. border: 1px solid #d2d2d2;
  282. border-radius: 3px;
  283. cursor: pointer ;
  284. }
  285. span.use{
  286. display: inline-block;
  287. margin-bottom: 30px;
  288. width: 360px;
  289. font-size: 14px;
  290. color: #000;
  291. text-align: left;
  292. em{
  293. font-size: 14px;
  294. font-style: normal;
  295. color: #000;
  296. }
  297. }
  298. .form-group {
  299. margin: 0 auto 16px;
  300. position: relative;
  301. width: 360px;
  302. height: 44px;
  303. line-height: 44px;
  304. input{
  305. padding: 0 0 0 18px;
  306. width: 360px;
  307. height: 44px;
  308. line-height: 44px;
  309. font-size: 14px;
  310. color: #000;
  311. border-radius: 0;
  312. }
  313. input.msg{
  314. float: left;
  315. width: 210px;
  316. padding: 0 0 0 18px;
  317. height: 44px;
  318. line-height: 44px;
  319. font-size: 14px;
  320. color: #000;
  321. border-radius: 0;
  322. }
  323. span.msg{
  324. float: right;
  325. margin: 0;
  326. width: 130px;
  327. height: 44px;
  328. line-height: 44px;
  329. text-align: center ;
  330. font-size: 14px;
  331. color: #5a5a5a;
  332. background: #f4f4f4;
  333. border: 1px solid #dcdcdc;
  334. cursor: pointer;
  335. }
  336. span.msg.send{
  337. background: #d2d2d2;
  338. color: #fff;
  339. }
  340. }
  341. .btn {
  342. margin: 34px 0 10px 0;
  343. width: 360px;
  344. height: 44px;
  345. line-height: 44px;
  346. font-size: 16px;
  347. color: #fff;
  348. background: #0076AD;
  349. border-radius: 3px;
  350. }
  351. }
  352. .choose{
  353. margin: 155px auto 0;
  354. padding-bottom: 44px;
  355. div{
  356. padding: 0 15px;
  357. margin: 0 auto 16px;
  358. width: 360px;
  359. height: 60px;
  360. line-height: 60px;
  361. text-align: left;
  362. overflow: hidden;
  363. border: 1px solid #d2d2d2;
  364. cursor: pointer;
  365. &:hover,&.active{
  366. border-color: #0076ad;
  367. span{
  368. color: #0076ad;
  369. }
  370. i.second {
  371. color: #0076ad;
  372. }
  373. }
  374. img.first{
  375. float: left;
  376. margin: 24px 20px 0 0;
  377. font-size: 20px;
  378. color: #323232;
  379. }
  380. img.first.mob{
  381. margin: 22px 20px 0 5px;
  382. font-size: 28px;
  383. }
  384. i.second {
  385. float: right;
  386. margin: 20px 0 0 5px;
  387. font-size: 20px;
  388. color: #323232;
  389. }
  390. span{
  391. float: left;
  392. font-size: 14px;
  393. color: #323232;
  394. }
  395. }
  396. }
  397. a.return{
  398. position: absolute;
  399. left: 0;
  400. top: -15px;
  401. img{
  402. width: 34px !important;
  403. height: 34px !important;
  404. }
  405. }
  406. }
  407. }
  408. }
  409. </style>