更新消息小红点未读显示
This commit is contained in:
@@ -321,8 +321,7 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
"assets/img/menu/e.svg", "assets/img/menu/n_e.svg", "菜单.小e".tr),
|
||||
getBottomNavigationBarItem("assets/img/menu/message.svg",
|
||||
"assets/img/menu/n_message.svg", "菜单.消息".tr,
|
||||
showBadge: (messageController.model.body_message_read == 1 ||
|
||||
messageController.model.system_message_read == 1)),
|
||||
showBadge: true),
|
||||
getBottomNavigationBarItem("assets/img/menu/mine.svg",
|
||||
"assets/img/menu/n_mine.svg", "菜单.我的".tr),
|
||||
];
|
||||
@@ -350,34 +349,38 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
if (size == 0) size = 36.rpx;
|
||||
|
||||
Widget buildIcon(String path) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 6.rpx),
|
||||
child: isEmpty
|
||||
? Container()
|
||||
: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
path,
|
||||
width: size,
|
||||
height: size,
|
||||
),
|
||||
if (showBadge)
|
||||
Positioned(
|
||||
right: -20.rpx,
|
||||
top: -2.rpx,
|
||||
child: Container(
|
||||
width: 14.rpx,
|
||||
height: 14.rpx,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
return Obx(() {
|
||||
int type1 = messageController.model.body_message_read!;
|
||||
int type2 = messageController.model.system_message_read!;
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 6.rpx),
|
||||
child: isEmpty
|
||||
? Container()
|
||||
: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
path,
|
||||
width: size,
|
||||
height: size,
|
||||
),
|
||||
if ((type1 == 1 || type2 == 1) && showBadge)
|
||||
Positioned(
|
||||
right: -20.rpx,
|
||||
top: -2.rpx,
|
||||
child: Container(
|
||||
width: 14.rpx,
|
||||
height: 14.rpx,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return BottomNavigationBarItem(
|
||||
|
||||
Reference in New Issue
Block a user