-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.vue
75 lines (64 loc) · 1.81 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
<script>
import StorageUtil from "./common/storage/StorageUtil.js"
export default {
onLaunch(){
uni.getSystemInfo({
success: function (res) {
// console.log(res)
// console.log(res.screenHeight); //屏幕高度 注意这里获得的高度宽度都是px 需要转换rpx
// console.log(res.windowWidth); //可使用窗口宽度
// console.log(res.windowHeight); //可使用窗口高度
// console.log(res.screenWidth); //屏幕宽度
const rpx=(res.screenHeight * (750 / res.windowWidth)) //将px 转换rpx
// console.log(rpx)
}
})
uni.getSystemInfo({
success:(res)=>{
if(res.windowHeight){
// console.log(res.windowHeight+'aaa')
StorageUtil.syncSaveStorage('rpx_height',res.windowHeight)
}
// this.$store.commit('set_window_height',res.windowHeight*2);
}
})
if (process.env.NODE_ENV === 'development') {
// baseUrl=""
// console.log('开发环境')
} else {
// baseUrl=""
console.log('生产环境')
}
},
onShow: function() {
},
onHide: function() {
console.log('App Hide');
}
}
</script>
<style>
ul,li{list-style-type: none;}
.left{float:left;}
.right{float:right;}
@font-face {
font-family: 'iconfont'; /* Project id 2512393 */
src: url('//at.alicdn.com/t/font_2512393_veyqltnxg2.woff2?t=1620202760479') format('woff2'),
url('//at.alicdn.com/t/font_2512393_veyqltnxg2.woff?t=1620202760479') format('woff'),
url('//at.alicdn.com/t/font_2512393_veyqltnxg2.ttf?t=1620202760479') format('truetype');
}
.font{
font-family: iconfont;
}
/*
想要高度100%适应 必须设置如下样式才行 一个坑
*/
body{
width:100%;height:100%;
}
/* #ifdef H5 || MP-WEIXIN */
uni-page-body,page{
height: 100%;
}
/* #endif */
</style>