加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
App.vue 3.05 KB
一键复制 编辑 原始数据 按行查看 历史
<script>
export default {
globalData:{
config : '',
},
onLaunch: function() {
const _this = this
console.log('App Launch')
const systemInfo = uni.getSystemInfoSync()
uni.setStorageSync("systemInfo",systemInfo)
if (systemInfo.pixelRatio > 1) {
//不推荐直接根据反馈的来,为了性能考虑,最好固定2
this.$options.globalData.pixelRatio = 2;
}
//获取全局配置
this.$store.dispatch('setConfigAsync').then((res) => {
console.log('config',res)
})
this.util.getUserInfo((res)=>{
console.log('userInfo',res)
})
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
}
</script>
<style lang="scss">
@font-face {
font-family: 'iconfont'; /* Project id 1635447 */
src: url('//at.alicdn.com/t/font_1635447_sg4ztadhbe.woff2?t=1633670200243') format('woff2'),
url('//at.alicdn.com/t/font_1635447_sg4ztadhbe.woff?t=1633670200243') format('woff'),
url('//at.alicdn.com/t/font_1635447_sg4ztadhbe.ttf?t=1633670200243') format('truetype');
}
.iconfont{
font-family:"iconfont" !important;
font-size:16px;font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
/*每个页面公共css */
.main-section {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
height: 100%;
height: calc(100% -(constant(safe-area-inset-bottom)));
height: calc(100% - (env(safe-area-inset-bottom)));
overflow-y: auto;
}
.main-section.top {
padding-top: 0;
}
// #ifdef H5
.main-section.top {
padding-top: 70rpx;
}
uni-slider .uni-slider-thumb {
left: 0;
}
// #endif
.main-section.tabbar-bottom {
padding-bottom: 102rpx;
padding-bottom: calc(102rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(102rpx + env(safe-area-inset-bottom));
height: calc(100% - (102rpx + constant(safe-area-inset-bottom)));
height: calc(100% - (102rpx + env(safe-area-inset-bottom)));
}
.main-section.video-player {
padding-top: 422rpx;
}
.hide-bottom {
padding-bottom: 0;
padding-bottom: calc(0 + constant(safe-area-inset-bottom));
padding-bottom: calc(0 + env(safe-area-inset-bottom));
}
.text-ellipsis {
overflow: hidden !important;
text-overflow: ellipsis !important;
display: -webkit-box !important;
-webkit-line-clamp: 1;//文字上限行
-webkit-box-orient: vertical;
}
.text-ellipsis-2 {
display: -webkit-box;
overflow: hidden;
white-space: normal !important;
text-overflow: ellipsis;
word-wrap: break-word;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.hidden {
display: none;
}
.show {
display: block;
}
[v-cloak]{
display: none;
}
image {
will-change: transform
}
rich-text {
line-height: 44rpx;
font-size: 28rpx;
}
/*课程标签*/
.base-info {
.tabs {
.item {
display: inline-block;
padding: 0 10rpx;
text-align: center;
font-size: 24rpx;
line-height: 38rpx;
border-radius: 16rpx;
color: #fff;
margin-right: 10rpx;
}
.only-member {
background-color: #dd524d;
}
.score {
background-color: #ff9900;
}
}
}
</style>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化