StepSelect.vue 2.9 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. </ul>
  19. </div>
  20. <!--未验证手机弹出框-->
  21. <div v-show="goValidPhone">
  22. <el-dialog class="valid-phone"
  23. :visible.sync="goValidPhone"
  24. @close="goValidPhoneStep"
  25. size="tiny">
  26. <div class="set-tip">
  27. <p>您的账号未验证手机,请先验证手机号</p>
  28. <a href="/validation/phoneValidation">确定</a>
  29. </div>
  30. </el-dialog>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. name: 'step-select',
  37. data () {
  38. return {
  39. goValidPhone: false,
  40. hasMobile: false,
  41. hasEmail: false,
  42. mobile: '',
  43. email: ''
  44. }
  45. },
  46. mounted () {
  47. this.$nextTick(() => {
  48. this.getVerifyWay()
  49. })
  50. },
  51. methods: {
  52. jump (type) {
  53. this.$emit('stepEvent', type)
  54. if (type === 'mobile') {
  55. this.$emit('setDataEvent', this.mobile)
  56. } else if (type === 'email') {
  57. this.$emit('setDataEvent', this.email)
  58. }
  59. },
  60. // 获取验证方式
  61. getVerifyWay () {
  62. this.$http.get('/update/user/checkType')
  63. .then(response => {
  64. if (response.data.success) {
  65. if (response.data.content.mobile) {
  66. this.mobile = response.data.content.mobile
  67. this.hasMobile = true
  68. } else {
  69. this.goValidPhone = true
  70. this.hasMobile = false
  71. }
  72. if (response.data.content.email) {
  73. this.hasEmail = true
  74. this.email = response.data.content.email
  75. }
  76. }
  77. }).catch(err => {
  78. console.log(err)
  79. })
  80. },
  81. goValidPhoneStep () {
  82. this.$router.push({ path: '/validation/phoneValidation' })
  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>