Merge branch 'master' of http://10.20.2.7:8080/r/~enchantedwyf/vbvs_app
Conflicts: lib/pages/mh_page/test/WebviewTestModel.dart
This commit is contained in:
@@ -4,6 +4,7 @@ import 'dart:convert';
|
||||
import 'package:EasyDartModule/EasyDartModule.dart';
|
||||
import 'package:EasyDartModule/base/logger/Logger.dart';
|
||||
import 'package:EasyDartModule/base/websocket/WebSocket.dart';
|
||||
import 'package:easyweb/utils/appmanger.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -106,6 +107,8 @@ Future<void> main() async {
|
||||
// // 初始化 flutter_xupdate android app 更新
|
||||
// initXUpdate();
|
||||
|
||||
initwebService();
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
|
||||
.then((_) {
|
||||
@@ -113,6 +116,15 @@ Future<void> main() async {
|
||||
});
|
||||
}
|
||||
|
||||
void initwebService() {
|
||||
ef.kvRoot.appmanger = MiniAppManager(assetsfilePath: 'assets/file.json');
|
||||
ef.kvRoot.appmanger.register(["mhtControl"]);
|
||||
ef.kvRoot.appmanger.init().then((x) {
|
||||
//先加载,后检测更新..
|
||||
ef.kvRoot.appmanger.start("https://wyf.it.real.he-info.cn:94/apk/webapp/");
|
||||
});
|
||||
}
|
||||
|
||||
initLanguageSetting() {
|
||||
try {
|
||||
Get.put(LanguageController());
|
||||
|
||||
@@ -20,7 +20,7 @@ class _MattressControlPageState extends State<MattressControlPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
// onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
|
||||
@@ -18,11 +18,22 @@ class _MhAboutUsPageState extends State<MhAboutUsPage> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
// pdfController.loadPdf();
|
||||
|
||||
String url;
|
||||
switch (AppConstants().ent_type) {
|
||||
case 1:
|
||||
url = "https://mp.weixin.qq.com/s/BrD3fTT2J2R-DxZrUuM4rw";
|
||||
break;
|
||||
case 2:
|
||||
url = "https://mp.weixin.qq.com/s/7BvvprVDqX1eOzM3Lms8dg";
|
||||
break;
|
||||
case 3:
|
||||
url = "https://mp.weixin.qq.com/s/BrD3fTT2J2R-DxZrUuM4rw";
|
||||
break;
|
||||
default:
|
||||
url = "https://mp.weixin.qq.com/s/BrD3fTT2J2R-DxZrUuM4rw";
|
||||
}
|
||||
widget.webView = MyWebView(
|
||||
url: AppConstants().ent_type == 1
|
||||
? "https://mp.weixin.qq.com/s/BrD3fTT2J2R-DxZrUuM4rw"
|
||||
: "https://mp.weixin.qq.com/s/7BvvprVDqX1eOzM3Lms8dg",
|
||||
url: url,
|
||||
onLoad: () {
|
||||
print('网页载入完毕');
|
||||
},
|
||||
|
||||
@@ -230,14 +230,6 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
TopSlideNotification.show(context,
|
||||
text: response.msg!);
|
||||
if (response.code == HttpStatusCodes.ok) {
|
||||
try {
|
||||
WebviewTestController webviewTestController =
|
||||
Get.find();
|
||||
webviewTestController.web.jsbridge?.dart
|
||||
.unBindDevice();
|
||||
} catch (e) {
|
||||
ef.log("[h5]通知列表更新报错:$e");
|
||||
}
|
||||
homeController.getPersonList();
|
||||
//请求绑定设备列表
|
||||
// homeController.getSleepReport();
|
||||
@@ -254,6 +246,14 @@ class _DeviceComponentWidgetState extends State<DeviceComponentWidget> {
|
||||
.getDeviceList(group: 'room')
|
||||
.then((apiResponse) {
|
||||
if (apiResponse.code != HttpStatusCodes.ok) {
|
||||
try {
|
||||
WebviewTestController webviewTestController =
|
||||
Get.find();
|
||||
webviewTestController.web.jsbridge?.dart
|
||||
.alterDevice();
|
||||
} catch (e) {
|
||||
ef.log("[h5]通知列表更新报错:$e");
|
||||
}
|
||||
TopSlideNotification.show(
|
||||
Get.context!,
|
||||
text: apiResponse.msg!,
|
||||
|
||||
@@ -58,7 +58,8 @@ class DeviceInfoWidget extends GetView {
|
||||
children: [
|
||||
Text(
|
||||
deviceListController.model.deviceList[index]['name'] ??
|
||||
'SWES系列 01号智能一键入眠床',
|
||||
getNameByType(
|
||||
deviceListController.model.deviceList[index]),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Colors.white,
|
||||
@@ -127,14 +128,14 @@ class DeviceInfoWidget extends GetView {
|
||||
.model.deviceList[index]
|
||||
["status"]?["status"]) ==
|
||||
1
|
||||
? '在线'
|
||||
: '离线',
|
||||
? '已绑定'
|
||||
: '已绑定',
|
||||
valueColor: (deviceListController
|
||||
.model.deviceList[index]
|
||||
["status"]?["status"]) ==
|
||||
1
|
||||
? Color(0xFF6BFDAC)
|
||||
: Color(0xFFFF7159)),
|
||||
: Color(0xFF6BFDAC)),
|
||||
// Row(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
@@ -207,15 +208,12 @@ class DeviceInfoWidget extends GetView {
|
||||
try {
|
||||
WebviewTestController webviewTestController =
|
||||
Get.find();
|
||||
var future = webviewTestController
|
||||
.web.jsbridge?.dart
|
||||
.appToHtmlDevice(device);
|
||||
Future.delayed(Duration(seconds: 5), () {
|
||||
return;
|
||||
});
|
||||
await future;
|
||||
|
||||
await webviewTestController.web.jsbridge?.dart
|
||||
.pageActive(false);
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
await webviewTestController.web.jsbridge?.dart
|
||||
.appToHtmlDevice(device);
|
||||
MainPageBBottomChange.jumpTo(2);
|
||||
Get.until((route) =>
|
||||
Get.currentRoute ==
|
||||
@@ -387,15 +385,17 @@ class DeviceInfoWidget extends GetView {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "功能开发中...",
|
||||
);
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "功能开发中...",
|
||||
// );
|
||||
// var a = [device["bindMacA"]];
|
||||
// if ("${device["bindMacB"]}".length > 6) {
|
||||
// a.add(device["bindMacB"]);
|
||||
// }
|
||||
// Get.toNamed("/sleepWebview", arguments: a);
|
||||
Get.toNamed("/mhtSleepReportReturnPage",
|
||||
arguments: device);
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.sizeOf(context).height * 0.1,
|
||||
@@ -464,4 +464,16 @@ class DeviceInfoWidget extends GetView {
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
getNameByType(device) {
|
||||
if (device['device_type'] == null) {
|
||||
return '未知类型设备'.tr;
|
||||
}
|
||||
if (device['device_type'] == 2) {
|
||||
return 'SWES 智能床'.tr;
|
||||
}
|
||||
if (device['device_type'] == 3) {
|
||||
return 'SWES 智能床垫'.tr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,13 +164,13 @@ class _MHTBindDeviceTypePageState extends State<MHTBindDeviceTypePage> {
|
||||
return CustomCard(
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () {
|
||||
if (type == 2) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "当前类型不支持绑定".tr,
|
||||
);
|
||||
return;
|
||||
}
|
||||
// if (type == 2) {
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "当前类型不支持绑定".tr,
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
MHTBlueToothController mhtBlueToothController = Get.find();
|
||||
mhtBlueToothController.model.deviceType = type.toInt();
|
||||
Get.toNamed("/mHTBlueteethDevicePage", arguments: data);
|
||||
|
||||
@@ -79,14 +79,12 @@ class _HomeDeviceStausWidgetState extends State<HomeDeviceStausWidget> {
|
||||
try {
|
||||
var device = widget.deviceStatus;
|
||||
WebviewTestController webviewTestController = Get.find();
|
||||
var future = webviewTestController.web.jsbridge?.dart
|
||||
.appToHtmlDevice(device);
|
||||
Future.delayed(Duration(seconds: 5), () {
|
||||
return;
|
||||
});
|
||||
await future;
|
||||
|
||||
await webviewTestController.web.jsbridge?.dart
|
||||
.pageActive(false);
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
await webviewTestController.web.jsbridge?.dart
|
||||
.appToHtmlDevice(device);
|
||||
MainPageBBottomChange.jumpTo(2);
|
||||
} catch (e) {
|
||||
DailyLogUtils.writeError("发生异常: $e");
|
||||
|
||||
@@ -102,6 +102,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
homeController.updateAll();
|
||||
});
|
||||
}
|
||||
//themeController.currentColor.sc5,
|
||||
if (homeController.personnelList.value.length != 0)
|
||||
return Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
@@ -125,6 +126,16 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'健康报告'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
ScrollbarTheme(
|
||||
data: ScrollbarThemeData(
|
||||
thumbColor: MaterialStateProperty.all(
|
||||
@@ -278,6 +289,7 @@ class _MhtSleepReportPageState extends State<MhtSleepReportPage> {
|
||||
'assets/images/new_background.png',
|
||||
'arrow': false,
|
||||
'noBackImg': true,
|
||||
'person_show': false,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
305
lib/pages/mh_page/homepage/mht_sleep_report_page_return.dart
Normal file
305
lib/pages/mh_page/homepage/mht_sleep_report_page_return.dart
Normal file
@@ -0,0 +1,305 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
|
||||
import 'package:vbvs_app/pages/sleep_report/new_sleep_report_page.dart';
|
||||
|
||||
class MhtSleepReportReturnPage extends StatefulWidget {
|
||||
final dynamic data;
|
||||
const MhtSleepReportReturnPage({super.key, required this.data});
|
||||
|
||||
@override
|
||||
State<MhtSleepReportReturnPage> createState() =>
|
||||
_MhtSleepReportReturnPageState();
|
||||
}
|
||||
|
||||
class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
|
||||
final UserInfoController userInfoController = Get.find();
|
||||
final MHTHomeController deviceController = Get.find();
|
||||
final MHTHomeController homeController = Get.find();
|
||||
final double borderRadius = 16.rpx;
|
||||
|
||||
final formFieldController = FormFieldController<String>(null);
|
||||
final personInfo = {}.obs;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (userInfoController.model.login == 1) {
|
||||
// 设备列表
|
||||
deviceController.getDeviceList(group: 'room');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: themeController.currentColor.sc3),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
/// 下拉选人
|
||||
Positioned(
|
||||
right: 20.rpx,
|
||||
child: ScrollbarTheme(
|
||||
data: ScrollbarThemeData(
|
||||
thumbColor:
|
||||
MaterialStateProperty.all(Colors.transparent),
|
||||
trackColor:
|
||||
MaterialStateProperty.all(Colors.transparent),
|
||||
trackBorderColor:
|
||||
MaterialStateProperty.all(Colors.transparent),
|
||||
),
|
||||
child: ValueListenableBuilder(
|
||||
valueListenable: formFieldController,
|
||||
// builder: (context, val, _) {
|
||||
// return ClipRRect(
|
||||
// borderRadius: BorderRadius.circular(36.rpx),
|
||||
// child: Theme(
|
||||
// data: Theme.of(context).copyWith(
|
||||
// splashColor: Colors.transparent,
|
||||
// highlightColor: Colors.transparent,
|
||||
// hoverColor: Colors.transparent,
|
||||
// ),
|
||||
// child: FlutterFlowDropDown<String>(
|
||||
// controller: formFieldController,
|
||||
// options: deviceController.personnelList.value
|
||||
// .map<String>((d) => "${d["mac"]}")
|
||||
// .toList(),
|
||||
// optionLabels: deviceController
|
||||
// .personnelList.value
|
||||
// .map<String>((d) => d["name"] ?? d["mac"])
|
||||
// .toList(),
|
||||
// onChanged: (val) {
|
||||
// WidgetsBinding.instance
|
||||
// .addPostFrameCallback((_) {
|
||||
// final list =
|
||||
// deviceController.personnelList.value;
|
||||
// final selectedPerson = list.firstWhere(
|
||||
// (element) => element['mac'] == val,
|
||||
// orElse: () => null,
|
||||
// );
|
||||
// homeController.selectPerson.value =
|
||||
// selectedPerson;
|
||||
// personInfo.value = selectedPerson;
|
||||
|
||||
// homeController.selectedDayIndex =
|
||||
// 6.obs; // 默认选第7天
|
||||
|
||||
// if (val == null) {
|
||||
// homeController.sleepDays.value = [];
|
||||
// } else {
|
||||
// homeController.selectDevcie.value = val;
|
||||
// deviceController.getSleeps(val);
|
||||
// homeController.updateAll();
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// width: 300.rpx,
|
||||
// height: 81.rpx,
|
||||
// maxHeight: 300.rpx,
|
||||
// textStyle: TextStyle(
|
||||
// fontSize: 28.rpx,
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// hintText: '',
|
||||
// icon: Icon(
|
||||
// Icons.keyboard_arrow_down_rounded,
|
||||
// color: stringToColor("#FFFFFF"),
|
||||
// size: 30.rpx,
|
||||
// ),
|
||||
// fillColor: stringToColor("#011D33"),
|
||||
// elevation: 2,
|
||||
// borderColor: Colors.transparent,
|
||||
// borderWidth: 2,
|
||||
// borderRadius: 0.rpx,
|
||||
// margin: EdgeInsetsDirectional.fromSTEB(
|
||||
// 32.rpx, 8.rpx, 32.rpx, 8.rpx),
|
||||
// hidesUnderline: true,
|
||||
// isOverButton: false,
|
||||
// isSearchable: false,
|
||||
// isMultiSelect: false,
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
|
||||
builder: (context, val, _) {
|
||||
// 只保留符合 bind_mac_a/b 的人员
|
||||
final macA = widget.data['bind_mac_a'];
|
||||
final macB = widget.data['bind_mac_b'];
|
||||
final list = deviceController.personnelList.value;
|
||||
final filteredList = list
|
||||
.where(
|
||||
(p) => p['mac'] == macA || p['mac'] == macB)
|
||||
.toList();
|
||||
|
||||
// 默认只赋值一次
|
||||
if (formFieldController.value == null &&
|
||||
filteredList.isNotEmpty) {
|
||||
final defaultMac = filteredList.first['mac'];
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
formFieldController.value = defaultMac;
|
||||
|
||||
final selectedPerson = filteredList.firstWhere(
|
||||
(element) => element['mac'] == defaultMac,
|
||||
orElse: () => null,
|
||||
);
|
||||
homeController.selectPerson.value =
|
||||
selectedPerson;
|
||||
personInfo.value = selectedPerson;
|
||||
|
||||
homeController.selectedDayIndex = 6.obs;
|
||||
homeController.selectDevcie.value = defaultMac;
|
||||
deviceController.getSleeps(defaultMac);
|
||||
homeController.updateAll();
|
||||
});
|
||||
}
|
||||
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(36.rpx),
|
||||
child: Theme(
|
||||
data: Theme.of(context).copyWith(
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
),
|
||||
child: FlutterFlowDropDown<String>(
|
||||
controller: formFieldController,
|
||||
options: filteredList
|
||||
.map<String>((d) => "${d["mac"]}")
|
||||
.toList(),
|
||||
optionLabels: filteredList
|
||||
.map<String>((d) => d["name"] ?? d["mac"])
|
||||
.toList(),
|
||||
onChanged: (val) {
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback((_) {
|
||||
final selectedPerson =
|
||||
filteredList.firstWhere(
|
||||
(element) => element['mac'] == val,
|
||||
orElse: () => null,
|
||||
);
|
||||
homeController.selectPerson.value =
|
||||
selectedPerson;
|
||||
personInfo.value = selectedPerson;
|
||||
|
||||
homeController.selectedDayIndex = 6.obs;
|
||||
|
||||
if (val == null) {
|
||||
homeController.sleepDays.value = [];
|
||||
} else {
|
||||
homeController.selectDevcie.value = val;
|
||||
deviceController.getSleeps(val);
|
||||
homeController.updateAll();
|
||||
}
|
||||
});
|
||||
},
|
||||
width: 300.rpx,
|
||||
height: 81.rpx,
|
||||
maxHeight: 300.rpx,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 28.rpx,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.white,
|
||||
),
|
||||
hintText: '',
|
||||
icon: Icon(
|
||||
Icons.keyboard_arrow_down_rounded,
|
||||
color: stringToColor("#FFFFFF"),
|
||||
size: 30.rpx,
|
||||
),
|
||||
fillColor: stringToColor("#003058"),
|
||||
elevation: 2,
|
||||
borderColor: Colors.transparent,
|
||||
borderWidth: 2,
|
||||
borderRadius: 0.rpx,
|
||||
margin: EdgeInsetsDirectional.fromSTEB(
|
||||
32.rpx, 8.rpx, 32.rpx, 8.rpx),
|
||||
hidesUnderline: true,
|
||||
isOverButton: false,
|
||||
isSearchable: false,
|
||||
isMultiSelect: false,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/// 左侧返回 + 标题
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: Row(
|
||||
children: [
|
||||
returnIconButtomNew,
|
||||
Text(
|
||||
'健康报告'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Obx(() {
|
||||
final device = homeController.selectDevcie.value;
|
||||
if (device != null && device.isNotEmpty) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: NewSleepReportPage(
|
||||
data: {
|
||||
"tag": "444",
|
||||
'date': DateTime.now().millisecondsSinceEpoch,
|
||||
'mac': device,
|
||||
'person': homeController.selectPerson.value,
|
||||
'backgroundImg': 'assets/images/new_background.png',
|
||||
'arrow': false,
|
||||
'noBackImg': true,
|
||||
'person_show': false,
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return Center(
|
||||
child: Text('暂无数据', style: TextStyle(color: Colors.white)));
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:easyweb/utils/appmanger.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
@@ -34,6 +37,7 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
GlobalController gloablController = Get.find();
|
||||
WeatherModelController weatherModelController = Get.find();
|
||||
// var selectedDayIndex = (6).obs;
|
||||
StreamSubscription? _newVersionSubscription;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -71,6 +75,28 @@ class _NewHomePageState extends State<NewHomePage> {
|
||||
homeController.homeSleepDays.value.length - 1;
|
||||
}
|
||||
});
|
||||
try {
|
||||
_newVersionSubscription =
|
||||
ef.kvRoot.appmanger.onAppUpdate.stream.listen((MiniAppPkg pkg) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text("发现新版本"),
|
||||
content: Text("新版本号:${pkg.version}"),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text("知道了"),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
|
||||
getWeekName(int i) {
|
||||
|
||||
@@ -32,16 +32,17 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
WebviewTestController() : super(WebviewTestModel()) {
|
||||
web = WebviewHelper(
|
||||
jsbridge: buildsdk(
|
||||
|
||||
// father: this,
|
||||
// clientId: '494641114',
|
||||
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
||||
),
|
||||
// father: this,
|
||||
// clientId: '494641114',
|
||||
// dbgserverUrl: 'ws://192.168.1.2:9001',
|
||||
),
|
||||
settings: buildsettings(),
|
||||
params: PlatformHeadlessInAppWebViewCreationParams(
|
||||
initialUrlRequest: URLRequest(
|
||||
url: WebUri(
|
||||
'https://wyf.it.real.he-info.cn:94/goods-front/index.html'),
|
||||
// url: WebUri(
|
||||
// 'http://192.168.1.2:8888'),
|
||||
),
|
||||
onLoadStop: (controller, url) {
|
||||
setState(() => ready.value = true);
|
||||
@@ -134,19 +135,6 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
return data;
|
||||
});
|
||||
});
|
||||
web
|
||||
//.file(
|
||||
// url: 'https://wsl.it.real.he-info.cn:94/webdemo/web.zip',
|
||||
// pretag: 'https://wsl.it.real.he-info.cn:94/webdemo/',
|
||||
//)
|
||||
.network()
|
||||
.then((value) {
|
||||
if (value) {
|
||||
setState(() {
|
||||
ready.value = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (e, s) {
|
||||
ef.log('$e,$s');
|
||||
}
|
||||
@@ -265,6 +253,36 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
||||
ws.connect();
|
||||
}
|
||||
//EasyFlutter End
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
ef.log("webview test init =>${DateTime.now()}");
|
||||
super.onInit();
|
||||
try {
|
||||
ef.kvRoot.appmanger.find("mhtControl").then((x) {
|
||||
x!.load().then((y) {
|
||||
ef.log("webview test res init loaded =>${DateTime.now()}");
|
||||
web
|
||||
.file(
|
||||
url: 'https://wyf.it.real.he-info.cn:94/goods-front/index.html',
|
||||
pretag: 'https://wyf.it.real.he-info.cn:94/goods-front/',
|
||||
raw: y,
|
||||
)
|
||||
//.network()
|
||||
.then((value) {
|
||||
if (value) {
|
||||
//资源准备完成..
|
||||
setState(() {
|
||||
ready.value = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
} catch (e, s) {
|
||||
ef.log('$e,$s');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class WebviewTestView extends GetComponent<WebviewTestController> {
|
||||
|
||||
@@ -178,41 +178,80 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent, // 背景透明
|
||||
appBar: AppBar(
|
||||
backgroundColor: widget.data['backgroundColor'] != null
|
||||
? widget.data['backgroundColor'].withOpacity(0.8)
|
||||
: themeController.currentColor.sc5,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: themeController.currentColor.sc3),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
/// 居中标题
|
||||
Text(
|
||||
'健康报告'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
// appBar: AppBar(
|
||||
// backgroundColor: widget.data['backgroundColor'] != null
|
||||
// ? widget.data['backgroundColor'].withOpacity(0.8)
|
||||
// : themeController.currentColor.sc5,
|
||||
// automaticallyImplyLeading: false,
|
||||
// iconTheme: IconThemeData(color: themeController.currentColor.sc3),
|
||||
// titleSpacing: 0,
|
||||
// title: Container(
|
||||
// width: double.infinity,
|
||||
// height: 180.rpx,
|
||||
// child: Stack(
|
||||
// alignment: Alignment.center,
|
||||
// children: [
|
||||
// /// 居中标题
|
||||
// Text(
|
||||
// '健康报告'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: themeController.currentColor.sc3,
|
||||
// letterSpacing: 0,
|
||||
// fontSize: 30.rpx,
|
||||
// ),
|
||||
// ),
|
||||
// /// 左边返回按钮
|
||||
// if (widget.data['arrow'] == null ||
|
||||
// widget.data['arrow'] == true)
|
||||
// Positioned(
|
||||
// left: 0,
|
||||
// child: returnIconButtomNew,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
appBar: (widget.data['arrow'] != null &&
|
||||
widget.data['arrow'] == false)
|
||||
? null
|
||||
: AppBar(
|
||||
backgroundColor: widget.data['backgroundColor'] != null
|
||||
? widget.data['backgroundColor'].withOpacity(0.8)
|
||||
: themeController.currentColor.sc5,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme:
|
||||
IconThemeData(color: themeController.currentColor.sc3),
|
||||
titleSpacing: 0,
|
||||
title: Container(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
/// 居中标题
|
||||
Text(
|
||||
'健康报告'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
if (widget.data['arrow'] == null ||
|
||||
widget.data['arrow'] == true)
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/// 左边返回按钮
|
||||
if (widget.data['arrow'] == null ||
|
||||
widget.data['arrow'] == true)
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: SingleChildScrollView(
|
||||
@@ -551,6 +590,8 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
child: getTimeWidget(),
|
||||
),
|
||||
),
|
||||
if (widget.data['person_show'] == null ||
|
||||
widget.data['person_show'] != false)
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 30.rpx, 51.rpx),
|
||||
|
||||
@@ -27,6 +27,7 @@ import 'package:vbvs_app/pages/mh_page/device_people_info.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/device_share_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/edit_bed.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/help/article.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/mht_sleep_report_page_return.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/homepage/new_Home_page.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/privacy_policy.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/user/page/edit_userinfo_page.dart';
|
||||
@@ -110,6 +111,8 @@ var mhroutes = {
|
||||
"/shareDeviceDetail": (context) => ShareDeviceDetailWidget(),
|
||||
"/messageDetail": (context, {arguments}) =>
|
||||
MessageDetailPage(data: arguments),
|
||||
"/mhtSleepReportReturnPage": (context, {arguments}) =>
|
||||
MhtSleepReportReturnPage(data: arguments),
|
||||
};
|
||||
var mhonGenerateRoute = (RouteSettings settings) {
|
||||
final String? name = settings.name; // 获取路由名称,如 /news 或 /search
|
||||
|
||||
Reference in New Issue
Block a user