indexs.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="home">
  3. <image :src="bgimg" class="homebg"></image>
  4. <view class="homebox" :style="'padding-top:'+padtop+'px'">
  5. <!-- 头部 -->
  6. <navbar :back="false" title="首页" :bgcolor="backgroundColor" color="#fff" fixed zIndex="1010" :center="true" :custom='true' @getTop="getTop"/>
  7. <view class="homeboxa">
  8. <div>22</div>
  9. <view style="background-color: #000;width: 100%;height: 100vh;">
  10. </view>
  11. </view>
  12. </view>
  13. <!-- 底部 导航栏 currentPage 当前页面ID -->
  14. <tab-bar :currentPage="0"></tab-bar>
  15. </view>
  16. </template>
  17. <script>
  18. import url from "@/util/url";
  19. let {host} = url
  20. //导入组件
  21. import tabBar from '@/components/tabbar/tabbar.vue'
  22. export default {
  23. data() {
  24. return {
  25. padtop:this.$http._GET.customBarH||0,
  26. backgroundColor: 'transparent',
  27. bgimg:require('@/static/image/bg.png'),
  28. };
  29. },
  30. components:{
  31. tabBar
  32. },
  33. methods: {
  34. getTop(e){
  35. this.padtop=e;
  36. },
  37. // 监听滚动
  38. },
  39. // onPageScroll(res) {
  40. // var scrolltop=res.scrollTop;
  41. // if(scrolltop>0){
  42. // this.backgroundColor='linear-gradient(90deg, #A00517, #E93030)'
  43. // }else{
  44. // this.backgroundColor='transparent'
  45. // }
  46. // console.log("页面滚动了",res.scrollTop)
  47. // },
  48. };
  49. </script>
  50. <style scoped lang="scss">
  51. .home{height: 100vh;background: #f5f5f5;position: relative;
  52. .homebg{width: 100%;height: 376rpx;}
  53. .homebox{position: absolute;left: 0;right: 0;top: 0;bottom: 0;box-sizing: border-box;max-height: 100vh;display: flex;flex-direction: column;
  54. .homeboxa{flex: 1;overflow: scroll;}
  55. }
  56. }
  57. </style>