diff --git a/packages/action-sheet/README.md b/packages/action-sheet/README.md
index e9d72a15..8ba9a082 100644
--- a/packages/action-sheet/README.md
+++ b/packages/action-sheet/README.md
@@ -178,6 +178,7 @@ Page({
| bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,openType="getUserInfo"时有效 | - |
| bind:contact | 客服消息回调,openType="contact"时有效 | - |
| bind:getphonenumber | 获取用户手机号回调,openType="getPhoneNumber"时有效 | - |
+| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调,openType="getRealtimePhoneNumber"时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调,openType="launchApp"时有效 | - |
| bind:launchapp | 打开 APP 成功的回调,openType="launchApp"时有效 | - |
| bind:opensetting | 在打开授权设置页后回调,openType="openSetting"时有效 | - |
diff --git a/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap b/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap
index 138de9f7..26969114 100644
--- a/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/action-sheet/test/__snapshots__/demo.spec.ts.snap
@@ -35,6 +35,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -100,6 +101,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -165,6 +167,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -230,6 +233,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -295,6 +299,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -360,6 +365,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/button/README.md b/packages/button/README.md
index 31052055..292250a5 100644
--- a/packages/button/README.md
+++ b/packages/button/README.md
@@ -156,6 +156,7 @@
| bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,
从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
| bind:contact | 客服消息回调 | - |
| bind:getphonenumber | 获取用户手机号回调 | - |
+| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调,open-type=getRealtimePhoneNumber 时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调 | - |
| bind:opensetting | 在打开授权设置页后回调 | - |
| bind:chooseavatar | 当 open-type 的值为 chooseAvatar 时,选择头像之后的回调 |
diff --git a/packages/button/index.wxml b/packages/button/index.wxml
index b5abebbd..b87b9b8f 100644
--- a/packages/button/index.wxml
+++ b/packages/button/index.wxml
@@ -22,6 +22,7 @@
bindgetuserinfo="onGetUserInfo"
bindcontact="onContact"
bindgetphonenumber="onGetPhoneNumber"
+ bindgetrealtimephonenumber="onGetRealTimePhoneNumber"
binderror="onError"
bindlaunchapp="onLaunchApp"
bindopensetting="onOpenSetting"
diff --git a/packages/button/test/__snapshots__/demo.spec.ts.snap b/packages/button/test/__snapshots__/demo.spec.ts.snap
index 5e4050c9..b3f065cc 100644
--- a/packages/button/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/button/test/__snapshots__/demo.spec.ts.snap
@@ -38,6 +38,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -74,6 +75,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -110,6 +112,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -147,6 +150,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -181,6 +185,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -228,6 +233,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -262,6 +268,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -309,6 +316,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -343,6 +351,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -390,6 +399,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -424,6 +434,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -471,6 +482,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -518,6 +530,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -600,6 +613,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -665,6 +679,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -699,6 +714,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -746,6 +762,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -789,6 +806,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -832,6 +850,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -894,6 +913,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -930,6 +950,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -966,6 +987,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -1000,6 +1022,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -1047,6 +1070,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -1081,6 +1105,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -1128,6 +1153,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -1164,6 +1190,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -1198,6 +1225,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/card/test/__snapshots__/demo.spec.ts.snap b/packages/card/test/__snapshots__/demo.spec.ts.snap
index a727e160..8dd9bfcc 100644
--- a/packages/card/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/card/test/__snapshots__/demo.spec.ts.snap
@@ -222,6 +222,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -256,6 +257,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/circle/index.ts b/packages/circle/index.ts
index 28d73067..3e2f7dd4 100644
--- a/packages/circle/index.ts
+++ b/packages/circle/index.ts
@@ -104,6 +104,8 @@ VantComponent({
if (isObj(color)) {
return this.getContext().then((context) => {
+ if (!context) return;
+
const LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color)
.sort((a, b) => parseFloat(a) - parseFloat(b))
@@ -160,6 +162,8 @@ VantComponent({
const { size } = this.data;
this.getContext().then((context) => {
+ if (!context) return;
+
context.clearRect(0, 0, size, size);
this.renderLayerCircle(context);
diff --git a/packages/config-provider/test/__snapshots__/demo.spec.ts.snap b/packages/config-provider/test/__snapshots__/demo.spec.ts.snap
index 87ffed39..06f9fbf0 100644
--- a/packages/config-provider/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/config-provider/test/__snapshots__/demo.spec.ts.snap
@@ -337,6 +337,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -692,6 +693,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/dialog/README.md b/packages/dialog/README.md
index 0a26e5fe..abfbb9a9 100644
--- a/packages/dialog/README.md
+++ b/packages/dialog/README.md
@@ -288,6 +288,7 @@ Page({
| bind:getuserinfo | 点击确认按钮时,会返回获取到的用户信息,
从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
| bind:contact | 客服消息回调 | - |
| bind:getphonenumber | 获取用户手机号回调 | - |
+| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调,open-type=getRealtimePhoneNumber 时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调 | - |
| bind:opensetting | 在打开授权设置页后回调 | - |
diff --git a/packages/empty/test/__snapshots__/demo.spec.ts.snap b/packages/empty/test/__snapshots__/demo.spec.ts.snap
index dc38f25a..2b01e426 100644
--- a/packages/empty/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/empty/test/__snapshots__/demo.spec.ts.snap
@@ -308,6 +308,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/field/test/__snapshots__/demo.spec.ts.snap b/packages/field/test/__snapshots__/demo.spec.ts.snap
index f81d5c42..91d90cb6 100644
--- a/packages/field/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/field/test/__snapshots__/demo.spec.ts.snap
@@ -830,6 +830,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/goods-action/test/__snapshots__/demo.spec.ts.snap b/packages/goods-action/test/__snapshots__/demo.spec.ts.snap
index 7ca1f42d..cc815d21 100644
--- a/packages/goods-action/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/goods-action/test/__snapshots__/demo.spec.ts.snap
@@ -49,6 +49,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -115,6 +116,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -182,6 +184,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -232,6 +235,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -298,6 +302,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -369,6 +374,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -440,6 +446,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -505,6 +512,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -553,6 +561,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -619,6 +628,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -683,6 +693,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -748,6 +759,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -796,6 +808,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -862,6 +875,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -926,6 +940,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -991,6 +1006,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -1039,6 +1055,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/mixins/button.ts b/packages/mixins/button.ts
index 68d7a365..2bc8fdc0 100644
--- a/packages/mixins/button.ts
+++ b/packages/mixins/button.ts
@@ -35,6 +35,10 @@ export const button = Behavior({
this.triggerEvent('getphonenumber', event.detail);
},
+ onGetRealTimePhoneNumber(event: WechatMiniprogram.ButtonGetPhoneNumber) {
+ this.triggerEvent('getrealtimephonenumber', event.detail);
+ },
+
onError(event: WechatMiniprogram.ButtonError) {
this.triggerEvent('error', event.detail);
},
@@ -50,7 +54,7 @@ export const button = Behavior({
onChooseAvatar(
event: WechatMiniprogram.CustomEvent<
WechatMiniprogram.GeneralCallbackResult & { avatarUrl: string }
- >
+ >
) {
this.triggerEvent('chooseavatar', event.detail);
},
diff --git a/packages/notify/test/__snapshots__/demo.spec.ts.snap b/packages/notify/test/__snapshots__/demo.spec.ts.snap
index 5e817d94..aec67c44 100644
--- a/packages/notify/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/notify/test/__snapshots__/demo.spec.ts.snap
@@ -35,6 +35,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -87,6 +88,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -124,6 +126,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -166,6 +169,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -203,6 +207,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -252,6 +257,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -288,6 +294,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -336,6 +343,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/overlay/test/__snapshots__/demo.spec.ts.snap b/packages/overlay/test/__snapshots__/demo.spec.ts.snap
index e2277aed..606f63a8 100644
--- a/packages/overlay/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/overlay/test/__snapshots__/demo.spec.ts.snap
@@ -35,6 +35,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -93,6 +94,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/panel/test/__snapshots__/demo.spec.ts.snap b/packages/panel/test/__snapshots__/demo.spec.ts.snap
index f12a443c..7c12a709 100644
--- a/packages/panel/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/panel/test/__snapshots__/demo.spec.ts.snap
@@ -144,6 +144,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -178,6 +179,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/steps/test/__snapshots__/demo.spec.ts.snap b/packages/steps/test/__snapshots__/demo.spec.ts.snap
index ce94195b..e9e9a5ef 100644
--- a/packages/steps/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/steps/test/__snapshots__/demo.spec.ts.snap
@@ -178,6 +178,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/sticky/index.ts b/packages/sticky/index.ts
index b433e281..2f67c71e 100644
--- a/packages/sticky/index.ts
+++ b/packages/sticky/index.ts
@@ -66,25 +66,24 @@ VantComponent({
this.scrollTop = scrollTop || this.scrollTop;
if (typeof container === 'function') {
- Promise.all([
- getRect(this, ROOT_ELEMENT),
- this.getContainerRect(),
- ]).then(([root, container]) => {
- if (offsetTop + root.height > container.height + container.top) {
- this.setDataAfterDiff({
- fixed: false,
- transform: container.height - root.height,
- });
- } else if (offsetTop >= root.top) {
- this.setDataAfterDiff({
- fixed: true,
- height: root.height,
- transform: 0,
- });
- } else {
- this.setDataAfterDiff({ fixed: false, transform: 0 });
- }
- });
+ Promise.all([getRect(this, ROOT_ELEMENT), this.getContainerRect()])
+ .then(([root, container]) => {
+ if (offsetTop + root.height > container.height + container.top) {
+ this.setDataAfterDiff({
+ fixed: false,
+ transform: container.height - root.height,
+ });
+ } else if (offsetTop >= root.top) {
+ this.setDataAfterDiff({
+ fixed: true,
+ height: root.height,
+ transform: 0,
+ });
+ } else {
+ this.setDataAfterDiff({ fixed: false, transform: 0 });
+ }
+ })
+ .catch(() => {});
return;
}
@@ -126,6 +125,10 @@ VantComponent({
getContainerRect() {
const nodesRef: WechatMiniprogram.NodesRef = this.data.container();
+ if (!nodesRef) {
+ return Promise.reject(new Error('not found container'));
+ }
+
return new Promise(
(resolve) => nodesRef.boundingClientRect(resolve).exec()
);
diff --git a/packages/sticky/test/__snapshots__/demo.spec.ts.snap b/packages/sticky/test/__snapshots__/demo.spec.ts.snap
index 364089ab..4fc14aa5 100644
--- a/packages/sticky/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/sticky/test/__snapshots__/demo.spec.ts.snap
@@ -42,6 +42,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -101,6 +102,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -164,6 +166,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -233,6 +236,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/submit-bar/test/__snapshots__/demo.spec.ts.snap b/packages/submit-bar/test/__snapshots__/demo.spec.ts.snap
index be62e01f..6c96e446 100644
--- a/packages/submit-bar/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/submit-bar/test/__snapshots__/demo.spec.ts.snap
@@ -79,6 +79,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -192,6 +193,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -288,6 +290,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -417,6 +420,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/toast/test/__snapshots__/demo.spec.ts.snap b/packages/toast/test/__snapshots__/demo.spec.ts.snap
index 2ebfd858..410ba12c 100644
--- a/packages/toast/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/toast/test/__snapshots__/demo.spec.ts.snap
@@ -36,6 +36,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -72,6 +73,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -120,6 +122,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -156,6 +159,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -204,6 +208,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -240,6 +245,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -287,6 +293,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
diff --git a/packages/uploader/test/__snapshots__/demo.spec.ts.snap b/packages/uploader/test/__snapshots__/demo.spec.ts.snap
index 579be48f..c7caba4c 100644
--- a/packages/uploader/test/__snapshots__/demo.spec.ts.snap
+++ b/packages/uploader/test/__snapshots__/demo.spec.ts.snap
@@ -531,6 +531,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"
@@ -688,6 +689,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact"
bind:error="onError"
bind:getphonenumber="onGetPhoneNumber"
+ bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting"