diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 50ff132b..7e8a7596 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -143,34 +143,34 @@ class _SystemMessagePage extends State 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 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 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(), diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index b12aefda..c53ef472 100644 --- a/lib/order/order_detail_page.dart +++ b/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 { ApiService apiService; MinApiService minService; int jumpState; + final RefreshController refreshController = RefreshController(); @override void initState() { @@ -99,7 +104,11 @@ class _OrderDetailPage extends State { } BaseData 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 { setState(() { statusTitle(); }); + refreshController.refreshCompleted(); + refreshController.loadComplete(); }else{ SmartDialog.showToast(baseData.msg,alignment: Alignment.center); + refreshController.refreshFailed(); + refreshController.loadFailed(); } } @@ -155,27 +168,31 @@ class _OrderDetailPage extends State { leadingColor: Colors.white, brightness: Brightness.dark, ), - body: Container( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - child: Column( - children: [ - ///订单状态显示 - OrderStatus( - orderStatus, - isTakeOut, - sendStatus, - payStatus, - refundStatus, - title, - center, - orderInfo, - ), - - ///订单取货地址,或, 收货地址 - if(orderInfo != null && orderInfo.addressExt != null) - OrderAddress( + 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( + child: Column( + children: [ + ///订单状态显示 + OrderStatus( orderStatus, isTakeOut, sendStatus, @@ -183,24 +200,38 @@ class _OrderDetailPage extends State { refundStatus, title, center, - paySelected, - _orderCancel, orderInfo, - jumpState ), - ///订单商品 - if(orderInfo != null) - OrderCommodity(orderInfo), + ///订单取货地址,或, 收货地址 + if(orderInfo != null && orderInfo.addressExt != null) + OrderAddress( + orderStatus, + isTakeOut, + sendStatus, + payStatus, + refundStatus, + title, + center, + paySelected, + _orderCancel, + orderInfo, + jumpState + ), - ///显示订单信息 - if(orderInfo != null) - OrderInfoView(orderInfo, isTakeOut), + ///订单商品 + if(orderInfo != null) + OrderCommodity(orderInfo), - Container( - height: 42.h, - ), - ], + ///显示订单信息 + if(orderInfo != null) + OrderInfoView(orderInfo, isTakeOut), + + Container( + height: 42.h, + ), + ], + ), ), ), ),