Commit 308f259a by baihong

add;新增OpenSans字体

parent 0fefa2bd
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch'); console.log('App Launch');
uni.getSystemInfo({ uni.getSystemInfo({
success: e => { success: e => {
this.initSize(e); this.initSize(e);
}
});
},
methods: {
/**
* 存储设备信息 参考colorUI
* @param {Object}
*/
initSize(e) {
const systemInfo = e;
let navigationBarHeight;
let custom = {};
// #ifndef MP
custom = {
height: 36,
width: 88
};
navigationBarHeight = 44;
// #endif
// #ifdef MP-WEIXIN
custom = wx.getMenuButtonBoundingClientRect();
navigationBarHeight = custom.bottom + custom.top - e.statusBarHeight * 2;
// 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
navigationBarHeight = (custom.top - systemInfo.statusBarHeight) * 2 + custom.height + systemInfo
.statusBarHeight;
systemInfo.menuBotton = custom.top - systemInfo.statusBarHeight;
systemInfo.menuRight = systemInfo.screenWidth - custom.right;
systemInfo.menuHeight = custom.height;
// #endif
systemInfo.custom = custom;
systemInfo.navigationBarHeight = navigationBarHeight;
Vue.prototype.systemInfo = systemInfo;
} }
}); },
}, onShow: function() {
methods: { console.log('App Show');
/** },
* 存储设备信息 参考colorUI onHide: function() {
* @param {Object} console.log('App Hide');
*/
initSize(e) {
const systemInfo = e;
let navigationBarHeight;
let custom = {};
// #ifndef MP
custom = { height: 36, width: 88 };
navigationBarHeight = 44;
// #endif
// #ifdef MP-WEIXIN
custom = wx.getMenuButtonBoundingClientRect();
navigationBarHeight = custom.bottom + custom.top - e.statusBarHeight * 2;
// 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
navigationBarHeight = (custom.top - systemInfo.statusBarHeight) * 2 + custom.height + systemInfo.statusBarHeight;
systemInfo.menuBotton = custom.top - systemInfo.statusBarHeight;
systemInfo.menuRight = systemInfo.screenWidth - custom.right;
systemInfo.menuHeight = custom.height;
// #endif
systemInfo.custom = custom;
systemInfo.navigationBarHeight = navigationBarHeight;
Vue.prototype.systemInfo = systemInfo;
} }
}, };
onShow: function() {
console.log('App Show');
},
onHide: function() {
console.log('App Hide');
}
};
</script> </script>
<style lang="scss"> <style lang="scss">
/*每个页面公共css */ /*每个页面公共css */
@import 'uview-ui/index.scss'; @import 'uview-ui/index.scss';
.app{
background-color: #F5F7F9; @font-face {
height: 100vh; font-family: OpenSans;
} font-weight: normal;
font-style: normal;
src: url('static/OpenSans.ttf');
}
@font-face {
font-family: OpenSans-Bold;
font-weight: bold;
src: url('static/OpenSansBold.ttf');
}
.app {
background-color: #F5F7F9;
height: 100vh;
}
</style> </style>
...@@ -329,7 +329,7 @@ ...@@ -329,7 +329,7 @@
margin-top: 10px; margin-top: 10px;
text { text {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #555555; color: #555555;
//line-height: 33rpx; //line-height: 33rpx;
...@@ -506,7 +506,7 @@ ...@@ -506,7 +506,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 30rpx; line-height: 30rpx;
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
align-items: center; align-items: center;
margin-right: 65rpx; margin-right: 65rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #555555; color: #555555;
line-height: 33rpx; line-height: 33rpx;
......
...@@ -229,14 +229,14 @@ ...@@ -229,14 +229,14 @@
} }
p { p {
font-size: 36rpx; font-size: 36rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: OpenSans;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 50rpx; line-height: 50rpx;
} }
text{ text{
font-size: 26rpx; font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
line-height: 37rpx; line-height: 37rpx;
...@@ -250,8 +250,8 @@ ...@@ -250,8 +250,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC; font-family: OpenSans;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
line-height: 40rpx; line-height: 40rpx;
...@@ -291,8 +291,8 @@ ...@@ -291,8 +291,8 @@
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC; font-family: OpenSans;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
line-height: 40rpx; line-height: 40rpx;
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
align-items: center; align-items: center;
margin-right: 65rpx; margin-right: 65rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #555555; color: #555555;
line-height: 33rpx; line-height: 33rpx;
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
.gz { .gz {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
line-height: 24rpx; line-height: 24rpx;
...@@ -459,7 +459,7 @@ ...@@ -459,7 +459,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 30rpx; line-height: 30rpx;
...@@ -521,7 +521,7 @@ ...@@ -521,7 +521,7 @@
text { text {
font-size: 22rpx; font-size: 22rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: OpenSans;
font-weight: 500; font-weight: 500;
color: #FFC915; color: #FFC915;
line-height: 24rpx; line-height: 24rpx;
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
text:nth-child(1) { text:nth-child(1) {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 40rpx; line-height: 40rpx;
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 30rpx; line-height: 30rpx;
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
text:nth-child(1) { text:nth-child(1) {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 40rpx; line-height: 40rpx;
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 30rpx; line-height: 30rpx;
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: OpenSans;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 30rpx; line-height: 30rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment