修复推荐页滑动切换回弹
为推荐页滑动提交后的 rail 复位增加无过渡 resetting 状态 补充推荐滑动状态模型测试覆盖 resetting 类名 补齐推荐页交互测试中的小程序运行态 mock
This commit is contained in:
@@ -9,6 +9,7 @@ export type RecommendSwipeDirection = 1 | -1;
|
||||
export type RecommendSwipeRailState = {
|
||||
offsetY: number;
|
||||
commitDirection: RecommendSwipeDirection | null;
|
||||
isResetting?: boolean;
|
||||
};
|
||||
|
||||
/** 收口推荐卡纵向滑动的纯判定,页面只保留 pointer 与动画副作用。 */
|
||||
@@ -47,6 +48,10 @@ export function resolveRecommendCommitOffset(
|
||||
export function buildRecommendSwipeRailClassName(
|
||||
state: RecommendSwipeRailState,
|
||||
) {
|
||||
if (state.isResetting) {
|
||||
return 'platform-recommend-swipe-rail--resetting';
|
||||
}
|
||||
|
||||
if (state.commitDirection) {
|
||||
return 'platform-recommend-swipe-rail--committing';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user