uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -0,0 +1,32 @@
// @ts-nocheck
type Callback = () => void//Function
// 是否支持被动事件监听
export const supportsPassive = true;
// 请求动画帧
export function raf(fn : Callback) : number {
// #ifndef WEB
return setTimeout(fn, 1000 / 60); // 请求动画帧
// #endif
// #ifdef WEB
return requestAnimationFrame(fn); // 请求动画帧
// #endif
}
// 取消动画帧
export function cancelRaf(id : number) {
// 如果是在浏览器环境下,使用 cancelAnimationFrame 方法
// #ifdef WEB
cancelAnimationFrame(id); // 取消动画帧
// #endif
// #ifndef WEB
clearTimeout(id); // 取消动画帧
// #endif
}
// 双倍动画帧
export function doubleRaf(fn : Callback) : void {
raf(() => {
raf(fn)
}); // 在下一帧回调中再次请求动画帧,实现双倍动画帧效果
}