UNPKG

1.77 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps } from './common'
3interface LoginProps extends StandardProps {
4 /** 组件中用户授权按钮的类名,可用于自定义样式
5 * @supported swan
6 */
7 buttonClass?: string
8
9 /** 组件中用户授权勾选框选中时的颜色,同 CSS 的 color
10 * @supported swan
11 * @default "#3388FF"
12 */
13 checkedColor?: string
14
15 /** 主题颜色,设置后将应用于 “用户授权按钮背景色” 和 “用户授权勾选框选中时的颜色”
16 * 注:theme-color 的优先级低于 button-class 和 checked-color,且当 button-class 存在时,theme-color 不生效
17 * @supported swan
18 * @default "#3388FF"
19 */
20 themeColor?: string
21
22 /** 用户完成授权后,获取用户手机号:
23 * detail.errMsg 值为"getPhoneNumber:ok" 时代表用户信息获取成功;
24 * detail.errMsg 值为"getPhoneNumber:fail auth deny"时代表用户信息获取失败。
25 * 参考 用户数据的签名验证和加解密 对用户数据进行处理获得用户手机号。
26 * 用户手机号信息解密后数据示例:{"mobile":"15000000000"}
27 * 1. 非个人开发者可申请;
28 * 2. 审核通过后,进入小程序首页,在左侧导航栏单击“设置 -> 开发设置”。下拉页面,在“获取用户手机号权限申请”中单击“申请开通”
29 * @supported swan
30 */
31 onGetPhoneNumber?: CommonEventFunction
32
33 /** 组件加载失败回调
34 * @supported swan
35 */
36 onLoadError?: CommonEventFunction
37}
38
39/** 联合登录 / 手机号授权内嵌组件
40 * @classification open
41 * @supported swan
42 * @see https://smartprogram.baidu.com/docs/develop/component/login/
43 */
44declare const Login: ComponentType<LoginProps>
45export { Login, LoginProps }