From ba718c6ecd733ac65295368e8cf9cd0e1857d316 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Thu, 2 Mar 2023 11:53:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 2 +- lib/message/system_details.dart | 1034 ++++++++++++++++--------------- lib/message/system_message.dart | 1 + pubspec.lock | 300 ++++----- pubspec.yaml | 4 +- 5 files changed, 698 insertions(+), 643 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index aa38b250..f35fed4c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -184,7 +184,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' +// implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' implementation fileTree(include: ['*.aar'], dir: 'libs') implementation 'androidx.legacy:legacy-support-v4:1.0.0' diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index 79f27255..8e4742e4 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -23,6 +23,7 @@ class SystemDetails extends StatefulWidget { final Map arguments; SystemDetails({this.arguments}); + @override State createState() { return _SystemDetails(); @@ -34,6 +35,7 @@ class _SystemDetails extends State { int pageNum = 1; List messages = []; int msgType = 0; + // String parenId = "0"; var commentFocus = FocusNode(); String hintText = S.current.liuxianinjingcaidepinglunba; @@ -43,7 +45,6 @@ class _SystemDetails extends State { final TextEditingController commentTextController = TextEditingController(); int indexMsg = 0; - @override void initState() { super.initState(); @@ -56,7 +57,6 @@ class _SystemDetails extends State { }); } - _refresh() { pageNum = 1; queryMessage(); @@ -92,13 +92,14 @@ class _SystemDetails extends State { } } - ///关注/取关会员 - _vipFollow(followId,isFollow) async { + ///关注/取关会员 + _vipFollow(followId, isFollow) async { BaseData baseData = await apiService.follow(followId); if (baseData != null && baseData.isSuccess) { // widget.refresh(); queryMessage(); - SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center); + SmartDialog.showToast(isFollow ? "取关成功" : "关注成功", + alignment: Alignment.center); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } @@ -117,16 +118,15 @@ class _SystemDetails extends State { BaseData baseData = await apiService.memberComment({ "content": content, "parentId": messageRelational["additionId"].toString(), - "relationalId":messageRelational["businessId"].toString(), - "relationalType":4 + "relationalId": messageRelational["businessId"].toString(), + "relationalType": 4 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { commentTextController.text = ""; FocusScope.of(context).unfocus(); Navigator.of(context).pop(); SmartDialog.showToast("发布成功", alignment: Alignment.center); - } - else{ + } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -139,11 +139,19 @@ class _SystemDetails extends State { appBar: MyAppBar( background: Colors.white, leadingColor: Colors.black, - title: (msgType == 2) ? S.of(context).dingdantongzhi:(msgType == 3) ? S.of(context).chongzhixiaoxi:(msgType == 4) ?"关注":(msgType == 5) ?"点赞":"评论", + title: (msgType == 2) + ? S.of(context).dingdantongzhi + : (msgType == 3) + ? S.of(context).chongzhixiaoxi + : (msgType == 4) + ? S.of(context).guanzhu + : (msgType == 5) + ? S.of(context).dianzan + : S.of(context).pinglun, titleSize: 18.sp, titleColor: Colors.black, ), - body:SmartRefresher( + body: SmartRefresher( enablePullDown: true, enablePullUp: true, header: MyHeader(), @@ -151,7 +159,7 @@ class _SystemDetails extends State { footer: CustomFooter( loadStyle: LoadStyle.ShowWhenLoading, builder: (BuildContext context, LoadStatus mode) { - return (messages.length == 0)?Container():MyFooter(mode); + return (messages.length == 0) ? Container() : MyFooter(mode); }, ), controller: _refreshController, @@ -159,76 +167,69 @@ class _SystemDetails extends State { onLoading: () { queryMessage(); }, - child: - Container( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: - Container( - child: Column( - children: [ - if(msgType == 2) - orderMessage(), - if(msgType == 3) - rechargeMessage(), - if(msgType == 5) - fabulousMessage(), - if(msgType == 6) - commentMessage(), - if(msgType == 4) - followMessage(), - ], - ), - ), + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + child: Column( + children: [ + if (msgType == 2) orderMessage(), + if (msgType == 3) rechargeMessage(), + if (msgType == 5) fabulousMessage(), + if (msgType == 6) commentMessage(), + if (msgType == 4) followMessage(), + ], ), ), + ), + ), ), ); } ///订单通知 - Widget orderMessage(){ + 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( - 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( - onTap: () { - // if (messages[position].typed == 2) { - // Navigator.of(context) - // .pushNamed('/router/exchange_order_details'); - // } - }, - child: orderMessageItem(messages[position]), - ); - }), - ], - ) - ); + 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( + 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( + 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( + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -242,13 +243,13 @@ class _SystemDetails extends State { (message.typed == 1) ? "assets/image/icon_system_message.webp" : (message.typed == 2) - ? "assets/image/icon_system_message.webp" - : "assets/image/c_z.webp", + ? "assets/image/icon_system_message.webp" + : "assets/image/c_z.webp", width: 24.w, height: 24.h, ), SizedBox( - width:8.w, + width: 8.w, ), Text( (message.typed == 1) @@ -273,87 +274,89 @@ class _SystemDetails extends State { ), ], ), - 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( + 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, + 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), - ) - ], - ), - ) + ), + ), + 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(){ + 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( + 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( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) + 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( - onTap: () { - // if (messages[position].typed == 2) { - // Navigator.of(context) - // .pushNamed('/router/exchange_order_details'); - // } - }, - child: rechargeMessageItem(messages[position]), - ); - }), + 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( + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -367,20 +370,20 @@ class _SystemDetails extends State { (message.typed == 1) ? "assets/image/icon_system_message.webp" : (message.typed == 2) - ? "assets/image/icon_system_message.webp" - : "assets/image/c_z.webp", + ? "assets/image/icon_system_message.webp" + : "assets/image/c_z.webp", width: 24.w, height: 24.h, ), SizedBox( - width:8.w, + width: 8.w, ), Text( (message.typed == 1) ? S.of(context).xitongtongzhi : (message.typed == 2) - ? S.of(context).dingdanxiaoxi - : "充值通知", + ? S.of(context).dingdanxiaoxi + : "充值通知", style: TextStyle( fontSize: 14.sp, fontWeight: FontWeight.bold, @@ -400,7 +403,7 @@ class _SystemDetails extends State { ), Container( width: double.infinity, - margin: EdgeInsets.only(left:30.w, top:20.h), + margin: EdgeInsets.only(left: 30.w, top: 20.h), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -413,20 +416,24 @@ class _SystemDetails extends State { color: Color(0xFF353535), ), ), - SizedBox(height:8.h,), + 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), + 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, @@ -448,171 +455,182 @@ class _SystemDetails extends State { } ///点赞通知 - Widget fabulousMessage(){ + Widget fabulousMessage() { return Container( color: Colors.white, width: double.infinity, - padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), - child:Column( + 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( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) + 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( - onTap: () { - Navigator.of(context).pushNamed( - '/router/community_details', - arguments: { - "businessId":jsonDecode(messages[position].relational)["businessId"].toString(), - "mid":messages[position].mid + padding: EdgeInsets.only(top: 16), + itemCount: messages.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/community_details', + arguments: { + "businessId": + jsonDecode(messages[position].relational)[ + "businessId"] + .toString(), + "mid": messages[position].mid + }, + ); }, + child: fabulousMessageItem(messages[position]), ); - }, - child: fabulousMessageItem(messages[position]), - ); - }), + }), ], - ) - ); + )); } + Widget fabulousMessageItem(Message message) { var messageRelational = jsonDecode(message.relational); return Container( - child: - Row( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + messageRelational["avatar"] ?? "", + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox( + width: 8, + ), + Expanded( + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - MImage( - messageRelational["avatar"] ?? "", - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox(width: 8,), - Expanded(child:Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + Row( children: [ - Row( - children: [ - Text( - messageRelational["nickname"] ?? "", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 14.sp, - color: Color(0xFF1A1A1A)) - ), - SizedBox(width:8.w,), - Text( - "点赞了", - style:TextStyle( - fontWeight: MyFontWeight.medium, + Text(messageRelational["nickname"] ?? "", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp, - color: Color(0xFF32A060), - ), - ), - ], + color: Color(0xFF1A1A1A))), + SizedBox( + width: 8.w, ), - 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.center, - children: [ - // Text( - // "我的评论:", - // style: TextStyle( - // fontSize: 12.sp, - // height: 1.3, - // fontWeight: MyFontWeight.regular, - // color: Color(0xFF1A1A1A), - // ), - // ), - MImage( - messageRelational["nickname"] , - width: 38, - height: 38, - isCircle: true, - fit: BoxFit.cover, - radius: BorderRadius.circular(2), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox(width:2.w), - Expanded(child:Text( - messageRelational["content"] ?? "", - maxLines: 2, - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - height: 1.3, - fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), - ), - ),) - ], + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFF32A060), ), ), - Container( - margin: EdgeInsets.only(top: 16.h,bottom:16.h), - height: 1.h, - width: double.infinity, - color: Color(0xFFF7F7F7), - ), ], - )), + ), + 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.center, + children: [ + // Text( + // "我的评论:", + // style: TextStyle( + // fontSize: 12.sp, + // height: 1.3, + // fontWeight: MyFontWeight.regular, + // color: Color(0xFF1A1A1A), + // ), + // ), + MImage( + messageRelational["nickname"], + width: 38, + height: 38, + isCircle: true, + fit: BoxFit.cover, + radius: BorderRadius.circular(2), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox(width: 2.w), + Expanded( + child: Text( + messageRelational["content"] ?? "", + 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(){ + 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( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) - : ListView.builder( + 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( + 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, @@ -623,28 +641,30 @@ class _SystemDetails extends State { Navigator.of(context).pushNamed( '/router/community_details', arguments: { - "businessId":jsonDecode(messages[position].relational)["businessId"].toString(), - "mid":messages[position].mid + "businessId": + jsonDecode(messages[position].relational)[ + "businessId"] + .toString(), + "mid": messages[position].mid }, ); }, - child: commentMessageItem(messages[position],position), + child: commentMessageItem(messages[position], position), ); }), - ], - ) - ); + ], + )); } - Widget commentMessageItem(Message message,index) { + + Widget commentMessageItem(Message message, index) { var messageRelational = jsonDecode(message.relational); return Container( - child: - Row( + child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ MImage( - messageRelational["avatar"], + messageRelational["avatar"], width: 44, height: 44, isCircle: true, @@ -652,8 +672,11 @@ class _SystemDetails extends State { errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), - SizedBox(width: 8,), - Expanded(child:Column( + SizedBox( + width: 8, + ), + Expanded( + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -661,42 +684,46 @@ class _SystemDetails extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - messageRelational["nickname"], + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text(messageRelational["nickname"], + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + color: Color(0xFF1A1A1A))), + SizedBox( + width: 8.w, + ), + 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), + 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: 8,), - Text( - message.updateTime, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFA29E9E), ), - ), - ], - ),), + ], + ), + ), GestureDetector( - onTap: (){ + onTap: () { setState(() { indexMsg = index; showDeleteDialog(); @@ -704,9 +731,9 @@ class _SystemDetails extends State { }); }, child: Container( - height:22.h, + height: 22.h, width: 40.w, - padding:EdgeInsets.only(left:2,right:2), + padding: EdgeInsets.only(left: 2, right: 2), alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(11), @@ -728,7 +755,9 @@ class _SystemDetails extends State { ) ], ), - SizedBox(height:8.h,), + SizedBox( + height: 8.h, + ), // Text( // messageRelational["content"], // maxLines: 2, @@ -785,8 +814,8 @@ class _SystemDetails extends State { // ), Container( width: double.infinity, - color:Color(0xFFF2F2F2), - padding:EdgeInsets.all(5), + color: Color(0xFFF2F2F2), + padding: EdgeInsets.all(5), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -810,23 +839,25 @@ class _SystemDetails extends State { errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), - SizedBox(width:2.w), - Expanded(child:Text( - messageRelational["content"], - maxLines: 2, - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - height: 1.3, - fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), + SizedBox(width: 2.w), + Expanded( + child: Text( + messageRelational["content"], + 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), + margin: EdgeInsets.only(top: 16.h, bottom: 16.h), height: 1.h, width: double.infinity, color: Color(0xFFF7F7F7), @@ -839,188 +870,195 @@ class _SystemDetails extends State { } ///关注通知 - Widget followMessage(){ + Widget followMessage() { return Container( color: Colors.white, width: double.infinity, - padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), - child:Column( + 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( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) + 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( - onTap: () { - // if (messages[position].typed == 2) { - // Navigator.of(context) - // .pushNamed('/router/exchange_order_details'); - // } - }, - child: followMessageItem(messages[position]), - ); - }), + 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) { var messageRelational = jsonDecode(message.relational); - if(message.relational.startsWith("{")) - return Container( - child: - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - MImage( - messageRelational["avatar"], - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - 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( + if (message.relational.startsWith("{")) + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + messageRelational["avatar"], + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + 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: [ - Text( - messageRelational["nickname"], - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, + Row( + children: [ + Text(messageRelational["nickname"], + 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(0xFF1A1A1A)) + color: Color(0xFF32A060), + ), + ), + ], + ), + SizedBox( + height: 8, ), - SizedBox(width:8.w,), Text( - "关注了你", - style:TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Color(0xFF32A060), + message.updateTime, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFFA29E9E), ), ), ], ), - SizedBox(height: 8,), - Text( - message.updateTime, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFA29E9E), + ), + GestureDetector( + onTap: () { + setState(() { + _vipFollow(messageRelational["mid"].toString(), + message?.followed ?? false); + }); + }, + child: RoundButton( + height: 21.h, + width: 56.w, + padding: EdgeInsets.all(2), + backgroup: (message?.followed ?? false) + ? Color(0xFFE6E6E6) + : Color(0xFF32A060), + textColor: (message?.followed ?? false) + ? Color(0xFF808080) + : Colors.white, + text: (message?.followed ?? false) ? "已关注" : "回关", + radius: 20, + icons: Icon( + (message?.followed ?? false) + ? Icons.check + : Icons.add, + color: (message?.followed ?? false) + ? Color(0xFF808080) + : Colors.white, + size: 12, + ), + ) + // 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: (message?.followed ?? false) + // ? Color(0xFFE6E6E6) + // : Color(0xFF32A060), + // ), + // child: Row( + // children: [ + // Icon((message?.followed ?? false) + // ? Icons.check + // : Icons.add, + // color:(message?.followed?? false) + // ? Color(0xFF808080) + // : Colors.white, + // size: 16, + // ), + // Text( + // (message?.followed ?? false) ? "已关注" : "回关", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color:(message?.followed ?? false) + // ? Color(0xFF808080) + // : Colors.white, + // ), + // ), + // ], + // ), + // ) ), - ), - ], - ),), - GestureDetector( - onTap: (){ - setState(() { - _vipFollow(messageRelational["mid"].toString(),message?.followed ?? false); - }); - }, - child: - RoundButton( - height: 21.h, - width:56.w, - padding: EdgeInsets.all(2), - backgroup: (message?.followed ?? false) - ? Color(0xFFE6E6E6) - : Color(0xFF32A060), - textColor: (message?.followed ?? false) - ? Color(0xFF808080) - : Colors.white, - text: (message?.followed ?? false) ? "已关注" : "回关", - radius:20, - icons: Icon( - (message?.followed ?? false) - ? Icons.check - : Icons.add, - color: (message?.followed?? false) - ? Color(0xFF808080) - : Colors.white, - size: 12, - ), - ) - // 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: (message?.followed ?? false) - // ? Color(0xFFE6E6E6) - // : Color(0xFF32A060), - // ), - // child: Row( - // children: [ - // Icon((message?.followed ?? false) - // ? Icons.check - // : Icons.add, - // color:(message?.followed?? false) - // ? Color(0xFF808080) - // : Colors.white, - // size: 16, - // ), - // Text( - // (message?.followed ?? false) ? "已关注" : "回关", - // style: TextStyle( - // fontSize: 12.sp, - // fontWeight: MyFontWeight.medium, - // color:(message?.followed ?? false) - // ? Color(0xFF808080) - // : 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), - ), - ], - )), - ], - ), - ); + ], + ), + SizedBox( + height: 8.h, + ), + Container( + margin: EdgeInsets.only(top: 16.h, bottom: 16.h), + height: 1.h, + width: double.infinity, + color: Color(0xFFF7F7F7), + ), + ], + )), + ], + ), + ); } ///动态弹窗 @@ -1061,11 +1099,11 @@ class _SystemDetails extends State { child: TextField( maxLines: 8, minLines: 1, - focusNode:commentFocus, - controller:commentTextController, + focusNode: commentFocus, + controller: commentTextController, decoration: InputDecoration( border: InputBorder.none, - hintText:hintText, + hintText: hintText, hintStyle: TextStyle( fontSize: 14.sp, color: Color(0xFF868686), diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index b8631255..48eeff31 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -176,6 +176,7 @@ class _SystemMessagePage extends State { child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( + padding: EdgeInsets.only(bottom: 30.h), child: Column( children: [ Container( diff --git a/pubspec.lock b/pubspec.lock index fd60a0b3..caa771cd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,154 +5,161 @@ packages: dependency: "direct main" description: name: ai_decimal_accuracy - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" android_intent_plus: dependency: "direct main" description: name: android_intent_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.8.2" barcode: dependency: transitive description: name: barcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" barcode_widget: dependency: "direct main" description: name: barcode_widget - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" bubble_tab_indicator: dependency: "direct main" description: name: bubble_tab_indicator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" chewie: dependency: transitive description: name: chewie - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.3" chewie_audio: dependency: "direct main" description: name: chewie_audio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.16.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.2" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" dio: dependency: "direct main" description: name: dio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.10" emoji_picker_flutter: dependency: "direct main" description: name: emoji_picker_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" event_bus: dependency: "direct main" description: name: event_bus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.4" flare_flutter: dependency: "direct main" description: name: flare_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" flutter: @@ -164,56 +171,56 @@ packages: dependency: "direct main" description: name: flutter_baidu_mapapi_base - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.3.0" flutter_baidu_mapapi_map: dependency: "direct main" description: name: flutter_baidu_mapapi_map - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" flutter_baidu_mapapi_search: dependency: "direct main" description: name: flutter_baidu_mapapi_search - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.3.0" flutter_baidu_mapapi_utils: dependency: "direct main" description: name: flutter_baidu_mapapi_utils - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.3.0" flutter_bmflocation: dependency: "direct main" description: name: flutter_bmflocation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.1" + version: "3.3.0" flutter_easyloading: dependency: "direct main" description: name: flutter_easyloading - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.5" flutter_html: dependency: "direct main" description: name: flutter_html - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.6" flutter_localizations: @@ -225,70 +232,70 @@ packages: dependency: transitive description: name: flutter_math_fork - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.2+2" flutter_page_indicator: dependency: transitive description: name: flutter_page_indicator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.7" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0+1" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" flutter_smart_dialog: dependency: "direct main" description: name: flutter_smart_dialog - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.8" + version: "2.1.6" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.0" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.1" flutter_svg: dependency: "direct main" description: name: flutter_svg - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.22.0" flutter_swiper: dependency: "direct main" description: name: flutter_swiper - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.6" flutter_test: @@ -305,385 +312,392 @@ packages: dependency: "direct main" description: name: fluwx - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.9.0+2" + version: "3.12.2" font_awesome_flutter: dependency: "direct main" description: name: font_awesome_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "9.2.0" gradient_widgets: dependency: "direct main" description: name: gradient_widgets - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" image_pickers: dependency: "direct main" description: name: image_pickers - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0+2" + version: "2.0.0+6" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.4" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" keframe: dependency: "direct main" description: name: keframe - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" like_button: dependency: "direct main" description: name: like_button - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" logger: dependency: "direct main" description: name: logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.4" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.7.0" + mqtt_client: + dependency: "direct main" + description: + name: mqtt_client + url: "https://pub.flutter-io.cn" + source: hosted + version: "9.6.8" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" network_to_file_image: dependency: "direct main" description: name: network_to_file_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" number_precision: dependency: "direct main" description: name: number_precision - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2+1" numerus: dependency: transitive description: name: numerus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.1" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.1+1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.7" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.3" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" photo_view: dependency: "direct main" description: name: photo_view - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.0" pin_input_text_field: dependency: "direct main" description: name: pin_input_text_field - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.4" provider: dependency: transitive description: name: provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.4" + version: "6.0.5" pull_to_refresh: dependency: "direct main" description: name: pull_to_refresh - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" qr: dependency: transitive description: name: qr - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" quiver: dependency: transitive description: name: quiver - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.0" + version: "3.2.1" retrofit: dependency: "direct main" description: name: retrofit - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.4+1" rive: dependency: "direct main" description: name: rive - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.8" rxdart: dependency: "direct main" description: name: rxdart - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.26.0" scan: dependency: "direct main" description: name: scan - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.6.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.15" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.14" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.1.2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.1.2" sharesdk_plugin: dependency: "direct main" description: name: sharesdk_plugin - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.5" + version: "1.3.6" simple_gesture_detector: dependency: transitive description: name: simple_gesture_detector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" sky_engine: @@ -695,63 +709,63 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" table_calendar: dependency: "direct main" description: name: table_calendar - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.3" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.9" thumbnails: dependency: "direct main" description: name: thumbnails - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" tobias: dependency: "direct main" description: name: tobias - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" tpns_flutter_plugin: @@ -767,168 +781,168 @@ packages: dependency: transitive description: name: transformer_page_view - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" tuple: dependency: transitive description: name: tuple - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.7.10" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+4" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+9" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.9" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.5+3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+3" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" video_player: dependency: "direct main" description: name: video_player - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.19" video_player_android: dependency: transitive description: name: video_player_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.4" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.7" + version: "2.3.8" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.0" video_player_web: dependency: transitive description: name: video_player_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.12" + version: "2.0.13" wakelock: dependency: transitive description: name: wakelock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.2" wakelock_macos: dependency: transitive description: name: wakelock_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" wakelock_platform_interface: dependency: transitive description: name: wakelock_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" wakelock_web: dependency: transitive description: name: wakelock_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" wakelock_windows: dependency: transitive description: name: wakelock_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" webview_flutter: dependency: transitive description: name: webview_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.14" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.1" + version: "3.1.3" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0+2" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.4.1" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 95525547..23a4247f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.2.0+41 +version: 3.2.3+44 environment: sdk: ">=2.7.0 <3.0.0" @@ -103,6 +103,8 @@ dependencies: emoji_picker_flutter: ^1.4.1 + mqtt_client: ^9.6.8 + dev_dependencies: flutter_test: sdk: flutter From b17eba5f26a93af43ffa9990ccbb63c9c3631cb2 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Tue, 7 Mar 2023 22:59:49 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- .../settlement_order_commodity.dart | 128 ++++++++++-------- lib/utils/flutter_utils.dart | 10 ++ pubspec.yaml | 2 +- 5 files changed, 86 insertions(+), 58 deletions(-) diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 7e9d7012..1308a39d 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 +const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index d0cbdfe8..57d5221c 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8766/app/";///本地 +const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index fa7a2ee1..bd554982 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -21,13 +21,18 @@ class SettlementOrderCommodity extends StatefulWidget { final bool showVipTips; SettlementOrderCommodity( - this.isTakeOut, this.settleOrderInfo, this.minOrderInfo,this.tableId,this.pageType,this.useVipPriceSelect,this.showVipTips); + this.isTakeOut, + this.settleOrderInfo, + this.minOrderInfo, + this.tableId, + this.pageType, + this.useVipPriceSelect, + this.showVipTips); @override State createState() { return _SettlementOrderCommodity(); } - } class _SettlementOrderCommodity extends State { @@ -105,38 +110,47 @@ class _SettlementOrderCommodity extends State { ); } - if(widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (!widget.settleOrderInfo.isRaise) && (widget?.settleOrderInfo?.discountAmount!= "0")){ - widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); + if (widget.useVipPriceSelect && + widget.settleOrderInfo.memberVO.isVip && + (!widget.settleOrderInfo.isRaise) && + (widget?.settleOrderInfo?.discountAmount != "0")) { + widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", + widget?.settleOrderInfo?.discountAmount ?? "")); } - if(widget.showVipTips){ - widgets.add(GestureDetector(child: Container( - alignment: Alignment.centerLeft, - child:Text.rich( - TextSpan( - children: [ - TextSpan( - text: "您未购买回乡VIP卡,无法享受优惠,", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, + if (widget.showVipTips) { + widgets.add(GestureDetector( + child: Container( + alignment: Alignment.centerLeft, + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "您未购买回乡VIP卡,无法享受优惠,", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), ), - ), - TextSpan( - text: "点击立即购买", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFF7A1A), + TextSpan( + text: "点击立即购买", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFF7A1A), + ), ), - ), - ], + ], + ), ), - ),),onTap: (){ - Navigator.of(context) - .pushNamedAndRemoveUntil('/router/main_page', (route) => false,arguments: {"index":2}); - },)); + ), + onTap: () { + Navigator.of(context).pushNamedAndRemoveUntil( + '/router/main_page', (route) => false, + arguments: {"index": 2}); + }, + )); } widgets.add(Container( @@ -154,7 +168,6 @@ class _SettlementOrderCommodity extends State { return widgets; } - Widget commodityItem(OrderProductVOList productList) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), @@ -173,7 +186,7 @@ class _SettlementOrderCommodity extends State { flex: 1, child: Container( margin: EdgeInsets.only( - left:8.w, + left: 8.w, ), // height: 44.h, child: Column( @@ -190,7 +203,9 @@ class _SettlementOrderCommodity extends State { color: Color(0xFF353535), ), ), - SizedBox(height: 4.h,), + SizedBox( + height: 4.h, + ), Text( productList.skuNameStr != null ? "${productList.skuNameStr ?? ""}" @@ -208,7 +223,6 @@ class _SettlementOrderCommodity extends State { color: Color(0xFF727272), ), ), - ], ), ), @@ -218,24 +232,26 @@ class _SettlementOrderCommodity extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), + productList.buyNum > 1 + ? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum)))) + : S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 14.sp, color: Color(0xFF4C4C4C), ), ), - if(productList.discountAmount != null) - Text( - S.of(context).yuan_(productList.sellPrice), - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - decoration: TextDecoration.lineThrough, - color: Color(0xFFA29E9E), - ), - ) + if (productList.discountAmount != null) + Text( + S.of(context).yuan_(productList.sellPrice), + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + fontFamily: 'JDZhengHT', + decoration: TextDecoration.lineThrough, + color: Color(0xFFA29E9E), + ), + ) ], ) ], @@ -403,13 +419,13 @@ class _SettlementOrderCommodity extends State { ); } - String countAllGoods(){ + String countAllGoods() { int count = 0; - if(widget.minOrderInfo != null){ + if (widget.minOrderInfo != null) { widget.minOrderInfo.orderProductVOList.forEach((element) { count += element.buyNum; }); - }else if(widget.settleOrderInfo != null){ + } else if (widget.settleOrderInfo != null) { widget.settleOrderInfo.orderProductList.forEach((element) { count += element.buyNum; }); @@ -450,7 +466,6 @@ class _SettlementOrderCommodity extends State { SizedBox( width: 15.w, ), - Container( child: Text( S.of(context).jiesuanjine, @@ -479,13 +494,16 @@ class _SettlementOrderCommodity extends State { ); } - String discountPrice(){ - if(widget.minOrderInfo != null){ - return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0") + double.tryParse(widget.settleOrderInfo?.benefitDiscountAmount ?? "0")); - }else if(widget.tableId < 0){ + String discountPrice() { + if (widget.minOrderInfo != null) { + return AppUtils.calculateDouble( + double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0") + + double.tryParse( + widget.settleOrderInfo?.benefitDiscountAmount ?? "0")); + } else if (widget.tableId < 0) { return "0"; - }else { - return widget?.settleOrderInfo?.discountAmount ?? "0"; + } else { + return widget?.settleOrderInfo?.discountAmount ?? "0"; } } diff --git a/lib/utils/flutter_utils.dart b/lib/utils/flutter_utils.dart index 4d6b7a61..9d061d16 100644 --- a/lib/utils/flutter_utils.dart +++ b/lib/utils/flutter_utils.dart @@ -17,6 +17,16 @@ class AppUtils { return "${numberFormat.format(mi / 1000)}"; } + ///保留两位小数 + static double stringAsFixedDouble2(double value) { + String valueStr = value.toString(); + if (!valueStr.contains(".")) return value; + if (valueStr.indexOf(".") + 3 >= valueStr.length) + return value; + else + return double.tryParse(valueStr.substring(0, valueStr.indexOf(".") + 3))??0; + } + ///版本号 static bool versionCompare(String localVersion, String serverVersion) { try { diff --git a/pubspec.yaml b/pubspec.yaml index 23a4247f..3bcbe75b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.2.3+44 +version: 3.2.4+45 environment: sdk: ">=2.7.0 <3.0.0" From ee6e0f9724652b25168f253bb18eb4f5efed9824 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 8 Mar 2023 11:35:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=B5=B7=E6=8A=A5=E5=BC=B9=E7=AA=97-?= =?UTF-8?q?=E6=96=B0=E4=BA=BA=E5=BC=B9=E7=AA=97=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/home_page.dart | 33 +++--- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/view_widget/activity_poster.dart | 139 ++++++++++++++----------- lib/view_widget/new_people_reward.dart | 2 +- 5 files changed, 95 insertions(+), 83 deletions(-) diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 8973c95c..a984a42e 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -81,9 +81,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { widget.interviewCouponList != null && widget.interviewCouponList.length > 0) showInvite = true; - if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) - showNew = true; - + //判断新人弹窗 + // if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) + // showNew = true; } @@ -98,19 +98,8 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ); } - ///新用户奖励弹窗 - newShowAlertDialog(newUserCouponList) { - //显示对话框 - showDialog( - context: context, - builder: (BuildContext context) { - return NewPeopleReward(newUserCouponList); - }, - ); - } - ///活动海报弹窗 - posterShowAlertDialog(ActivityPos activityPos) { + posterShowAlertDialog(ActivityPos activityPos,firstLoginCouponList) { var today = DateTime.now().day; SharedPreferences.getInstance().then((value) { if(value.getInt("today")==today && (value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) @@ -121,7 +110,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { showDialog( context: context, builder: (BuildContext context) { - return ActivityPoster(activityPos); + return ActivityPoster(activityPos,firstLoginCouponList); }, ); }); @@ -283,10 +272,12 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { inviteShowAlertDialog(widget.invite, widget.interviewCouponList[0]); showInvite = false; } - if (showNew) { - newShowAlertDialog(widget.firstLoginCouponList); - showNew = false; - } + + //判断新人弹窗 + // if (showNew) { + // newShowAlertDialog(widget.firstLoginCouponList); + // showNew = false; + // } } queryUserBalance() async { @@ -337,7 +328,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { }); if (baseData != null && baseData.isSuccess) { if(baseData.data?.enabled ?? true) - posterShowAlertDialog(baseData.data); + posterShowAlertDialog(baseData.data,widget.firstLoginCouponList); } } diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 1308a39d..f7e60731 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 57d5221c..7b1581b7 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/view_widget/activity_poster.dart b/lib/view_widget/activity_poster.dart index 45b0b334..9500d023 100644 --- a/lib/view_widget/activity_poster.dart +++ b/lib/view_widget/activity_poster.dart @@ -1,17 +1,18 @@ - - import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:huixiang/retrofit/data/activity_pos.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../retrofit/data/login_info.dart'; import 'custom_image.dart'; +import 'new_people_reward.dart'; class ActivityPoster extends StatefulWidget { final ActivityPos activityPos; + final List firstLoginCouponList; - ActivityPoster(this.activityPos); + ActivityPoster(this.activityPos, this.firstLoginCouponList); @override State createState() { @@ -20,58 +21,81 @@ class ActivityPoster extends StatefulWidget { } class _ActivityPoster extends State { + bool showNew = false; + + @override + void initState() { + super.initState(); + if (widget.firstLoginCouponList != null && + widget.firstLoginCouponList.length > 0) showNew = true; + } + @override Widget build(BuildContext context) { - return WillPopScope( + return WillPopScope( onWillPop: () async => false, - child:Container( - width: double.infinity, - alignment: Alignment.center, - margin: EdgeInsets.only( - left:27.w, - right:27.w, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - onTap: (){ - jumpClick(widget.activityPos); - }, - child: - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - ), - child:MImage( - widget?.activityPos?.showImage ?? "", - aspectRatio: 0.75, - fit: BoxFit.cover, - noCompress: true, - radius: BorderRadius.all(Radius.circular(12)), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ),), + child: Container( + width: double.infinity, + alignment: Alignment.center, + margin: EdgeInsets.only( + left: 27.w, + right: 27.w, ), - Container( - margin: EdgeInsets.only(top:35.h,right: 8.w,bottom:8.w), - child:GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: (){ - Navigator.of(context).pop(); + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + jumpClick(widget.activityPos); }, - child: Image.asset( - "assets/image/yq_qx.webp", - width: 40, - height: 40, - fit: BoxFit.cover, - color: Colors.white, - ) - ) ) - ], - ), - )); + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + ), + child: MImage( + widget?.activityPos?.showImage ?? "", + aspectRatio: 0.75, + fit: BoxFit.cover, + noCompress: true, + radius: BorderRadius.all(Radius.circular(12)), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + ), + ), + Container( + margin: EdgeInsets.only(top: 35.h, right: 8.w, bottom: 8.w), + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pop(); + if (showNew) { + newShowAlertDialog(widget.firstLoginCouponList); + showNew = false; + } + }, + child: Image.asset( + "assets/image/yq_qx.webp", + width: 40, + height: 40, + fit: BoxFit.cover, + color: Colors.white, + ))) + ], + ), + )); + } + + ///新用户奖励弹窗 + newShowAlertDialog(newUserCouponList) { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return NewPeopleReward(newUserCouponList); + }, + ); } /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) @@ -82,31 +106,28 @@ class _ActivityPoster extends State { arguments: {"goodsId": widget.activityPos.jumpUrl}); break; case 2: - Navigator.of(context) - .pushNamed('/router/web_page', arguments: { + Navigator.of(context).pushNamed('/router/web_page', arguments: { "activityId": widget.activityPos.jumpUrl, }); break; case 3: - Navigator.of(context) - .pushNamed('/router/web_page', arguments: { + Navigator.of(context).pushNamed('/router/web_page', arguments: { "articleId": widget.activityPos.jumpUrl, }); break; case 4: String router = widget.activityPos.jumpUrl; + // String router = "/router/store_order?{\"id\":\"1333246101343436800\",\"tenant\":\"1175\",\"storeName\":\"海峡姐妹茶(汉街店)\"}"; if (router.contains("?")) { - String params = router.substring(router.indexOf("?")); - params = params.replaceAll("?", ""); + String params = router.substring(router.indexOf("?")+1); Map map = jsonDecode(params); - Navigator.of(context).pushNamed(router, arguments: map); + Navigator.of(context).pushNamed(router.substring(0,router.indexOf("?")), arguments: map); } else { Navigator.of(context).pushNamed(router); } break; case 5: - Navigator.of(context) - .pushNamed('/router/class_details', arguments: { + Navigator.of(context).pushNamed('/router/class_details', arguments: { "id": widget.activityPos.jumpUrl, }); break; diff --git a/lib/view_widget/new_people_reward.dart b/lib/view_widget/new_people_reward.dart index 7acf376d..ad29fd59 100644 --- a/lib/view_widget/new_people_reward.dart +++ b/lib/view_widget/new_people_reward.dart @@ -42,7 +42,7 @@ class _NewPeopleReward extends State { GestureDetector( onTap: () { Navigator.of(context).pop(); - SmartDialog.showToast("领取成功"); + SmartDialog.showToast("领取成功",alignment: Alignment.center); }, child: Container( margin: EdgeInsets.only( From 07654c9b423ebb37982fd7199920846079ae95ec Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 15 Mar 2023 14:38:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1.=E5=AE=9A=E4=BD=8D=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=EF=BC=9B=202.=E7=81=AB=E9=94=85=E5=BA=97?= =?UTF-8?q?=E5=A5=97=E9=A4=90=E4=B8=8B=E5=8D=95=E6=9B=B4=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=203.=E7=81=AB=E9=94=85=E4=B8=8B=E5=8D=95vip=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=EF=BC=9B=204.=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E9=94=AE=E7=9B=98=E4=BC=98=E5=8C=96=EF=BC=9B=205.?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main_page.dart | 1 + lib/mine/mine_page.dart | 43 +++--- lib/order/order_detail_page.dart | 6 +- lib/order/order_history_page.dart | 5 +- lib/retrofit/data/order_product_vo.dart | 9 ++ lib/retrofit/data/shoppingCart.dart | 132 +++++++++--------- lib/settlement/settlement.dart | 9 +- .../activity_coupon_remarks.dart | 2 +- lib/union/location_map_page.dart | 3 +- lib/union/union_list.dart | 1 + lib/utils/location.dart | 62 ++++++++ lib/view_widget/new_coupon_widget.dart | 5 +- pubspec.yaml | 2 +- 13 files changed, 189 insertions(+), 91 deletions(-) diff --git a/lib/main_page.dart b/lib/main_page.dart index 331f2662..85b3f8e2 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -161,6 +161,7 @@ class _MainPage extends State with WidgetsBindingObserver { queryUserInfo(); + ///App自动更新 appAutoUpdate(); } final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 04157479..51996486 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -78,6 +78,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { super.initState(); querySocialInfo(); queryMsgStats(); + queryCoupon(); // queryCard(); eventBus.on().listen((event) { @@ -118,22 +119,6 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ranks.addAll(rankData.data); } - BaseData> baseData = await apiService.queryCard({ - "centre": true, - "pageNum": 1, - "pageSize": 10, - "searchKey": "", - "state": 1 - }).catchError((error) { - _refreshController.refreshFailed(); - }); - if (baseData != null && baseData.isSuccess) { - couponNum = baseData.data.total; - _refreshController.refreshCompleted(); - } else { - _refreshController.refreshFailed(); - } - BaseData baseDate = await apiService.queryInfo().catchError((onError) { _refreshController.refreshFailed(); @@ -152,8 +137,34 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { // EasyLoading.dismiss(); } + queryCoupon()async{ + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + showLoading: false, + ); + BaseData> baseData = await apiService.queryCard({ + "centre": true, + "pageNum": 1, + "pageSize": 10, + "searchKey": "", + "state": 1 + }).catchError((error) { + _refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + couponNum = baseData.data.total; + _refreshController.refreshCompleted(); + } else { + _refreshController.refreshFailed(); + } + } + _onRefresh() { // queryUserInfo(); + queryCoupon(); querySocialInfo(); queryMsgStats(); } diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index db277842..b12aefda 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -119,6 +119,8 @@ class _OrderDetailPage extends State { setState(() { statusTitle(); }); + }else{ + SmartDialog.showToast(baseData.msg,alignment: Alignment.center); } } @@ -172,7 +174,7 @@ class _OrderDetailPage extends State { ), ///订单取货地址,或, 收货地址 - if(orderInfo != null) + if(orderInfo != null && orderInfo.addressExt != null) OrderAddress( orderStatus, isTakeOut, @@ -521,6 +523,8 @@ class _OrderDetailPage extends State { // Future.delayed(Duration(milliseconds:450), () { queryDetails(); // }); + }else{ + SmartDialog.showToast(baseData.msg,alignment: Alignment.center); } } diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 84d4ac59..c65f5708 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -364,7 +364,7 @@ class _OrderHistoryList extends State ], ), Container( - margin: EdgeInsets.only(left: 12.w), + margin: EdgeInsets.only(left: 12.w,top:3.h), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -614,6 +614,9 @@ class _OrderHistoryList extends State if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("订单取消成功"); _onRefresh(); + }else{ + if(baseData.msg != null) + SmartDialog.showToast(baseData.msg,alignment: Alignment.center); } } diff --git a/lib/retrofit/data/order_product_vo.dart b/lib/retrofit/data/order_product_vo.dart index bb4c5b53..b0c75db1 100644 --- a/lib/retrofit/data/order_product_vo.dart +++ b/lib/retrofit/data/order_product_vo.dart @@ -1,3 +1,5 @@ +import 'package:huixiang/retrofit/data/shoppingCart.dart'; + class OrderProductVOList { OrderProductVOList({ ActInfo actInfo, @@ -17,6 +19,7 @@ class OrderProductVOList { String skuId, String skuImg, String skuNameStr, + List setMealDataList }) { this.actInfo = actInfo; this.additionalComment = additionalComment; @@ -35,6 +38,7 @@ class OrderProductVOList { this.skuId = skuId; this.skuImg = skuImg; this.skuNameStr = skuNameStr; + this.setMealDataList = setMealDataList; } OrderProductVOList.fromJson(dynamic json) { @@ -59,6 +63,9 @@ class OrderProductVOList { this.skuId = json['skuId']; this.skuImg = json['skuImg']; this.skuNameStr = json['skuNameStr']; + this.setMealDataList = []..addAll( + (json['setMealDataList'] as List ?? []) + .map((o) => SetMealDataList.fromJson(o))); } ActInfo actInfo; @@ -78,6 +85,7 @@ class OrderProductVOList { String skuId; String skuImg; String skuNameStr; + List setMealDataList; Map toJson() { @@ -105,6 +113,7 @@ class OrderProductVOList { map['skuId'] = this.skuId; map['skuImg'] = this.skuImg; map['skuNameStr'] = this.skuNameStr; + map['setMealDataList']=this.setMealDataList; return map; } diff --git a/lib/retrofit/data/shoppingCart.dart b/lib/retrofit/data/shoppingCart.dart index 2322df3c..489fd961 100644 --- a/lib/retrofit/data/shoppingCart.dart +++ b/lib/retrofit/data/shoppingCart.dart @@ -18,8 +18,8 @@ class ShoppingCart { int selectDiscount; String storeName; String tableId; - List promotionInfoList; - List couponList; + List promotionInfoList; + List couponList; static ShoppingCart fromJson(Map map) { if (map == null) return null; @@ -35,10 +35,10 @@ class ShoppingCart { shoppingCartBean.selectDiscount = map['selectDiscount']; shoppingCartBean.tableId = map['tableId']; shoppingCartBean.promotionInfoList = List()..addAll( - (map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBean.fromJson(o)) + (map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBeans.fromJson(o)) ); shoppingCartBean.couponList = List()..addAll( - (map['couponList'] as List ?? []).map((o) => CouponListBean.fromJson(o)) + (map['couponList'] as List ?? []).map((o) => CouponListBeans.fromJson(o)) ); return shoppingCartBean; } @@ -308,7 +308,7 @@ class ProductInfoList { /// isMaxPromotion : true /// promotionProuctList : null -class PromotionInfoListBean { +class PromotionInfoListBeans { String id; String createTime; String createUser; @@ -339,43 +339,43 @@ class PromotionInfoListBean { bool isMaxPromotion; dynamic promotionProuctList; - static PromotionInfoListBean fromJson(Map map) { + static PromotionInfoListBeans fromJson(Map map) { if (map == null) return null; - PromotionInfoListBean promotionInfoListBean = PromotionInfoListBean(); - promotionInfoListBean.id = map['id']; - promotionInfoListBean.createTime = map['createTime']; - promotionInfoListBean.createUser = map['createUser']; - promotionInfoListBean.updateTime = map['updateTime']; - promotionInfoListBean.updateUser = map['updateUser']; - promotionInfoListBean.storeId = map['storeId']; - promotionInfoListBean.name = map['name']; - promotionInfoListBean.image = map['image']; - promotionInfoListBean.description = map['description']; - promotionInfoListBean.status = map['status']; - promotionInfoListBean.applyStartTime = map['applyStartTime']; - promotionInfoListBean.applyEndTime = map['applyEndTime']; - promotionInfoListBean.activityStartTime = map['activityStartTime']; - promotionInfoListBean.activityEndTime = map['activityEndTime']; - promotionInfoListBean.doStartTime = map['doStartTime']; - promotionInfoListBean.doEndTime = map['doEndTime']; - promotionInfoListBean.isNeedSecurityDeposit = map['isNeedSecurityDeposit']; - promotionInfoListBean.securityDeposit = map['securityDeposit']; - promotionInfoListBean.tag = map['tag']; - promotionInfoListBean.promotionType = map['promotionType']; - promotionInfoListBean.promotionPlan = map['promotionPlan']; - promotionInfoListBean.promotionDetail = List()..addAll( + PromotionInfoListBeans promotionInfoListBeans = PromotionInfoListBeans(); + promotionInfoListBeans.id = map['id']; + promotionInfoListBeans.createTime = map['createTime']; + promotionInfoListBeans.createUser = map['createUser']; + promotionInfoListBeans.updateTime = map['updateTime']; + promotionInfoListBeans.updateUser = map['updateUser']; + promotionInfoListBeans.storeId = map['storeId']; + promotionInfoListBeans.name = map['name']; + promotionInfoListBeans.image = map['image']; + promotionInfoListBeans.description = map['description']; + promotionInfoListBeans.status = map['status']; + promotionInfoListBeans.applyStartTime = map['applyStartTime']; + promotionInfoListBeans.applyEndTime = map['applyEndTime']; + promotionInfoListBeans.activityStartTime = map['activityStartTime']; + promotionInfoListBeans.activityEndTime = map['activityEndTime']; + promotionInfoListBeans.doStartTime = map['doStartTime']; + promotionInfoListBeans.doEndTime = map['doEndTime']; + promotionInfoListBeans.isNeedSecurityDeposit = map['isNeedSecurityDeposit']; + promotionInfoListBeans.securityDeposit = map['securityDeposit']; + promotionInfoListBeans.tag = map['tag']; + promotionInfoListBeans.promotionType = map['promotionType']; + promotionInfoListBeans.promotionPlan = map['promotionPlan']; + promotionInfoListBeans.promotionDetail = List()..addAll( (map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o)) ); - promotionInfoListBean.channels = List()..addAll( + promotionInfoListBeans.channels = List()..addAll( (map['channels'] as List ?? []).map((o) => o.toString()) ); - promotionInfoListBean.isVip = map['isVip']; - promotionInfoListBean.isDelete = map['isDelete']; - promotionInfoListBean.tenantCode = map['tenantCode']; - promotionInfoListBean.canPartake = map['canPartake']; - promotionInfoListBean.isMaxPromotion = map['isMaxPromotion']; - promotionInfoListBean.promotionProuctList = map['promotionProuctList']; - return promotionInfoListBean; + promotionInfoListBeans.isVip = map['isVip']; + promotionInfoListBeans.isDelete = map['isDelete']; + promotionInfoListBeans.tenantCode = map['tenantCode']; + promotionInfoListBeans.canPartake = map['canPartake']; + promotionInfoListBeans.isMaxPromotion = map['isMaxPromotion']; + promotionInfoListBeans.promotionProuctList = map['promotionProuctList']; + return promotionInfoListBeans; } Map toJson() => { @@ -437,7 +437,7 @@ class PromotionInfoListBean { /// isMaxCoupon:true /// productList : null -class CouponListBean { +class CouponListBeans { String id; String storeId; int bizType; @@ -466,35 +466,35 @@ class CouponListBean { bool isEx; - static CouponListBean fromJson(Map map) { + static CouponListBeans fromJson(Map map) { if (map == null) return null; - CouponListBean couponListBean = CouponListBean(); - couponListBean.id = map['id']; - couponListBean.storeId = map['storeId']; - couponListBean.bizType = map['bizType']; - couponListBean.fullAmount = map['fullAmount']; - couponListBean.discountAmount = map['discountAmount']; - couponListBean.fullNumber = map['fullNumber']; - couponListBean.discountPercent = map['discountPercent']; - couponListBean.bizId = map['bizId']; - couponListBean.publishStartTime = map['publishStartTime']; - couponListBean.publishEndTime = map['publishEndTime']; - couponListBean.useStartTime = map['useStartTime']; - couponListBean.useEndTime = map['useEndTime']; - couponListBean.promotionId = map['promotionId']; - couponListBean.mid = map['mid']; - couponListBean.couponId = map['couponId']; - couponListBean.receiveTime = map['receiveTime']; - couponListBean.useTime = map['useTime']; - couponListBean.status = map['status']; - couponListBean.tenantCode = map['tenantCode']; - couponListBean.type = map['type']; - couponListBean.promotionName = map['promotionName']; - couponListBean.usable = map['usable']; - couponListBean.allProduct = map['allProduct']; - couponListBean.isMaxCoupon = map['isMaxCoupon']; - couponListBean.productList = map['productList']; - return couponListBean; + CouponListBeans couponListBeans = CouponListBeans(); + couponListBeans.id = map['id']; + couponListBeans.storeId = map['storeId']; + couponListBeans.bizType = map['bizType']; + couponListBeans.fullAmount = map['fullAmount']; + couponListBeans.discountAmount = map['discountAmount']; + couponListBeans.fullNumber = map['fullNumber']; + couponListBeans.discountPercent = map['discountPercent']; + couponListBeans.bizId = map['bizId']; + couponListBeans.publishStartTime = map['publishStartTime']; + couponListBeans.publishEndTime = map['publishEndTime']; + couponListBeans.useStartTime = map['useStartTime']; + couponListBeans.useEndTime = map['useEndTime']; + couponListBeans.promotionId = map['promotionId']; + couponListBeans.mid = map['mid']; + couponListBeans.couponId = map['couponId']; + couponListBeans.receiveTime = map['receiveTime']; + couponListBeans.useTime = map['useTime']; + couponListBeans.status = map['status']; + couponListBeans.tenantCode = map['tenantCode']; + couponListBeans.type = map['type']; + couponListBeans.promotionName = map['promotionName']; + couponListBeans.usable = map['usable']; + couponListBeans.allProduct = map['allProduct']; + couponListBeans.isMaxCoupon = map['isMaxCoupon']; + couponListBeans.productList = map['productList']; + return couponListBeans; } Map toJson() => { diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index c6f656fd..23f86df5 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -33,11 +33,10 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/round_button.dart'; -import 'package:huixiang/view_widget/tips_dialog.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 '../retrofit/data/shoppingCart.dart'; import '../view_widget/settlement_tips_dialog.dart'; class Settlement extends StatefulWidget { @@ -85,6 +84,7 @@ class _Settlement extends State { bool useVipPriceSelect = true; bool showVipTips = false; bool isRaiseChannel = false; + ShoppingCart shopCarGoods; @override void initState() { @@ -107,6 +107,8 @@ class _Settlement extends State { productSkuId = widget.arguments["productSkuId"]; count1 = widget.arguments["buyNum"]; productId = widget.arguments["productId"]; + shopCarGoods = widget.arguments["shoppingCart"]; + if (tableId == 0) { placeOrder = true; } @@ -516,6 +518,9 @@ class _Settlement extends State { placeOrderFirst.storeId = storeInfo.id; placeOrderFirst.subcribeTime = null; placeOrderFirst.tableId = "$tableId"; + for(int i = 0;i { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false)) + if( !(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && widget.placeOrder) Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/union/location_map_page.dart b/lib/union/location_map_page.dart index 0f37fd49..cdc28cea 100644 --- a/lib/union/location_map_page.dart +++ b/lib/union/location_map_page.dart @@ -76,7 +76,8 @@ class _LocationMap extends State { leadingColor: Colors.black, ), body: Container( - child: BMFMapWidget( + //BMFMapWidget 组件会自动默认沾满全屏,并且挡住所有遮盖物 ,BMFTextureMapWidget不会强制遮盖其他控件。 + child: BMFTextureMapWidget( mapOptions: BMFMapOptions( center: BMFCoordinate( double.tryParse(widget.arguments["lat"]), diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index ee005ff7..a7d6c822 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -121,6 +121,7 @@ class _UnionList extends State { child: TextField( textInputAction: TextInputAction.search, onEditingComplete: () { + FocusScope.of(context).requestFocus(FocusNode()); widget.queryStore(editingController.text); }, controller: editingController, diff --git a/lib/utils/location.dart b/lib/utils/location.dart index 5dfa092b..f678878c 100644 --- a/lib/utils/location.dart +++ b/lib/utils/location.dart @@ -2,11 +2,15 @@ import 'dart:io'; import 'package:android_intent_plus/android_intent.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_bmflocation/flutter_bmflocation.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'font_weight.dart'; + BaiduLocationAndroidOption initAndroidOptions() { BaiduLocationAndroidOption options = BaiduLocationAndroidOption( @@ -99,14 +103,18 @@ class Location { } return true; } else if (await Permission.location.isUndetermined) { + showAlertDialog(context); await Permission.location.request(); + Navigator.of(context).pop(); return false; } else { if (Platform.isIOS) { //去设置中心 requestDialog(context, locationCallback); } else { + showAlertDialog(context); await Permission.location.request(); + Navigator.of(context).pop(); } return false; } @@ -162,4 +170,58 @@ class Location { }, ); } + + ///定位权限说明弹窗 + showAlertDialog(context) { + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return SimpleDialog( + titlePadding: EdgeInsets.all(10), + backgroundColor: Colors.transparent, + elevation: 0, + alignment: Alignment.topCenter, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + children: [ + Container( + width: double.infinity, + height: 120.h, + padding: EdgeInsets.all(16), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "访问精确地理位置信息权限说明", + style: TextStyle( + fontSize: 15.sp, + fontWeight:MyFontWeight.regular, + color: Colors.black, + ), + ), + SizedBox(height: 3.h,), + Text( + "为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。", + style: TextStyle( + fontSize: 13.sp, + height: 1.3.h, + fontWeight:MyFontWeight.regular, + color: Colors.black, + ), + ), + ], + ), + ), + ], + ); + }, + ); + } + } diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index aa1b0b78..bd3cbc32 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -43,7 +43,7 @@ class NewCouponWidget extends StatelessWidget { // } return Container( - height: (coupon != null && coupon.isEx) ? 155.h : 135.h, + height: (coupon != null && coupon.isEx) ? 160.h : 140.h, width: double.infinity, margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), padding: EdgeInsets.only(right: 5), @@ -83,11 +83,12 @@ class NewCouponWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "券名称:${coupon != null ? coupon.couponName ?? "" : ""}", + "${coupon != null ? coupon.couponName ?? "" : ""}", maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 15.sp, + height: 1.2.h, fontWeight: MyFontWeight.semi_bold, color: Color(0xFF0D0D0D), ), diff --git a/pubspec.yaml b/pubspec.yaml index 3bcbe75b..fd79f61e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.2.4+45 +version: 3.2.4+48 environment: sdk: ">=2.7.0 <3.0.0"