From 1cc6aaf56e5a949089c8a8a37c166b95d7a4986d Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 26 Dec 2022 15:11:04 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=EF=BC=9B=202.=E4=BC=98=E5=8C=96=E6=96=87=E6=9C=AC?= =?UTF-8?q?=EF=BC=9B=203.=E6=9B=B4=E6=94=B9=E5=8A=A8=E6=80=81=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=9F=A5=E7=9C=8B=E8=83=8C=E6=99=AF=EF=BC=9B=204.?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=88=97=E8=A1=A8"..."=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=8C=83=E5=9B=B4=EF=BC=9B=205.=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=AF=84=E8=AE=BA=E9=94=AE=E7=9B=98=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=8F=91=E9=80=81=E4=BA=8B=E4=BB=B6=EF=BC=9B=206.=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E7=82=B9=E8=B5=9E?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/base_state.dart | 21 +- lib/community/community_child_page.dart | 7 + .../community_view/class_details.dart | 515 +++++++++--------- .../community_view/community_dynamic.dart | 408 ++++++++------ lib/community/photo_view_gallery_screen.dart | 72 +-- lib/generated/intl/messages_en.dart | 6 + lib/generated/intl/messages_en_US.dart | 10 +- lib/generated/intl/messages_zh_CN.dart | 6 + lib/generated/intl/messages_zh_Hans_CN.dart | 6 + lib/generated/intl/messages_zh_Hant_CN.dart | 8 +- lib/generated/intl/messages_zh_TW.dart | 6 + lib/generated/l10n.dart | 60 ++ lib/home/home_page.dart | 163 +++--- lib/home/welfare_exchange.dart | 86 +-- lib/l10n/intl_en.arb | 9 + lib/l10n/intl_en_US.arb | 8 + lib/l10n/intl_zh_CN.arb | 8 + lib/l10n/intl_zh_Hans_CN.arb | 8 + lib/l10n/intl_zh_Hant_CN.arb | 8 + lib/l10n/intl_zh_TW.arb | 8 + lib/login/new_login_page.dart | 59 +- lib/main_page.dart | 2 +- lib/mine/mine_page.dart | 111 ++-- lib/mine/mine_view/mine_view.dart | 2 +- lib/mine/personal_page.dart | 100 ++-- lib/mine/recharge_page.dart | 62 +-- lib/mine/user_info_page.dart | 103 ++-- lib/retrofit/data/settleOrderInfo.dart | 8 + lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/settlement/settlement.dart | 417 +++++++------- lib/union/union_page.dart | 2 + lib/view_widget/activity_coupons.dart | 4 +- lib/view_widget/coupon_details_dialog.dart | 2 +- lib/view_widget/cupertino_date_picker.dart | 2 +- lib/view_widget/new_coupon_widget.dart | 4 +- lib/view_widget/pay_selected_dialog.dart | 4 +- lib/view_widget/receiving_method_dialog.dart | 2 +- lib/view_widget/update_dialog.dart | 117 ++-- lib/view_widget/vip_dialog.dart | 4 +- lib/vip/user_vip_service_page.dart | 2 +- lib/vip/vip_view/vip_top.dart | 252 +++++---- lib/web/web_turntable_activity.dart | 2 - lib/web/web_view/input_comment.dart | 8 + pubspec.yaml | 2 +- 45 files changed, 1506 insertions(+), 1192 deletions(-) diff --git a/lib/base_state.dart b/lib/base_state.dart index 8d293697..8262544f 100644 --- a/lib/base_state.dart +++ b/lib/base_state.dart @@ -1,12 +1,11 @@ - import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:huixiang/utils/bridge.dart'; import 'package:shared_preferences/shared_preferences.dart'; -abstract class BaseState extends State with WidgetsBindingObserver { - +abstract class BaseState extends State + with WidgetsBindingObserver { @override void dispose() { super.dispose(); @@ -71,6 +70,18 @@ abstract class BaseState extends State with Widgets routeName = "/router/order_details"; params["id"] = pushMap["info"]; break; + case 6: + routeName = "/router/community_details"; + params["businessId"] = pushMap["info"]; + break; + case 8: + routeName = "/router/mine_wallet"; + params["id"] = pushMap["info"]; + break; + case 9: + routeName = "/router/welfare_page"; + params["id"] = pushMap["info"]; + break; } sharedPreferences.setString("pushData", ""); print("xgPushClickAction: routeName: $routeName"); @@ -79,6 +90,4 @@ abstract class BaseState extends State with Widgets } } } - - -} \ No newline at end of file +} diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index b154c9d4..37018099 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -15,6 +16,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../utils/flutter_utils.dart'; + class CommunityChildPage extends StatefulWidget { final String typeStr; final Function onScroll; @@ -84,6 +87,8 @@ class CommunityChildPageState extends State "pageSize": 10, "searchKey": searchKey ?? "" }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); if (searchKey == null) { refreshController.refreshFailed(); refreshController.loadFailed(); @@ -101,6 +106,7 @@ class CommunityChildPageState extends State element.content = jsonEncode(baseData.data.list[0].subjectInfo); element.mainTitle = baseData.data.list[0].subject; element.followed = baseData.data.list[0].selfFollow; + element.liked = baseData.data.list[0].selfLike; element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar; element.authorName = baseData.data.list[0].memberInfo?.nickname; element.location = baseData.data.list[0].location; @@ -123,6 +129,7 @@ class CommunityChildPageState extends State article.content = jsonEncode(element.subjectInfo); article.mainTitle = element.subject; article.followed = element.selfFollow; + article.liked = element.selfLike; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; article.location = element.location; diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index e1632f2d..d7058800 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -131,277 +131,298 @@ class _ClassDetails extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { return AnnotatedRegion( - value: SystemUiOverlayStyle.light, - child: Material(child: Scaffold( - body: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - FocusScope.of(context).requestFocus(FocusNode()); - }, - child:Container( - // margin: EdgeInsets.only(top:25), - child: Column( - children: [ - Expanded( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - Container( - child:Stack( + value: SystemUiOverlayStyle.light, + child: Material( + child: Scaffold( + body: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Container( + // margin: EdgeInsets.only(top:25), + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( children: [ - ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});}, - coverImg: chapterList.length > chapterIndex - ? chapterList[chapterIndex].content.coverImg - : "",isShowImg: this.isShowImg, - changeShowImg: (isShowImg){setState(() { - this.isShowImg = isShowImg; - });},heightFun: (height) { - this.height = height + - MediaQuery - .of(context) - .padding - .top + - kToolbarHeight + - 24; - if (mounted) setState(() {}); - },), Container( - margin: EdgeInsets.only( - top: 40.h, left: 16.w, right: 16.w), - decoration: BoxDecoration( - color: Colors.transparent, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Stack( children: [ - GestureDetector( - child: Image.asset( - "assets/image/integral_return.webp", - width: 24, - height: 24, - ), - onTap: () { - Navigator.of(context).pop( - course != null ? course.viewers + 1 : 0); + ClassDetailsVideo( + key: videoKey, + exitFull: () { + setState(() {}); + }, + coverImg: + chapterList.length > chapterIndex + ? chapterList[chapterIndex] + .content + .coverImg + : "", + isShowImg: this.isShowImg, + changeShowImg: (isShowImg) { + setState(() { + this.isShowImg = isShowImg; + }); + }, + heightFun: (height) { + this.height = height + + MediaQuery.of(context).padding.top + + kToolbarHeight + + 24; + if (mounted) setState(() {}); }, ), - ], - ), - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(bottom: 16.h), - padding: EdgeInsets.only(left: 16, top: 16, right: 10), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - // height: 22.h, - padding:EdgeInsets.only(left:2,right:2), - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - border: Border.all( - width: 1, - color: Color(0xFFFF7A1A), - style: BorderStyle.solid, - ), - ), - child: Text( - (course?.tags != null && - course.tags.length > 0) - ? course.tags[0] - : "", - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFFF7A1A), + Container( + margin: EdgeInsets.only( + top: 40.h, left: 16.w, right: 16.w), + decoration: BoxDecoration( + color: Colors.transparent, ), - ), - ), - SizedBox( - width: 6.w, - ), - Expanded( - child: Text( - course != null ? course.subject : "", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF1A1A1A), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.webp", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop( + course != null + ? course.viewers + 1 + : 0); + }, + ), + ], ), ), - flex: 1, - ), - // GestureDetector( - // onTap: () { - // share(); - // }, - // child: Icon( - // Icons.share, - // size: 24, - // color: Colors.black, - // ), - // ), - // SizedBox(width: 15.w,), - ], - ), - SizedBox( - height: 10.h, + ], + ), ), - Padding( - padding: EdgeInsets.only(right: 16), - child: Row( + Container( + margin: EdgeInsets.only(bottom: 16.h), + padding: EdgeInsets.only( + left: 16, top: 16, right: 10), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Text( - "${S.of(context).jiangshi}:${course != null ? course.author.name : ""}", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, + Row( + children: [ + Container( + // height: 22.h, + padding: EdgeInsets.only( + left: 2, right: 2), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(2), + border: Border.all( + width: 1, + color: Color(0xFFFF7A1A), + style: BorderStyle.solid, + ), ), - )), - Text( - "${S.of(context).bofangcishu}:", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), + child: Text( + (course?.tags != null && + course.tags.length > 0) + ? course.tags[0] + : "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFFF7A1A), + ), + ), + ), + SizedBox( + width: 6.w, + ), + Expanded( + child: Text( + course != null + ? course.subject + : "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + color: Color(0xFF1A1A1A), + ), + ), + flex: 1, + ), + // GestureDetector( + // onTap: () { + // share(); + // }, + // child: Icon( + // Icons.share, + // size: 24, + // color: Colors.black, + // ), + // ), + // SizedBox(width: 15.w,), + ], + ), + SizedBox( + height: 10.h, + ), + Padding( + padding: EdgeInsets.only(right: 16), + child: Row( + children: [ + Expanded( + child: Text( + "${S.of(context).jiangshi}:${course != null ? course.author.name : ""}", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + )), + Text( + "${S.of(context).bofangcishu}:", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + ), + SizedBox( + width: 4, + ), + Text( + course != null + ? course.viewers.toString() + : "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + ), + ], ), ), SizedBox( - width: 4, + height: 10.h, ), Text( - course != null - ? course.viewers.toString() - : "", - overflow: TextOverflow.ellipsis, - maxLines: 2, + course != null ? course.introduce : "", + overflow: isShowMore + ? TextOverflow.visible + : TextOverflow.ellipsis, + maxLines: isShowMore ? 10 : 2, style: TextStyle( fontSize: 12.sp, + height: 1.2.h, fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), + color: Colors.black, ), ), + SizedBox(height: 3.h), + GestureDetector( + onTap: () { + setState(() { + isShowMore = !isShowMore; + }); + }, + child: Align( + alignment: Alignment.center, + child: Icon( + (isShowMore != null && !isShowMore) + ? Icons.keyboard_arrow_down + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 24, + ), + ), + ), + SizedBox(height: 3.h), ], ), ), - SizedBox( - height: 10.h, - ), - Text( - course != null ? course.introduce : "", - overflow: isShowMore - ? TextOverflow.visible - : TextOverflow.ellipsis, - maxLines: isShowMore ? 10 : 2, - style: TextStyle( - fontSize: 12.sp, - height: 1.2.h, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), - ), - SizedBox(height: 3.h), - GestureDetector( - onTap: () { + anthology(), + CommentList( + commentKey, + course?.likes ?? course?.likes ?? 0, + widget.arguments["id"], + 3, + isKeyBoardShow, + _reply, + _delCommentTips, + 12.sp, + requestApiFinish: (total) { setState(() { - isShowMore = !isShowMore; + commentTotal = total; }); }, - child:Align( - alignment: Alignment.center, - child: Icon( - (isShowMore != null && !isShowMore) - ? Icons.keyboard_arrow_down - : Icons.keyboard_arrow_up, - color: Colors.black, - size: 24, + ), + if (commentTotal == 0) + Container( + width: double.infinity, + alignment: Alignment.topCenter, + margin: EdgeInsets.only(top: 40), + padding: EdgeInsets.all(22.h), + child: Text( + S.of(context).zanwupinglun, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Color(0xFFA0A0A0), + ), ), ), - ), - SizedBox(height: 3.h), ], ), ), - anthology(), - CommentList( - commentKey, - course?.likes ?? course?.likes ?? 0, - widget.arguments["id"], - 3, - isKeyBoardShow, - _reply, - _delCommentTips, - 12.sp, - requestApiFinish: (total) { - setState(() { - commentTotal = total; - }); - }, - ), - if (commentTotal == 0) - Container( - width: double.infinity, - alignment: Alignment.topCenter, - margin: EdgeInsets.only(top: 40), - padding: EdgeInsets.all(22.h), - child: Text( - S.of(context).zanwupinglun, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.bold, - color: Color(0xFFA0A0A0), - ), - ), - ), - ], - ), + flex: 1, + ), + + /// 富文本评论的输入框 + InputComment( + inputKey, + hintText, + isKeyBoardShow, + commentFocus, + commentTextController, + _toComment, + _queryMemberComment, + _queryCourseLikes, + isLike: course?.selfLiked, + ), + ], ), - flex: 1, - ), - /// 富文本评论的输入框 - InputComment( - inputKey, - hintText, - isKeyBoardShow, - commentFocus, - commentTextController, - _toComment, - _queryMemberComment, - _queryCourseLikes, - isLike: course?.selfLiked, - ), - ], - ), - )), - ),) - ); + )), + ), + )); } Widget anthology() { @@ -563,16 +584,16 @@ class _ClassDetails extends State with WidgetsBindingObserver { share() async { SSDKMap params = SSDKMap() ..setGeneral( - course.subject != null - ? course.subject - : "", + course.subject != null ? course.subject : "", course != null ? course.introduce : "", [ chapterList[chapterIndex].content.coverImg != null - ? chapterList[chapterIndex].content.coverImg:"", + ? chapterList[chapterIndex].content.coverImg + : "", ], chapterList[chapterIndex].content.fileUrl != null - ? chapterList[chapterIndex].content.fileUrl:"", + ? chapterList[chapterIndex].content.fileUrl + : "", "", buildShareUrl(), "", @@ -590,12 +611,12 @@ class _ClassDetails extends State with WidgetsBindingObserver { if (platform == ShareSDKPlatforms.line) { params.map["type"] = SSDKContentTypes.text.value; params.map["text"] = - "${course.subject ?? ""} ${buildShareUrl()}"; + "${course.subject ?? ""} ${buildShareUrl()}"; } SharesdkPlugin.share(platform, params, - (state, userData, contentEntity, error) { - print("share!$state"); - }); + (state, userData, contentEntity, error) { + print("share!$state"); + }); }); }); } diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 22260e31..2e31ffc9 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -37,7 +37,7 @@ class CommunityDynamic extends StatefulWidget { CommunityDynamic( this.article, - this.commentType, { + this.commentType,{ Key key, this.itemCount = 9, this.heightFun, @@ -149,11 +149,28 @@ class _CommunityDynamic extends State { } } - goPersonalPage()async{ - await Navigator.of(context) - .pushNamed('/router/personal_page', arguments: { - "memberId": - (widget.article.author == widget.userId) + ///给文章/活动点赞 + _queryInformationLikes(isLikes) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService + .informationLikes(widget.article.id) + .catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + widget.exitFull(); + setState(() {}); + } + } + + goPersonalPage() async { + await Navigator.of(context).pushNamed('/router/personal_page', arguments: { + "memberId": (widget.article.author == widget.userId) ? "0" : widget.article.author, }); @@ -168,7 +185,7 @@ class _CommunityDynamic extends State { margin: EdgeInsets.only(top: 2.h), key: globalKey, alignment: Alignment.topCenter, - padding: EdgeInsets.only(left: 16.w,top: 16.h,right: 16.w), + padding: EdgeInsets.only(left: 16.w, top: 16.h, right: 16.w), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -228,7 +245,10 @@ class _CommunityDynamic extends State { Text( widget?.article?.authorName ?? "", style: TextStyle( - fontSize: MediaQuery.of(context).size.width >= 650 ? 12.sp :15.sp, + fontSize: + MediaQuery.of(context).size.width >= 650 + ? 12.sp + : 15.sp, fontWeight: MyFontWeight.semi_bold, color: Color(0xFF1A1A1A), ), @@ -236,7 +256,10 @@ class _CommunityDynamic extends State { Text( widget?.article?.createTime ?? "", style: TextStyle( - fontSize: MediaQuery.of(context).size.width >= 650 ? 10.sp :13.sp, + fontSize: + MediaQuery.of(context).size.width >= 650 + ? 10.sp + : 13.sp, fontWeight: MyFontWeight.regular, color: Color(0xFF808080), ), @@ -301,52 +324,56 @@ class _CommunityDynamic extends State { SizedBox( height: 12.h, ), - widget.isList ? Text( - widget?.article?.mainTitle ?? "", - maxLines:5, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular, - fontSize: 15.sp, - ), - ) :Text( - widget?.article?.mainTitle ?? "", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular, - fontSize: 15.sp, - ), - ), + widget.isList + ? Text( + widget?.article?.mainTitle ?? "", + maxLines: 5, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + ), + ) + : Text( + widget?.article?.mainTitle ?? "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + ), + ), buildMedia(widget?.article?.content), SizedBox( - height:8.h, + height: 8.h, ), if (widget.article.location != "") - Padding(padding:EdgeInsets.only(bottom:7), - child: Row( - children: [ - Icon( - Icons.place, - size: 16, - color: Color(0xFFB3B2B2), - ), - SizedBox( - width: 2, - ), - Expanded( - child: Text( - widget?.article?.location ?? "", - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFB3B2B2), - ), - )), - ], - ),), + Padding( + padding: EdgeInsets.only(bottom: 7), + child: Row( + children: [ + Icon( + Icons.place, + size: 16, + color: Color(0xFFB3B2B2), + ), + SizedBox( + width: 2, + ), + Expanded( + child: Text( + widget?.article?.location ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFB3B2B2), + ), + )), + ], + ), + ), if (!widget.isDetails) SizedBox( height: 5.h, @@ -355,111 +382,125 @@ class _CommunityDynamic extends State { Container( // padding: EdgeInsets.only(bottom: 16), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(bottom: 16.h), - child:Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - "assets/svg/liulanliang.svg", - width: 16, - height: 16, - ), - SizedBox( - width: 5.w, - ), - Text( - (widget.article != null) - ? "${widget.article.viewers}" - : "", - style: TextStyle( - fontSize: 14.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFF1A1A1A), - ), - ), - ], - )), - ), - Expanded( - child:Container( - padding: EdgeInsets.only(bottom: 16.h), - child:Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - "assets/svg/pinglun.svg", - width: 16, - height: 16, - ), - SizedBox( - width: 5.w, - ), - Text( - "${widget.article.comments ?? 0}", - style: TextStyle( - fontSize: 14.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFF1A1A1A), - ), - ), - ], - ))), - Expanded( - child:Container( - padding: EdgeInsets.only(bottom: 16.h), - child:Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - "assets/svg/xihuan.svg", - width: 16, - height: 16, - ), - SizedBox( - width: 5.w, - ), - Text( - "${widget.article.likes ?? 0}", - style: TextStyle( - fontSize: 14.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFF1A1A1A), - ), - ), - ], - )), - ), - if (widget?.article?.author != widget.userId ?? "") + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - choiceShowBottomSheet(); - }); - }, - child: Container( - padding: EdgeInsets.only(top:3.h,bottom: 16.h), - alignment: Alignment.center, - // color: Colors.red, - child: Icon( - Icons.more_horiz, - color: Colors.black, + child: Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + SvgPicture.asset( + "assets/svg/liulanliang.svg", + width: 16, + height: 16, ), + SizedBox( + width: 5.w, + ), + Text( + (widget.article != null) + ? "${widget.article.viewers}" + : "", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + )), + ), + Expanded( + child: Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + SvgPicture.asset( + "assets/svg/pinglun.svg", + width: 16, + height: 16, + ), + SizedBox( + width: 5.w, + ), + Text( + "${widget.article.comments ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], ))), - ], - ),), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + widget.article.liked = + !(widget.article.liked ?? false); + _queryInformationLikes( + widget.article.liked ?? false); + }); + }, + child: Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + (widget.article.liked ?? false) + ? Image.asset( + "assets/image/icon_like.webp", + width: 16, + height: 16, + ) + : Image.asset( + "assets/image/icon_like_h.webp", + width: 16, + height: 16, + ), + SizedBox( + width: 5.w, + ), + Text( + "${widget.article.likes ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + )), + ) + ), + if ((widget?.article?.author != widget.userId ?? "") && + widget.commentType == 0) + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + choiceShowBottomSheet(); + }); + }, + child: Container( + padding: + EdgeInsets.only(top: 3.h, bottom: 16.h), + alignment: Alignment.center, + // color: Colors.red, + child: Icon( + Icons.more_horiz, + color: Colors.black, + ), + ))), + ], + ), + ), ], ), ), @@ -794,14 +835,11 @@ class _CommunityDynamic extends State { topLeft: const Radius.circular(25.0), topRight: const Radius.circular(25.0))), child: Container( - width: 130.w, height: 130.h, child: Column( children: [ - SizedBox( - height: 10.h, - ), GestureDetector( + behavior: HitTestBehavior.translucent, onTap: () { setState(() { Navigator.of(context).pop(); @@ -809,6 +847,9 @@ class _CommunityDynamic extends State { }); }, child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10.h), + padding: EdgeInsets.symmetric(vertical: 5.h), child: Row( children: [ SizedBox( @@ -841,37 +882,42 @@ class _CommunityDynamic extends State { color: Color(0xFFF7F7F7), ), GestureDetector( + behavior: HitTestBehavior.translucent, onTap: () { setState(() { Navigator.of(context) - .popAndPushNamed('/router/report_page',arguments: { - "userName":widget?.article?.authorName ?? "", - "authorId":widget?.article?.author ?? "", + .popAndPushNamed('/router/report_page', arguments: { + "userName": widget?.article?.authorName ?? "", + "authorId": widget?.article?.author ?? "", }); }); }, - child: Row( - children: [ - SizedBox( - width: 4.w, - ), - SvgPicture.asset( - "assets/svg/ju_b.svg", - width: 20, - height: 20, - ), - SizedBox( - width: 15.w, - ), - Text( - S.of(context).jubaogaineirong, - style: TextStyle( - fontSize: 17.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF1A1A1A), + child: Container( + width: double.infinity, + padding: EdgeInsets.symmetric(vertical: 5.h), + child: Row( + children: [ + SizedBox( + width: 4.w, ), - ), - ], + SvgPicture.asset( + "assets/svg/ju_b.svg", + width: 20, + height: 20, + ), + SizedBox( + width: 15.w, + ), + Text( + S.of(context).jubaogaineirong, + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), )) ], ), diff --git a/lib/community/photo_view_gallery_screen.dart b/lib/community/photo_view_gallery_screen.dart index 78d91382..5b301b22 100644 --- a/lib/community/photo_view_gallery_screen.dart +++ b/lib/community/photo_view_gallery_screen.dart @@ -42,41 +42,47 @@ class _PhotoViewGalleryScreenState extends State { left: 0, bottom: 0, right: 0, - child: Container( - child: PhotoViewGallery.builder( - scrollPhysics: const BouncingScrollPhysics(), - builder: (BuildContext context, int index) { - return PhotoViewGalleryPageOptions( - imageProvider: NetworkToFileImage( - url: widget.images[index], - file: fileFromDocsDir(widget.images[index].toString() - .replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")), - debug: true, - ), - ); - }, - itemCount: widget.images.length, - loadingBuilder: (context, progress) => Center( - child: Container( - width: 20.0, - height: 20.0, - child: CircularProgressIndicator( - value: progress == null - ? null - : progress.cumulativeBytesLoaded / - progress.expectedTotalBytes, + child: GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child: Container( + color: Colors.black, + child: PhotoViewGallery.builder( + scrollPhysics: const BouncingScrollPhysics(), + builder: (BuildContext context, int index) { + return PhotoViewGalleryPageOptions( + imageProvider: NetworkToFileImage( + url: widget.images[index], + file: fileFromDocsDir(widget.images[index].toString() + .replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")), + debug: true, + ), + ); + }, + itemCount: widget.images.length, + loadingBuilder: (context, progress) => Center( + child: Container( + width: 20.0, + height: 20.0, + child: CircularProgressIndicator( + value: progress == null + ? null + : progress.cumulativeBytesLoaded / + progress.expectedTotalBytes, + ), ), ), - ), - backgroundDecoration: null, - pageController: widget.controller, - enableRotation: false, - onPageChanged: (index){ - setState(() { - currentIndex=index; - }); - }, - ) + backgroundDecoration: null, + pageController: widget.controller, + enableRotation: false, + onPageChanged: (index){ + setState(() { + currentIndex=index; + }); + }, + ) + ), ), ), Positioned(//图片index显示 diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 1486d54c..9a698a61 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), + "huozan" : MessageLookupByLibrary.simpleMessage("获赞"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), diff --git a/lib/generated/intl/messages_en_US.dart b/lib/generated/intl/messages_en_US.dart index 0bddbe0b..fd59232d 100644 --- a/lib/generated/intl/messages_en_US.dart +++ b/lib/generated/intl/messages_en_US.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("For:Any store dedicated to returning home"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("Homecoming Headlines"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("Home Return VIP Card Exclusive Rights"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("Homecoming VIP Membership Card Rules Agreement"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("Membership Level"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("Member Level Description"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("Member Rules Description"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("Activity information"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("The goods have been delivered"), + "huozan" : MessageLookupByLibrary.simpleMessage("liked"), "input_code" : MessageLookupByLibrary.simpleMessage("Mobile phone verification code"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("Please enter the verification code"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("Fill in the invitation code"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("Open now"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("Get it now"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("Sign in immediately"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("Use Now"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("Experience Now"), "likekaitong" : MessageLookupByLibrary.simpleMessage("Open now"), "likexufei" : MessageLookupByLibrary.simpleMessage("Renew now"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("Use Date"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("Instructions for Use"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("Use Conditions"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("Use Details"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("Ship To Address"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("Please enter the detailed receiving address"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("Delivery address"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("finish"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("Place an order once"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("Forgot password"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("Play healthy"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("Automatically generated after improving birthday information"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("Exclusive coupon for improving birthday information"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("Modify User Name"), "xuanguige" : MessageLookupByLibrary.simpleMessage("Select specs"), "xuanji" : MessageLookupByLibrary.simpleMessage("Selection"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("Please select the picking method of goods"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("Renewal member"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("Learning Health"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("Renewal Home VIP"), @@ -751,8 +757,8 @@ class MessageLookup extends MessageLookupByLibrary { "zaituzhong" : MessageLookupByLibrary.simpleMessage("In transit"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("Online Customer Service"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("Online ordering is not supported temporarily"), - "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("Not yet unlocked"), - "zanweikaifang" : MessageLookupByLibrary.simpleMessage("Not yet open"), + "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("Not unlocked"), + "zanweikaifang" : MessageLookupByLibrary.simpleMessage("Not open"), "zanweikaitong" : MessageLookupByLibrary.simpleMessage("Not yet open"), "zanwupinglun" : MessageLookupByLibrary.simpleMessage("No comment, please comment"), "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("Temporary wireless shopping"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 11f7b57c..bf6757c5 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), + "huozan" : MessageLookupByLibrary.simpleMessage("获赞"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 59c93d09..b5bd83c7 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), + "huozan" : MessageLookupByLibrary.simpleMessage("获赞"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index e4a0deaf..ec37d6fd 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -289,6 +289,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回鄉VIP會員卡規則協定"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"), @@ -313,6 +314,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), + "huozan" : MessageLookupByLibrary.simpleMessage("獲贊"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), @@ -385,6 +387,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"), @@ -560,6 +563,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用詳情"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("請輸入收貨人手機號"), @@ -601,6 +605,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "), @@ -670,6 +675,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanji" : MessageLookupByLibrary.simpleMessage("選集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("請選擇商品的領取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"), @@ -746,7 +752,7 @@ class MessageLookup extends MessageLookupByLibrary { "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在線客服"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暫不支持線上點餐"), "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("暫未解鎖"), - "zanweikaifang" : MessageLookupByLibrary.simpleMessage("暂未开放"), + "zanweikaifang" : MessageLookupByLibrary.simpleMessage("暫未開放"), "zanweikaitong" : MessageLookupByLibrary.simpleMessage("暫未開通"), "zanwupinglun" : MessageLookupByLibrary.simpleMessage("暫無評論,快去評論吧~"), "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上門店"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index a011baca..0abb2099 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -291,6 +291,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回鄉VIP會員卡規則協定"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"), @@ -315,6 +316,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), + "huozan" : MessageLookupByLibrary.simpleMessage("獲贊"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), @@ -387,6 +389,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"), @@ -562,6 +565,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用詳情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"), @@ -604,6 +608,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "), @@ -673,6 +678,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanji" : MessageLookupByLibrary.simpleMessage("選集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("請選擇商品的領取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index de8d5e66..ff27cb82 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -6875,6 +6875,66 @@ class S { ); } + /// `回乡VIP会员卡规则协议` + String get huixiangxieyi { + return Intl.message( + '回乡VIP会员卡规则协议', + name: 'huixiangxieyi', + desc: '', + args: [], + ); + } + + /// `获赞` + String get huozan { + return Intl.message( + '获赞', + name: 'huozan', + desc: '', + args: [], + ); + } + + /// `使用详情` + String get shiyongxiangqing { + return Intl.message( + '使用详情', + name: 'shiyongxiangqing', + desc: '', + args: [], + ); + } + + /// `立即使用` + String get lijishiyong { + return Intl.message( + '立即使用', + name: 'lijishiyong', + desc: '', + args: [], + ); + } + + /// `忘记密码` + String get wangjimima { + return Intl.message( + '忘记密码', + name: 'wangjimima', + desc: '', + args: [], + ); + } + + /// `请选择商品的领取方式` + String get xuanzeshangpinlingqufangshi { + return Intl.message( + '请选择商品的领取方式', + name: 'xuanzeshangpinlingqufangshi', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index e418f8ad..4956f22c 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -163,8 +163,6 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { final BaseData brand = await apiService.queryHomeBrand().catchError((onError) { - SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), - alignment: Alignment.center); refreshController.refreshFailed(); }); if (brand != null && brand.isSuccess) { @@ -289,7 +287,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { queryUserBalance() async { BaseData baseData = - await apiService.queryInfo().catchError((onError) {}); + await apiService.queryInfo().catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center);}); if (baseData != null && baseData.isSuccess) { userInfo = baseData.data; mRaiseMoney = double.tryParse(userInfo.raiseMoney); @@ -503,83 +503,87 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { }, child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), - child: Column( - children: [ - ///banner - HomeBanner(bannerData, controller), - - ///吃喝玩 - UnionEntry((int jpIndex) { - widget.changeTab(1,jpIndex); + child: FutureBuilder( + future:queryHome(), + builder: (context, snapshot) { + return Column( + children: [ + ///banner + HomeBanner(bannerData, controller), + + ///吃喝玩 + UnionEntry((int jpIndex) { + widget.changeTab(1,jpIndex); + }), + + ///快捷操作 + ShortcutOperation((int jpIndex) { + widget.changeTab(1,jpIndex); + }), + + ///推广图 + spread(), + + // ///签到 + // SignView(isSigned, (value) { + // setState(() { + // isSigned = value; + // }); + // }), + + ///特惠专区 + DiscountZone(coupons), + + ///特惠专区-推荐商品展示 + HomeRecommendGoods(homeRank), + + ///助农专区 + if(mRaiseMoney != 0.0) + HappyHelpFarmers(), + + ///福利中心 + WelfareCore(), + + ///吃喝玩商品热销榜 + TopSellingList(homeRank), + + // ///店铺推荐 + // QuickOrder(), + + // ///超级优惠券 + // CouponView(), + + // ///精选活动 + // FeaturedActivity(), + + // ///积分商城 + // HomeIntegralStore(gooods), + + ///积分商品头Tab + PointsGoodsTitle( + gooodsCategorys, + (orderType, orderDesc) { + this.orderType = orderType; + this.orderDesc = orderDesc; + setState(() {}); + }, + (index) { + categoryId = gooodsCategorys[index].id; + pageNum = 1; + setState(() {}); + }, + ), + + ///积分商品列表 + PointGoods( + goods, + (index) { + _toDetails(index); + }, + ), + ], + ); }), - - ///快捷操作 - ShortcutOperation((int jpIndex) { - widget.changeTab(1,jpIndex); - }), - - ///推广图 - spread(), - - // ///签到 - // SignView(isSigned, (value) { - // setState(() { - // isSigned = value; - // }); - // }), - - ///特惠专区 - DiscountZone(coupons), - - ///特惠专区-推荐商品展示 - HomeRecommendGoods(homeRank), - - ///助农专区 - if(mRaiseMoney != 0) - HappyHelpFarmers(), - - ///福利中心 - WelfareCore(), - - ///吃喝玩商品热销榜 - TopSellingList(homeRank), - - // ///店铺推荐 - // QuickOrder(), - - // ///超级优惠券 - // CouponView(), - - // ///精选活动 - // FeaturedActivity(), - - // ///积分商城 - // HomeIntegralStore(gooods), - - ///积分商品头Tab - PointsGoodsTitle( - gooodsCategorys, - (orderType, orderDesc) { - this.orderType = orderType; - this.orderDesc = orderDesc; - setState(() {}); - }, - (index) { - categoryId = gooodsCategorys[index].id; - pageNum = 1; - setState(() {}); - }, - ), - - ///积分商品列表 - PointGoods( - goods, - (index) { - _toDetails(index); - }, - ), - ], - ), ), ), ), @@ -599,7 +603,6 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { child: GestureDetector( onTap: (){ Navigator.of(context).pushNamed('/router/invite_friends'); - // Navigator.of(context).pushNamed('/router/mine_greenery'); }, child: ClipRRect( child:Image.asset( diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index 16a1aeba..ae017223 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -28,7 +28,8 @@ class WelfareExchange extends StatefulWidget { } } -class _WelfareExchange extends State with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin{ +class _WelfareExchange extends State + with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { ApiService apiService; final ScrollController scrollController = ScrollController(); final RefreshController refreshController = RefreshController(); @@ -195,28 +196,28 @@ class _WelfareExchange extends State with SingleTickerProvider ), ), flexibleSpace: FlexibleSpaceBar( - background:Stack( - children: [ - Container( - // padding: EdgeInsets.only(top: 40.h), - height: 172.h, - decoration: BoxDecoration( - // border: Border.all(color: Colors.white,width: 0.5), - color: Color(0xFF277D4B), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(40.r), - bottomLeft: Radius.circular(40.r), - ), - ), - ), - Container( - alignment: Alignment.topCenter, - margin: EdgeInsets.only(top: 110.h), - child: pointUser(), + background: Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height: 172.h, + decoration: BoxDecoration( + // border: Border.all(color: Colors.white,width: 0.5), + color: Color(0xFF277D4B), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(40.r), + bottomLeft: Radius.circular(40.r), ), - ], - )), + ), + ), + Container( + alignment: Alignment.topCenter, + margin: EdgeInsets.only(top: 110.h), + child: pointUser(), + ), + ], + )), expandedHeight: 258.h, bottom: PreferredSize( preferredSize: Size(double.infinity, 0), @@ -408,27 +409,28 @@ class _WelfareExchange extends State with SingleTickerProvider SizedBox( height: 4.h, ), - Expanded(child: Row( - children: [ - Text( - (userInfo != null) ? "${userInfo.points}" : "", - style: TextStyle( - fontSize: 16.sp, - color: Color(0xFF32A060), - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium, - ), - ), - SizedBox( - width: 6.w, + Expanded( + child: Row( + children: [ + Text( + (userInfo != null) ? "${userInfo.points}" : "", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF32A060), + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, ), - Image.asset( - "assets/image/icon_gold_coin.webp", - width: 18, - height: 18, - ) - ], - )) + ), + SizedBox( + width: 6.w, + ), + Image.asset( + "assets/image/icon_gold_coin.webp", + width: 18, + height: 18, + ) + ], + )) ], ), ) diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index cbd7d680..8ee66699 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -713,6 +713,15 @@ "canyingfuwu":"餐饮服务", "qiyetuanjian":"企业团建", "zhunongjifen":"助农积分", + "huixiangxieyi":"回乡VIP会员卡规则协议", + "zanweikaifang":"暂未开放", + "zanweijiesuo":"暂未解锁", + "huozan":"获赞", + "shiyongxiangqing":"使用详情", + "lijishiyong":"立即使用", + "wangjimima":"忘记密码", + "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", + diff --git a/lib/l10n/intl_en_US.arb b/lib/l10n/intl_en_US.arb index a5283cf8..076d6fbb 100644 --- a/lib/l10n/intl_en_US.arb +++ b/lib/l10n/intl_en_US.arb @@ -714,6 +714,14 @@ "canyingfuwu":"catering service", "qiyetuanjian":"Enterprise League Building", "zhunongjifen":"Farming aid points", + "huixiangxieyi":"Homecoming VIP Membership Card Rules Agreement", + "zanweikaifang":"Not open", + "zanweijiesuo":"Not unlocked", + "huozan":"liked", + "shiyongxiangqing":"Use Details", + "lijishiyong":"Use Now", + "wangjimima":"Forgot password", + "xuanzeshangpinlingqufangshi":"Please select the picking method of goods", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index edb9f2a0..4a53c7b4 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -714,6 +714,14 @@ "canyingfuwu":"餐饮服务", "qiyetuanjian":"企业团建", "zhunongjifen":"助农积分", + "huixiangxieyi":"回乡VIP会员卡规则协议", + "zanweikaifang":"暂未开放", + "zanweijiesuo":"暂未解锁", + "huozan":"获赞", + "shiyongxiangqing":"使用详情", + "lijishiyong":"立即使用", + "wangjimima":"忘记密码", + "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 5d24beec..6c615ef0 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -714,6 +714,14 @@ "canyingfuwu":"餐饮服务", "qiyetuanjian":"企业团建", "zhunongjifen":"助农积分", + "huixiangxieyi":"回乡VIP会员卡规则协议", + "zanweikaifang":"暂未开放", + "zanweijiesuo":"暂未解锁", + "huozan":"获赞", + "shiyongxiangqing":"使用详情", + "lijishiyong":"立即使用", + "wangjimima":"忘记密码", + "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 9c107d87..be665571 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -705,6 +705,14 @@ "canyingfuwu":"餐飲服務", "qiyetuanjian":"企業團建", "zhunongjifen":"助農積分", + "huixiangxieyi":"回鄉VIP會員卡規則協定", + "zanweikaifang":"暫未開放", + "zanweijiesuo":"暫未解鎖", + "huozan":"獲贊", + "shiyongxiangqing":"使用詳情", + "lijishiyong":"立即使用", + "wangjimima":"忘記密碼", + "xuanzeshangpinlingqufangshi":"請選擇商品的領取方式", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 467affc4..1e4c6b0f 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -707,6 +707,14 @@ "canyingfuwu":"餐飲服務", "qiyetuanjian":"企業團建", "zhunongjifen":"助農積分", + "huixiangxieyi":"回鄉VIP會員卡規則協定", + "zanweikaifang":"暫未開放", + "zanweijiesuo":"暫未解鎖", + "huozan":"獲贊", + "shiyongxiangqing":"使用詳情", + "lijishiyong":"立即使用", + "wangjimima":"忘記密碼", + "xuanzeshangpinlingqufangshi":"請選擇商品的領取方式", diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 50c904ac..4edfb2e4 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -123,7 +123,7 @@ class _NewLoginPage extends State { } if (_sendCodeStatus == 0) { apiService - .sendVerify(area,mobile) + .sendVerify(area, mobile) .then((value) => { if (value.isSuccess) {_sendCodeStatus = 1, countdown()} @@ -207,7 +207,12 @@ class _NewLoginPage extends State { return; } var invite = _controllerInviteCode.text; - var param = {"capcha": code, "mobile": mobile, "invite": invite,"areaCode":area}; + var param = { + "capcha": code, + "mobile": mobile, + "invite": invite, + "areaCode": area + }; EasyLoading.show(status: S.of(context).zhengzaijiazai); BaseData value = await apiService.memberLogin(param).catchError((error) { print(error.message); @@ -217,7 +222,8 @@ class _NewLoginPage extends State { // EasyLoading.show(status: S.of(context).zhengzaijiazai); if (value != null && value.isSuccess) { var userInfo = LoginInfo.fromJson(value.data); - ExamineInstance.instance.isExamine = userInfo.authInfo.account == "13800138000"; + ExamineInstance.instance.isExamine = + userInfo.authInfo.account == "13800138000"; saveUserJson(userInfo.authInfo.toJson()); eventBus.fire(EventType(3)); @@ -257,7 +263,8 @@ class _NewLoginPage extends State { if (sharedPreferences.containsKey('token') && sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != "") { - ExamineInstance.instance.isExamine = sharedPreferences.getString("mobile") == "13800138000"; + ExamineInstance.instance.isExamine = + sharedPreferences.getString("mobile") == "13800138000"; Navigator.of(context).popAndPushNamed('/router/main_page'); } else { initController(); @@ -383,22 +390,24 @@ class _NewLoginPage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ GestureDetector( - onTap: (){ - Navigator.of(context).pushNamed('/router/phone_address_page').then((value) { - if(value != null) - setState(() { - area = value; + onTap: () { + Navigator.of(context) + .pushNamed('/router/phone_address_page') + .then((value) { + if (value != null) + setState(() { + area = value; + }); }); - }); - }, - child: Text( - area, - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 16.sp, - color: Color(0xFF1A1A1A), - ), - )), + }, + child: Text( + area, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + )), Icon( Icons.keyboard_arrow_right, size: 18, @@ -454,7 +463,9 @@ class _NewLoginPage extends State { height: 1.h, width: MediaQuery.of(context).size.width - 80.h, // color: statusPhoneLineColor, - color: _controllerPhone.text== "" ? Color(0xFFE7E3E3):Color(0xFF32A060), + color: _controllerPhone.text == "" + ? Color(0xFFE7E3E3) + : Color(0xFF32A060), ), SizedBox( height: 30.h, @@ -680,8 +691,8 @@ class _NewLoginPage extends State { // Navigator.of(context).pop(); // } else { ExamineInstance.instance.isExamine = true; - Navigator.of(context) - .popAndPushNamed('/router/main_page'); + Navigator.of(context) + .popAndPushNamed('/router/main_page'); // } }, child: Container( @@ -732,7 +743,7 @@ class _NewLoginPage extends State { showDialog( context: context, builder: (BuildContext context) { - return WillPopScope( + return WillPopScope( onWillPop: () async => false, child: SimpleDialog( titlePadding: EdgeInsets.all(10), @@ -855,7 +866,7 @@ class _NewLoginPage extends State { }); SharesdkPlugin.uploadPrivacyPermissionStatus( 1, - (success) => { + (success) => { Navigator.of(context).pop(), }, ); diff --git a/lib/main_page.dart b/lib/main_page.dart index 69255113..3390b4f0 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -204,7 +204,7 @@ class _MainPage extends State with WidgetsBindingObserver { myLocPlugin.authAK("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); BMFMapSDK.setApiKeyAndCoordType( 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', - BMF_COORD_TYPE.COMMON, + BMF_COORD_TYPE.BD09LL, ); } else if (Platform.isAndroid) { BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 153ad73e..e5577168 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -31,8 +31,8 @@ import 'mine_view/mine_item.dart'; import 'mine_view/mine_view.dart'; class MinePage extends StatefulWidget { + MinePage(Key key) : super(key: key); - MinePage(Key key): super(key: key); @override State createState() { return MinePageState(); @@ -50,13 +50,16 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { _toUserInfo() async { SharedPreferences shared = await SharedPreferences.getInstance(); if (shared.getString("token") == null || shared.getString("token") == "") { - Navigator.of(context) - .pushReplacementNamed('/router/new_login_page', arguments: {"login": "login"}); + Navigator.of(context).pushReplacementNamed('/router/new_login_page', + arguments: {"login": "login"}); return; } - (Platform.isAndroid&&ExamineInstance.instance.isExamine)? - await Navigator.of(context).pushNamed('/router/user_info_page'): - await Navigator.of(context).pushNamed('/router/personal_page',arguments:{"memberId":"0",}); + (Platform.isAndroid && ExamineInstance.instance.isExamine) + ? await Navigator.of(context).pushNamed('/router/user_info_page') + : await Navigator.of(context) + .pushNamed('/router/personal_page', arguments: { + "memberId": "0", + }); setState(() {}); } @@ -101,8 +104,8 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { BaseData> rankData = await apiService.rankList().catchError((onError) { - SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), - alignment: Alignment.center); + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); _refreshController.refreshFailed(); }); if (rankData != null && rankData.isSuccess) { @@ -165,7 +168,8 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { token: value.getString("token"), ); } - BaseData> baseData = await apiService.stats().catchError((onError) {}); + BaseData> baseData = + await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { totalMsg = 0; @@ -203,48 +207,38 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { children: [ Container( height: 502.h, - decoration: BoxDecoration( - // color: Color(0xFF32A060) - image: DecorationImage( - fit: BoxFit.cover, - image: AssetImage("assets/image/settlement_bg.webp"), + decoration: BoxDecoration( + // color: Color(0xFF32A060) + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/image/settlement_bg.webp"), + ), ), - ), ), FutureBuilder( future: queryUserInfo(), builder: (context, snapshot) { return Column( children: [ - ///我的 用户信息 - MineView( - userInfo, - () { - _toUserInfo(); - }, - () { - toIntegralPage(); - }, - (){ - setState(() { - totalMsg =0; - }); - }, - totalMsg, - infoNumber - ), + MineView(userInfo, () { + _toUserInfo(); + }, () { + toIntegralPage(); + }, () { + setState(() { + totalMsg = 0; + }); + }, totalMsg, infoNumber), ///我的 VIP等级信息 MineVipEntry( tag: "vip", ranks: ranks, userInfo: userInfo, - rank: double.tryParse( - userInfo?.expendAmount ?? "0") + rank: double.tryParse(userInfo?.expendAmount ?? "0") .toInt(), - rankMax: - userInfo?.memberRankVo?.nextOrigin ?? 0, + rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0, createTime: userInfo?.createTime ?? "", ), @@ -286,15 +280,16 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { Widget attainment() { return GestureDetector( behavior: HitTestBehavior.opaque, - onTap: (){ + onTap: () { Navigator.of(context).pushNamed( '/router/mine_attainment_page', arguments: {"userInfo": userInfo}, ); }, - child:Container( - margin: EdgeInsets.only(left:16.w,right:16.w,bottom:15.h), - padding: EdgeInsets.only(left:12.w, top:12.h, right:10.w,bottom: 17.h), + child: Container( + margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 15.h), + padding: + EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h), width: double.infinity, decoration: BoxDecoration( color: Colors.white, @@ -320,34 +315,38 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { color: Color(0xFF0D0D0D), ), ), - SizedBox(height: 9.h,), + SizedBox( + height: 9.h, + ), Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ Image.asset( "assets/image/icon_attainment.webp", - width:54, - height:54, + width: 54, + height: 54, fit: BoxFit.cover, ), - SizedBox(width: 7.w,), - Expanded(child: - Column( + SizedBox( + width: 7.w, + ), + Expanded( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - "已解锁${infoNumber != null - ? infoNumber.achievementNumber.toString() - : "0"}个成就", + "已解锁${infoNumber != null ? infoNumber.achievementNumber.toString() : "0"}个成就", style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 14.sp, color: Color(0xFF262626), ), ), - SizedBox(height:4.w,), + SizedBox( + height: 4.w, + ), Text( "完成任务解锁更多成就", style: TextStyle( @@ -390,17 +389,17 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ///推广图 Widget spreadImage() { return Container( - margin: EdgeInsets.only(right:14.w,bottom:15.h,left: 14.w), + margin: EdgeInsets.only(right: 14.w, bottom: 15.h, left: 14.w), child: GestureDetector( - onTap: (){ + onTap: () { Navigator.of(context).pushNamed('/router/invite_friends'); }, - child:ClipRRect( - child:Image.asset( + child: ClipRRect( + child: Image.asset( "assets/image/welfare_spread.webp", - width:double.infinity, + width: double.infinity, fit: BoxFit.fill, - height:80.h, + height: 80.h, ), borderRadius: BorderRadius.circular(6.w), ), diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index d5bd0531..8780951d 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -300,7 +300,7 @@ class _MineView extends State { child: Text( widget.userInfo == null ? S.of(context).denglu - : "${widget.userInfo.nickname??""}", + : "${widget.userInfo.nickname==""?"回乡":widget.userInfo.nickname}", style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.bold, diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index 95fa8e8f..b2cccb9b 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -98,54 +98,52 @@ class _PersonalPage extends State with WidgetsBindingObserver { ///动态列表 queryCommunity(String searchKey) async { - if(!isRefresh){ + if (!isRefresh) { isRefresh = true; return; } - if(isLoadingData){ + if (isLoadingData) { return; } isLoadingData = true; if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); userId = value.getString('userId'); - apiService = ApiService( - Dio(), + apiService = ApiService(Dio(), context: context, token: value.getString("token"), - showLoading: false - ); + showLoading: false); } - if(isLoadMore){ + if (isLoadMore) { pageNum += 1; isLoadMore = false; - } - else if(searchKey == null)pageNum = 1; + } else if (searchKey == null) pageNum = 1; BaseData> baseData = await apiService.trendList({ "mid": memberId == "0" ? userId : memberId, "onlyFollow": false, "onlyMe": true, - "pageNum": searchKey == null?pageNum:1, + "pageNum": searchKey == null ? pageNum : 1, "pageSize": 10, - "searchKey": searchKey??"" + "searchKey": searchKey ?? "" }).catchError((error) { - if(searchKey == null) { + if (searchKey == null) { refreshController.refreshFailed(); refreshController.loadFailed(); } }); - if(searchKey == null){ - refreshController.refreshCompleted(); - refreshController.loadComplete(); + if (searchKey == null) { + refreshController.refreshCompleted(); + refreshController.loadComplete(); } if (baseData.isSuccess) { - if(searchKey != null){ - if(baseData?.data?.list != null && baseData.data.list.isNotEmpty) + if (searchKey != null) { + if (baseData?.data?.list != null && baseData.data.list.isNotEmpty) articles.forEach((element) { - if(element.id == searchKey){ + if (element.id == searchKey) { element.content = jsonEncode(baseData.data.list[0].subjectInfo); - element.mainTitle =baseData.data.list[0].subject; + element.mainTitle = baseData.data.list[0].subject; element.followed = baseData.data.list[0].selfFollow; + element.liked = baseData.data.list[0].selfLike; element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar; element.authorName = baseData.data.list[0].memberInfo?.nickname; element.location = baseData.data.list[0].location; @@ -155,12 +153,10 @@ class _PersonalPage extends State with WidgetsBindingObserver { element.likes = baseData.data.list[0]?.likes; element.comments = baseData.data.list[0]?.comments; this.isRefresh = false; - setState(() { - }); + setState(() {}); } }); - } - else{ + } else { if (pageNum == 1) { articles.clear(); } @@ -168,8 +164,9 @@ class _PersonalPage extends State with WidgetsBindingObserver { var article = Article(); article.id = element.id; article.content = jsonEncode(element.subjectInfo); - article.mainTitle =element.subject; + article.mainTitle = element.subject; article.followed = element.selfFollow; + article.liked = element.selfLike; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; article.location = element.location; @@ -180,8 +177,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { article.comments = element?.comments; articles.add(article); }); - setState(() { - }); + setState(() {}); // comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); // print("comments: ${comments.length}"); if (int.tryParse(baseData.data.total) < (pageNum * 10)) { @@ -350,7 +346,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: 248, + height: 248.h, color: Color(0xFFFFFFFF), // color: Colors.red, child: Stack( @@ -359,7 +355,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { Positioned( top: 0, left: 0, - bottom: 36, + bottom: 36.h, right: 0, child: Stack( alignment: Alignment.bottomRight, @@ -402,7 +398,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), if (memberId == "0") Positioned( - bottom: 9, + bottom: 9.h, right: 16.w, child: GestureDetector( onTap: () { @@ -438,12 +434,14 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), Container( color: Color(0xFFFFFFFF), + margin: EdgeInsets.only(bottom:30.h), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 86, top: 12, right: 16), + margin: + EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w), child: GestureDetector( onTap: () { setState(() { @@ -470,7 +468,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { fontSize: 12.sp, color: Color(0xFF868686), fontWeight: MyFontWeight.regular, - height: 1.5), + height: 1.5.h), )), Icon( (isShrink != null && !isShrink) @@ -483,7 +481,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), )), Container( - margin: EdgeInsets.only(left: 16, right: 16), + margin: EdgeInsets.only(left: 16.w, right: 16.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, @@ -508,7 +506,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( S.of(context).guanzhu, @@ -542,7 +540,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( S.of(context).fensi, @@ -575,7 +573,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( S.of(context).dongtai, @@ -608,10 +606,10 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( - "获赞", + S.of(context).huozan, style: TextStyle( color: Color(0xFF353535), fontSize: 12.sp, @@ -631,7 +629,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { color: Color(0xFFF7F7F7), ), Padding( - padding: EdgeInsets.only(left: 16), + padding: EdgeInsets.only(left: 16.w), child: Text( memberId != "0" ? "TA的动态" : "我的动态", style: TextStyle( @@ -640,7 +638,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { fontWeight: MyFontWeight.semi_bold, ), )), - dynamicList() + dynamicList(), ], ), ), @@ -657,8 +655,8 @@ class _PersonalPage extends State with WidgetsBindingObserver { right: 0, child: Container( padding: EdgeInsets.only( - left: 16, - right: 16, + left: 16.w, + right: 16.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -691,7 +689,9 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), SizedBox(width: 10.w), Text( - memberInfor?.nickname ?? "", + ((memberInfor?.nickname ?? "") == "") + ? "回乡" + : memberInfor?.nickname, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16.sp, @@ -714,14 +714,14 @@ class _PersonalPage extends State with WidgetsBindingObserver { }); }, child: Container( - height: 23, - padding: - EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), + height: 23.h, + padding: EdgeInsets.only( + left: 6.w, right: 6.w, bottom: 2.h, top: 2.h), alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), border: Border.all( - width: 1, + width: 1.w, color: Color(0xFF353535), style: BorderStyle.solid, ), @@ -749,7 +749,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { isShowBtn: false, text: "目前暂无发布动态,要把开心的事讲出来哦~", fontSize: 16.sp, - margin: EdgeInsets.only(left: 60.w, right: 60.w), + margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 75.h), ) : ListView.builder( physics: NeverScrollableScrollPhysics(), @@ -760,9 +760,9 @@ class _PersonalPage extends State with WidgetsBindingObserver { articles[position], memberId == "0" ? 1 : 0, exitFull: () { - // setState(() { - // _onRefresh(); - // }); + setState(() { + _onRefresh(); + }); }, removalDynamic: () { setState(() { diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 1889cb9e..b511fea3 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -327,37 +327,37 @@ class _RechargePage extends State { ), ), SizedBox(height:10.h), - GestureDetector( - onTap: () { - setState(() { - checkIndex = 3; - }); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Image.asset( - "assets/image/icon_alipay.webp"), - Expanded( - flex: 1, - child: Padding( - padding: EdgeInsets.only(left: 8.w), - child: Text( - S.of(context).zhifubao, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xff353535), - ), - ), - ), - ), - checkView(3), - ], - ), - ), + // GestureDetector( + // onTap: () { + // setState(() { + // checkIndex = 3; + // }); + // }, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Image.asset( + // "assets/image/icon_alipay.webp"), + // Expanded( + // flex: 1, + // child: Padding( + // padding: EdgeInsets.only(left: 8.w), + // child: Text( + // S.of(context).zhifubao, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xff353535), + // ), + // ), + // ), + // ), + // checkView(3), + // ], + // ), + // ), ], ), ), diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index da182e8b..096cff0a 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -35,7 +35,7 @@ class _UserInfoPage extends State { "headimg": "", "nickname": "", "sex": "", - "signature":"" + "signature": "" }; @override @@ -52,7 +52,8 @@ class _UserInfoPage extends State { modifyInfo["sex"] = user.sex, age = AppUtils.getAgeByString(user.birth), refresh(), - apiService = ApiService(Dio(), context: context, token: value.getString('token')), + apiService = ApiService(Dio(), + context: context, token: value.getString('token')), }); } @@ -89,7 +90,7 @@ class _UserInfoPage extends State { Widget userInfo() { return Container( - margin: EdgeInsets.only(left:14.w,right: 14.w), + margin: EdgeInsets.only(left: 14.w, right: 14.w), child: Column( children: [ InkWell( @@ -97,7 +98,8 @@ class _UserInfoPage extends State { showImagePicker(); }, child: avatarItem(0, ""), - ),Container( + ), + Container( margin: EdgeInsets.symmetric(vertical: 12.h), width: double.infinity, height: 1, @@ -120,8 +122,11 @@ class _UserInfoPage extends State { onTap: () { editSignature(); }, - child:avatarItem(2, - (modifyInfo["signature"]) == "" ? "还未编辑个性签名~" : modifyInfo["signature"]), + child: avatarItem( + 2, + (modifyInfo["signature"]) == "" + ? "还未编辑个性签名~" + : modifyInfo["signature"]), ), Container( margin: EdgeInsets.symmetric(vertical: 12.h), @@ -130,7 +135,7 @@ class _UserInfoPage extends State { color: Color(0xFFF2F2F2), ), InkWell( - onTap:(modifyInfo["birth"] == "")?showDateSelector:(){}, + onTap: (modifyInfo["birth"] == "") ? showDateSelector : () {}, child: avatarItem( 3, (modifyInfo["birth"] != null && modifyInfo["birth"] != "") @@ -171,7 +176,8 @@ class _UserInfoPage extends State { } editSignature() async { - dynamic signature = await Navigator.of(context).pushNamed('/router/edit_signature', + dynamic signature = await Navigator.of(context).pushNamed( + '/router/edit_signature', arguments: {"signature": modifyInfo['signature']}); if (signature != null && signature != "") { modifyInfo["signature"] = signature; @@ -196,7 +202,7 @@ class _UserInfoPage extends State { builder: (_) { return CupertinoDatePickerWidget(); }); - if (dateTime != null ) { + if (dateTime != null) { modifyInfo["birth"] = DateFormat("yyyy-MM-dd").format(dateTime); user.birth = modifyInfo["birth"]; age = AppUtils.getAge(dateTime); @@ -295,38 +301,38 @@ class _UserInfoPage extends State { } // Future cropImage(imagePath) async { - // File croppedFile = await ImageCropper.cropImage( - // sourcePath: imagePath, - // aspectRatioPresets: [ - // CropAspectRatioPreset.square, - // // CropAspectRatioPreset.ratio3x2, - // // CropAspectRatioPreset.original, - // // CropAspectRatioPreset.ratio4x3, - // // CropAspectRatioPreset.ratio16x9 - // ], - // aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1), - // androidUiSettings: AndroidUiSettings( - // toolbarTitle: 'Cropper', - // toolbarColor: Colors.black, - // toolbarWidgetColor: Colors.white, - // initAspectRatio: CropAspectRatioPreset.square, - // hideBottomControls: true, - // lockAspectRatio: false), - // iosUiSettings: IOSUiSettings( - // minimumAspectRatio: 1.0, - // resetAspectRatioEnabled: false, - // aspectRatioPickerButtonHidden: true, - // rectWidth: 500.w, - // rectHeight: 500.h, - // )); - // return croppedFile; + // File croppedFile = await ImageCropper.cropImage( + // sourcePath: imagePath, + // aspectRatioPresets: [ + // CropAspectRatioPreset.square, + // // CropAspectRatioPreset.ratio3x2, + // // CropAspectRatioPreset.original, + // // CropAspectRatioPreset.ratio4x3, + // // CropAspectRatioPreset.ratio16x9 + // ], + // aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1), + // androidUiSettings: AndroidUiSettings( + // toolbarTitle: 'Cropper', + // toolbarColor: Colors.black, + // toolbarWidgetColor: Colors.white, + // initAspectRatio: CropAspectRatioPreset.square, + // hideBottomControls: true, + // lockAspectRatio: false), + // iosUiSettings: IOSUiSettings( + // minimumAspectRatio: 1.0, + // resetAspectRatioEnabled: false, + // aspectRatioPickerButtonHidden: true, + // rectWidth: 500.w, + // rectHeight: 500.h, + // )); + // return croppedFile; // } ///调用修改用户信息接口 modifyInfos() async { var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); if (info.isSuccess) { - SharedPreferences.getInstance().then((value){ + SharedPreferences.getInstance().then((value) { value.setString('user', jsonEncode(modifyInfo)); }); setState(() { @@ -338,7 +344,9 @@ class _UserInfoPage extends State { ///文件上传 fileUpload() async { if (filePath != null && filePath != "" && await File(filePath).exists()) { - BaseData baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {}); + BaseData baseData = await apiService + .upload(File(filePath), 123123123, false) + .catchError((onError) {}); if (baseData != null && baseData.isSuccess) { UploadResult uploadResult = baseData.data; modifyInfo["headimg"] = uploadResult.url; @@ -347,8 +355,6 @@ class _UserInfoPage extends State { } } - - Widget avatarItem(type, value) { print("object: $value"); return Container( @@ -366,7 +372,10 @@ class _UserInfoPage extends State { flex: 1, ), buildValue(type, value), - if (type != 5 && type != 4 && type != 3 && (((modifyInfo["birth"] == "")) || type != 3)) + if (type != 5 && + type != 4 && + type != 3 && + (((modifyInfo["birth"] == "")) || type != 3)) valueEnd(), ], ), @@ -375,11 +384,10 @@ class _UserInfoPage extends State { Widget valueEnd() { return Container( - child: Icon( - Icons.keyboard_arrow_right, - size: 20.sp, - ) - ); + child: Icon( + Icons.keyboard_arrow_right, + size: 20.sp, + )); } Widget buildValue(type, value) { @@ -411,7 +419,7 @@ class _UserInfoPage extends State { return Text( value, maxLines: 1, - overflow:TextOverflow.ellipsis, + overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 13.sp, @@ -419,10 +427,11 @@ class _UserInfoPage extends State { ), ); } else { - return Expanded(child: Text( + return Expanded( + child: Text( value, maxLines: 1, - overflow:TextOverflow.ellipsis, + overflow: TextOverflow.ellipsis, textAlign: TextAlign.right, style: TextStyle( fontWeight: MyFontWeight.regular, diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index 24b7c920..26204a46 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -543,6 +543,7 @@ class MemberVo { String money, String activityMoney, String greenMoney, + String raiseMoney, String expendAmount, dynamic organic, String points, @@ -577,6 +578,7 @@ class MemberVo { _money = money; _activityMoney = activityMoney; _greenMoney = greenMoney; + _raiseMoney = raiseMoney; _expendAmount = expendAmount; _organic = organic; _points = points; @@ -614,6 +616,7 @@ class MemberVo { _money = json['money']; _activityMoney = json['activityMoney']; _greenMoney = json['greenMoney']; + _raiseMoney = json['raiseMoney']; _expendAmount = json['expendAmount']; _organic = json['organic']; _points = json['points']; @@ -649,6 +652,7 @@ class MemberVo { String _money; String _activityMoney; String _greenMoney; + String _raiseMoney; String _expendAmount; dynamic _organic; String _points; @@ -683,6 +687,7 @@ class MemberVo { String money, String activityMoney, String greenMoney, + String raiseMoney, String expendAmount, dynamic organic, String points, @@ -717,6 +722,7 @@ class MemberVo { money: money ?? _money, activityMoney: activityMoney ?? _activityMoney, greenMoney: greenMoney ?? _greenMoney, + raiseMoney: raiseMoney ?? _raiseMoney, expendAmount: expendAmount ?? _expendAmount, organic: organic ?? _organic, points: points ?? _points, @@ -752,6 +758,7 @@ class MemberVo { String get money => _money; String get activityMoney => _activityMoney; String get greenMoney => _greenMoney; + String get raiseMoney => _raiseMoney; String get expendAmount => _expendAmount; dynamic get organic => _organic; String get points => _points; @@ -789,6 +796,7 @@ class MemberVo { map['money'] = _money; map['activityMoney'] = _activityMoney; map['greenMoney'] = _greenMoney; + map['raiseMoney'] = _raiseMoney; map['expendAmount'] = _expendAmount; map['organic'] = _organic; map['points'] = _points; diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 7e9d7012..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 = "http://192.168.10.129:8765/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 e1507418..06429ed5 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 = "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/settlement/settlement.dart b/lib/settlement/settlement.dart index 41a039fc..aea82211 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -120,8 +120,8 @@ class _Settlement extends State { token: minToken, tenant: tenant, storeId: storeId, - showLoading: false - ); + showLoading: false); + queryMemberInfo(); if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, @@ -189,73 +189,87 @@ class _Settlement extends State { try { EasyLoading.show(status: S.current.zhengzaijiazai); - BaseData baseData = await minService.getOrderInfo({ - "addressId": addressId, - "isTake": isTake, - "memberCouponId": memberCouponId, - "orderId": orderId, - "promotionId": promotionId, - "productSkuId": productSkuId, - "actProductId": actProductId, - "actProductSkuId": actProductSkuId, - "useVipPrice":useVipPriceSelect, - "buyNum": buyNum, - "payChannel":payChannel, - "tableId": tableId - }).catchError((error) {}); - this.promotion = null; - promotions = ""; - this.couponListBean = null; - coupons = ""; - if (baseData != null && baseData.isSuccess) { - settleOrderInfo = baseData.data; - if ((settleOrderInfo?.promotionId ?? "") != "") { - settleOrderInfo.promotionInfoList.forEach((element) { - if (element.id == settleOrderInfo.promotionId) { - this.promotion = element; - promotions = promotion?.name ?? ""; - } - }); - } - if ((settleOrderInfo?.memberCouponId ?? "") != "") { - settleOrderInfo.couponList.forEach((element) { - if (element.id == settleOrderInfo.memberCouponId) { - this.couponListBean = element; - coupons = couponListBean?.promotionName ?? ""; - } - }); - } - if (settleOrderInfo.orderProductList == null || - settleOrderInfo.orderProductList.length == 0) { - placeOrder = true; - queryOrderDetails( - pageType != null ? widget.arguments["orderId"] : parentId); - } - if(!isRaiseChannel && settleOrderInfo.isRaise){ - isRaiseChannel = true; - queryOrderInfo( - address?.id, - selectedBtn, - couponListBean?.id, - 0, - promotion?.id ?? productId, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - settleOrderInfo.isRaise ? 7 :payChannel, - tableId); + BaseData baseData = await minService.getOrderInfo({ + "addressId": addressId, + "isTake": isTake, + "memberCouponId": memberCouponId, + "orderId": orderId, + "promotionId": promotionId, + "productSkuId": productSkuId, + "actProductId": actProductId, + "actProductSkuId": actProductSkuId, + "useVipPrice": useVipPriceSelect, + "buyNum": buyNum, + "payChannel": payChannel, + "tableId": tableId + }).catchError((error) {}); + this.promotion = null; + promotions = ""; + this.couponListBean = null; + coupons = ""; + if (baseData != null && baseData.isSuccess) { + settleOrderInfo = baseData.data; + if ((settleOrderInfo?.promotionId ?? "") != "") { + settleOrderInfo.promotionInfoList.forEach((element) { + if (element.id == settleOrderInfo.promotionId) { + this.promotion = element; + promotions = promotion?.name ?? ""; + } + }); + } + if ((settleOrderInfo?.memberCouponId ?? "") != "") { + settleOrderInfo.couponList.forEach((element) { + if (element.id == settleOrderInfo.memberCouponId) { + this.couponListBean = element; + coupons = couponListBean?.promotionName ?? ""; + } + }); + } + if (settleOrderInfo.orderProductList == null || + settleOrderInfo.orderProductList.length == 0) { + placeOrder = true; + queryOrderDetails( + pageType != null ? widget.arguments["orderId"] : parentId); + } + if (!isRaiseChannel && settleOrderInfo.isRaise) { + isRaiseChannel = true; + queryOrderInfo( + address?.id, + selectedBtn, + couponListBean?.id, + 0, + promotion?.id ?? productId, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + settleOrderInfo.isRaise ? 7 : payChannel, + tableId); + } + } else { + SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); } - } else { - SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); - } - }finally{ + } finally { setState(() {}); EasyLoading.dismiss(); } } + ///会员信息 + queryMemberInfo() async { + BaseData baseData = await minService.memberInfo().catchError((error) { + debugPrint(error); + }); + if (baseData != null && baseData.isSuccess) { + SharedPreferences.getInstance().then( + (value) => { + value.setString('minMember', jsonEncode(baseData.data)), + }, + ); + } + } + ///查看订单详情 queryOrderDetails(id) async { BaseData baseData = await minService.getOrderDetails({ @@ -298,76 +312,76 @@ class _Settlement extends State { } queryAddress(int selectedBtn) async { + setState(() { + this.selectedBtn = selectedBtn; + }); + if (address != null) { + queryOrderInfo( + address.id, + selectedBtn, + null, + 0, + productId ?? null, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + payChannel, + tableId); + return; + } + BaseData> baseDate = + await minService.queryAddress().catchError((error) {}); + + BMFCoordinate bmfCoordinate = BMFCoordinate( + double.tryParse(storeInfo.latitude), + double.tryParse(storeInfo.longitude), + ); + if (baseDate != null && baseDate.isSuccess) { setState(() { - this.selectedBtn = selectedBtn; + address = baseDate.data[0]; }); - if (address != null) { - queryOrderInfo( - address.id, - selectedBtn, - null, - 0, - productId ?? null, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - payChannel, - tableId); - return; - } - BaseData> baseDate = - await minService.queryAddress().catchError((error) {}); - - BMFCoordinate bmfCoordinate = BMFCoordinate( - double.tryParse(storeInfo.latitude), - double.tryParse(storeInfo.longitude), - ); - if (baseDate != null && baseDate.isSuccess) { - setState(() { - address = baseDate.data[0]; - }); - for (int i = 1; i < baseDate.data.length; i++) { - Address address1 = baseDate.data[i]; + for (int i = 1; i < baseDate.data.length; i++) { + Address address1 = baseDate.data[i]; - BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert( - coordinate: BMFCoordinate( - double.tryParse(address.longitude), - double.tryParse(address.latitude), - ), - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL); - BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert( - coordinate: BMFCoordinate( - double.tryParse(address1.longitude), - double.tryParse(address1.latitude), - ), - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL); + BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert( + coordinate: BMFCoordinate( + double.tryParse(address.longitude), + double.tryParse(address.latitude), + ), + fromType: BMF_COORD_TYPE.COMMON, + toType: BMF_COORD_TYPE.BD09LL); + BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert( + coordinate: BMFCoordinate( + double.tryParse(address1.longitude), + double.tryParse(address1.latitude), + ), + fromType: BMF_COORD_TYPE.COMMON, + toType: BMF_COORD_TYPE.BD09LL); - double mi = await BMFCalculateUtils.getLocationDistance( - bmfCoordinate, coordinate); - double mi1 = await BMFCalculateUtils.getLocationDistance( - bmfCoordinate, coordinate1); - if (mi1 < mi) { - address = address1; - } + double mi = await BMFCalculateUtils.getLocationDistance( + bmfCoordinate, coordinate); + double mi1 = await BMFCalculateUtils.getLocationDistance( + bmfCoordinate, coordinate1); + if (mi1 < mi) { + address = address1; } - await queryOrderInfo( - address.id, - selectedBtn, - null, - 0, - productId ?? null, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - payChannel, - tableId); } + await queryOrderInfo( + address.id, + selectedBtn, + null, + 0, + productId ?? null, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + payChannel, + tableId); + } } ///选择收货地址 @@ -484,7 +498,9 @@ class _Settlement extends State { placeOrderFirst.orderTypeId = 0; placeOrderFirst.parentCode = parentCode; // 火锅加菜 placeOrderFirst.parentId = parentId; // 火锅加菜 - placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") ? payChannel = 0 : (settleOrderInfo.isRaise ? 7:payChannel)); + placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") + ? payChannel = 0 + : (settleOrderInfo.isRaise ? 7 : payChannel)); placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); placeOrderFirst.promotionInfoDTO.promotionId = (promotion != null && tableId <= 0) ? promotion.id : ""; @@ -737,8 +753,8 @@ class _Settlement extends State { child: Container( child: Column( children: [ - DistributionMode((addressId, isTake, memberCouponId, - orderId, promotionId) { + DistributionMode((addressId, isTake, + memberCouponId, orderId, promotionId) { setState(() { this.selectedBtn = 0; }); @@ -769,50 +785,58 @@ class _Settlement extends State { // ), ///订单商品 - if(settleOrderInfo != null || minOrderInfo != null) - SettlementOrderCommodity( - selectedBtn, - settleOrderInfo, - minOrderInfo, - tableId, - pageType, - (coupons != "" || promotions!="") ? false :useVipPriceSelect, - this.showVipTips - ), + if (settleOrderInfo != null || + minOrderInfo != null) + SettlementOrderCommodity( + selectedBtn, + settleOrderInfo, + minOrderInfo, + tableId, + pageType, + (coupons != "" || promotions != "") + ? false + : useVipPriceSelect, + this.showVipTips), ///优惠券/备注/会员优惠金额 - if(settleOrderInfo != null || minOrderInfo != null) - ActivityCouponRemarks( - couponCart, - activityCart, - settleOrderInfo, - minOrderInfo, - coupons, - promotions, - couponCount(), - placeOrder, - remakers, + if (settleOrderInfo != null || + minOrderInfo != null) + ActivityCouponRemarks( + couponCart, + activityCart, + settleOrderInfo, + minOrderInfo, + coupons, + promotions, + couponCount(), + placeOrder, + remakers, () { - Navigator.of(context).pushNamed( - '/router/edit_remarks_page', - arguments: {}, - ).then((value) => { - setState(() { - if (value != null) remakers = value; - }) - });}, - tableId, - vipPriceSelect, - (){ - setState(() { - this.showVipTips = true; - }); - } - ), + Navigator.of(context).pushNamed( + '/router/edit_remarks_page', + arguments: {}, + ).then((value) => { + setState(() { + if (value != null) + remakers = value; + }) + }); + }, + tableId, + vipPriceSelect, + () { + setState(() { + this.showVipTips = true; + }); + }), - if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug) - ///支付方式 - PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo), + if (settleOrderInfo != null && + placeOrder && + joinA != JoinActivity.BargainBug) + + ///支付方式 + PayMethod(payChannelCheck, coupons, promotions, + useVipPriceSelect, settleOrderInfo), ], ), ), @@ -882,10 +906,10 @@ class _Settlement extends State { orderButton = true; pageType != null ? bargainOrderId != null - ? activityPay() - : joinA == JoinActivity.GoJoin - ? queryJoinAct() - : queryLaunchAct() + ? activityPay() + : joinA == JoinActivity.GoJoin + ? queryJoinAct() + : queryLaunchAct() : queryPlaceOrderFirst(); }, ), @@ -906,23 +930,23 @@ class _Settlement extends State { payChannelCheck(int payChannel) { this.payChannel = payChannel; - if (tableId > 0) { - queryOrderDetails(parentId); - } else { - queryOrderInfo( - address?.id, - selectedBtn, - couponListBean?.id, - 0, - promotion?.id ?? productId, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - payChannel, - tableId);} - + if (tableId > 0) { + queryOrderDetails(parentId); + } else { + queryOrderInfo( + address?.id, + selectedBtn, + couponListBean?.id, + 0, + promotion?.id ?? productId, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + payChannel, + tableId); + } } vipPriceSelect(bool useVipPriceSelect) { @@ -942,7 +966,8 @@ class _Settlement extends State { useVipPriceSelect, count1, payChannel, - tableId);} + tableId); + } } mobileChange(String mobile) { @@ -982,10 +1007,8 @@ class _Settlement extends State { // promotions = ""; // this.promotion = null; if (tableId > 0) { - if(couponBean == null) - queryCancelMemberCoupon(parentId); - if (couponBean.id != null) - queryUseMemberCoupon(couponBean.id); + if (couponBean == null) queryCancelMemberCoupon(parentId); + if (couponBean.id != null) queryUseMemberCoupon(couponBean.id); } else { queryOrderInfo( address?.id, @@ -1025,7 +1048,7 @@ class _Settlement extends State { selectedBtn, null, 0, - (pro.id??"")??productId, + (pro.id ?? "") ?? productId, productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 37696e6e..67519db7 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -257,6 +257,8 @@ class UnionPageState extends State ? "DRINKSTORE" : "HAPPYSTORE")), }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); if (index == -1) tabRefresh().refreshFailed(); }); if (baseData != null && baseData.isSuccess) { diff --git a/lib/view_widget/activity_coupons.dart b/lib/view_widget/activity_coupons.dart index a5be7841..c6e5c87f 100644 --- a/lib/view_widget/activity_coupons.dart +++ b/lib/view_widget/activity_coupons.dart @@ -11,6 +11,8 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../generated/l10n.dart'; + class ActivityCoupons extends StatefulWidget { final String result; @@ -196,7 +198,7 @@ class _ActivityCoupons extends State { ), if (listData["type"] == 3) Text( - "兑换券", + S.of(context).duihuanquan, overflow: TextOverflow.ellipsis, maxLines: 2, style: TextStyle( diff --git a/lib/view_widget/coupon_details_dialog.dart b/lib/view_widget/coupon_details_dialog.dart index 2ef4c28e..663ec786 100644 --- a/lib/view_widget/coupon_details_dialog.dart +++ b/lib/view_widget/coupon_details_dialog.dart @@ -49,7 +49,7 @@ class _CouponDetailsWidget extends State { alignment: Alignment.center, margin: EdgeInsets.symmetric(vertical: 12), child: Text( - "使用详情", + S.of(context).shiyongxiangqing, style: TextStyle( fontWeight: MyFontWeight.bold, fontSize: 15.sp, diff --git a/lib/view_widget/cupertino_date_picker.dart b/lib/view_widget/cupertino_date_picker.dart index 1ed41312..104914d3 100644 --- a/lib/view_widget/cupertino_date_picker.dart +++ b/lib/view_widget/cupertino_date_picker.dart @@ -33,7 +33,7 @@ class CupertinoDatePickerWidget extends StatelessWidget { }, child: Container( child: Text( - "取消", + S.of(context).quxiao, style: TextStyle( fontSize: 16, fontWeight: MyFontWeight.semi_bold, diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index e00a17fc..aa1b0b78 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -156,7 +156,7 @@ class NewCouponWidget extends StatelessWidget { child: Row( children: [ Text( - "使用详情", + S.of(context).shiyongxiangqing, style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, @@ -639,7 +639,7 @@ class NewCouponWidget extends StatelessWidget { ), alignment: Alignment.center, child:Text( - "立即使用", + S.of(context).lijishiyong, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( diff --git a/lib/view_widget/pay_selected_dialog.dart b/lib/view_widget/pay_selected_dialog.dart index d64ba68d..56eb810a 100644 --- a/lib/view_widget/pay_selected_dialog.dart +++ b/lib/view_widget/pay_selected_dialog.dart @@ -52,7 +52,7 @@ class _PaySelectedDialog extends State { child: Align( alignment: Alignment.center, child: Text( - "请输入支付密码", + S.of(context).qingshuruzhifumima, style: TextStyle( fontWeight: MyFontWeight.bold, fontSize: 15.sp, @@ -94,7 +94,7 @@ class _PaySelectedDialog extends State { GestureDetector( onTap: (){}, child: Text( - "忘记密码?", + "${S.of(context).wangjimima}?", style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 12.sp, diff --git a/lib/view_widget/receiving_method_dialog.dart b/lib/view_widget/receiving_method_dialog.dart index 9007d97e..b945ec67 100644 --- a/lib/view_widget/receiving_method_dialog.dart +++ b/lib/view_widget/receiving_method_dialog.dart @@ -52,7 +52,7 @@ class _ReceivingMethodDialog extends State { child: Column( children: [ Text( - "请选择商品的领取方式", + S.of(context).xuanzeshangpinlingqufangshi, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.regular, diff --git a/lib/view_widget/update_dialog.dart b/lib/view_widget/update_dialog.dart index 4fb563a7..8c951cf1 100644 --- a/lib/view_widget/update_dialog.dart +++ b/lib/view_widget/update_dialog.dart @@ -13,10 +13,10 @@ import 'package:url_launcher/url_launcher.dart'; import '../generated/l10n.dart'; class UpdateDialog extends StatefulWidget { - final String version; - final AppUpdate appUpdate; + final String version; + final AppUpdate appUpdate; - UpdateDialog(this.version,this.appUpdate); + UpdateDialog(this.version, this.appUpdate); @override State createState() { @@ -30,8 +30,7 @@ class _UpdateDialog extends State { return Material( type: MaterialType.transparency, child: Center( - child: - Container( + child: Container( width: MediaQuery.of(context).size.width - 80.w, decoration: BoxDecoration( color: Colors.transparent, @@ -50,8 +49,7 @@ class _UpdateDialog extends State { border: Border.all( color: Colors.white, width: 0, - style: BorderStyle.solid - ), + style: BorderStyle.solid), // borderRadius: BorderRadius.only( // topLeft: Radius.circular(8.r), // topRight: Radius.circular(8.r), @@ -61,7 +59,7 @@ class _UpdateDialog extends State { Image.asset( "assets/image/update.webp", width: MediaQuery.of(context).size.width - 80.w, - fit:BoxFit.cover, + fit: BoxFit.cover, ) ], ), @@ -69,10 +67,7 @@ class _UpdateDialog extends State { decoration: BoxDecoration( color: Colors.white, border: Border.all( - color: Colors.white, - width: 0, - style: BorderStyle.solid - ), + color: Colors.white, width: 0, style: BorderStyle.solid), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(8.r), bottomRight: Radius.circular(8.r), @@ -80,63 +75,70 @@ class _UpdateDialog extends State { ), padding: EdgeInsets.symmetric(horizontal: 14.w), child: Column( - children: [ - SizedBox(height:32.h,), - Text( - widget.appUpdate.appLastVersionExplain ?? "", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 17.sp, - height: 1.2, - fontWeight: MyFontWeight.regular, - color: Color(0xFF333333), + children: [ + SizedBox( + height: 32.h, ), - ), - SizedBox(height: 57.h,), - InkWell( - onTap: () { - updateApp(); - }, - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(27), - ), - margin: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 8.h), - padding: EdgeInsets.symmetric(vertical: 11.h), - alignment: Alignment.center, - child: Text( - S.of(context).lijigengxin, - style: TextStyle( - fontSize: 17.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFFFFFFF), - ), + Text( + widget.appUpdate.appLastVersionExplain ?? "", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 17.sp, + height: 1.2, + fontWeight: MyFontWeight.regular, + color: Color(0xFF333333), ), ), - ), - if(!AppUtils.versionCompare(widget.version,widget.appUpdate.appLastVersionUp)) + SizedBox( + height: 57.h, + ), InkWell( - onTap:() { - doNotUpdate(); + onTap: () { + updateApp(); }, child: Container( width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(27), + ), + margin: EdgeInsets.only( + left: 14.w, right: 14.w, bottom: 8.h), + padding: EdgeInsets.symmetric(vertical: 11.h), alignment: Alignment.center, - padding: EdgeInsets.only(top: 8.h,bottom: 15.h), child: Text( - S.of(context).yihouzaishuo, + S.of(context).lijigengxin, style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF8C8C8C), + fontSize: 17.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFFFFFF), ), ), ), ), - ], - ),) + if (!AppUtils.versionCompare( + widget.version, widget.appUpdate.appLastVersionUp)) + InkWell( + onTap: () { + doNotUpdate(); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + padding: EdgeInsets.only(top: 8.h, bottom: 15.h), + child: Text( + S.of(context).yihouzaishuo, + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF8C8C8C), + ), + ), + ), + ), + ], + ), + ) ], ), ), @@ -151,12 +153,13 @@ class _UpdateDialog extends State { } updateApp() async { - String url = Platform.isIOS ? "itms-apps://itunes.apple.com/app/id1575124838":"http://application.lotus-wallet.com/huixiang?release_id="; + String url = Platform.isIOS + ? "itms-apps://itunes.apple.com/app/id1575124838" + : "http://application.lotus-wallet.com/huixiang?release_id="; if (await canLaunch(url)) { await launch(url); } else { throw 'Could not launch $url'; } } - } diff --git a/lib/view_widget/vip_dialog.dart b/lib/view_widget/vip_dialog.dart index e107b306..61b7193a 100644 --- a/lib/view_widget/vip_dialog.dart +++ b/lib/view_widget/vip_dialog.dart @@ -241,7 +241,7 @@ class _VipDialog extends State { size: 10, ), Text( - "暂未开放", + S.of(context).zanweikaifang, style: TextStyle( color: Color(0xFFFFDCA1), fontWeight: MyFontWeight.regular, @@ -269,7 +269,7 @@ class _VipDialog extends State { size: 10, ), Text( - "暂未解锁", + S.of(context).zanweijiesuo, style: TextStyle( color: Color(0xFFFFDCA1), fontWeight: MyFontWeight.regular, diff --git a/lib/vip/user_vip_service_page.dart b/lib/vip/user_vip_service_page.dart index 416e70de..29a2d908 100644 --- a/lib/vip/user_vip_service_page.dart +++ b/lib/vip/user_vip_service_page.dart @@ -34,7 +34,7 @@ class _UserVipServicePage extends State with WidgetsBindingO Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( - title:"回乡VIP会员卡规则协议", + title:S.of(context).huixiangxieyi, titleColor: Colors.black, background: Color(0xFFFFFFFF), leadingColor: Colors.black, diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index bdd7317e..b7b05e97 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -135,118 +135,124 @@ class _VipTop extends State { (!(widget?.vipCardHome?.member?.isVip ?? false)) ? vipCardList() : Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - Expanded( - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - horizontal: 10.w, vertical: 15.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.w), - color: Color(0xffffffff), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: S.of(context).yixianghuiyuanquanyi, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), - ), + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + Expanded( + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + horizontal: 10.w, vertical: 15.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.w), + color: Color(0xffffffff), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], ), - TextSpan( - text: widget - ?.vipCardHome?.member?.vipDuration - .toString() ?? - "0", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xffF96519), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: S + .of(context) + .yixianghuiyuanquanyi, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xff32A060), + ), + ), + TextSpan( + text: widget?.vipCardHome?.member + ?.vipDuration + .toString() ?? + "0", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xffF96519), + ), + ), + TextSpan( + text: " 天", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xff32A060), + ), + ), + ], ), - ), - TextSpan( - text: " 天", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), + textDirection: TextDirection.ltr, + ))), + SizedBox( + width: 10.w, + ), + Expanded( + child: GestureDetector( + onTap: () { + setState(() { + vipRenewShowBottomSheet(); + }); + }, + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + horizontal: 10.w, vertical: 15.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.w), + color: Color(0xffffffff), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], ), - ), - ], - ), - textDirection: TextDirection.ltr, - ))), - SizedBox( - width: 10.w, + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", + style: TextStyle( + color: Color((widget + ?.vipCardHome + ?.member + ?.isVipSubscribe ?? + false) + ? 0xff3A3936 + : 0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + width: 6.w, + ), + Image.asset( + "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", + width: 16, + height: 16, + fit: BoxFit.fill, + color: Color(0xff32A060), + ), + ], + ))), + ) + ], + ), ), - Expanded( - child: GestureDetector( - onTap: () { - setState(() { - vipRenewShowBottomSheet(); - }); - }, - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - horizontal: 10.w, vertical: 15.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.w), - color: Color(0xffffffff), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", - style: TextStyle( - color: Color((widget?.vipCardHome - ?.member?.isVipSubscribe ?? - false) - ? 0xff3A3936 - : 0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - width: 6.w, - ), - Image.asset( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", - width: 16, - height: 16, - fit: BoxFit.fill, - color: Color(0xff32A060), - ), - ], - ))), - ) - ], - ), - ), ], ), ) @@ -258,7 +264,7 @@ class _VipTop extends State { Widget vipCard() { return Container( margin: EdgeInsets.fromLTRB( - 14.w,( MediaQuery.of(context).padding.top + 50.h), 14.w, 8.h), + 14.w, (MediaQuery.of(context).padding.top + 50.h), 14.w, 8.h), width: double.infinity, height: 207.h, decoration: BoxDecoration( @@ -279,11 +285,11 @@ class _VipTop extends State { Image.asset( "assets/image/vip_card.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( - padding: EdgeInsets.only(top: 24.h,right:16.w), + padding: EdgeInsets.only(top: 24.h, right: 16.w), alignment: Alignment.topRight, child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -410,18 +416,21 @@ class _VipTop extends State { TextSpan( text: "¥", style: TextStyle( - fontSize: 20.sp, - color: Color(0xff32A060), - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium,), + fontSize: 20.sp, + color: Color(0xff32A060), + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + ), ), TextSpan( - text: "${AppUtils.calculateDouble(double.tryParse(cards?.price ?? ""))}", + text: + "${AppUtils.calculateDouble(double.tryParse(cards?.price ?? ""))}", style: TextStyle( - fontSize: 36.sp, - color: Color(0xff32A060), + fontSize: 36.sp, + color: Color(0xff32A060), fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium,), + fontWeight: MyFontWeight.medium, + ), ), ]), ), @@ -700,7 +709,8 @@ class _VipTop extends State { Widget buildBottomSheetWidget(BuildContext context, state) { return Container( - padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,bottom:35.h), + padding: + EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w, bottom: 35.h), decoration: new BoxDecoration( color: Colors.white, borderRadius: new BorderRadius.only( @@ -789,6 +799,8 @@ class _VipTop extends State { ), ), ), + if (widget?.vipCardHome?.cards[selectIndex]?.autoSubscribe ?? + false) GestureDetector( onTap: () { state(() { diff --git a/lib/web/web_turntable_activity.dart b/lib/web/web_turntable_activity.dart index 6fe1cf8c..3c4b49db 100644 --- a/lib/web/web_turntable_activity.dart +++ b/lib/web/web_turntable_activity.dart @@ -1,10 +1,8 @@ import 'dart:io'; import 'dart:ui'; -import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:webview_flutter/webview_flutter.dart'; diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart index 96e6d003..d89346f4 100644 --- a/lib/web/web_view/input_comment.dart +++ b/lib/web/web_view/input_comment.dart @@ -73,6 +73,14 @@ class _InputComment extends State { margin: EdgeInsets.symmetric(horizontal: 4.w), alignment: Alignment.topLeft, child: TextField( + textInputAction:TextInputAction.send, + onEditingComplete: () { + var commentText = widget.commentTextController.text; + if (commentText.trim() == "") { + return; + } + widget.queryMemberComment(commentText); + }, maxLines: 8, minLines: 1, focusNode: widget.commentFocus, diff --git a/pubspec.yaml b/pubspec.yaml index 386d551b..0afefa75 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.1.8+36 +version: 3.1.9+39 environment: sdk: ">=2.7.0 <3.0.0"