Browse Source

修改信息动态通知

ff_new
w-R 3 years ago
parent
commit
d2775ada04
  1. BIN
      assets/image/2x/c_z.png
  2. BIN
      assets/image/2x/icon_gz.png
  3. BIN
      assets/image/2x/icon_pl.png
  4. BIN
      assets/image/2x/icon_z.png
  5. BIN
      assets/image/3x/c_z.png
  6. BIN
      assets/image/3x/icon_gz.png
  7. BIN
      assets/image/3x/icon_pl.png
  8. BIN
      assets/image/3x/icon_z.png
  9. BIN
      assets/image/c_z.png
  10. BIN
      assets/image/icon_gz.png
  11. BIN
      assets/image/icon_pl.png
  12. BIN
      assets/image/icon_z.png
  13. 3
      lib/main.dart
  14. 875
      lib/message/system_details.dart
  15. 534
      lib/message/system_message.dart
  16. 2
      lib/retrofit/min_api.dart
  17. 8
      lib/retrofit/retrofit_api.dart
  18. 2
      lib/retrofit/retrofit_api.g.dart

BIN
assets/image/2x/c_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/2x/icon_gz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
assets/image/2x/icon_pl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
assets/image/2x/icon_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
assets/image/3x/c_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets/image/3x/icon_gz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/image/3x/icon_pl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/image/3x/icon_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/image/c_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

BIN
assets/image/icon_gz.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/image/icon_pl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/icon_z.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

3
lib/main.dart

@ -74,6 +74,7 @@ import 'community/photo_view_gallery_screen.dart';
import 'home/guide_page.dart';
import 'home/home_view/activity_list.dart';
import 'main_page.dart';
import 'message/system_details.dart';
import 'mine/manage_address_page.dart';
import 'mine/mine_view/community_follow.dart';
import 'mine/mine_vip/binding_assistant_card.dart';
@ -328,4 +329,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
HeadlinesColumnDetails(arguments: arguments),
'/router/photo_view_gallery_screen': (context, {arguments}) =>
PhotoViewGalleryScreen(),
'/router/system_details': (context, {arguments}) =>
SystemDetails(),
};

875
lib/message/system_details.dart

@ -0,0 +1,875 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/message.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class SystemDetails extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _SystemDetails();
}
}
class _SystemDetails extends State<SystemDetails> {
ApiService apiService;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService =
ApiService(Dio(), token: value.getString("token"), context: context);
queryMessage();
});
}
int pageNum = 1;
List<Message> messages = [];
_refresh() {
pageNum = 1;
queryMessage();
}
queryMessage() async {
BaseData<PageInfo<Message>> baseData = await apiService.msgList({
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": "",
"typed": ""
}).catchError((onError) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
if (pageNum == 1) {
messages.clear();
}
messages.addAll(baseData.data.list);
_refreshController.loadComplete();
_refreshController.refreshCompleted();
if (mounted) setState(() {});
if (pageNum * 10 > int.tryParse(baseData.data.total)) {
_refreshController.loadNoData();
} else {
pageNum += 1;
}
} else {
_refreshController.loadFailed();
_refreshController.refreshFailed();
}
}
RefreshController _refreshController = RefreshController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
background: Colors.white,
leadingColor: Colors.black,
// title: "订单通知",
// title: "充值消息",
title: "点赞",
titleSize: 18.sp,
titleColor: Colors.black,
),
body: SmartRefresher(
enablePullDown: true,
enablePullUp: true,
header: MyHeader(),
physics: BouncingScrollPhysics(),
footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) {
return MyFooter(mode);
},
),
controller: _refreshController,
onRefresh: _refresh,
onLoading: () {
queryMessage();
},
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
child: Column(
children: [
orderMessage(),
// rechargeMessage(),
// fabulousMessage(),
// commentMessage(),
// followMessage(),
],
),
),
),
),
),
);
}
///
Widget orderMessage(){
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
// if (messages[position].typed == 2) {
// Navigator.of(context)
// .pushNamed('/router/exchange_order_details');
// }
},
child: orderMessageItem(messages[position]),
);
}),
],
)
);
}
Widget orderMessageItem(Message message) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child:
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Image.asset(
(message.typed == 1)
? "assets/image/icon_system_message.png"
: (message.typed == 2)
? "assets/image/icon_system_message.png"
: "assets/image/c_z.png",
width: 24.w,
height: 24.h,
),
SizedBox(
width:8.w,
),
Text(
(message.typed == 1)
? S.of(context).xitongtongzhi
: (message.typed == 2)
? S.of(context).dingdanxiaoxi
: S.of(context).chongzhixiaoxi,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF060606),
),
)
],
),
Text(
message.updateTime,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
],
),
Container(
width: double.infinity,
margin: EdgeInsets.only(left:30.w, top:20.h),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: Text(
message.content,
maxLines: 2,
overflow:TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
),
),),
Icon(
Icons.keyboard_arrow_right,
color: Colors.black,
)
],
),
Container(
margin: EdgeInsets.only(top: 14.h),
height: 1,
width: double.infinity,
color: Color(0XFFF7F7F7),
)
],
),
)
],
),
);
}
///
Widget rechargeMessage(){
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
// if (messages[position].typed == 2) {
// Navigator.of(context)
// .pushNamed('/router/exchange_order_details');
// }
},
child: rechargeMessageItem(messages[position]),
);
}),
],
)
);
}
Widget rechargeMessageItem(Message message) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child:
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Image.asset(
(message.typed == 1)
? "assets/image/icon_system_message.png"
: (message.typed == 2)
? "assets/image/icon_system_message.png"
: "assets/image/c_z.png",
width: 24.w,
height: 24.h,
),
SizedBox(
width:8.w,
),
Text(
(message.typed == 1)
? S.of(context).xitongtongzhi
: (message.typed == 2)
? S.of(context).dingdanxiaoxi
: "充值通知",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF060606),
),
)
],
),
Text(
message.updateTime,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
],
),
Container(
width: double.infinity,
margin: EdgeInsets.only(left:30.w, top:20.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"充值成功",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
SizedBox(height:8.h,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: Text(
message.content,
maxLines: 2,
overflow:TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
),
),),
Icon(
Icons.keyboard_arrow_right,
color: Colors.black,
)
],
),
Container(
margin: EdgeInsets.only(top: 14.h),
height: 1,
width: double.infinity,
color: Color(0XFFF7F7F7),
)
],
),
)
],
),
);
}
///
Widget fabulousMessage(){
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
// if (messages[position].typed == 2) {
// Navigator.of(context)
// .pushNamed('/router/exchange_order_details');
// }
},
child: fabulousMessageItem(messages[position]),
);
}),
],
)
);
}
Widget fabulousMessageItem(Message message) {
return Container(
child:
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/c_z.png",
width: 44.w,
height: 44.h,
),
// MImage(
// "",
// width: 44,
// height: 44,
// isCircle: true,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
SizedBox(width: 8,),
Expanded(child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"张五",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF1A1A1A))
),
SizedBox(width:8.w,),
Text(
"点赞了",
style:TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF32A060),
),
),
],
),
SizedBox(height: 8,),
Text(
message.updateTime,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFA29E9E),
),
),
SizedBox(height:12.h,),
Container(
width: double.infinity,
color:Color(0xFFF2F2F2),
padding:EdgeInsets.all(5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"我的评论:",
style: TextStyle(
fontSize: 12.sp,
height: 1.3,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
// MImage(
// "",
// width: 38,
// height: 38,
// isCircle: true,
// fit: BoxFit.cover,
// radius: BorderRadius.circular(2),
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
SizedBox(width:2.w),
Expanded(child:Text(
"文本,是指书面语言的表现形式文本,文本,是指书面语言的表现形式文本。",
maxLines: 2,
overflow:TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
height: 1.3,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),)
],
),
),
Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h),
height: 1.h,
width: double.infinity,
color: Color(0xFFF7F7F7),
),
],
)),
],
),
);
}
///
Widget commentMessage(){
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
// if (messages[position].typed == 2) {
// Navigator.of(context)
// .pushNamed('/router/exchange_order_details');
// }
},
child: commentMessageItem(messages[position]),
);
}),
],
)
);
}
Widget commentMessageItem(Message message) {
return Container(
child:
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/c_z.png",
width: 44.w,
height: 44.h,
),
// MImage(
// "",
// width: 44,
// height: 44,
// isCircle: true,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
SizedBox(width: 8,),
Expanded(child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"张五",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF1A1A1A))
),
SizedBox(width:8.w,),
Text(
"评论了",
style:TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF32A060),
),
),
],
),
SizedBox(height: 8,),
Text(
message.updateTime,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFA29E9E),
),
),
],
),),
Container(
height: 21.h,
width: 40.w,
padding:EdgeInsets.only(left:2,right:2),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11),
border: Border.all(
width: 1,
color: Color(0xFF00A359),
style: BorderStyle.solid,
),
),
child: Text(
"回复",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF00A359),
),
),
),
],
),
SizedBox(height:8.h,),
Text(
"文本,是指书面语言的表现形式,从文学角度说,通常是具有完整、系统含义(Mess…",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
height: 1.3,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
SizedBox(height:12.h,),
Container(
width: double.infinity,
color:Color(0xFFF2F2F2),
padding:EdgeInsets.all(5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"我的评论:",
style: TextStyle(
fontSize: 12.sp,
height: 1.3,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
// MImage(
// "",
// width: 38,
// height: 38,
// isCircle: true,
// fit: BoxFit.cover,
// radius: BorderRadius.circular(2),
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
SizedBox(width:2.w),
Expanded(child:Text(
"文本,是指书面语言的表现形式文本,文本,是指书面语言的表现形式文本。",
maxLines: 2,
overflow:TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
height: 1.3,
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),)
],
),
),
Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h),
height: 1.h,
width: double.infinity,
color: Color(0xFFF7F7F7),
),
],
)),
],
),
);
}
///
Widget followMessage(){
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
// if (messages[position].typed == 2) {
// Navigator.of(context)
// .pushNamed('/router/exchange_order_details');
// }
},
child: followMessageItem(messages[position]),
);
}),
],
)
);
}
Widget followMessageItem(Message message) {
return Container(
child:
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/c_z.png",
width: 44.w,
height: 44.h,
),
// MImage(
// "",
// width: 44,
// height: 44,
// isCircle: true,
// fit: BoxFit.cover,
// errorSrc: "assets/image/default_1.png",
// fadeSrc: "assets/image/default_1.png",
// ),
SizedBox(width: 8,),
Expanded(child:Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"张五",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF1A1A1A))
),
SizedBox(width:8.w,),
Text(
"关注了你",
style:TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 14.sp,
color: Color(0xFF32A060),
),
),
],
),
SizedBox(height: 8,),
Text(
message.updateTime,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFA29E9E),
),
),
],
),),
Container(
height: 21.h,
width:56.w,
padding:EdgeInsets.only(left:5,right:5),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11),
border: Border.all(
width: 1,
color: Color(0xFF00A359),
style: BorderStyle.solid,
),
color: Color(0xFF00A359),
),
child: Row(
children: [
Icon(Icons.add,
color:Colors.white,
size: 16,
),
Text(
"回关",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
),
],
),
SizedBox(height:8.h,),
Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h),
height: 1.h,
width: double.infinity,
color: Color(0xFFF7F7F7),
),
],
)),
],
),
);
}
}

534
lib/message/system_message.dart

@ -10,6 +10,7 @@ import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -80,11 +81,29 @@ class _SystemMessagePage extends State<SystemMessagePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
background: Color(0xFFF7F7F7),
background: Colors.white,
leadingColor: Colors.black,
title: S.of(context).xitongxiaoxi,
title: S.of(context).xiaoxi,
titleSize: 18.sp,
titleColor: Colors.black,
actions: [
Container(
margin: EdgeInsets.only(right: 16.w),
alignment: Alignment.centerRight,
child: GestureDetector(
onTap: () {
},
child: Text(
"标为已读",
style: TextStyle(
fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
),
),
],
),
body: SmartRefresher(
enablePullDown: true,
@ -102,151 +121,442 @@ class _SystemMessagePage extends State<SystemMessagePage> {
onLoading: () {
queryMessage();
},
child: (messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
if (messages[position].typed == 2) {
Navigator.of(context)
.pushNamed('/router/exchange_order_details');
}
},
child: buildMessageItem(messages[position]),
);
}),
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
child: Column(
children: [
newsSurvey(),
SizedBox(height: 16.h,),
buildMessage(),
],
),
),
),
),
),
);
}
Widget buildMessageItem(Message message) {
Widget newsSurvey(){
return Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h),
padding: EdgeInsets.all(20.w),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.white,
padding: EdgeInsets.only(top: 16.h,bottom: 16.h),
child: Row(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
Expanded(child: Column(
children: [
Row(
Stack(
children: [
Image.asset(
(message.typed == 1)
? "assets/image/icon_system_notices.png"
: (message.typed == 2)
? "assets/image/icon_system_order.png"
: "assets/image/icon_system_recharge.png",
width: 24.w,
height: 24.h,
"assets/image/icon_z.png",
width: 40,
height: 40,
),
SizedBox(
width: 4.w,
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:20,
height:17,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
),
child:RoundButton(
text: "99+",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:8.sp,
radius: 100,
)
),
)
],
),
SizedBox(height: 6.h),
GestureDetector(
onTap: (){
Navigator.of(context)
.pushNamed('/router/system_details');
},
child:Text(
"点赞",
style: TextStyle(
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
Text(
(message.typed == 1)
? S.of(context).xitongtongzhi
: (message.typed == 2)
? S.of(context).dingdanxiaoxi
: S.of(context).chongzhixiaoxi,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF060606),
)
),
],
)),
Expanded(child:Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_pl.png",
width: 40,
height: 40,
),
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:16,
height:16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
),
child:RoundButton(
text: "99",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:8.sp,
radius: 100,
)
),
)
],
),
SizedBox(height: 6.h),
Text(
message.updateTime,
S.of(context).pinglun,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
),
],
),
if (message.typed != 3)
Container(
margin: EdgeInsets.only(left: 28.w, top: 12.h),
child: Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
)),
Expanded(child:Column(
children: [
Stack(
children: [
Image.asset(
"assets/image/icon_gz.png",
width: 40,
height: 40,
),
Container(
width:48,
alignment: Alignment.topRight,
child:Container(
width:16,
height:16,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(
width: 1,
color: Colors.white,
style: BorderStyle.solid,
),
color:Color(0xFFFF441A),
),
child:RoundButton(
text: "1",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:8.sp,
radius: 100,
)
),
)
],
),
)
else
Container(
margin: EdgeInsets.only(left: 28.w, top: 18.h),
child: Text(
message.title,
SizedBox(height: 6.h),
Text(
S.of(context).guanzhu,
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
fontSize: 14.sp,
fontWeight:MyFontWeight.medium,
color: Color(0xFF060606),
),
),
],
)),
],
),
);
}
Widget buildMessage(){
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(20.w),
child:Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).xitongxiaoxi,
style: TextStyle(
fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold,
color: Colors.black,
),
if (message.typed != 3)
Container(
margin: EdgeInsets.only(left: 28.w, top: 22.h),
child: Row(
),
(messages == null || messages.length == 0)
? NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
)
: ListView.builder(
padding: EdgeInsets.only(top: 16),
itemCount: messages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
// if (messages[position].typed == 2) {
// Navigator.of(context)
// .pushNamed('/router/exchange_order_details');
// }
Navigator.of(context)
.pushNamed('/router/system_details');
},
child: buildMessageItem(messages[position]),
);
}),
],
)
);
}
Widget buildMessageItem(Message message) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
// margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 8.h),
// padding: EdgeInsets.all(20.w),
// decoration: BoxDecoration(
// color: Colors.white,
// boxShadow: [
// BoxShadow(
// color: Colors.black.withAlpha(12),
// offset: Offset(0, 3),
// blurRadius: 14,
// spreadRadius: 0,
// )
// ],
// borderRadius: BorderRadius.circular(8),
// ),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
(message.typed == 1)
? "assets/image/icon_system_message.png"
: (message.typed == 2)
? "assets/image/icon_system_message.png"
: "assets/image/c_z.png",
width: 40.w,
height: 40.h,
),
SizedBox(
width:12.w,
),
Expanded(child:Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child:Text(
(message.typed == 1)
? S.of(context).xitongtongzhi
: (message.typed == 2)
? S.of(context).dingdanxiaoxi
: S.of(context).chongzhixiaoxi,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF060606),
),
)),
Text(
message.updateTime,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
],
),
SizedBox(height:4.h,),
(message.typed != 3) ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
S.of(context).ninyouyigexindedingdan,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),),
RoundButton(
width: 16,
height: 16,
text: "1",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFFFF441A),
fontSize:10.sp,
radius: 100,
),
],
):
Text(
S.of(context).chakangengduo,
message.content,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.black,
)
],
),
)
else
Container(
margin: EdgeInsets.only(left: 28.w, top: 22.h),
child: Text(
message.content,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
)),
],
),
Container(
margin: EdgeInsets.only(top: 16.h,bottom:8.h),
height: 1.h,
width: double.infinity,
color: Color(0xFFF7F7F7),
),
],
),
// Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Row(
// children: [
// Image.asset(
// (message.typed == 1)
// ? "assets/image/icon_system_notices.png"
// : (message.typed == 2)
// ? "assets/image/icon_system_order.png"
// : "assets/image/icon_system_recharge.png",
// width: 24.w,
// height: 24.h,
// ),
// SizedBox(
// width: 4.w,
// ),
// Text(
// (message.typed == 1)
// ? S.of(context).xitongtongzhi
// : (message.typed == 2)
// ? S.of(context).dingdanxiaoxi
// : S.of(context).chongzhixiaoxi,
// style: TextStyle(
// fontSize: 14.sp,
// fontWeight: FontWeight.bold,
// color: Color(0xFF060606),
// ),
// )
// ],
// ),
// Text(
// message.updateTime,
// style: TextStyle(
// fontSize: 10.sp,
// color: Color(0xFFA29E9E),
// ),
// ),
// ],
// ),
// if (message.typed != 3)
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 12.h),
// child: Text(
// S.of(context).ninyouyigexindedingdan,
// style: TextStyle(
// fontSize: 10.sp,
// color: Color(0xFF353535),
// ),
// ),
// )
// else
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 18.h),
// child: Text(
// message.title,
// style: TextStyle(
// fontSize: 20.sp,
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF353535),
// ),
// ),
// ),
// if (message.typed != 3)
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 22.h),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text(
// S.of(context).chakangengduo,
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: FontWeight.bold,
// color: Color(0xFF353535),
// ),
// ),
// Icon(
// Icons.keyboard_arrow_right,
// color: Colors.black,
// )
// ],
// ),
// )
// else
// Container(
// margin: EdgeInsets.only(left: 28.w, top: 22.h),
// child: Text(
// message.content,
// style: TextStyle(
// fontSize: 10.sp,
// color: Color(0xFF353535),
// ),
// ),
// ),
// ],
// ),
);
}
}

2
lib/retrofit/min_api.dart

@ -201,7 +201,7 @@ abstract class MinApiService {
@POST("store/getStore")
Future<BaseData> queryStoreInfo1(@Body() Map<String, dynamic> param);
//
///
@GET("order/getParentInfo?tableId={tableId}")
Future<BaseData> getParentInfo(@Path("tableId") String tableId);

8
lib/retrofit/retrofit_api.dart

@ -53,8 +53,8 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
@ -66,8 +66,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式
// const baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.142:8766/app/";///
// const baseUrl = "http://192.168.10.142:8766/app/";///
const base_url = "http://192.168.10.142:8766/app/";///
const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/';
baseUrl ??= 'http://192.168.10.142:8766/app/';
}
final Dio _dio;

Loading…
Cancel
Save