first commit

This commit is contained in:
lingxiao865
2026-02-10 08:05:03 +08:00
commit c5af079d8c
1094 changed files with 97530 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
export const getObserver = (context, selector) => new Promise((resolve) => {
uni
.createIntersectionObserver(context, {
nativeMode: true,
})
.relativeToViewport()
.observe(selector, (res) => {
resolve(res);
});
});
/**
* 背景:单页模式下, getWindowInfo、getAppBaseInfo、getDeviceInfo 等接口均返回 undefined。
* 复现路径分享到朋友圈再打开单页模式的该页面uni.getWindowInfo() 等接口返回 undefined
* 代码片段https://developers.weixin.qq.com/s/mzvZ8FmH7vVW
*/
export const getWindowInfo = () => (uni.getWindowInfo ? uni.getWindowInfo() || uni.getSystemInfoSync() : uni.getSystemInfoSync());
export const getAppBaseInfo = () => (uni.getAppBaseInfo ? uni.getAppBaseInfo() || uni.getSystemInfoSync() : uni.getSystemInfoSync());
export const getDeviceInfo = () => (uni.getDeviceInfo ? uni.getDeviceInfo() || uni.getSystemInfoSync() : uni.getSystemInfoSync());