StepSelect.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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')" v-if="hasMobile">
  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. hasMobile: false,
  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. }
  60. },
  61. // 获取验证方式
  62. getVerifyWay () {
  63. this.$http.get('/sso/change/admin/checkType')
  64. .then(response => {
  65. console.log('验证方式', response.data)
  66. if (response.data.content) {
  67. if (response.data.content.mobile) {
  68. this.hasMobile = true
  69. this.mobile = response.data.content.mobile
  70. }
  71. if (response.data.content.email) {
  72. this.hasEmail = true
  73. this.email = response.data.content.email
  74. }
  75. if (response.data.content.questions) {
  76. this.hasQuestion = true
  77. this.questions = response.data.content.questions
  78. }
  79. }
  80. }).catch(err => {
  81. console.log(err)
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped type="text/scss" lang="scss">
  88. .select-item {
  89. padding-top:.5rem;
  90. .item {
  91. position:relative;
  92. padding-left:.4rem;
  93. margin-bottom:.2rem;
  94. line-height: 1.5rem;
  95. background: #f4f4f4;
  96. font-size: .32rem;
  97. span{
  98. color:#505050;
  99. margin-left:.4rem;
  100. }
  101. i{
  102. display:inline-block;
  103. position:absolute;
  104. right:.4rem;
  105. line-height: 1.5rem;
  106. font-size:.45rem;
  107. }
  108. }
  109. }
  110. </style>