VerificationBox.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="verification-box-wrap">
  3. <div class="icon">
  4. <img :src="verifiesType==='mobile'?mobile_src:email_src" />
  5. </div>
  6. <div class="text">{{infoText}}</div>
  7. <el-button type="primary" @click="goNext" v-if="!hideBtn" :disabled="countDown">{{countDown?`重发(${countDown}秒)`:btnText}}</el-button>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. props:{
  13. verifiesType:{//安全验证 mobile or email
  14. type:String,
  15. default:'mobile'
  16. },
  17. infoText:{//手机号或邮箱
  18. type:String,
  19. default:'123456'
  20. },
  21. hideBtn:{
  22. type:Boolean,
  23. default:false
  24. },
  25. countDown:{
  26. type:Number,
  27. default:0
  28. },
  29. btnText:{
  30. type:String,
  31. default:'开始验证'
  32. }
  33. },
  34. data() {
  35. return {
  36. mobile_src:require('@/assets/img/home/phone_icon.png'),
  37. email_src:require('@/assets/img/home/email_icon.png'),
  38. };
  39. },
  40. methods: {
  41. goNext(){
  42. this.$emit('goNext',this.verifiesType)
  43. }
  44. },
  45. };
  46. </script>
  47. <style scoped lang="scss">
  48. .verification-box-wrap{
  49. display: flex;
  50. align-items: center;
  51. margin-bottom: 60px;
  52. cursor: pointer;
  53. .icon{
  54. width:40px;
  55. height:40px;
  56. box-sizing: border-box;
  57. padding:8px;
  58. border-radius: 50%;
  59. box-shadow: 0px 2px 12px 0px #0000001A;
  60. text-align: center;
  61. img{
  62. width: 24px;
  63. height: 24px;
  64. }
  65. }
  66. .text{
  67. margin-left: 20px;
  68. font-size: 18px;
  69. }
  70. .el-button{
  71. /* background-color: #3654C1;
  72. color: #fff; */
  73. margin-left: auto;
  74. }
  75. }
  76. </style>