ValidationPhoneStepSelect.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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('question')" 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. }
  40. },
  41. mounted () {
  42. this.$nextTick(() => {
  43. this.getVerifyWay()
  44. })
  45. },
  46. methods: {
  47. jump (type) {
  48. this.$emit('stepEvent', type)
  49. },
  50. // 获取验证方式
  51. getVerifyWay () {
  52. this.$http.get('/update/user/checkType' + (this.$store.state.option.isLogin.data.content.isLogin ? 'update' : 'reset'))
  53. .then(response => {
  54. if (response.data.success) {
  55. console.log(response.data)
  56. if (response.data.content.email) {
  57. this.hasEmail = true
  58. }
  59. if (response.data.content.question) {
  60. this.hasQuestion = true
  61. }
  62. }
  63. }).catch(err => {
  64. console.log(err)
  65. })
  66. }
  67. }
  68. }
  69. </script>
  70. <style scoped type="text/scss" lang="scss">
  71. .select-item {
  72. padding-top:.5rem;
  73. .item {
  74. position:relative;
  75. padding-left:.4rem;
  76. margin-bottom:.2rem;
  77. line-height: 1.5rem;
  78. background: #f4f4f4;
  79. font-size: .32rem;
  80. span{
  81. color:#505050;
  82. margin-left:.4rem;
  83. }
  84. i{
  85. display:inline-block;
  86. position:absolute;
  87. right:.4rem;
  88. line-height: 1.5rem;
  89. font-size:.45rem;
  90. }
  91. }
  92. }
  93. </style>