更新ios未安装微信时,隐藏微信图标

This commit is contained in:
wyf
2025-08-30 14:30:19 +08:00
parent f7b11fbb7e
commit ccfbf58d81
18 changed files with 251 additions and 164 deletions

View File

@@ -1017,7 +1017,6 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
),
].divide(SizedBox(width: 50.rpx)),
),
].divide(SizedBox(width: 34.rpx)),
),
SizedBox(height: 20.rpx),
@@ -1214,7 +1213,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
// Get.toNamed("/sleepReportPage",
// arguments: sleepReportUrl);
Get.toNamed("/newSleepReportPage", arguments: {
'date':DateTime.now().millisecondsSinceEpoch,
'date': DateTime.now().millisecondsSinceEpoch,
"mac": widget.device['mac'],
'type': 1,
'name': 'sleep', //'sleep', 'heartRate' 或 'breathe'
@@ -1241,7 +1240,7 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"体征检测设备.健康报告".tr,
"体征检测设备.睡眠报告".tr,
style: TextStyle(
color: themeController.currentColor.sc3,
fontFamily: 'Inter',

View File

@@ -597,6 +597,38 @@ class _InstantBodyPageState extends State<InstantBodyPage>
),
),
),
SizedBox(
height: 40.rpx,
),
Column(
children: [
Text(
"MAC号".tr +
": ${widget.personInfo['mac'] ?? '未知数据'.tr}",
style: TextStyle(
color: themeController.currentColor.sc4
.withOpacity(0.2),
fontSize:
AppConstants().smaller_text_fontSize,
),
),
SizedBox(
height: 10.rpx,
),
Text(
"睡眠报告提示".tr,
style: TextStyle(
color: themeController.currentColor.sc4
.withOpacity(0.2),
fontSize:
AppConstants().smaller_text_fontSize,
),
),
],
),
SizedBox(
height: 40.rpx,
),
SizedBox(
height: 26.rpx,
),

View File

@@ -126,16 +126,16 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
.currentColor.sc4,
),
),
Text(
'实时体征.年龄'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc4,
),
),
// Text(
// '实时体征.年龄'.tr,
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc4,
// ),
// ),
].divide(SizedBox(height: 34.rpx)),
),
Column(
@@ -152,16 +152,16 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
.currentColor.sc3,
),
),
Text(
'${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc3,
),
),
// Text(
// '${MyUtils.getAgeByDate(MyUtils.formatBirthdayTime(widget.data['person']?['birthday'])) ?? '未知数据'.tr}',
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc3,
// ),
// ),
].divide(SizedBox(height: 34.rpx)),
),
]
@@ -194,16 +194,16 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
.currentColor.sc4,
),
),
Text(
'实时体征.体重'.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc4,
),
),
// Text(
// '实时体征.体重'.tr,
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc4,
// ),
// ),
].divide(SizedBox(height: 34.rpx)),
),
Expanded(
@@ -224,16 +224,16 @@ class _MessageReviewPageState extends State<MessageReviewPage> {
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
'${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
color: themeController
.currentColor.sc3,
),
),
// Text(
// '${widget.data['person']?['weight'] ?? '未知数据'.tr}kg',
// style: TextStyle(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: themeController
// .currentColor.sc3,
// ),
// ),
].divide(SizedBox(height: 34.rpx)),
),
),

View File

@@ -42,9 +42,9 @@ class _EPageState extends State<LoginPage> {
debugPrint('is wechat installed: $isWeChatInstalled');
if (!isWeChatInstalled) {
// TODO ios未安装微信 隐藏微信一键登录按钮
loginController.model.isWeChatNotInstalled = false;
} else {
loginController.model.isWeChatNotInstalled = true;
} else {
loginController.model.isWeChatNotInstalled = false;
}
loginController.updateAll();
});

View File

@@ -73,9 +73,9 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
debugPrint('is wechat installed: $isWeChatInstalled');
if (!isWeChatInstalled) {
// TODO ios未安装微信 隐藏微信一键登录按钮
loginController.model.isWeChatNotInstalled = false;
} else {
loginController.model.isWeChatNotInstalled = true;
} else {
loginController.model.isWeChatNotInstalled = false;
}
loginController.updateAll();
});
@@ -922,41 +922,53 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ClickableContainer(
backgroundColor: Colors.white, // 背景色
highlightColor: Colors.grey, // 点击水波纹颜色
borderRadius: 999.rpx,
padding: EdgeInsets.zero,
onTap: () async {
//loginController.model.isIos == true &&
if (loginController.model.register_agree ==
null ||
loginController.model.register_agree !=
true) {
TopSlideNotification.show(
context,
text: "登录页.未同意协议".tr,
textColor: themeController.currentColor.sc9,
);
return;
}
await loginController.wxLoginSendAuth(context);
},
child: Container(
width: 91.rpx,
height: 91.rpx,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
shape: BoxShape.circle,
children: [
Obx(() {
var aa =
loginController.model.isWeChatNotInstalled;
if (isiOS &&
(loginController.model.isWeChatNotInstalled !=
null &&
loginController
.model.isWeChatNotInstalled ==
true)) return Container();
return ClickableContainer(
backgroundColor: Colors.white, // 背景色
highlightColor: Colors.grey, // 点击水波纹颜色
borderRadius: 999.rpx,
padding: EdgeInsets.zero,
onTap: () async {
if (loginController.model.register_agree ==
null ||
loginController.model.register_agree !=
true) {
TopSlideNotification.show(
context,
text: "登录页.未同意协议".tr,
textColor:
themeController.currentColor.sc9,
);
return;
}
await loginController
.wxLoginSendAuth(context);
},
child: Container(
width: 91.rpx,
height: 91.rpx,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
child: Image.asset(
"assets/img/wechat.png",
width: 30.rpx,
height: 30.rpx,
),
),
child: Image.asset(
"assets/img/wechat.png",
width: 30.rpx,
height: 30.rpx,
),
),
),
);
}),
// ClickableContainer(
// backgroundColor: Colors.white,
// highlightColor: Colors.grey,

View File

@@ -81,27 +81,27 @@ class MainPageBottomChange extends GetView<MainPageController> {
final getStorage = GetStorage();
@override
Widget build(BuildContext context) {
// Future.delayed(const Duration(milliseconds: 0), () {
// String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
// if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
// String btnName = "同意".tr;
// String cancelName = "取消".tr;
// if (Platform.isAndroid) {
// cancelName = "退出".tr;
// }
// showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
// btnName: btnName, showCancel: true, cancelName: cancelName)
// .then((e) {
// if (e == "confirm") {
// getStorage.write("isShowYingShiDialog", "true");
// } else {
// if (cancelName == "退出") {
// SystemNavigator.pop();
// }
// }
// });
// }
// });
Future.delayed(const Duration(milliseconds: 0), () {
String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
String btnName = "同意".tr;
String cancelName = "取消".tr;
if (Platform.isAndroid) {
cancelName = "退出".tr;
}
showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
btnName: btnName, showCancel: true, cancelName: cancelName)
.then((e) {
if (e == "confirm") {
getStorage.write("isShowYingShiDialog", "true");
} else {
if (cancelName == "退出") {
SystemNavigator.pop();
}
}
});
}
});
return PopScope(
canPop: false,
@@ -155,14 +155,14 @@ class MainPageBottomChange extends GetView<MainPageController> {
),
child: Scaffold(
backgroundColor: Colors.transparent,
body: arr[controller.model.currentIndex],
// body: IndexedStack(
// // ✅ 改成 IndexedStack
// index: controller.model.currentIndex??3,
// children: arr
// .map((page) => SizedBox.expand(child: page))
// .toList(),
// ),
// body: arr[controller.model.currentIndex],
body: IndexedStack(
// ✅ 改成 IndexedStack
index: controller.model.currentIndex??3,
children: arr
.map((page) => SizedBox.expand(child: page))
.toList(),
),
floatingActionButtonAnimator:
FloatingActionButtonAnimator.noAnimation,
floatingActionButtonLocation:

View File

@@ -78,8 +78,8 @@ class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
final macB = widget.data['bind_mac_b'];
final list = deviceController.personnelList.value;
final filteredList = list
.where(
(p) => p['mac'.tr] == macA || p['mac'.tr] == macB)
.where((p) =>
p['mac'.tr] == macA || p['mac'.tr] == macB)
.toList();
// 默认只赋值一次
@@ -118,7 +118,8 @@ class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
.map<String>((d) => "${d["mac"]}")
.toList(),
optionLabels: filteredList
.map<String>((d) => d["name"] ?? d["mac".tr])
.map<String>(
(d) => d["name"] ?? d["mac".tr])
.toList(),
onChanged: (val) {
WidgetsBinding.instance
@@ -183,7 +184,7 @@ class _MhtSleepReportReturnPageState extends State<MhtSleepReportReturnPage> {
children: [
returnIconButtomNew(),
Text(
'健康报告'.tr,
'睡眠报告'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,

View File

@@ -526,14 +526,14 @@ Widget MonthDataWidget(
bottomPadding: 16,
),
padding: 45.rpx),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("MAC${data['mac']}",
style: TextStyle(
color: Color(0xFFD3D3D3).withOpacity(0.2), fontSize: 18.rpx))
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text("MAC${data['mac']}",
// style: TextStyle(
// color: Color(0xFFD3D3D3).withOpacity(0.2), fontSize: 18.rpx))
// ],
// ),
]
.map((widget) => Padding(
padding: padding,

View File

@@ -666,14 +666,14 @@ Widget WeekDataWidget(
bottomPadding: 50,
),
padding: 45.rpx),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("MAC${data['mac']}",
style: TextStyle(
color: Color(0xFFD3D3D3).withOpacity(0.2), fontSize: 18.rpx))
],
)
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text("MAC${data['mac']}",
// style: TextStyle(
// color: Color(0xFFD3D3D3).withOpacity(0.2), fontSize: 18.rpx))
// ],
// )
]
.map((widget) => Padding(
padding: padding,

View File

@@ -142,7 +142,6 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
child: Scaffold(
backgroundColor: Colors.transparent, // 背景透明
appBar: (widget.data['arrow'] != null &&
widget.data['arrow'] == false)
? null
@@ -162,7 +161,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
children: [
/// 居中标题
Text(
'健康报告'.tr,
'睡眠报告'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
@@ -869,7 +868,36 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
default:
return NullDataWidget();
}
})
}),
Column(
children: [
Text(
"MAC号".tr +
": ${widget.data['mac'] ?? '未知数据'.tr}",
style: TextStyle(
color: themeController.currentColor.sc4
.withOpacity(0.2),
fontSize:
AppConstants().smaller_text_fontSize,
),
),
SizedBox(
height: 10.rpx,
),
Text(
"睡眠报告提示".tr,
style: TextStyle(
color: themeController.currentColor.sc4
.withOpacity(0.2),
fontSize:
AppConstants().smaller_text_fontSize,
),
),
],
),
SizedBox(
height: 40.rpx,
),
].divide(SizedBox(
height: 25.rpx,
)),
@@ -1433,11 +1461,11 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
String dateStr = MyUtils.formatToDate(widget.data['date']);
sleepReportController.isLoading.value = true;
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=$dateStr&type=${sleepReportController.model.type}&sleepType=2";
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.sleep_report;
String queryUrl =
"$serviceAddress$serviceName$serviceApi?mac=${widget.data['mac']}&time=$dateStr&type=${sleepReportController.model.type}&sleepType=2";
requestWithLog(
logTitle: "查询睡眠报告",
method: MyHttpMethod.get,

View File

@@ -65,7 +65,7 @@ class _SleepReportPageState extends State<SleepReportPage> {
children: [
/// 居中标题
Text(
'健康报告'.tr,
'睡眠报告'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: themeController.currentColor.sc3,
@@ -104,12 +104,12 @@ class _SleepReportPageState extends State<SleepReportPage> {
builder: (context, isLoading, child) {
return isLoading
? Center(
child:CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
themeController.currentColor.sc1,
),
), // 加载指示器
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
themeController.currentColor.sc1,
),
), // 加载指示器
)
: SizedBox.shrink();
},