EncryptedEmail.vue 7.4 KB

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