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

@@ -19,7 +19,8 @@
<script>
import {
addUnit,
guid
guid,
rpx2px
} from '../../libs/function/index.js';
/**
* lazyLoad 懒加载
@@ -114,7 +115,7 @@
// 将threshold从rpx转为px
getThreshold() {
// 先取绝对值因为threshold可能是负数最后根据this.threshold是正数或者负数重新还原
let thresholdPx = uni.upx2px(Math.abs(this.threshold));
let thresholdPx = rpx2px(Math.abs(this.threshold));
return this.threshold < 0 ? -thresholdPx : thresholdPx;
},
// 计算图片的高度可能为auto带%,或者直接数值
@@ -223,6 +224,10 @@
if (res.intersectionRatio > 0) {
// 懒加载状态改变
this.isShow = true;
// 图片为空时显示错误
if (!this.image) {
this.loadError();
}
// 如果图片已经加载,去掉监听,减少性能的消耗
this.disconnectObserver('contentObserver');
}
@@ -238,8 +243,6 @@
</script>
<style scoped lang="scss">
@import "../../libs/css/components.scss";
.u-wrap {
background-color: #eee;
overflow: hidden;