更改分享和解绑消息弹窗

This commit is contained in:
czz
2025-08-26 17:56:36 +08:00
parent 5ac6c891b3
commit daf782bf9f
10 changed files with 407 additions and 90 deletions

View File

@@ -1469,6 +1469,13 @@ Future<void> showDeleteDeviceConfirmDialog({
// }
Future<String?> showMessageConfirmDialog({
required String title,
List<Color> colorsList = const [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
Color backgroundColor = Colors.white,
Color textColor = Colors.black,
}) async {
return await Get.dialog<String>(
FrostedDialog(
@@ -1477,7 +1484,7 @@ Future<String?> showMessageConfirmDialog({
width: 520.rpx,
height: 460.rpx,
decoration: BoxDecoration(
color: Colors.white,
color: backgroundColor,
borderRadius: BorderRadius.circular(20.0),
),
child: Padding(
@@ -1489,18 +1496,18 @@ Future<String?> showMessageConfirmDialog({
children: [
Text(
title,
style: TextStyle(fontSize: 30.rpx, color: Colors.black),
style: TextStyle(fontSize: 30.rpx, color: textColor),
),
const SizedBox(height: 12),
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
style: TextStyle(fontSize: 26.rpx, color: Colors.black),
children: [
TextSpan(
text: '有一条新的设备分享消息'.tr,
style:
TextStyle(color: Colors.black, fontSize: 26.rpx)),
TextStyle(color: textColor, fontSize: 26.rpx)),
],
),
),
@@ -1514,11 +1521,7 @@ Future<String?> showMessageConfirmDialog({
onTap: () {
Get.back(result: 'cancel');
},
colors: [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
colors: colorsList,
child: Container(
width: 200.rpx,
height: 90.rpx,
@@ -1534,11 +1537,7 @@ Future<String?> showMessageConfirmDialog({
onTap: () {
Get.back(result: 'confirm');
},
colors: [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
colors: colorsList,
child: Container(
width: 200.rpx,
height: 90.rpx,
@@ -1563,6 +1562,13 @@ Future<String?> showMessageConfirmDialog({
Future<String?> showUnShareMessageDialog({
required String title,
required String mac,
List<Color> colorsList = const [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
Color backgroundColor = Colors.white,
Color textColor = Colors.black,
}) async {
return await Get.dialog<String>(
FrostedDialog(
@@ -1571,7 +1577,7 @@ Future<String?> showUnShareMessageDialog({
width: 520.rpx,
height: 460.rpx,
decoration: BoxDecoration(
color: Colors.white,
color: backgroundColor,
borderRadius: BorderRadius.circular(20.0),
),
child: Padding(
@@ -1583,21 +1589,20 @@ Future<String?> showUnShareMessageDialog({
children: [
Text(
title,
style: TextStyle(fontSize: 30.rpx, color: Colors.black),
style: TextStyle(fontSize: 30.rpx, color: textColor),
),
const SizedBox(height: 12),
RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
style: TextStyle(fontSize: 26.rpx, color: Colors.black),
children: [
TextSpan(
text: mac,
style: TextStyle(color: Colors.blue, fontSize: 26.rpx)),
TextSpan(
text: " " + '设备已被用户解绑,将取消当前分享!'.tr,
style:
TextStyle(color: Colors.black, fontSize: 26.rpx)),
style: TextStyle(color: textColor, fontSize: 26.rpx)),
],
),
),
@@ -1610,11 +1615,7 @@ Future<String?> showUnShareMessageDialog({
onTap: () {
Get.back(result: 'confirm');
},
colors: [
Color(0xFF1592AA),
Color(0XFF0C83A7),
Color(0XFF006FA3)
],
colors: colorsList,
child: Container(
width: 200.rpx,
height: 90.rpx,

View File

@@ -30,7 +30,7 @@ class _MessagePageState extends State<MessagePage> {
_pageController =
PageController(initialPage: messageController.model.type == 1 ? 0 : 1);
messageController.getMessageStatus();
_fetchMessageData();
// _fetchMessageData();
}
void _fetchMessageData() {
@@ -272,13 +272,13 @@ class _MessagePageState extends State<MessagePage> {
final list = messageController.messageList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list);
: _buildMessageListView(list, "app_vsm");
}),
Obx(() {
final list = messageController.messageList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list);
: _buildMessageListView(list, "app_system");
}),
],
),
@@ -289,21 +289,42 @@ class _MessagePageState extends State<MessagePage> {
);
}
Widget _buildMessageListView(List dataList) {
return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 30.rpx),
...dataList
.map((item) => MessageWidgetWidget(data: item))
.toList()
.divide(SizedBox(height: 30.rpx)),
SizedBox(height: 30.rpx),
],
),
// Widget _buildMessageListView(List dataList) {
// return Container(
// width: double.infinity,
// padding: EdgeInsets.symmetric(horizontal: 30.rpx),
// child: SingleChildScrollView(
// child: Column(
// children: [
// SizedBox(height: 30.rpx),
// ...dataList
// .map((item) => MessageWidgetWidget(data: item))
// .toList()
// .divide(SizedBox(height: 30.rpx)),
// SizedBox(height: 30.rpx),
// ],
// ),
// ),
// );
// }
Widget _buildMessageListView(List dataList, String type) {
return NotificationListener<ScrollNotification>(
onNotification: (scrollInfo) {
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent) {
// 滑到底部,加载下一页
messageController.loadMore(type);
}
return true;
},
child: ListView.builder(
padding: EdgeInsets.symmetric(horizontal: 30.rpx, vertical: 30.rpx),
itemCount: dataList.length,
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(bottom: 30.rpx),
child: MessageWidgetWidget(data: dataList[index]),
);
},
),
);
}

View File

@@ -907,11 +907,11 @@ class EditAddressPage extends GetView<AddressController>
TextFormField(
// autofocus: true,
onChanged:
(val) {
(value) {
controller
.model
.address =
val;
value;
},
initialValue:
address[

View File

@@ -182,13 +182,13 @@ class _MessagePageState extends State<MessagePage> {
final list = messageController.bodyMessageList;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list);
: _buildMessageListView(list, "app_vsm");
}),
Obx(() {
final list = messageController.systemMessageList;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list);
: _buildMessageListView(list, "app_system");
}),
],
),
@@ -253,7 +253,7 @@ class _MessagePageState extends State<MessagePage> {
alignment: Alignment.center,
child: Obx(() {
return ClickableContainer(
padding: EdgeInsets.zero,
padding: EdgeInsets.symmetric(horizontal: 16.rpx, vertical: 8.rpx),
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor.sc21,
borderRadius: 8.rpx,
@@ -325,7 +325,7 @@ class _MessagePageState extends State<MessagePage> {
alignment: Alignment.center,
child: Obx(() {
return ClickableContainer(
padding: EdgeInsets.zero,
padding: EdgeInsets.symmetric(horizontal: 16.rpx, vertical: 8.rpx),
backgroundColor: Colors.transparent,
highlightColor: themeController.currentColor.sc21,
borderRadius: 8.rpx,
@@ -386,21 +386,25 @@ class _MessagePageState extends State<MessagePage> {
);
}
Widget _buildMessageListView(List dataList) {
return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 30.rpx),
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 30.rpx),
...dataList
.map((item) => MhMessageListWidget(data: item))
.toList()
.divide(SizedBox(height: 30.rpx)),
SizedBox(height: 30.rpx),
],
),
Widget _buildMessageListView(List dataList, String type) {
return NotificationListener<ScrollNotification>(
onNotification: (scrollInfo) {
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent) {
// 滑到底部,加载下一页
messageController.loadMore(type);
}
return true;
},
child: ListView.builder(
padding: EdgeInsets.symmetric(horizontal: 30.rpx, vertical: 30.rpx),
itemCount: dataList.length,
itemBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(bottom: 30.rpx),
child: MhMessageListWidget(data: dataList[index]),
);
},
),
);
}