widgets/button/v_count_down_btn
library
Enums
-
AccountValidateType
-
账号校验类型
-
CountDownPhase
-
@author: wzp_vicky
@time: 2026年5月13日15:36:03
@version: V2
@description:第二版彻底重构
1.Ticker 替代 Timer — 与 vsync 同步,低配机不再闪数字
2.三态管理(idle / loading / counting)— 等接口时有 loading 动画,倒计时中自动禁用
3.复用 VButton — 样式参数全部透传,主题、渐变、圆角等能力直接继承
4.可配置 — 时长、文案格式、结束回调都可自定义
5.外部可控 — 暴露 VCountDownBtnState,通过 GlobalKey 可调用 reset() 手动重置
6.Mixin 抽离(CountDownTimerMixin)
6.1、倒计时的 Ticker 逻辑独立成 mixin,以后其他场景(支付倒计时、活动倒计时)直接 with CountDownTimerMixin 复用
7.账号校验体系:相关支撑属性:accountType、accountGetter、onValidateFailed 三个参数,点击时先校验再触发 onSend
7.1、校验逻辑 — phone 校验 1 开头 + 11 位数字,email 校验基本格式
7.2、解耦 toast — 校验失败通过回调通知调用方,组件本身不依赖任何 toast 实现