点击立即进入正能量网站php做网站教程
ty.showStatusBar
显示手机状态栏
需引入
MiniKit,且在>=2.6.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
函数定义示例
/*** 显示手机状态栏*/
export function showStatusBar(params?: {complete?: () => void;success?: (params: null) => void;fail?: (params: {errorMsg: string;errorCode: string | number;innerError: {errorCode: string | number;errorMsg: string;};}) => void;
}): void;
ty.hideStatusBar
隐藏手机状态栏
需引入
MiniKit,且在>=2.6.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
函数定义示例
/*** 隐藏手机状态栏*/
export function hideStatusBar(params?: {complete?: () => void;success?: (params: null) => void;fail?: (params: {errorMsg: string;errorCode: string | number;innerError: {errorCode: string | number;errorMsg: string;};}) => void;
}): void;
ty.share
分享
需引入
BizKit,且在>=3.0.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| type | string | 是 | 分享渠道,可选值如下: WeChat:微信 Message:短信 Email:邮件 More:系统更多分享渠道(调用系统分享) | |
| title | string | 是 | title 标题 | |
| message | string | 是 | message 文本内容 | |
| contentType | string | 是 | contentType 内容类型 空值默认为 text 可选值如下: text:文本 image:图片 file:文件 web:网页地址 miniProgram:微信小程序分享内容 | |
| recipients | array | 否 | recipients 邮件收件人 | |
| imagePath | string | 否 | imagePath 图片路径 | |
| filePath | string | 否 | filePath 当 contentType == file 时候使用 | |
| webPageUrl | string | 否 | web 当 contentType == file 时候使用 | |
| miniProgramInfo | MiniProgramInfo | 否 | miniProgramInfo 当 contentType == miniProgram 时候使用,且分享渠道必须是微信。 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
MiniProgramInfo
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| userName | string | 是 | 用户名称 | |
| path | string | 是 | 路径 | |
| hdImagePath | string | 是 | 图片地址 | |
| withShareTicket | boolean | 是 | ticket | |
| miniProgramType | number | 是 | 类型 | |
| webPageUrl | string | 是 | 小程序地址 |
ty.getShareChannelList
获取可分享的渠道列表
需引入
BizKit,且在>=3.0.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| shareChannelList | array | 可分享的渠道列表 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
ty.getUserInfo
获取用户信息
需引入
BizKit,且在>=3.0.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| nickName | string | nickName 用户昵称 |
| avatarUrl | string | 用户头像 |
| phoneCode | string | 国家代码 |
| isTemporaryUser | boolean | 是否是临时用户 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string | 插件错误信息 |
| errorCode | string | 错误码 |
| innerError | object | 插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
ty.openCountrySelectPage
进入选择国家页面
需引入
BizKit,且在>=3.0.0版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 |
ty.onCountrySelectResult
国家列表界面选择的国家信息
需引入
BizKit,且在>=3.0.0版本才可使用
参数
function callback
国家列表界面选择的国家信息的回调函数
回调参数 Object res
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| countryCode | string | 否 | 国家码 | |
| countryAbb | string | 否 | 国家编码 | |
| countryName | string | 否 | 国家名称 |
ty.offCountrySelectResult
取消监听:国家列表界面选择的国家信息
需引入
BizKit,且在>=3.0.0版本才可使用
参数
function callback
取消监听:国家列表界面选择的国家信息的回调函数
回调参数 Object res
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| countryCode | string | 否 | 国家码 | |
| countryAbb | string | 否 | 国家编码 | |
| countryName | string | 否 | 国家名称 |
👉 立即开发。
