quick.device
setOrientation
设置屏幕方向
quick.device.setOrientation({
orientation: 1,
success: function(result) {},
error: function(error) {}
});
参数说明
| 参数 | 参数类型 | 说明 |
|---|---|---|
| orientation | Number | 必填,屏幕方向,1表示竖屏,0表示横屏,其他表示跟随系统,-1为跟随系统 |
环境支持
quick
getDeviceId
获取设备ID
quick.device.getDeviceId({
success: function(result) {
/**
* {
deviceId: ''
}
*/
},
error: function(error) {}
});
返回说明
| 参数 | 参数类型 | 说明 |
|---|---|---|
| deviceId | String | 对应的设备唯一ID |
环境支持
quick
getNetWorkInfo
获取网络状态
quick.device.getNetWorkInfo({
success: function(result) {
/**
* {
netWorkType: 1
}
*/
},
error: function(error) {}
});
返回说明
| 参数 | 参数类型 | 说明 |
|---|---|---|
| netWorkType | Number | 网络状态,1代表wifi,0代表移动网络,-1代表无网络 |
环境支持
quick
getVendorInfo
获取设备厂商信息
同时将设备其它信息也一起返回
quick.device.getVendorInfo({
success: function(result) {
/**
* {
netWorkType: 'xxx',
deviceId: 'xxx',
pixel: '1080*1920',
uaInfo: 'android HUAWEI VTR-AL00'
}
*/
},
error: function(error) {}
});
返回说明
| 参数 | 参数类型 | 说明 |
|---|---|---|
| netWorkType | Number | 网络状态,1代表wifi |
| deviceId | String | 对应的设备唯一ID |
| pixel | String | 屏幕的像素信息,宽高以*分隔 |
| uaInfo | String | 厂商信息 |
环境支持
quick
callPhone
拨打电话
quick.device.callPhone({
phoneNum: "182xxxxxxxx",
success: function(result) {},
error: function(error) {}
});
// 兼容快速调用
quick.device.callPhone('182xxxxxxxx');
参数说明
| 参数 | 参数类型 | 说明 |
|---|---|---|
| phoneNum | Number | 需要拨打的电话号码 |
环境支持
H5、quick
sendMsg
发送短信
quick.device.sendMsg({
phoneNum: "182xxxxxxxx",
message:'hello',
success: function(result) {},
error: function(error) {}
});
// 兼容快速调用
quick.device.sendMsg('182xxxxxxxx', 'hello');
参数说明
| 参数 | 参数类型 | 说明 |
|---|---|---|
| phoneNum | Number | 目标的电话号码 |
| message | String | 短信内容 |
环境支持
H5、quick
closeInputKeyboard
关闭输入法软键盘,如果已经打开,则关闭
quick.device.closeInputKeyboard({
success: function(result) {},
error: function(error) {}
});
环境支持
quick
vibrate
调用原生的震动功能
quick.device.vibrate({
duration: 500,
success: function(result) {},
error: function(error) {}
});
// 支持快速调用
quick.device.vibrate(500);
参数说明
| 参数 | 参数类型 | 说明 |
|---|---|---|
| duration | Number | 只在Android中有用,iOS中请忽略,震动的持续时间,单位是毫秒,默认是500 |
环境支持
quick