Browse Source

消息页面更改;

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

115
lib/message/system_message.dart

@ -143,34 +143,34 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: MyAppBar( // appBar: MyAppBar(
background: Colors.white, // background: Colors.white,
leadingColor: Colors.black, // leadingColor: Colors.black,
title: S.of(context).xiaoxi, // title: S.of(context).xiaoxi,
titleSize: 18.sp, // titleSize: 18.sp,
titleColor: Colors.black, // titleColor: Colors.black,
actions: [ // actions: [
Container( // Container(
margin: EdgeInsets.only(right: 16.w), // margin: EdgeInsets.only(right: 16.w),
alignment: Alignment.centerRight, // alignment: Alignment.centerRight,
child: GestureDetector( // child: GestureDetector(
onTap: () { // onTap: () {
setState(() { // setState(() {
queryMsgStats(); // queryMsgStats();
}); // });
}, // },
child: Text( // child: Text(
S.of(context).biaoweiyidu, // S.of(context).biaoweiyidu,
style: TextStyle( // style: TextStyle(
fontSize: 16.sp, // fontSize: 16.sp,
fontWeight:MyFontWeight.semi_bold, // fontWeight:MyFontWeight.semi_bold,
color: Color(0xFF353535), // color: Color(0xFF353535),
), // ),
), // ),
), // ),
), // ),
], // ],
), // ),
body: SmartRefresher( body: SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
@ -197,6 +197,62 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
padding: EdgeInsets.only(bottom: 30.h), padding: EdgeInsets.only(bottom: 30.h),
child: Column( child: Column(
children: [ 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( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: (){ onTap: (){
@ -799,10 +855,11 @@ class _SystemMessagePage extends State<SystemMessagePage> implements OnChatMessa
); );
} }
///
Widget chatList(){ Widget chatList(){
return Container( return Container(
child: ListView.builder( child: ListView.builder(
// padding: EdgeInsets.only(top: 16), padding: EdgeInsets.only(top: 16),
itemCount: 6, itemCount: 6,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),

101
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/utils/font_weight.dart';
import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.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:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.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'; import 'order_utils.dart';
class OrderDetailPage extends StatefulWidget { class OrderDetailPage extends StatefulWidget {
@ -35,6 +39,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
ApiService apiService; ApiService apiService;
MinApiService minService; MinApiService minService;
int jumpState; int jumpState;
final RefreshController refreshController = RefreshController();
@override @override
void initState() { void initState() {
@ -99,7 +104,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
} }
BaseData<OrderInfo> baseData = await apiService BaseData<OrderInfo> baseData = await apiService
.orderDetail(widget.arguments["id"]) .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) { if (baseData != null && baseData.isSuccess) {
orderInfo = baseData.data; orderInfo = baseData.data;
payStatus = orderInfo.payStatus; payStatus = orderInfo.payStatus;
@ -119,8 +128,12 @@ class _OrderDetailPage extends State<OrderDetailPage> {
setState(() { setState(() {
statusTitle(); statusTitle();
}); });
refreshController.refreshCompleted();
refreshController.loadComplete();
}else{ }else{
SmartDialog.showToast(baseData.msg,alignment: Alignment.center); SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
refreshController.refreshFailed();
refreshController.loadFailed();
} }
} }
@ -155,27 +168,31 @@ class _OrderDetailPage extends State<OrderDetailPage> {
leadingColor: Colors.white, leadingColor: Colors.white,
brightness: Brightness.dark, brightness: Brightness.dark,
), ),
body: Container( body: SmartRefresher(
child: SingleChildScrollView( controller: refreshController,
physics: BouncingScrollPhysics(), enablePullDown: true,
child: Container( enablePullUp: false,
child: Column( header: MyHeader(),
children: [ footer: CustomFooter(
/// builder: (context, mode) {
OrderStatus( return MyFooter(mode);
orderStatus, },
isTakeOut, ),
sendStatus, onRefresh:(){
payStatus, setState(() {
refundStatus, queryDetails();
title, });
center, },
orderInfo, physics: BouncingScrollPhysics(),
), scrollController: ScrollController(),
child: Container(
/// child: SingleChildScrollView(
if(orderInfo != null && orderInfo.addressExt != null) physics: BouncingScrollPhysics(),
OrderAddress( child: Container(
child: Column(
children: [
///
OrderStatus(
orderStatus, orderStatus,
isTakeOut, isTakeOut,
sendStatus, sendStatus,
@ -183,24 +200,38 @@ class _OrderDetailPage extends State<OrderDetailPage> {
refundStatus, refundStatus,
title, title,
center, center,
paySelected,
_orderCancel,
orderInfo, orderInfo,
jumpState
), ),
/// ///
if(orderInfo != null) if(orderInfo != null && orderInfo.addressExt != null)
OrderCommodity(orderInfo), OrderAddress(
orderStatus,
isTakeOut,
sendStatus,
payStatus,
refundStatus,
title,
center,
paySelected,
_orderCancel,
orderInfo,
jumpState
),
/// ///
if(orderInfo != null) if(orderInfo != null)
OrderInfoView(orderInfo, isTakeOut), OrderCommodity(orderInfo),
Container( ///
height: 42.h, if(orderInfo != null)
), OrderInfoView(orderInfo, isTakeOut),
],
Container(
height: 42.h,
),
],
),
), ),
), ),
), ),

Loading…
Cancel
Save