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. middleware: 'authenticated',
  36. data () {
  37. return {
  38. hasEmail: false,
  39. hasQuestion: false,
  40. mobile: '',
  41. email: '',
  42. question: ''
  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. }
  60. },
  61. // 获取验证方式
  62. getVerifyWay () {
  63. this.$http.get('/update/user/checkType')
  64. .then(response => {
  65. if (response.data.success) {
  66. console.log(response.data)
  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>