feat:还原更新框架

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