stepSelect.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div class="f-main">
  3. <div class="content-top">
  4. <p>密码重置</p>
  5. </div>
  6. <div>
  7. <ul class="select-item">
  8. <li class="item" @click="jump('before')" v-if="$store.state.option.isLogin.data.content.isLogin">
  9. <img src="/images/all/icon03.png">
  10. <span>通过登录密码</span>
  11. <i class="fa fa-angle-right second"></i>
  12. </li>
  13. <li class="item" @click="jump('mobile')">
  14. <img src="/images/all/icon01.png">
  15. <span>通过验证手机</span>
  16. <i class="fa fa-angle-right second"></i>
  17. </li>
  18. <li class="item" @click="jump('email')" v-if="hasEmail">
  19. <img src="/images/all/icon02.png">
  20. <span>通过验证邮箱</span>
  21. <i class="fa fa-angle-right second"></i>
  22. </li>
  23. <li class="item" @click="jump('appeal')">
  24. <img src="/images/all/icon04.png">
  25. <i></i><span>通过人工申诉</span>
  26. <i class="fa fa-angle-right second"></i>
  27. </li>
  28. </ul>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. export default {
  34. name: 'step-two',
  35. data () {
  36. return {
  37. hasEmail: false,
  38. mobile: '',
  39. email: ''
  40. }
  41. },
  42. mounted () {
  43. this.$nextTick(() => {
  44. this.getVerifyWay()
  45. })
  46. },
  47. methods: {
  48. jump (type) {
  49. this.$emit('stepEvent', type)
  50. if (type === 'mobile') {
  51. this.$emit('setDataEvent', this.mobile)
  52. } else if (type === 'email') {
  53. this.$emit('setDataEvent', this.email)
  54. }
  55. },
  56. // 获取验证方式
  57. getVerifyWay () {
  58. this.$http.get('/sso/resetPwd/checkType/' + (this.$store.state.option.isLogin.data.content.isLogin ? 'update' : 'reset'))
  59. .then(response => {
  60. if (response.data.success) {
  61. this.mobile = response.data.content.mobile
  62. if (response.data.content.email) {
  63. this.hasEmail = true
  64. this.email = response.data.content.email
  65. }
  66. }
  67. }).catch(err => {
  68. console.log(err)
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped type="text/scss" lang="scss">
  75. .select-item {
  76. padding-top:.5rem;
  77. .item {
  78. position:relative;
  79. padding-left:.4rem;
  80. margin-bottom:.2rem;
  81. line-height: 1.5rem;
  82. background: #f4f4f4;
  83. font-size: .32rem;
  84. span{
  85. color:#505050;
  86. margin-left:.4rem;
  87. }
  88. i{
  89. display:inline-block;
  90. position:absolute;
  91. right:.4rem;
  92. line-height: 1.5rem;
  93. font-size:.45rem;
  94. }
  95. }
  96. }
  97. </style>