Banner.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div class="banner">
  3. <div class="block">
  4. <el-carousel indicator-position="none" arrow="never">
  5. <el-carousel-item v-for="item in 3" :key="item">
  6. <div class="wrap">
  7. <button class="ask-for" @click="goApply()">申请经纪商</button>
  8. </div>
  9. </el-carousel-item>
  10. </el-carousel>
  11. <div class="wrap-block">
  12. <LoginWindow></LoginWindow>
  13. </div>
  14. <div :class="{'black-line':true,'fix-bottom':scrolled}">
  15. <button class="line-button" @click="goApply()">申请经纪商</button>
  16. <span class="phoneNum">热线电话:+86 173 5471 8363</span>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import LoginWindow from './LoginWindow'
  23. export default {
  24. name: 'Banner',
  25. components: {LoginWindow},
  26. data () {
  27. return {
  28. scrolled:false
  29. }
  30. },
  31. methods:{
  32. handleScroll () {
  33. if (window.scrollY > 900) {
  34. this.scrolled = true;
  35. }else{
  36. this.scrolled = false;
  37. }
  38. },
  39. goApply: function () {
  40. this.$router.push('/apply')
  41. }
  42. },
  43. mounted () {
  44. window.addEventListener('scroll', this.handleScroll)
  45. }
  46. }
  47. </script>
  48. <style scoped>
  49. .banner{
  50. text-align: left;
  51. }
  52. .el-carousel__item{
  53. background-size: auto 100%;
  54. }
  55. .el-carousel__item:nth-of-type(1) {
  56. background: url("../../static/images/banner1/banner.png") no-repeat 50%;
  57. background-size: auto 100%;
  58. }
  59. .el-carousel__item:nth-of-type(2) {
  60. background: url("../../static/images/banner1/banner1.png") no-repeat 50%;
  61. background-size: auto 100%;
  62. }
  63. .el-carousel__item:nth-of-type(3) {
  64. background: url("../../static/images/banner1/banner2.png") no-repeat 50%;
  65. background-size: auto 100%;
  66. }
  67. button.ask-for{
  68. margin: 425px 0 0 8px;
  69. width: 150px;
  70. height: 40px;
  71. font-size: 16px;
  72. color: #1f52c9;
  73. background: #fede00;
  74. border: none;
  75. cursor: pointer;
  76. }
  77. .wrap-block{
  78. width: 1200px;
  79. margin: 0 auto;
  80. position: absolute;
  81. left: 50%;
  82. margin-left: -600px;
  83. top: 0;
  84. margin-top: 180px;
  85. }
  86. .black-line{
  87. height: 100px;
  88. background-color: rgba(0,0,0,.5);
  89. width: 100%;
  90. margin: 0 auto;
  91. line-height: 100px;
  92. position: absolute;
  93. top: 800px;
  94. z-index: 100;
  95. text-align: center;
  96. }
  97. .fix-bottom{
  98. position: fixed;
  99. bottom: 0;
  100. top: auto;
  101. }
  102. .line-button{
  103. width: 140px;
  104. height: 40px;
  105. border-radius: 20px;
  106. border: 0;
  107. font-size: 18px;
  108. font-weight: 700;
  109. margin-right: 60px;
  110. cursor: pointer;
  111. background-color: #1a6fa6;
  112. color: #fff;
  113. }
  114. .phoneNum{
  115. color: #fff;
  116. font-size: 25px;
  117. font-weight: 700;
  118. }
  119. </style>