Browse Source

消息页面更改;

订单详情增加下拉刷新
dart3_last
wurong 2 years ago
parent
commit
16013c6bf5
  1. 115
      lib/message/system_message.dart
  2. 35
      lib/order/order_detail_page.dart

115
lib/message/system_message.dart

@ -143,34 +143,34 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
background: Colors.white,
leadingColor: Colors.black,
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: () {
setState(() {
queryMsgStats();
});
},
child: Text(
S.of(context).biaoweiyidu,
style: TextStyle(
fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
),
),
],
),
// appBar: MyAppBar(
// background: Colors.white,
// leadingColor: Colors.black,
// 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: () {
// setState(() {
// queryMsgStats();
// });
// },
// child: Text(
// S.of(context).biaoweiyidu,
// style: TextStyle(
// fontSize: 16.sp,
// fontWeight:MyFontWeight.semi_bold,
// color: Color(0xFF353535),
// ),
// ),
// ),
// ),
// ],
// ),
body: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
@ -197,6 +197,62 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
padding: EdgeInsets.only(bottom: 30.h),
child: Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: MediaQuery.of(context).padding.top + 10.h,
bottom: 15.h,right: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Container(
alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 12,),
padding: EdgeInsets.all(6),
child: Icon(
Icons.arrow_back_ios,
color: Colors.black,
size: 24,
),
),
),
Expanded(
child: Text(
S.of(context).xiaoxi,
style: TextStyle(
color: Colors.black,
fontSize: 18.sp,
fontWeight: MyFontWeight.bold,
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
queryMsgStats();
});
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Text(
S.of(context).biaoweiyidu,
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
@ -799,10 +855,11 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
);
}
///
Widget chatList(){
return Container(
child: ListView.builder(
// padding: EdgeInsets.only(top: 16),
padding: EdgeInsets.only(top: 16),
itemCount: 6,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),

35
lib/order/order_detail_page.dart

@ -15,9 +15,13 @@ import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../utils/flutter_utils.dart';
import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart';
import 'order_utils.dart';
class OrderDetailPage extends StatefulWidget {
@ -35,6 +39,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService;
MinApiService minService;
int jumpState;
final RefreshController refreshController = RefreshController();
@override
void initState() {
@ -99,7 +104,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
}
BaseData<OrderInfo> baseData = await apiService
.orderDetail(widget.arguments["id"])
.catchError((error) {});
.catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();});
if (baseData != null && baseData.isSuccess) {
orderInfo = baseData.data;
payStatus = orderInfo.payStatus;
@ -119,8 +128,12 @@ class _OrderDetailPage extends State<OrderDetailPage> {
setState(() {
statusTitle();
});
refreshController.refreshCompleted();
refreshController.loadComplete();
}else{
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
@ -155,7 +168,24 @@ class _OrderDetailPage extends State<OrderDetailPage> {
leadingColor: Colors.white,
brightness: Brightness.dark,
),
body: Container(
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh:(){
setState(() {
queryDetails();
});
},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
@ -205,6 +235,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
),
),
),
),
)
],
),

Loading…
Cancel
Save