feat(button): add getRealtimePhoneNumber support (#5471)

This commit is contained in:
landluck 2023-07-05 13:53:44 +08:00 committed by GitHub
parent bc3d307c4d
commit 2c7629fe07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 122 additions and 20 deletions

View File

@ -178,6 +178,7 @@ Page({
| bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,<a href="#/action-sheet#actions">openType</a>="getUserInfo"时有效 | - | | bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,<a href="#/action-sheet#actions">openType</a>="getUserInfo"时有效 | - |
| bind:contact | 客服消息回调,<a href="#/action-sheet#actions">openType</a>="contact"时有效 | - | | bind:contact | 客服消息回调,<a href="#/action-sheet#actions">openType</a>="contact"时有效 | - |
| bind:getphonenumber | 获取用户手机号回调,<a href="#/action-sheet#actions">openType</a>="getPhoneNumber"时有效 | - | | bind:getphonenumber | 获取用户手机号回调,<a href="#/action-sheet#actions">openType</a>="getPhoneNumber"时有效 | - |
| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调,<a href="#/action-sheet#actions">openType</a>="getRealtimePhoneNumber"时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调,<a href="#/action-sheet#actions">openType</a>="launchApp"时有效 | - | | bind:error | 当使用开放能力时,发生错误的回调,<a href="#/action-sheet#actions">openType</a>="launchApp"时有效 | - |
| bind:launchapp | 打开 APP 成功的回调,<a href="#/action-sheet#actions">openType</a>="launchApp"时有效 | - | | bind:launchapp | 打开 APP 成功的回调,<a href="#/action-sheet#actions">openType</a>="launchApp"时有效 | - |
| bind:opensetting | 在打开授权设置页后回调,<a href="#/action-sheet#actions">openType</a>="openSetting"时有效 | - | | bind:opensetting | 在打开授权设置页后回调,<a href="#/action-sheet#actions">openType</a>="openSetting"时有效 | - |

View File

@ -35,6 +35,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -100,6 +101,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -165,6 +167,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -230,6 +233,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -295,6 +299,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -360,6 +365,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -156,6 +156,7 @@
| bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - | | bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
| bind:contact | 客服消息回调 | - | | bind:contact | 客服消息回调 | - |
| bind:getphonenumber | 获取用户手机号回调 | - | | bind:getphonenumber | 获取用户手机号回调 | - |
| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调open-type=getRealtimePhoneNumber 时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调 | - | | bind:error | 当使用开放能力时,发生错误的回调 | - |
| bind:opensetting | 在打开授权设置页后回调 | - | | bind:opensetting | 在打开授权设置页后回调 | - |
| bind:chooseavatar | 当 open-type 的值为 chooseAvatar 时,选择头像之后的回调 | | bind:chooseavatar | 当 open-type 的值为 chooseAvatar 时,选择头像之后的回调 |

View File

@ -22,6 +22,7 @@
bindgetuserinfo="onGetUserInfo" bindgetuserinfo="onGetUserInfo"
bindcontact="onContact" bindcontact="onContact"
bindgetphonenumber="onGetPhoneNumber" bindgetphonenumber="onGetPhoneNumber"
bindgetrealtimephonenumber="onGetRealTimePhoneNumber"
binderror="onError" binderror="onError"
bindlaunchapp="onLaunchApp" bindlaunchapp="onLaunchApp"
bindopensetting="onOpenSetting" bindopensetting="onOpenSetting"

View File

@ -38,6 +38,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -74,6 +75,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -110,6 +112,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -147,6 +150,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -181,6 +185,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -228,6 +233,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -262,6 +268,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -309,6 +316,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -343,6 +351,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -390,6 +399,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -424,6 +434,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -471,6 +482,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -518,6 +530,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -600,6 +613,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -665,6 +679,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -699,6 +714,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -746,6 +762,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -789,6 +806,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -832,6 +850,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -894,6 +913,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -930,6 +950,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -966,6 +987,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -1000,6 +1022,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -1047,6 +1070,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -1081,6 +1105,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -1128,6 +1153,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -1164,6 +1190,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -1198,6 +1225,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -222,6 +222,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -256,6 +257,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -104,6 +104,8 @@ VantComponent({
if (isObj(color)) { if (isObj(color)) {
return this.getContext().then((context) => { return this.getContext().then((context) => {
if (!context) return;
const LinearColor = context.createLinearGradient(size, 0, 0, 0); const LinearColor = context.createLinearGradient(size, 0, 0, 0);
Object.keys(color) Object.keys(color)
.sort((a, b) => parseFloat(a) - parseFloat(b)) .sort((a, b) => parseFloat(a) - parseFloat(b))
@ -160,6 +162,8 @@ VantComponent({
const { size } = this.data; const { size } = this.data;
this.getContext().then((context) => { this.getContext().then((context) => {
if (!context) return;
context.clearRect(0, 0, size, size); context.clearRect(0, 0, size, size);
this.renderLayerCircle(context); this.renderLayerCircle(context);

View File

@ -337,6 +337,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -692,6 +693,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -288,6 +288,7 @@ Page({
| bind:getuserinfo | 点击确认按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - | | bind:getuserinfo | 点击确认按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
| bind:contact | 客服消息回调 | - | | bind:contact | 客服消息回调 | - |
| bind:getphonenumber | 获取用户手机号回调 | - | | bind:getphonenumber | 获取用户手机号回调 | - |
| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调open-type=getRealtimePhoneNumber 时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调 | - | | bind:error | 当使用开放能力时,发生错误的回调 | - |
| bind:opensetting | 在打开授权设置页后回调 | - | | bind:opensetting | 在打开授权设置页后回调 | - |

View File

@ -308,6 +308,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -830,6 +830,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -49,6 +49,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -115,6 +116,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -182,6 +184,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -232,6 +235,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -298,6 +302,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -369,6 +374,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -440,6 +446,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -505,6 +512,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -553,6 +561,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -619,6 +628,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -683,6 +693,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -748,6 +759,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -796,6 +808,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -862,6 +875,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -926,6 +940,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -991,6 +1006,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -1039,6 +1055,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -35,6 +35,10 @@ export const button = Behavior({
this.triggerEvent('getphonenumber', event.detail); this.triggerEvent('getphonenumber', event.detail);
}, },
onGetRealTimePhoneNumber(event: WechatMiniprogram.ButtonGetPhoneNumber) {
this.triggerEvent('getrealtimephonenumber', event.detail);
},
onError(event: WechatMiniprogram.ButtonError) { onError(event: WechatMiniprogram.ButtonError) {
this.triggerEvent('error', event.detail); this.triggerEvent('error', event.detail);
}, },
@ -50,7 +54,7 @@ export const button = Behavior({
onChooseAvatar( onChooseAvatar(
event: WechatMiniprogram.CustomEvent< event: WechatMiniprogram.CustomEvent<
WechatMiniprogram.GeneralCallbackResult & { avatarUrl: string } WechatMiniprogram.GeneralCallbackResult & { avatarUrl: string }
> >
) { ) {
this.triggerEvent('chooseavatar', event.detail); this.triggerEvent('chooseavatar', event.detail);
}, },

View File

@ -35,6 +35,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -87,6 +88,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -124,6 +126,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -166,6 +169,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -203,6 +207,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -252,6 +257,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -288,6 +294,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -336,6 +343,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -35,6 +35,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -93,6 +94,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -144,6 +144,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -178,6 +179,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -178,6 +178,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -66,25 +66,24 @@ VantComponent({
this.scrollTop = scrollTop || this.scrollTop; this.scrollTop = scrollTop || this.scrollTop;
if (typeof container === 'function') { if (typeof container === 'function') {
Promise.all([ Promise.all([getRect(this, ROOT_ELEMENT), this.getContainerRect()])
getRect(this, ROOT_ELEMENT), .then(([root, container]) => {
this.getContainerRect(), if (offsetTop + root.height > container.height + container.top) {
]).then(([root, container]) => { this.setDataAfterDiff({
if (offsetTop + root.height > container.height + container.top) { fixed: false,
this.setDataAfterDiff({ transform: container.height - root.height,
fixed: false, });
transform: container.height - root.height, } else if (offsetTop >= root.top) {
}); this.setDataAfterDiff({
} else if (offsetTop >= root.top) { fixed: true,
this.setDataAfterDiff({ height: root.height,
fixed: true, transform: 0,
height: root.height, });
transform: 0, } else {
}); this.setDataAfterDiff({ fixed: false, transform: 0 });
} else { }
this.setDataAfterDiff({ fixed: false, transform: 0 }); })
} .catch(() => {});
});
return; return;
} }
@ -126,6 +125,10 @@ VantComponent({
getContainerRect() { getContainerRect() {
const nodesRef: WechatMiniprogram.NodesRef = this.data.container(); const nodesRef: WechatMiniprogram.NodesRef = this.data.container();
if (!nodesRef) {
return Promise.reject(new Error('not found container'));
}
return new Promise<WechatMiniprogram.BoundingClientRectCallbackResult>( return new Promise<WechatMiniprogram.BoundingClientRectCallbackResult>(
(resolve) => nodesRef.boundingClientRect(resolve).exec() (resolve) => nodesRef.boundingClientRect(resolve).exec()
); );

View File

@ -42,6 +42,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -101,6 +102,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -164,6 +166,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -233,6 +236,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -79,6 +79,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -192,6 +193,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -288,6 +290,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -417,6 +420,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -36,6 +36,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -72,6 +73,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -120,6 +122,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -156,6 +159,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -204,6 +208,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -240,6 +245,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -287,6 +293,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"

View File

@ -531,6 +531,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"
@ -688,6 +689,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:contact="onContact" bind:contact="onContact"
bind:error="onError" bind:error="onError"
bind:getphonenumber="onGetPhoneNumber" bind:getphonenumber="onGetPhoneNumber"
bind:getrealtimephonenumber="onGetRealTimePhoneNumber"
bind:getuserinfo="onGetUserInfo" bind:getuserinfo="onGetUserInfo"
bind:launchapp="onLaunchApp" bind:launchapp="onLaunchApp"
bind:opensetting="onOpenSetting" bind:opensetting="onOpenSetting"