FixLine.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div class="fl-ctnr" v-show="state||isbanner">
  3. <button class="btn btn-fl" @click='goapply'>申请经纪商</button>
  4. <span class="phoneNum">热线电话:+86 173 5471 8363</span>
  5. </div>
  6. </template>
  7. <script>
  8. export default{
  9. data(){
  10. return {
  11. state:false
  12. }
  13. },
  14. props:["isbanner"],
  15. mounted(){
  16. this.$nextTick(()=>{
  17. window.addEventListener("scroll",this.fixchangge);
  18. });
  19. },
  20. methods:{
  21. fixchangge(){
  22. if (document.documentElement.scrollTop>=800) {
  23. this.state=true;
  24. }else{
  25. this.state=false;
  26. }
  27. },
  28. goapply(){
  29. this.$router.push({path:"/applyAgent"})
  30. }
  31. }
  32. }
  33. </script>
  34. <style scoped>
  35. .fl-ctnr{
  36. height: 100px;
  37. width: 100%;
  38. background: rgba(0,0,0,.5);
  39. line-height: 100px;
  40. color: #fff;
  41. .btn-fl{
  42. color: #fff;
  43. background: #1a6fa6;
  44. border-radius: 20px;
  45. margin-right: 60px;
  46. font-size: 18px;
  47. font-weight: 700;
  48. }
  49. .phoneNum{
  50. font-size: 25px;
  51. font-weight: 700;
  52. }
  53. }
  54. </style>