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

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

<style>
DCloud-WZF's avatar
DCloud-WZF 已提交
40
/* @font-face {
H
init.  
hdx 已提交
41 42 43 44 45 46
    font-family: uniicons;
    font-weight: normal;
    font-style: normal;
    src: url('./static/fonts/uni.ttf') format('truetype');
  } */

DCloud-WZF's avatar
DCloud-WZF 已提交
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
.page {
  padding: 15px;
}

.uni-panel {
  margin-bottom: 12px;
}

.uni-panel-h {
  background-color: #ffffff;
  flex-direction: row;
  align-items: center;
  padding: 12px;
}

.uni-panel-h-on {
  background-color: #f0f0f0;
}

.uni-panel-text {
  color: #000000;
  font-size: 14px;
  font-weight: normal;
}

.uni-panel-icon-on {
  transform: rotate(180deg);
}

.uni-navigate-item {
  flex-direction: row;
  align-items: center;
  background-color: #ffffff;
  border-top-style: solid;
  border-top-color: #f0f0f0;
  border-top-width: 1px;
  padding: 12px;
  justify-content: space-between;
}

.uni-navigate-item:active {
  background-color: #f8f8f8;
}

.uni-navigate-text {
  color: #000000;
  font-size: 12px;
  opacity: 0.8;
}

.uni-navigate-icon {
  margin-left: 15px;
  color: #999999;
  font-size: 14px;
  font-weight: normal;
}

.text-disabled {
  color: #a0a0a0;
}

.list-item-text {
  line-height: 36px;
}

.split-title {
  margin: 20px 0 5px;
  padding: 5px 0;
  border-bottom: 1px solid #dfdfdf;
}

.btn-view {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #dfdfdf;
  border-radius: 3px;
}
</style>