diff --git a/assets/image/2x/c_z.webp b/assets/image/2x/c_z.webp deleted file mode 100644 index ea1056ff..00000000 Binary files a/assets/image/2x/c_z.webp and /dev/null differ diff --git a/assets/image/2x/icon_chat.webp b/assets/image/2x/icon_chat.webp new file mode 100644 index 00000000..bc2ea7c1 Binary files /dev/null and b/assets/image/2x/icon_chat.webp differ diff --git a/assets/image/2x/icon_cz.webp b/assets/image/2x/icon_cz.webp new file mode 100644 index 00000000..e7309b25 Binary files /dev/null and b/assets/image/2x/icon_cz.webp differ diff --git a/assets/image/2x/icon_gz.webp b/assets/image/2x/icon_gz.webp index 3611d1f1..c2633137 100644 Binary files a/assets/image/2x/icon_gz.webp and b/assets/image/2x/icon_gz.webp differ diff --git a/assets/image/2x/icon_order.webp b/assets/image/2x/icon_order.webp new file mode 100644 index 00000000..8b14cf19 Binary files /dev/null and b/assets/image/2x/icon_order.webp differ diff --git a/assets/image/2x/icon_pl.webp b/assets/image/2x/icon_pl.webp index 3b61e9e0..fec5889a 100644 Binary files a/assets/image/2x/icon_pl.webp and b/assets/image/2x/icon_pl.webp differ diff --git a/assets/image/2x/icon_scan_qr_code.webp b/assets/image/2x/icon_scan_qr_code.webp index 87b4da15..d177630f 100644 Binary files a/assets/image/2x/icon_scan_qr_code.webp and b/assets/image/2x/icon_scan_qr_code.webp differ diff --git a/assets/image/2x/icon_system_message.webp b/assets/image/2x/icon_system_message.webp index dc24acb0..3b15d414 100644 Binary files a/assets/image/2x/icon_system_message.webp and b/assets/image/2x/icon_system_message.webp differ diff --git a/assets/image/2x/icon_z.webp b/assets/image/2x/icon_z.webp index 77b48e80..65835cb4 100644 Binary files a/assets/image/2x/icon_z.webp and b/assets/image/2x/icon_z.webp differ diff --git a/assets/image/3x/c_z.webp b/assets/image/3x/c_z.webp deleted file mode 100644 index cd545fe5..00000000 Binary files a/assets/image/3x/c_z.webp and /dev/null differ diff --git a/assets/image/3x/icon_chat.webp b/assets/image/3x/icon_chat.webp new file mode 100644 index 00000000..935c3dee Binary files /dev/null and b/assets/image/3x/icon_chat.webp differ diff --git a/assets/image/3x/icon_cz.webp b/assets/image/3x/icon_cz.webp new file mode 100644 index 00000000..809ffee9 Binary files /dev/null and b/assets/image/3x/icon_cz.webp differ diff --git a/assets/image/3x/icon_gz.webp b/assets/image/3x/icon_gz.webp index ab41b159..ff4ff7f5 100644 Binary files a/assets/image/3x/icon_gz.webp and b/assets/image/3x/icon_gz.webp differ diff --git a/assets/image/3x/icon_order.webp b/assets/image/3x/icon_order.webp new file mode 100644 index 00000000..7a418bf0 Binary files /dev/null and b/assets/image/3x/icon_order.webp differ diff --git a/assets/image/3x/icon_pl.webp b/assets/image/3x/icon_pl.webp index d0a79b70..abc8b393 100644 Binary files a/assets/image/3x/icon_pl.webp and b/assets/image/3x/icon_pl.webp differ diff --git a/assets/image/3x/icon_scan_qr_code.webp b/assets/image/3x/icon_scan_qr_code.webp index e9900820..ab7e546a 100644 Binary files a/assets/image/3x/icon_scan_qr_code.webp and b/assets/image/3x/icon_scan_qr_code.webp differ diff --git a/assets/image/3x/icon_system_message.webp b/assets/image/3x/icon_system_message.webp index e6d478bc..e82bf99e 100644 Binary files a/assets/image/3x/icon_system_message.webp and b/assets/image/3x/icon_system_message.webp differ diff --git a/assets/image/3x/icon_z.webp b/assets/image/3x/icon_z.webp index b26cd79c..953f1d79 100644 Binary files a/assets/image/3x/icon_z.webp and b/assets/image/3x/icon_z.webp differ diff --git a/assets/image/c_z.webp b/assets/image/c_z.webp deleted file mode 100644 index 48c9a9c4..00000000 Binary files a/assets/image/c_z.webp and /dev/null differ diff --git a/assets/image/icon_chat.webp b/assets/image/icon_chat.webp new file mode 100644 index 00000000..4bd90fb9 Binary files /dev/null and b/assets/image/icon_chat.webp differ diff --git a/assets/image/icon_cz.webp b/assets/image/icon_cz.webp new file mode 100644 index 00000000..c769ed49 Binary files /dev/null and b/assets/image/icon_cz.webp differ diff --git a/assets/image/icon_gz.webp b/assets/image/icon_gz.webp index 9e2a50c1..42b9de87 100644 Binary files a/assets/image/icon_gz.webp and b/assets/image/icon_gz.webp differ diff --git a/assets/image/icon_order.webp b/assets/image/icon_order.webp new file mode 100644 index 00000000..c6b9f905 Binary files /dev/null and b/assets/image/icon_order.webp differ diff --git a/assets/image/icon_pl.webp b/assets/image/icon_pl.webp index ce3e2b6d..3a3bd73f 100644 Binary files a/assets/image/icon_pl.webp and b/assets/image/icon_pl.webp differ diff --git a/assets/image/icon_scan_qr_code.webp b/assets/image/icon_scan_qr_code.webp index fef2d544..afe8afde 100644 Binary files a/assets/image/icon_scan_qr_code.webp and b/assets/image/icon_scan_qr_code.webp differ diff --git a/assets/image/icon_system_message.webp b/assets/image/icon_system_message.webp index 8a42f386..c7f69186 100644 Binary files a/assets/image/icon_system_message.webp and b/assets/image/icon_system_message.webp differ diff --git a/assets/image/icon_z.webp b/assets/image/icon_z.webp index dc3a8889..2433add2 100644 Binary files a/assets/image/icon_z.webp and b/assets/image/icon_z.webp differ diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 4edfb2e4..78229327 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -416,7 +416,7 @@ class _NewLoginPage extends State { Container( height: 30.h, width: MediaQuery.of(context).size.width - 100.w, - margin: EdgeInsets.only(bottom: 10.h), + margin: EdgeInsets.only(bottom:5.h), child: TextField( style: TextStyle( height: 1.h, diff --git a/lib/main.dart b/lib/main.dart index 236b1317..d3e6be7a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -98,6 +98,7 @@ import 'login/new_login_page.dart'; import 'login/phone_address_page.dart'; import 'main_page.dart'; import 'message/system_details.dart'; +import 'message/system_notice.dart'; import 'mine/coupon_page.dart'; import 'mine/edit_signature.dart'; import 'mine/invitation_record.dart'; @@ -423,4 +424,6 @@ Map routers = { ScanWeb(arguments:arguments), '/router/vip_pay_code': (context, {arguments}) => VipPayCode(), + '/router/system_notice': (context, {arguments}) => + SystemNotice(), }; diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 48eeff31..c253b071 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -204,14 +204,13 @@ class _SystemMessagePage extends State { ), ), ), - Spacer(), Expanded( child: Text( S.of(context).xiaoxi, style: TextStyle( color: Colors.black, - fontSize: 16.sp, - fontWeight: MyFontWeight.regular, + fontSize: 18.sp, + fontWeight: MyFontWeight.bold, ), )), GestureDetector( @@ -236,11 +235,59 @@ class _SystemMessagePage extends State { ], ), ), - newsSurvey(), - SizedBox( - height: 16.h, + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/system_details', + arguments: {"msgType": 6}).then((value) { + setState(() { + msgNumber["6"] = 0; + }); + }); + }, + child:messageItem("assets/image/icon_pl.webp", S.of(context).pinglun, msgNumber["6"].toString()), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/system_details', + arguments: {"msgType": 5}).then((value) { + setState(() { + msgNumber["5"] = 0; + }); + }); + }, + child: messageItem("assets/image/icon_z.webp", S.of(context).dianzan, msgNumber["5"].toString()), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/system_details', + arguments: {"msgType": 4}).then((value) { + setState(() { + msgNumber["4"] = 0; + }); + }); + }, + child:messageItem("assets/image/icon_gz.webp", S.of(context).guanzhu,msgNumber["4"].toString()), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/system_notice').then((value) { + setState(() { + msgNumber["2"] = 0; + msgNumber["3"] = 0; + }); + }); + }, + child:messageItem("assets/image/icon_system_message.webp", S.of(context).xitongxiaoxi, (msgNumber["2"]+msgNumber["3"]).toString()), ), - buildMessage(), + // newsSurvey(), + // SizedBox( + // height: 16.h, + // ), + // buildMessage(), ], ), ), @@ -250,6 +297,83 @@ class _SystemMessagePage extends State { ); } + Widget messageItem(img, title, messageNum) { + return Container( + padding: EdgeInsets.only(top:14.h, left:14.w, bottom:10.h, right:14.w), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Column( + children: [ + Row( + children: [ + Image.asset( + img, + fit: BoxFit.fill, + ), + SizedBox( + width: 12.w, + ), + Text( + title, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF060606), + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + width: 9.w, + ), + if(messageNum != "0") + ((double.tryParse(messageNum) < 100)? + Container( + width: 16, + height: 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + color: Color(0xFFFF441A), + ), + child: RoundButton( + text:messageNum, + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 10.sp, + radius: 100, + )): + Container( + padding: EdgeInsets.symmetric(horizontal:4.w,vertical:2.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + color: Color(0xFFFF441A), + ), + child: RoundButton( + text:"99+", + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 10.sp, + radius: 100, + ))), + Spacer(), + Icon( + Icons.keyboard_arrow_right, + size: 24, + ), + ], + ), + Container( + margin: EdgeInsets.only(top: 12.h), + width: double.infinity, + height: 1.h, + color: Color(0xFFF7F7F7), + ) + ], + ), + ); + } + Widget newsSurvey() { return Container( color: Colors.white, diff --git a/lib/message/system_notice.dart b/lib/message/system_notice.dart new file mode 100644 index 00000000..47d23f30 --- /dev/null +++ b/lib/message/system_notice.dart @@ -0,0 +1,323 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.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 SystemNotice extends StatefulWidget { + + @override + State createState() { + return _SystemNotice(); + } +} + +class _SystemNotice extends State { + ApiService apiService; + int pageNum = 1; + List messages = []; + int msgType = 0; + + // String parenId = "0"; + var commentFocus = FocusNode(); + String hintText = S.current.liuxianinjingcaidepinglunba; + bool isKeyBoardShow = false; + final GlobalKey commentKey = GlobalKey(); + final GlobalKey inputKey = GlobalKey(); + final TextEditingController commentTextController = TextEditingController(); + int indexMsg = 0; + + @override + void initState() { + super.initState(); + // msgType = widget.arguments["msgType"]; + + SharedPreferences.getInstance().then((value) { + apiService = + ApiService(Dio(), token: value.getString("token"), context: context); + queryMessage(); + }); + } + + _refresh() { + pageNum = 1; + queryMessage(); + } + + queryMessage() async { + BaseData> 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(); + } + List message = []; + message.addAll(baseData.data.list); + message.forEach((element) { + if (element.typed == 2 || element.typed == 3) { + messages.add(element); + } + }); + _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( + body: SmartRefresher( + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + physics: BouncingScrollPhysics(), + footer: CustomFooter( + loadStyle: LoadStyle.ShowWhenLoading, + builder: (BuildContext context, LoadStatus mode) { + return (messages.length == 0) ? Container() : MyFooter(mode); + }, + ), + controller: _refreshController, + onRefresh: _refresh, + onLoading: () { + queryMessage(); + }, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + child: Column( + children: [ + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: MediaQuery.of(context).padding.top + 10.h, + bottom: 10.h, + right: 16.w), + child: Row( + 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, + ), + ), + ), + Text( + "消息通知", + style: TextStyle( + color: Colors.black, + fontSize: 18.sp, + fontWeight: MyFontWeight.bold, + ), + ), + ], + ), + ), + buildMessage() + ], + ), + ), + ), + ), + ), + ); + } + + Widget buildMessage() { + return Container( + color: Colors.white, + width: double.infinity, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + (messages == null || messages.length == 0) + ? NoDataView( + src: "assets/image/icon_empty.webp", + 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( + behavior: HitTestBehavior.opaque, + onTap: () { + if (messages[position].typed == 2) + Navigator.of(context).pushNamed( + '/router/system_details', + arguments: {"msgType": 2}); + else if (messages[position].typed == 3) + Navigator.of(context).pushNamed( + '/router/system_details', + arguments: {"msgType": 3}); + }, + child: buildMessageItem(messages[position]), + ); + }), + ], + )); + } + + Widget buildMessageItem(Message message) { + return Container( + margin: EdgeInsets.only(top: 8.h, bottom: 8.h,left: 16.w,right: 17.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + (message.typed == 1) + ? "assets/image/icon_order.webp" + : (message.typed == 2) + ? "assets/image/icon_order.webp" + : "assets/image/icon_cz.webp", + width: 24.w, + height: 24.h, + ), + SizedBox( + width: 8.w, + ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + 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: 24.h, + ), + (message.typed != 3) + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + S.of(context).ninyouyigexindedingdan, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF353535), + ), + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 24, + ), + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Text( + message.content, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF353535), + ), + )), + + Icon( + Icons.keyboard_arrow_right, + size: 24, + ), + ], + ), + Container( + margin: EdgeInsets.only(top: 16.h, bottom: 8.h), + height: 1.h, + width: double.infinity, + color: Color(0xFFF7F7F7), + ), + ], + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index e0292ffe..f8b5c7d0 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -76,6 +76,7 @@ class _MineView extends State { Container( height: 24.h, alignment: Alignment.center, + margin: EdgeInsets.only(right: 12.w), child: GestureDetector( onTap: () { Navigator.of(context) @@ -90,10 +91,9 @@ class _MineView extends State { child: Stack( children: [ Image.asset( - "assets/image/icon_notices.webp", - width: 32, - height: 32, - color: Colors.white, + "assets/image/icon_chat.webp", + width:24, + height: 24, ), if (widget.totalMsg != 0) Container( @@ -128,12 +128,11 @@ class _MineView extends State { toScan(); }, child: Container( - padding: EdgeInsets.all(8.h), + padding: EdgeInsets.only(left: 12.w,right:16.w,top:8.h,bottom:8.h), child: Image.asset( "assets/image/icon_scan_qr_code.webp", - width: 32, - height: 32, - color: Colors.white, + width: 22, + height: 22, ), ), ), diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 3b672481..a9fac982 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,17 +39,14 @@ class _OrderDetailPage extends State { ApiService apiService; MinApiService minService; int jumpState; + final RefreshController refreshController = RefreshController(); @override void initState() { super.initState(); SharedPreferences.getInstance().then((value) { - apiService = ApiService( - Dio(), - context: context, - token: value.getString("token"), - showLoading: true - ); + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), showLoading: true); queryDetails(); }); jumpState = widget.arguments["jumpState"]; @@ -89,17 +90,20 @@ class _OrderDetailPage extends State { queryDetails() async { if (apiService == null) { - SharedPreferences value = await SharedPreferences.getInstance(); - apiService = ApiService( - Dio(), - context: context, - token: value.getString("token"), - showLoading: false - ); - } + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, + token: value.getString("token"), + showLoading: false); + } 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 +123,12 @@ class _OrderDetailPage extends State { setState(() { statusTitle(); }); - }else{ - SmartDialog.showToast(baseData.msg,alignment: Alignment.center); + refreshController.refreshCompleted(); + refreshController.loadComplete(); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + refreshController.refreshFailed(); + refreshController.loadFailed(); } } @@ -155,27 +163,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 +195,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) + OrderCommodity(orderInfo), - ///显示订单信息 - if(orderInfo != null) - OrderInfoView(orderInfo, isTakeOut), + ///显示订单信息 + if(orderInfo != null) + OrderInfoView(orderInfo, isTakeOut), - Container( - height: 42.h, - ), - ], + Container( + height: 42.h, + ), + ], + ), ), ), ), @@ -227,11 +253,12 @@ class _OrderDetailPage extends State { } } - payResult(BaseData baseData) async{ + payResult(BaseData baseData) async { await queryDetails(); Future.delayed(Duration(milliseconds: 800), () { EasyLoading.dismiss(); - SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); + SmartDialog.showToast(baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg, + alignment: Alignment.center); }); } @@ -525,10 +552,10 @@ class _OrderDetailPage extends State { if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("订单取消成功"); // Future.delayed(Duration(milliseconds:450), () { - queryDetails(); + queryDetails(); // }); - }else{ - SmartDialog.showToast(baseData.msg,alignment: Alignment.center); + } else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index bd3cbc32..4abeec11 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -84,7 +84,7 @@ class NewCouponWidget extends StatelessWidget { children: [ Text( "${coupon != null ? coupon.couponName ?? "" : ""}", - maxLines: 1, + maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 15.sp,