# getDeviceInfo 获取本地设备信息
获取本地设备信息
type ResBody = {
// 设备ID
deviceCode: string,
// 当前浏览器模式
browserMode: string,
// 当前浏览器版本
browserVersion: string,
// 平台
platform: string,
// 架构
arch: string,
//发行厂商
publisher: string
}
zwexplorer.__native.getDeviceInfo({}, callback: (res: ResBody)=>void): Promise<ResBody>
参数 | 类型 | 必然存在 | 说明 |
---|---|---|---|
res.deviceCode | string | 是 | 返回当前设备的设备 ID |
res.browserMode | string | 是 | 返回当前设备的浏览器模式 |
res.browserVersion | string | 是 | 返回当前设备的浏览器版本 |
res.platform | string | 是 | 返回当前设备的平台 |
res.arch | string | 是 | 返回当前设备的架构 |
res.publisher | string | 是 | 返回当前设备的发行厂商 |
zwexplorer.__native.getDeviceInfo({}, (res) => {
});
# setDailogInfo 调用全局弹窗
根据特定的入参来调用特定样式的全局弹窗,并根据点击弹窗的按钮拿到特定的返回值
type ReqBody = {
type?: string, //'success' | 'info' | 'warning' | 'error',默认是info
title?: string, //标题,默认是'提示'
content?: string, //内容,默认是'提示内容'
showClose?: boolean,//是否显示右上角关闭按钮,默认是false
showCancel?: boolean,//是否显示取消按钮,默认是true
showConfirm?: boolean,//是否显示取消按钮,默认是true
cancelText?: string,//取消按钮的文本内容 ,默认是'取消'
confirmText?: string,//确定按钮的文本内容,默认是'确定'
}
type ResBody = {
confirm: ReqBody,
result:boolean
}
zwexplorer.__native.setDailogInfo(
data: ReqBody,
callback?: (res: ResBody)=>void
): Promise<ResBody>
参数 | 类型 | 必然存在 | 说明 |
---|---|---|---|
res.confirm | Object | 是 | 返回调用弹窗接口的入参 |
res.result | Boolean | 是 | 返回点击弹窗的按钮结果 |
zwexplorer.__native.setDailogInfo({}, (res) => {
// 返回数据
});