This commit is contained in:
wyf
2025-06-21 21:22:04 +08:00
parent ca1995372c
commit 6588b4f053
18 changed files with 170 additions and 161 deletions

BIN
assets/img/huanshuiF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

View File

@@ -44,4 +44,7 @@ class AppConstants {
stringToColor("0C83A7"), // 浅蓝
stringToColor("006FA3"), // 浅蓝
];
//系统参数
int ent_type = 1;//1.默认太和 2.欢睡
}

View File

@@ -5,6 +5,7 @@ import 'package:get/get.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:http/http.dart' as http;
import 'package:vbvs_app/common/color/appConstants.dart';
class UserPdfController extends GetxController {
var localPdfPath = Rx<String?>(null);

View File

@@ -358,6 +358,7 @@ class MyApp extends StatelessWidget {
Get.lazyPut(() => MHTDeviceCalibrationController()),
Get.lazyPut(() => SleepReportController()),
Get.lazyPut(() => CalendarController()),
Get.put(WebviewTestController()),
]));
}

View File

@@ -442,7 +442,7 @@ class _MessageSettingPageState extends State<MessageSettingPage> {
],
),
Text(
"APP消息介绍".tr,
AppConstants().ent_type == 1? "APP消息介绍".tr:"打开“欢睡科技”APP可以查看该设备的消息内容",
style: TextStyle(
color: themeController.currentColor.sc4,
fontSize: AppConstants()
@@ -548,7 +548,7 @@ class _MessageSettingPageState extends State<MessageSettingPage> {
],
),
Text(
"服务号消息介绍".tr,
AppConstants().ent_type == 1? "服务号消息介绍".tr:"无需打开“欢睡科技”APP关注欢睡智能睡眠研究所服务号后微信内即可接收该设备消息推送",
style: TextStyle(
color: themeController.currentColor.sc4,
fontSize: AppConstants()

View File

@@ -152,7 +152,7 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
'登录页.欢迎使用太和e护'.tr,
AppConstants().ent_type == 1?'登录页.欢迎使用太和e护'.tr:"欢迎使用欢睡科技",
style: TextStyle(
fontFamily: 'Inter',
fontSize: 48.rpx,

View File

@@ -1,5 +1,6 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/WebViewWidget.dart';
@@ -85,7 +86,7 @@ class _FollowPageState extends State<FollowPage> {
// child: widget.webView,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/img/followus.png'), // 本地图片
image: AssetImage(AppConstants().ent_type == 1?'assets/img/followus.png':"assets/img/huanshuiF.png"), // 本地图片
fit: BoxFit.cover, // 填满整个 Container
),
),

View File

@@ -1,5 +1,6 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/WebViewWidget.dart';
@@ -20,7 +21,9 @@ class _HelpPageState extends State<HelpPage> {
super.initState();
// pdfController.loadPdf();
widget.webView = MyWebView(
url: "https://mp.weixin.qq.com/s/hBo0FMYrpe04I2WV6wbcxQ",
url: AppConstants().ent_type == 1
? "https://mp.weixin.qq.com/s/hBo0FMYrpe04I2WV6wbcxQ"
: "https://mp.weixin.qq.com/s/tOnQjYa7foFLgic-RMAb7Q",
onLoad: () {
print('网页载入完毕');
},

View File

@@ -5,6 +5,7 @@ import 'package:flutter_switch/flutter_switch.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class MattressControlPage extends StatefulWidget {
const MattressControlPage({super.key});
@@ -62,101 +63,84 @@ class _MattressControlPageState extends State<MattressControlPage> {
child: Scaffold(
backgroundColor: Colors.transparent,
// 顶部返回 + 设备选择 + 蓝牙图标 + 设置按钮
appBar: AppBar(
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
titleSpacing: 0,
elevation: 0,
title: SizedBox(
width: double.infinity,
height: 180.rpx,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: 20.rpx),
returnIconButtomNew,
SizedBox(width: 26.rpx),
Container(
decoration: BoxDecoration(
color: const Color(0xFF003058),
borderRadius: BorderRadius.circular(30.rpx),
),
constraints: BoxConstraints(
minHeight: 60.rpx,
maxHeight: 60.rpx,
maxWidth: 260.rpx,
minWidth: 260.rpx),
padding: EdgeInsets.symmetric(
horizontal: 20.rpx), // 加左右边距
child: DropdownButton<String>(
value: 'Eason Chan',
underline: const SizedBox(),
dropdownColor: Colors.blueGrey,
iconEnabledColor: Colors.white,
icon: Icon(
Icons.keyboard_arrow_down, // 最常用的向下箭头
color: Colors.white,
size: 30.rpx,
),
style: const TextStyle(color: Colors.white),
isExpanded: true,
items: const [
DropdownMenuItem(
value: 'Eason Chan',
child: Text('Eason Chan'),
),
DropdownMenuItem(
value: 'Anna',
child: Text('Anna'),
),
],
onChanged: (_) {},
),
),
],
)),
actions: [
ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.only(right: 69.rpx),
onTap: () {},
child:
//根据data['status']判断用那个svg
Image.asset(
'assets/images/active_bluetooth.png',
width: 42.rpx,
height: 42.rpx,
),
),
ClickableContainer(
backgroundColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: EdgeInsets.only(right: 38.rpx),
onTap: () {
Get.toNamed('/bluetoothPage', arguments: data);
},
child: Icon(Icons.tune,
color: Colors.white, size: 42.rpx))
],
centerTitle: false,
),
body: const SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Text(
"等待引入",
style: TextStyle(
color: Colors.white,
),
))
// appBar: AppBar(
// backgroundColor: Colors.transparent,
// automaticallyImplyLeading: false,
// titleSpacing: 0,
// elevation: 0,
// title: SizedBox(
// width: double.infinity,
// height: 180.rpx,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// SizedBox(width: 20.rpx),
// returnIconButtomNew,
// SizedBox(width: 26.rpx),
// Container(
// decoration: BoxDecoration(
// color: Color(0xFF003058),
// borderRadius: BorderRadius.circular(30.rpx),
// ),
// constraints: BoxConstraints(
// minHeight: 60.rpx,
// maxHeight: 60.rpx,
// maxWidth: 260.rpx,
// minWidth: 260.rpx),
// padding: EdgeInsets.symmetric(
// horizontal: 20.rpx), // 加左右边距
// child: DropdownButton<String>(
// value: 'Eason Chan',
// underline: const SizedBox(),
// dropdownColor: Colors.blueGrey,
// iconEnabledColor: Colors.white,
// style: const TextStyle(color: Colors.white),
// isExpanded: true,
// items: const [
// DropdownMenuItem(
// value: 'Eason Chan',
// child: Text('Eason Chan'),
// ),
// DropdownMenuItem(
// value: 'Anna',
// child: Text('Anna'),
// ),
// ],
// onChanged: (_) {},
// ),
// ),
// ],
// )),
// actions: [
// ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.only(right: 69.rpx),
// onTap: () {},
// child: Icon(
// Icons.bluetooth,
// color: Colors.white,
// size: 42.rpx,
// ),
// ),
// ClickableContainer(
// backgroundColor: Colors.transparent,
// highlightColor: Colors.transparent,
// padding: EdgeInsets.only(right: 38.rpx),
// onTap: () {
// Get.toNamed('/bluetoothPage', arguments: data);
// },
// child: Icon(Icons.tune,
// color: Colors.white, size: 42.rpx))
// ],
// centerTitle: false,
// ),
// _buildBedImageSection(context),
// _buildModeSelector(context),
// Expanded(child: _buildControlCards(context)),
],
body: SafeArea(
child: WebviewTestView(
oncreate: (widget) {
return WebviewTestController();
},
),
),
))));

View File

@@ -1,21 +1,12 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/color/app_uri_status.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/controller/weather/weather_controller.dart';
import 'package:vbvs_app/pages/mh_page/FloatingSvgIcon.dart';
import 'package:vbvs_app/pages/mh_page/homepage/component/HomeDeviceWidget.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
import 'package:vbvs_app/pages/sleep_report/mht_new_sleep_report_page.dart';
import 'package:vbvs_app/pages/sleep_report/new_sleep_report_page.dart';
class MhtSleepReportPage extends StatefulWidget {

View File

@@ -568,8 +568,8 @@ class _SettingPageState extends State<SettingPage> {
),
),
Text(
'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有'
.tr,
AppConstants().ent_type == 1? 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有'
.tr:"Copyright © 202-2025 杭州欢睡科技有限公司 版权所有",
style: TextStyle(
color: themeController.currentColor.sc4,
fontFamily: 'Inter',

View File

@@ -3,6 +3,9 @@ import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:easyweb/base/minisdk.dart';
import 'package:easydevice/easydevice.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
class WebviewTestModel {
WebviewTestModel();
@@ -17,20 +20,22 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
web = WebviewHelper(
jsbridge: buildsdk(
father: this,
clientId: '494641114',
// clientId: '494641114',
//dbgserverUrl: 'ws://192.168.1.2:9001',
),
settings: buildsettings(),
params: PlatformHeadlessInAppWebViewCreationParams(
initialUrlRequest: URLRequest(
url: WebUri('https://wsl.it.real.he-info.cn:94/webdemo/index.html'),
url: WebUri(
'https://wyf.it.real.he-info.cn:94/goods-front/index.html'),
),
onLoadStop: (controller, url) => {setState(() => ready.value = true)},
),
);
try {
web.jsbridge!.bind((bridge) {
Minibleapp(bridge: bridge);
var minible = Minibleapp(bridge: bridge);
// minible.bridge.sdk.ble.scanenable(5);
});
web
//.file(
@@ -39,13 +44,13 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
//)
.network()
.then((value) {
if (value) {
//资源准备完成..
setState(() {
ready.value = true;
});
}
if (value) {
//资源准备完成..
setState(() {
ready.value = true;
});
}
});
} catch (e, s) {
ef.log('$e,$s');
}
@@ -61,48 +66,50 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
@override
Widget build(BuildContext context) {
UserInfoController userInfoController = Get.find();
MHTHomeController deviceController = Get.find();
deviceController.getDeviceList(group: 'room');
return Scaffold(
backgroundColor: Colors.black12,
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: (userInfoController.model.login! != null &&
userInfoController.model.login! == 1)
? MainAxisAlignment.start
: MainAxisAlignment.center,
children: [
Align(
alignment: Alignment.topLeft,
child: Padding(
padding: EdgeInsets.all(8),
child: SizedBox(
height: 30,
child: TextButton(
onPressed: () {
setState(() => controller.cnt.value++);
// Get.to(
// () => TestInkWellView(
// oncreate: (x) => TestInkWellController(),
// ),
// );
},
child: Text('转跳'),
Obx(() {
if (userInfoController.model.login! == null ||
userInfoController.model.login! == 0) {
return Center(
// 包一层 Center强制水平和垂直都居中
child: Text(
"登录进行设备控制".tr,
style: TextStyle(color: Colors.white, fontSize: 30.rpx),
),
),
),
),
Expanded(
child: Align(
alignment: Alignment.topLeft,
child:
controller.ready.value
? ((controller.cnt.value % 2 == 0)
? controller.web.build(
);
}
WebviewTestController webviewTestController = Get.find();
var dataList = deviceController.deviceList.value;
webviewTestController.web.jsbridge!.dart.updateDeviceList(dataList);
return Expanded(
child: Align(
alignment: Alignment.topLeft,
child: controller.ready.value
? ((controller.cnt.value % 2 == 0)
? controller.web.build(
key: ValueKey("A"),
headless: false,
)
: controller.web.build(
: controller.web.build(
key: ValueKey("B"),
headless: false,
))
: Container(),
),
),
: Container(),
),
);
}),
],
),
);

View File

@@ -375,7 +375,9 @@ class _CommonMessageSettingPageState extends State<CommonMessageSettingPage> {
],
),
Text(
"通用APP消息介绍".tr,
AppConstants().ent_type == 1
? "通用APP消息介绍".tr
: "打开“欢睡科技”APP可以查看消息内容",
style: TextStyle(
color:
themeController.currentColor.sc4,
@@ -482,7 +484,9 @@ class _CommonMessageSettingPageState extends State<CommonMessageSettingPage> {
],
),
Text(
"通用服务号消息介绍".tr,
AppConstants().ent_type == 1
? "通用服务号消息介绍".tr
: "无需打开“欢睡科技”APP关注欢睡智能睡眠研究所服务号后微信内即可接收消息推送",
style: TextStyle(
color:
themeController.currentColor.sc4,

View File

@@ -1,5 +1,6 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/WebViewWidget.dart';
@@ -17,8 +18,11 @@ class _AboutUsPageState extends State<AboutUsPage> {
void initState() {
super.initState();
// pdfController.loadPdf();
widget.webView = MyWebView(
url: "https://mp.weixin.qq.com/s/IAr4RNBy0hGJXGKyMxe7eQ",
url: AppConstants().ent_type == 1
? "https://mp.weixin.qq.com/s/IAr4RNBy0hGJXGKyMxe7eQ"
: "https://mp.weixin.qq.com/s/7BvvprVDqX1eOzM3Lms8dg",
onLoad: () {
print('网页载入完毕');
},

View File

@@ -1,6 +1,7 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_pdfview/flutter_pdfview.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/controller/setting/pdf/PrivacyPdfController.dart';
@@ -19,14 +20,16 @@ class _PrivacySchemePageState extends State<PrivacySchemePage> {
void initState() {
super.initState();
String language = "zh_CN"; // 默认语言
int ent_type = AppConstants().ent_type;
if (languageController.selectLanguage?.value?.language_code != null) {
language = languageController.selectLanguage!.value!.language_code!;
}
} // 根据 ent_type 拼接不同的文件名
String pdfName =
ent_type == 1 ? "$language.pdf" : "${language}_$ent_type.pdf";
pdfController.loadPdf(
2,
"https://vsbst-api.he-info.cn/vsbs_sotrage/privacy-scheme/$language.pdf",
"https://vsbst-api.he-info.cn/vsbs_sotrage/privacy-scheme/$pdfName",
);
}

View File

@@ -577,8 +577,8 @@ class _SettingPageState extends State<SettingPage> {
),
),
Text(
'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有'
.tr,
AppConstants().ent_type == 1? 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有'
.tr:"Copyright © 202-2025 杭州欢睡科技有限公司 版权所有",
style: TextStyle(
color: themeController.currentColor.sc4,
fontFamily: 'Inter',

View File

@@ -1,6 +1,7 @@
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:flutter_pdfview/flutter_pdfview.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/controller/setting/pdf/UserPdfController.dart';
@@ -24,9 +25,15 @@ class _UserSchemePageState extends State<UserSchemePage> {
language = languageController.selectLanguage!.value!.language_code!;
}
int ent_type = AppConstants().ent_type;
// 根据 ent_type 拼接不同的文件名
String pdfName =
ent_type == 1 ? "$language.pdf" : "${language}_$ent_type.pdf";
pdfController.loadPdf(
1,
"https://vsbst-api.he-info.cn/vsbs_sotrage/user-scheme/$language.pdf",
"https://vsbst-api.he-info.cn/vsbs_sotrage/user-scheme/$pdfName",
);
}

View File

@@ -21,8 +21,8 @@ dependencies:
flutter_svg: ^2.0.10+1
EasyDartModule:
git:
url: http://git.real.he-info.cn:8080/r/~qmqz/EasyDartModule.git
ref: master
url: http://git.he-info.cn/r/~qmqz/EasyDartModule.git
ref: cff5448fe07ca7f2141dcb1b7c5ee430ca44d64d
flutter_localization: ^0.3.1
syncfusion_localizations: ^27.2.5
flutterflow_ui: