Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
4a31b6b6
U
uni-api
项目概览
DCloud
/
uni-api
通知
670
Star
23
Fork
12
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4a31b6b6
编写于
5月 25, 2023
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wifi 新增ts-doc 描述
上级
e9cd4eeb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
178 addition
and
94 deletion
+178
-94
pages.json
pages.json
+7
-0
uni_modules/uni-wifi/utssdk/interface.uts
uni_modules/uni-wifi/utssdk/interface.uts
+171
-94
未找到文件。
pages.json
浏览文件 @
4a31b6b6
...
@@ -5,6 +5,13 @@
...
@@ -5,6 +5,13 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"uni-app"
"navigationBarTitleText"
:
"uni-app"
}
}
},
{
"path"
:
"pages/autotest/uni-getbatteryinfo/uni-getbatteryinfo"
,
"style"
:
{
"navigationBarTitleText"
:
"uni-getbatteryinfo"
,
"enablePullDownRefresh"
:
false
}
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
...
...
uni_modules/uni-wifi/utssdk/interface.uts
浏览文件 @
4a31b6b6
/**
/**
* Wifi 函数通用入参封装
* Wifi 函数通用入参封装
*/
*/
export type WifiOption = {
export type WifiOption = {
success
?: (res
: UniWifiResult) => void;
success
?: (res
: UniWifiResult) => void;
fail
?: (res
: UniWifiResult) => void;
fail
?: (res
: UniWifiResult) => void;
complete
?: (res
: UniWifiResult) => void;
complete
?: (res
: UniWifiResult) => void;
};
};
/**
/**
* Wifi 链接参数封装
* Wifi 链接参数封装
*/
*/
export type WifiConnectOption = {
export type WifiConnectOption = {
SSID?: string;
SSID
?: string;
BSSID?: string;
BSSID
?: string;
password?: string;
password
?: string;
maunal?: boolean;
maunal
?: boolean;
partialInfo?: boolean; //ios不生效
partialInfo
?: boolean; //ios不生效
success
?: (res
: UniWifiResult) => void;
success
?: (res
: UniWifiResult) => void;
fail
?: (res
: UniWifiResult) => void;
fail
?: (res
: UniWifiResult) => void;
complete
?: (res
: UniWifiResult) => void;
complete
?: (res
: UniWifiResult) => void;
}
}
/**
/**
* 获取当前链接的wifi信息
* 获取当前链接的wifi信息
*/
*/
export type GetConnectedWifiOptions = {
export type GetConnectedWifiOptions = {
partialInfo?: boolean
partialInfo
?: boolean
success
?: (res
: UniWifiResult) => void
success
?: (res
: UniWifiResult) => void
fail
?: (res
: UniWifiResult) => void
fail
?: (res
: UniWifiResult) => void
complete
?: (res
: UniWifiResult) => void
complete
?: (res
: UniWifiResult) => void
}
}
/*
/*
* 对外暴露的wifi信息
* 对外暴露的wifi信息
*/
*/
export type UniWifiInfo = {
export type UniWifiInfo = {
SSID: string;
SSID
: string;
BSSID?: string;
BSSID
?: string;
secure?: boolean;
secure
?: boolean;
signalStrength?: number;
signalStrength
?: number;
frequency?: number;
frequency
?: number;
}
}
...
@@ -47,35 +47,35 @@ export type UniWifiResult = {
...
@@ -47,35 +47,35 @@ export type UniWifiResult = {
errCode : number,
errCode : number,
errSubject : string,
errSubject : string,
errMsg : string,
errMsg : string,
wifi: UniWifiInfo | null
wifi
: UniWifiInfo | null
}
}
export type UniWifiCallback = () => void
export type UniWifiCallback = () => void
export type StartWifi = (option: WifiOption) => void
export type StartWifi = (option
: WifiOption) => void
export type StopWifi = (option: WifiOption) => void
export type StopWifi = (option
: WifiOption) => void
export type GetWifiList = (option: WifiOption) => void
export type GetWifiList = (option
: WifiOption) => void
export type OnGetWifiList = (callback: UniWifiCallback) => void
export type OnGetWifiList = (callback
: UniWifiCallback) => void
export type OffGetWifiList = (callback: UniWifiCallback) => void
export type OffGetWifiList = (callback
: UniWifiCallback) => void
export type GetConnectedWifi = (option: GetConnectedWifiOptions) => void
export type GetConnectedWifi = (option
: GetConnectedWifiOptions) => void
export type ConnectWifi = (option: WifiConnectOption) => void
export type ConnectWifi = (option
: WifiConnectOption) => void
export type OnWifiConnected = (callback: UniWifiCallback) => void
export type OnWifiConnected = (callback
: UniWifiCallback) => void
export type OnWifiConnectedWithPartialInfo = (callback: UniWifiCallback) => void
export type OnWifiConnectedWithPartialInfo = (callback
: UniWifiCallback) => void
export type OffWifiConnected = (callback: UniWifiCallback | null) => void
export type OffWifiConnected = (callback
: UniWifiCallback | null) => void
export type OnOffWifiConnectedWithPartialInfo = (callback: UniWifiCallback | null) => void
export type OnOffWifiConnectedWithPartialInfo = (callback
: UniWifiCallback | null) => void
export type SetWifiList = (option: WifiOption) => void
export type SetWifiList = (option
: WifiOption) => void
interface Uni {
interface Uni {
/**
/**
...
@@ -84,11 +84,18 @@ interface Uni {
...
@@ -84,11 +84,18 @@ interface Uni {
* @param {WifiOption} option
* @param {WifiOption} option
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -100,11 +107,18 @@ interface Uni {
...
@@ -100,11 +107,18 @@ interface Uni {
* @param {WifiOption} option
* @param {WifiOption} option
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#stopwifi
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#stopwifi
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -114,11 +128,18 @@ interface Uni {
...
@@ -114,11 +128,18 @@ interface Uni {
* @param {WifiConnectOption} option
* @param {WifiConnectOption} option
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#connectWifi
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#connectWifi
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -135,24 +156,31 @@ interface Uni {
...
@@ -135,24 +156,31 @@ interface Uni {
password:"streamApp!2016",
password:"streamApp!2016",
}],
}],
output:{
output:{
callbackType: 'success',
callbackType: 'success',
value: { errCode: 12013 ,errMsg: "connectWifi:wifi config may be expired",errSubject: "uni-connectWifi"}
value: { errCode: 12013 ,errMsg: "connectWifi:wifi config may be expired",errSubject: "uni-connectWifi"}
}
}
}
}
]
]
}
}
*/
*/
connectWifi: ConnectWifi,
connectWifi
: ConnectWifi,
/**
/**
* 请求获取 Wi-Fi 列表。wifiList 数据会在 onGetWifiList 注册的回调中返回。
* 请求获取 Wi-Fi 列表。wifiList 数据会在 onGetWifiList 注册的回调中返回。
* @param {WifiOption} option
* @param {WifiOption} option
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#getWifiList
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#getWifiList
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -173,11 +201,18 @@ interface Uni {
...
@@ -173,11 +201,18 @@ interface Uni {
* @param {UniWifiCallback} callback
* @param {UniWifiCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onGetWifiList
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onGetWifiList
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -189,11 +224,18 @@ interface Uni {
...
@@ -189,11 +224,18 @@ interface Uni {
* @param {UniWifiCallback} callback
* @param {UniWifiCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#offGetWifiList
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#offGetWifiList
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -205,11 +247,18 @@ interface Uni {
...
@@ -205,11 +247,18 @@ interface Uni {
* @param {GetConnectedWifiOptions} option
* @param {GetConnectedWifiOptions} option
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#getConnectedWifi
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#getConnectedWifi
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -221,11 +270,18 @@ interface Uni {
...
@@ -221,11 +270,18 @@ interface Uni {
* @param {UniWifiCallback} callback
* @param {UniWifiCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnected
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnected
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -237,11 +293,18 @@ interface Uni {
...
@@ -237,11 +293,18 @@ interface Uni {
* @param {UniWifiCallback} callback
* @param {UniWifiCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnectedWithPartialInfo
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnectedWithPartialInfo
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -253,11 +316,18 @@ interface Uni {
...
@@ -253,11 +316,18 @@ interface Uni {
* @param {UniWifiCallback} callback
* @param {UniWifiCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#offWifiConnected
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#offWifiConnected
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
...
@@ -269,15 +339,22 @@ interface Uni {
...
@@ -269,15 +339,22 @@ interface Uni {
* @param {UniWifiCallback} callback
* @param {UniWifiCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onOffWifiConnectedWithPartialInfo
* @tutorial https://uniapp.dcloud.net.cn/api/system/wifi.html#onOffWifiConnectedWithPartialInfo
* @uniPlatform {
* @uniPlatform {
* app: {
* app: {
* android: "4.4.4",
* "android": {
* ios: "9.0",
* "osVer": "4.4.4",
* page: ['vue','uvue','nvue']
* "uniVer": "3.7.0",
* }
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "9.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* }
* @uniVersion 3.7.7
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
* @uniVueVersion 2,3 //支持的vue版本
*/
*/
onOffWifiConnectedWithPartialInfo : OnOffWifiConnectedWithPartialInfo,
onOffWifiConnectedWithPartialInfo : OnOffWifiConnectedWithPartialInfo,
setWifiList : SetWifiList,
setWifiList : SetWifiList,
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录