更新波形图
This commit is contained in:
Binary file not shown.
@@ -541,7 +541,8 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
|||||||
DailyLogUtils.printLog("蓝牙获取MAC失败:$e");
|
DailyLogUtils.printLog("蓝牙获取MAC失败:$e");
|
||||||
TopSlideNotification.show(
|
TopSlideNotification.show(
|
||||||
context,
|
context,
|
||||||
text: "设备连接失败,请重试".tr,
|
// text: e.message ?? "设备连接失败,请重试".tr,
|
||||||
|
text: "获取不到传感器mac,请重试".tr,
|
||||||
textColor: themeController.currentColor.sc9,
|
textColor: themeController.currentColor.sc9,
|
||||||
);
|
);
|
||||||
rethrow;
|
rethrow;
|
||||||
@@ -632,6 +633,12 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
final mac = await completer.future.timeout(timeout);
|
final mac = await completer.future.timeout(timeout);
|
||||||
|
if (mac == null || mac.isEmpty) {
|
||||||
|
throw Exception("获取MAC失败");
|
||||||
|
}
|
||||||
|
if (mac == "000000000000") {
|
||||||
|
throw Exception("获取MAC失败");
|
||||||
|
}
|
||||||
await subscription.cancel();
|
await subscription.cancel();
|
||||||
return mac;
|
return mac;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
|||||||
@@ -31,10 +31,11 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
var bluetooth = 0;
|
var bluetooth = 0;
|
||||||
List personList = [];
|
List personList = [];
|
||||||
List instantData = [];
|
List instantData = [];
|
||||||
|
RxBool initFlag = false.obs;
|
||||||
|
|
||||||
WebviewTestController() : super(WebviewTestModel()) {
|
WebviewTestController() : super(WebviewTestModel()) {
|
||||||
web = WebviewHelper(
|
web = WebviewHelper(
|
||||||
isheadless: true,
|
isheadless: false,
|
||||||
jsbridge: buildsdk(
|
jsbridge: buildsdk(
|
||||||
// father: this,
|
// father: this,
|
||||||
// clientId: '494641114',
|
// clientId: '494641114',
|
||||||
@@ -161,6 +162,16 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
bridge.sdk.webPageBuild((args) async {
|
||||||
|
ef.log('网页加载完成: $args[0]');
|
||||||
|
try {
|
||||||
|
initFlag.value = true;
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
ef.log("[网页加载失败]:$e");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
ef.log('$e,$s');
|
ef.log('$e,$s');
|
||||||
@@ -392,11 +403,11 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
|
|||||||
child: Expanded(
|
child: Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.topLeft,
|
alignment: Alignment.topLeft,
|
||||||
child: Obx(
|
child: Obx(() {
|
||||||
() => controller.ready.value
|
return controller.ready.value
|
||||||
? controller.web.build()
|
? controller.web.build()
|
||||||
: Container(),
|
: Container();
|
||||||
),
|
}),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user