ValidationPhoneStepSelect.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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('mobile')">
  9. <img src="/images/all/icon01.png">
  10. <span>通过验证手机</span>
  11. <i class="fa fa-angle-right second"></i>
  12. </li>
  13. <li class="item" @click="jump('email')" v-if="hasEmail">
  14. <img src="/images/all/icon02.png">
  15. <span>通过验证邮箱</span>
  16. <i class="fa fa-angle-right second"></i>
  17. </li>
  18. <li class="item" @click="jump('questions')" v-if="hasQuestion">
  19. <img src="/images/all/icon03.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-select',
  35. // middleware: 'authenticated',
  36. data () {
  37. return {
  38. hasEmail: false,
  39. hasQuestion: false,
  40. mobile: '',
  41. email: '',
  42. questions: ''
  43. }
  44. },
  45. mounted () {
  46. this.$nextTick(() => {
  47. this.getVerifyWay()
  48. })
  49. },
  50. methods: {
  51. jump (type) {
  52. this.$emit('stepEvent', type)
  53. if (type === 'mobile') {
  54. this.$emit('setDataEvent', this.mobile)
  55. } else if (type === 'email') {
  56. this.$emit('setDataEvent', this.email)
  57. } else if (type === 'questions') {
  58. this.$emit('setDataEvent', this.questions)
  59. } else if (type === 'appeal') {
  60. // 跳转到申诉页面
  61. }
  62. },
  63. // 获取验证方式
  64. getVerifyWay () {
  65. this.$http.get('/update/user/checkType')
  66. .then(response => {
  67. if (response.data.success) {
  68. this.mobile = response.data.content.mobile
  69. if (response.data.content.email) {
  70. this.hasEmail = true
  71. this.email = response.data.content.email
  72. }
  73. if (response.data.content.questions) {
  74. this.hasQuestion = true
  75. this.questions = response.data.content.questions
  76. }
  77. }
  78. }).catch(err => {
  79. console.log(err)
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped type="text/scss" lang="scss">
  86. .select-item {
  87. padding-top:.5rem;
  88. .item {
  89. position:relative;
  90. padding-left:.4rem;
  91. margin-bottom:.2rem;
  92. line-height: 1.5rem;
  93. background: #f4f4f4;
  94. font-size: .32rem;
  95. span{
  96. color:#505050;
  97. margin-left:.4rem;
  98. }
  99. i{
  100. display:inline-block;
  101. position:absolute;
  102. right:.4rem;
  103. line-height: 1.5rem;
  104. font-size:.45rem;
  105. }
  106. }
  107. }
  108. </style>