This commit is contained in:
wyf
2025-08-18 18:19:56 +08:00
parent 111bd78a24
commit e5e405f205
23 changed files with 337 additions and 212 deletions

View File

@@ -11,6 +11,7 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/device/device_calibration_controller.dart';
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
import 'package:vbvs_app/pages/policy/privacy_policy.dart';
getOnePicker(BuildContext context, List arr, int checkIndex,
Function onSelectedItemChanged,
@@ -1494,6 +1495,101 @@ void showSleepCalendarBottomSheet({
);
}
// Future showCustomConfirmOfWebViewDialog(
// BuildContext context, String name, String webviewUrl,
// {String btnName = "确定",
// bool showCancel = false,
// String cancelName = "取消",
// ConfirmDialogIcon icon = ConfirmDialogIcon.warn}) async {
// return showDialog(
// context: context,
// barrierDismissible: true,
// builder: (BuildContext context) {
// return Dialog(
// backgroundColor: Colors.white,
// insetPadding: EdgeInsets.all(0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// child: Container(
// width: 640.rpx,
// padding: EdgeInsets.fromLTRB(22.rpx, 0, 20.rpx, 10.rpx),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// alignment: Alignment.centerRight,
// child: closeIcon,
// ),
// SizedBox(height: 40.rpx),
// Container(
// height: MediaQuery.of(context).size.height * 0.4,
// child: PrivacyPolicyNewPage(
// sleepUri: webviewUrl,
// showAppbar: false,
// ),
// ),
// SizedBox(height: 20.rpx),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// if (showCancel)
// Container(
// margin: EdgeInsets.only(
// top: 50.rpx, bottom: 40.rpx, right: 100.rpx),
// alignment: Alignment.center,
// child: InkWell(
// onTap: () {
// Get.back();
// },
// child: Container(
// width: 200.rpx,
// height: 60.rpx,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(6),
// border: Border.all(color: Colors.black12)),
// child: Text(
// '$cancelName',
// style: TextStyle(
// color: Colors.black, fontSize: 30.rpx),
// ),
// ),
// ),
// ),
// Container(
// margin: EdgeInsets.only(top: 50.rpx, bottom: 40.rpx),
// alignment: Alignment.center,
// child: InkWell(
// onTap: () {
// Get.back(result: "confirm");
// },
// child: Container(
// width: 200.rpx,
// height: 60.rpx,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(6),
// color: stringToColor("#D3B684")),
// child: Text(
// '$btnName',
// style:
// TextStyle(color: Colors.white, fontSize: 30.rpx),
// ),
// ),
// ),
// )
// ],
// )
// ],
// ),
// ),
// );
// },
// );
// }
Future showCustomConfirmOfWebViewDialog(
BuildContext context, String name, String webviewUrl,
{String btnName = "确定",
@@ -1504,29 +1600,33 @@ Future showCustomConfirmOfWebViewDialog(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return Dialog(
insetPadding: EdgeInsets.all(0),
backgroundColor: Colors.white,
insetPadding: EdgeInsets.zero, // 移除默认的内边距
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
child: Container(
width: 640.rpx,
width: screenSize.width, // 使用屏幕宽度
height: screenSize.height, // 使用屏幕高度
padding: EdgeInsets.fromLTRB(22.rpx, 0, 20.rpx, 10.rpx),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
alignment: Alignment.centerRight,
child: closeIcon,
),
SizedBox(height: 40.rpx),
// Container(
// height: MediaQuery.of(context).size.height * 0.4,
// child: Shopping(
// url: webviewUrl,
// ),
// alignment: Alignment.centerRight,
// child: closeIcon,
// ),
// SizedBox(height: 40.rpx),
Expanded(
// 使用 Expanded 让 WebView 占据剩余空间
child: PrivacyPolicyNewPage(
sleepUri: webviewUrl,
showAppbar: false,
),
),
SizedBox(height: 20.rpx),
Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -1555,24 +1655,51 @@ Future showCustomConfirmOfWebViewDialog(
),
),
),
Container(
margin: EdgeInsets.only(top: 50.rpx, bottom: 40.rpx),
alignment: Alignment.center,
child: InkWell(
onTap: () {
Get.back(result: "confirm");
},
child: Container(
width: 200.rpx,
height: 60.rpx,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: stringToColor("#D3B684")),
child: Text(
'$btnName',
style:
TextStyle(color: Colors.white, fontSize: 30.rpx),
// Container(
// margin: EdgeInsets.only(top: 50.rpx, bottom: 40.rpx),
// alignment: Alignment.center,
// child: InkWell(
// onTap: () {
// Get.back(result: "confirm");
// },
// child: Container(
// width: 200.rpx,
// height: 60.rpx,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(6),
// color: stringToColor("#D3B684")),
// child: Text(
// '$btnName',
// style:
// TextStyle(color: Colors.white, fontSize: 30.rpx),
// ),
// ),
// ),
// )
CustomCard(
borderRadius: 12.rpx, // 圆角半径
onTap: () {
Get.back(result: "confirm");
},
colors: AppConstants().mhtNormalButton, // 渐变背景
gradientDirection: GradientDirection.horizontal,
child: Container(
// width: MediaQuery.sizeOf(context).width * 0.5, // 宽度占屏幕一半
// height: MediaQuery.sizeOf(context).height * 0.055,
constraints: BoxConstraints(
minWidth: 200.rpx,
minHeight: 60.rpx,
),
alignment: Alignment.center,
child: Text(
'$btnName',
style: TextStyle(
color: Colors.white, // 文字颜色
fontFamily: 'Inter',
fontSize: AppConstants().normal_text_fontSize, // 字体大小
fontWeight: FontWeight.w600,
letterSpacing: 0.0,
),
),
),