Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(button): add getRealtimePhoneNumber support #5471

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/action-sheet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Page({
| bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,<a href="#/action-sheet#actions">openType</a>="getUserInfo"时有效 | - |
| bind:contact | 客服消息回调,<a href="#/action-sheet#actions">openType</a>="contact"时有效 | - |
| 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:launchapp | 打开 APP 成功的回调,<a href="#/action-sheet#actions">openType</a>="launchApp"时有效 | - |
| bind:opensetting | 在打开授权设置页后回调,<a href="#/action-sheet#actions">openType</a>="openSetting"时有效 | - |
Expand Down
6 changes: 6 additions & 0 deletions packages/action-sheet/test/__snapshots__/demo.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
| bind:getuserinfo | 用户点击该按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
| bind:contact | 客服消息回调 | - |
| bind:getphonenumber | 获取用户手机号回调 | - |
| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调,open-type=getRealtimePhoneNumber 时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调 | - |
| bind:opensetting | 在打开授权设置页后回调 | - |
| bind:chooseavatar | 当 open-type 的值为 chooseAvatar 时,选择头像之后的回调 |
Expand Down
1 change: 1 addition & 0 deletions packages/button/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
bindgetuserinfo="onGetUserInfo"
bindcontact="onContact"
bindgetphonenumber="onGetPhoneNumber"
bindgetrealtimephonenumber="onGetRealTimePhoneNumber"
binderror="onError"
bindlaunchapp="onLaunchApp"
bindopensetting="onOpenSetting"
Expand Down
28 changes: 28 additions & 0 deletions packages/button/test/__snapshots__/demo.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions packages/card/test/__snapshots__/demo.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions packages/circle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions packages/config-provider/test/__snapshots__/demo.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/dialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ Page({
| bind:getuserinfo | 点击确认按钮时,会返回获取到的用户信息,<br>从返回参数的 detail 中获取到的值同 wx.getUserInfo | - |
| bind:contact | 客服消息回调 | - |
| bind:getphonenumber | 获取用户手机号回调 | - |
| bind:getrealtimephonenumber `v1.10.21` | 获取手机号实时验证回调,open-type=getRealtimePhoneNumber 时有效 | - |
| bind:error | 当使用开放能力时,发生错误的回调 | - |
| bind:opensetting | 在打开授权设置页后回调 | - |

Expand Down
1 change: 1 addition & 0 deletions packages/empty/test/__snapshots__/demo.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/field/test/__snapshots__/demo.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading