更新
This commit is contained in:
@@ -16,6 +16,7 @@ import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/WebSocketMessage.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device/controller/mht_bluetooth_controller.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/component/HomeDeviceStausWidget.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||
|
||||
class WebviewTestModel {
|
||||
@@ -225,6 +226,27 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
bridge.sdk.updatePermisson((args) async {
|
||||
ef.log('获取权限: $args[0]');
|
||||
try {
|
||||
if (MainPageBBottomChange.getCurrentIndex() != 2) {
|
||||
return false;
|
||||
}
|
||||
Map data = await checkBlueToothPermissin();
|
||||
if (data == null || data.isEmpty) {
|
||||
return false;
|
||||
}
|
||||
if (!data['bluetoothScanGranted'] ||
|
||||
!data['bluetoothConnectGranted'] ||
|
||||
!data['locationGranted']) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
ef.log("[网页加载失败]:$e");
|
||||
}
|
||||
return true;
|
||||
});
|
||||
// bridge.sdk.bluetoothConnect((args) async {
|
||||
// ef.log('[蓝牙连接失败]: $args[0]');
|
||||
// try {
|
||||
@@ -540,7 +562,8 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
|
||||
child: Obx(() {
|
||||
int? aa = MainPageBBottomChange.getCurrentIndex();
|
||||
print(aa);
|
||||
return (controller.ready.value && (MainPageBBottomChange.getCurrentIndex() == 2))
|
||||
// return (controller.ready.value && (MainPageBBottomChange.getCurrentIndex() == 2))
|
||||
return (controller.ready.value)
|
||||
? controller.web.build()
|
||||
: Center(child: CircularProgressIndicator());
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user