更新记录
1.0.6(2024-10-29)
- 修改接口名称:
setConnectHandle改为onConnectHandle,
setOperateHandle改为onOperateHandle
1.0.5(2024-10-29)
- 优化内部逻辑
1.0.4(2024-10-29)
- 修复新版本HB只回调一次问题
查看更多
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 3.6.8,Android:4.4,iOS:不支持,HarmonyNext:不确定 |
× |
× |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
× |
× |
× |
× |
× |
× |
× |
× |
× |
康泰肺活量计SP80B SP70B
import {
UTSContexsp
} from "@/uni_modules/wrs-uts-contexsp80b";
let contexsp = new UTSContexsp();
let isDelete = true
contexsp.initSDK(isDelete)
contexsp.onConnectHandle((status) => {
this.showMsg("setConnectHandle status:" + status)
})
contexsp.onOperateHandle((resp) => {
this.showMsg("setOperateHandle:" + JSON.stringify(resp))
let opt = resp.opt
switch (opt) {
case "onSuccess":
// todo -> resp
break;
case "onFail":
let operate = opt.operate
let errorCode = opt.errorCode
// todo -> operate
break;
case "onDataInformation":
let totalNumber = resp.totalNumber
break;
default:
break;
}
})
let address = device.address // mac地址
contexsp.connect(address)
contexsp.disconnect()
let version = contexsp.getSdkVersion()
let params = {}
params.measureMode = "ALL" // ALL、FVC、VC、MVV、MV
params.sex = "MALE"// MALE、FEMALE
params.age = 20
params.weight = 100
// params.height = 170
params.smoke = "SMOKE" // SMOKE、FEMALE
params.standard = "ECCS"// ECCS、KNUDSON、USA
contexsp.setUserParams(params)
contexsp.deleteData()
contexsp.getData()
contexsp.getDataInformation()