feat:设备使用记录

This commit is contained in:
houjunxiang
2026-03-05 16:54:47 +08:00
parent 749ac7f507
commit 9c88c45d66
357 changed files with 21486 additions and 5845 deletions

View File

@@ -5,6 +5,11 @@ export const props = defineMixin({
bgColor: {
type: String,
default: () => defProps.statusBar.bgColor
}
},
// 状态栏获取得高度
height: {
type: Number,
default: () => defProps.statusBar.height
}
}
})

View File

@@ -1,15 +1,16 @@
/*
* @Author : LQ
* @Description :
* @version : 1.0
* @version : 3.0
* @Date : 2021-08-20 16:44:21
* @LastAuthor : LQ
* @lastTime : 2021-08-20 17:20:39
* @FilePath : /u-view2.0/uview-ui/libs/config/props/statusBar.js
* @LastAuthor : jry
* @lastTime : 2025-12-19 08:55:21
* @FilePath : /uview-plus/libs/config/props/statusBar.js
*/
export default {
// statusBar
statusBar: {
bgColor: 'transparent'
bgColor: 'transparent',
height: 0
}
}

View File

@@ -12,7 +12,7 @@
import { props } from './props';
import { mpMixin } from '../../libs/mixin/mpMixin';
import { mixin } from '../../libs/mixin/mixin';
import { addUnit, addStyle, deepMerge, sys } from '../../libs/function/index';
import { addUnit, addStyle, deepMerge, getWindowInfo } from '../../libs/function/index';
/**
* StatbusBar 状态栏占位
* @description 本组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。
@@ -26,16 +26,26 @@
mixins: [mpMixin, mixin, props],
data() {
return {
// #ifdef H5
isH5: true
// #endif
isH5: false
}
},
created() {
// #ifdef H5
this.isH5 = true
// #endif
},
emits: ['update:height'],
computed: {
style() {
const style = {}
// 状态栏高度由于某些安卓和微信开发工具无法识别css的顶部状态栏变量所以使用js获取的方式
style.height = addUnit(sys().statusBarHeight, 'px')
let sheight = getWindowInfo().statusBarHeight
this.$emit('update:height', sheight)
if (sheight == 0) {
this.isH5 = true
} else {
style.height = addUnit(sheight, 'px')
}
style.backgroundColor = this.bgColor
return deepMerge(style, addStyle(this.customStyle))
}