App.uvue 1.8 KB
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1
<script lang="ts">
DCloud-WZF's avatar
DCloud-WZF 已提交
2
import { state, setLifeCycleNum } from './store/index.uts'
3 4
export default {
  onLaunch: function () {
5
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
6
    setLifeCycleNum(state.lifeCycleNum + 1000)
7
    console.log('App Launch')
8

H
hdx 已提交
9
    const performance = uni.getPerformance()
10 11 12 13 14 15 16 17 18 19 20
    const observer1: PerformanceObserver = performance.createObserver(
      (entryList: PerformanceObserverEntryList) => {
        console.log(
          'observer1:entryList.getEntries()' +
            JSON.stringify(entryList.getEntries())
        )
      }
    )
    observer1.observe({
      entryTypes: ['render', 'navigation'],
    } as PerformanceObserverOptions)
21 22
  },
  onShow: function () {
23
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
24
    setLifeCycleNum(state.lifeCycleNum + 100)
25
    console.log('App Show')
26 27
  },
  onHide: function () {
28
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
29
    setLifeCycleNum(state.lifeCycleNum - 100)
30
    console.log('App Hide')
31 32
  },
  onLastPageBackPress: function (): boolean | null {
33
    // 自动化测试
DCloud-WZF's avatar
DCloud-WZF 已提交
34
    setLifeCycleNum(state.lifeCycleNum - 1000)
DCloud-WZF's avatar
DCloud-WZF 已提交
35
    console.log('App LastPageBackPress')
36
    return null
37
  },
DCloud-WZF's avatar
DCloud-WZF 已提交
38 39 40 41 42 43
  methods: {
    increasetLifeCycleNum() {
      setLifeCycleNum(state.lifeCycleNum + 100)
      console.log('App increasetLifeCycleNum')
    }
  }
44
}
Y
init  
yurj26 已提交
45 46 47
</script>

<style>
48
/*每个页面公共css */
49
@import './common/uni.css';
50 51 52 53 54 55 56 57 58 59

/* #ifdef H5 */
@media screen and (min-width: 768px) {
  body {
    overflow-y: scroll;
  }
}

/* 顶栏通栏样式 */
/* .uni-top-window {
Y
yurj26 已提交
60 61 62 63
  	    left: 0;
  	    right: 0;
  	} */

64 65 66 67 68
uni-page-body {
  background-color: #f5f5f5 !important;
  min-height: 100% !important;
  height: auto !important;
}
Y
yurj26 已提交
69

70 71 72
.uni-top-window uni-tabbar .uni-tabbar {
  background-color: #fff !important;
}
Y
yurj26 已提交
73

74 75 76
.uni-app--showleftwindow .hideOnPc {
  display: none !important;
}
Y
yurj26 已提交
77

78 79
/* #endif */
</style>