Mixin.js 705 B

1234567891011121314151617181920212223242526272829303132333435
  1. let app = getApp();
  2. export default {
  3. data() {
  4. return {
  5. defaultScrollTop: 0,
  6. pageHeight: 0,
  7. nav_status_Height: 0, // 头部栏高度 (状态栏高度 - 标题高度)
  8. };
  9. },
  10. beforeCreate() {},
  11. created() {
  12. const {
  13. statusBarHeight,
  14. screenHeight,
  15. viewHeight,
  16. navHeight
  17. } = app.globalData;
  18. this.nav_status_Height = statusBarHeight + navHeight;
  19. const h = uni.upx2px(this.topFixedHeight || 0);
  20. this.defaultScrollTop = statusBarHeight + navHeight + h; // 头部综合高度(态栏高度 - 标题高度 - 搜索栏高度)
  21. // 屏幕高度 - 头部综合高度
  22. this.pageHeight = screenHeight - this.defaultScrollTop - 80;
  23. },
  24. onload() {
  25. },
  26. methods: {
  27. },
  28. }