ValidationPhoneStepSelect.vue 2.9 KB

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