// 下面是官方案例中的 handlePrimaryAnimation 函数,设置的 borderRadius 不生效(基础库 3.0.1)
// 有的版本在工具中运行生效,而IOS预览无效;而 3.0.1 无论是工具还是预览都无效
// 链接:https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html
const handlePrimaryAnimation = () => {
'worklet'
let t = primaryAnimation.value
if (!userGestureInProgress.value) {
t = _curvePrimaryAnimation.value
}
const topDistance = 0.12
const marginTop = topDistance * screenHeight
const pageHeight = (1 - topDistance) * screenHeight
const transY = pageHeight * (1 - t)
return {
borderRadius: '10px',
marginTop: `${marginTop}px`,
height: `${pageHeight}px`,
transform: `translateY(${transY}px)`,
}