diff --git a/assets/image/2x/icon_mine_edit.png b/assets/image/2x/icon_mine_edit.png index 876eac44..21dad93f 100644 Binary files a/assets/image/2x/icon_mine_edit.png and b/assets/image/2x/icon_mine_edit.png differ diff --git a/assets/image/2x/ju_bao.png b/assets/image/2x/ju_bao.png new file mode 100644 index 00000000..9a1f86c8 Binary files /dev/null and b/assets/image/2x/ju_bao.png differ diff --git a/assets/image/3x/icon_mine_edit.png b/assets/image/3x/icon_mine_edit.png index f636944c..0d95663f 100644 Binary files a/assets/image/3x/icon_mine_edit.png and b/assets/image/3x/icon_mine_edit.png differ diff --git a/assets/image/3x/ju_bao.png b/assets/image/3x/ju_bao.png new file mode 100644 index 00000000..a3e5bf8f Binary files /dev/null and b/assets/image/3x/ju_bao.png differ diff --git a/assets/image/icon_mine_edit.png b/assets/image/icon_mine_edit.png index 9316ebca..a107036b 100644 Binary files a/assets/image/icon_mine_edit.png and b/assets/image/icon_mine_edit.png differ diff --git a/assets/image/ju_bao.png b/assets/image/ju_bao.png new file mode 100644 index 00000000..c0d2a3eb Binary files /dev/null and b/assets/image/ju_bao.png differ diff --git a/assets/svg/ju_b.svg b/assets/svg/ju_b.svg new file mode 100644 index 00000000..6bcb07c5 --- /dev/null +++ b/assets/svg/ju_b.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5e35f588..26d1a564 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -140,6 +140,9 @@ PODS: - mob_sharesdk/ShareSDKPlatforms/WatermelonVideo (4.4.0): - mob_sharesdk/ShareSDK - MOBFoundation (>= 3.2.9) + - mob_sharesdk/ShareSDKPlatforms/WeChat_Lite (4.4.0): + - mob_sharesdk/ShareSDK + - MOBFoundation (>= 3.2.9) - mob_sharesdk/ShareSDKPlatforms/WhatsApp (4.4.0): - mob_sharesdk/ShareSDK - MOBFoundation (>= 3.2.9) @@ -167,7 +170,7 @@ PODS: - SDWebImage (5.12.1): - SDWebImage/Core (= 5.12.1) - SDWebImage/Core (5.12.1) - - shared_preferences_ios (0.0.1): + - shared_preferences (0.0.1): - Flutter - sharesdk_plugin (1.1.2): - Flutter @@ -201,12 +204,12 @@ PODS: - mob_sharesdk/ShareSDKPlatforms/Twitter - mob_sharesdk/ShareSDKPlatforms/VKontakte - mob_sharesdk/ShareSDKPlatforms/WatermelonVideo + - mob_sharesdk/ShareSDKPlatforms/WeChat_Lite - mob_sharesdk/ShareSDKPlatforms/WhatsApp - mob_sharesdk/ShareSDKPlatforms/Yixin - mob_sharesdk/ShareSDKPlatforms/YouDaoNote - mob_sharesdk/ShareSDKRestoreScene - mob_sharesdk/ShareSDKUI - - WechatOpenSDK_Fuck (~> 1.9.2) - SSZipArchive (2.4.2) - thumbnails (0.0.1): - Flutter @@ -216,7 +219,7 @@ PODS: - TPNS-iOS (= 1.3.3.0) - url_launcher (0.0.1): - Flutter - - video_player_avfoundation (0.0.1): + - video_player (0.0.1): - Flutter - wakelock (0.0.1): - Flutter @@ -239,13 +242,13 @@ DEPENDENCIES: - path_provider (from `.symlinks/plugins/path_provider/ios`) - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - scan (from `.symlinks/plugins/scan/ios`) - - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) + - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - sharesdk_plugin (from `.symlinks/plugins/sharesdk_plugin/ios`) - SSZipArchive (~> 2.4.2) - thumbnails (from `.symlinks/plugins/thumbnails/ios`) - tpns_flutter_plugin (from `.symlinks/plugins/tpns_flutter_plugin/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) + - video_player (from `.symlinks/plugins/video_player/ios`) - wakelock (from `.symlinks/plugins/wakelock/ios`) - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) @@ -287,8 +290,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/permission_handler/ios" scan: :path: ".symlinks/plugins/scan/ios" - shared_preferences_ios: - :path: ".symlinks/plugins/shared_preferences_ios/ios" + shared_preferences: + :path: ".symlinks/plugins/shared_preferences/ios" sharesdk_plugin: :path: ".symlinks/plugins/sharesdk_plugin/ios" thumbnails: @@ -297,8 +300,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/tpns_flutter_plugin/ios" url_launcher: :path: ".symlinks/plugins/url_launcher/ios" - video_player_avfoundation: - :path: ".symlinks/plugins/video_player_avfoundation/ios" + video_player: + :path: ".symlinks/plugins/video_player/ios" wakelock: :path: ".symlinks/plugins/wakelock/ios" webview_flutter: @@ -308,13 +311,13 @@ SPEC CHECKSUMS: AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8 BMKLocationKit: 097814ef672b1e57e86e6c1968d7892fb78002bf - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c flutter_baidu_mapapi_base: 90fddba11ec4435406a7211d6ee905b4311c31db flutter_baidu_mapapi_map: 771bf00671832b1fcddb17733518cd631529df16 flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c - fluwx: 02670633ce7509206f62b366e9734e7dda81e100 + fluwx: c192ef1ea3617badb813fa1a761ffc5c9c12208a image_pickers: 5e6ec7083f9363d014c0fb061f1b9cd97bb5e451 mob_sharesdk: c771f001e00739d24301a9fa250247601efe7a3c MOBFoundation: 2abd23c80c33d1337d30dc4b0018ed914cef8f8e @@ -323,16 +326,16 @@ SPEC CHECKSUMS: permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 scan: aea35bb4aa59ccc8839c576a18cd57c7d492cc86 SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b - shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad - sharesdk_plugin: eda37b6eee2c0af21d3ee5e9c56f85ac538a9884 + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d + sharesdk_plugin: 5a59e49d2d5e55c8e8f67cc9ddf05172c2494a6b SSZipArchive: e7b4f3d9e780c2acc1764cd88fbf2de28f26e5b2 - thumbnails: df4b2db0d4030d134e7665da9c3060b0d78726fe + thumbnails: bb4f4e9bb4b51c8ae4e6ad9a2fa81373f9b634ad TPNS-iOS: 57a146496858ba2fb5d43e5f240feb19243b69cb - tpns_flutter_plugin: ee51c5d85993cee1dba9a1caa0eb22270a71f988 + tpns_flutter_plugin: a366649c8ad71f19dfb864d3c994ed0480b69daa url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef - video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff + video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f - webview_flutter: 5fb4def2bbd4339889ee14d045b605cefc5bc232 + webview_flutter: 3603125dfd3bcbc9d8d418c3f80aeecf331c068b WechatOpenSDK_Fuck: aa8f4b0af902837e887a1d40c62f06c060c1dc98 ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 127c485d..f1f65acc 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -211,6 +211,76 @@ path = Class; sourceTree = SOURCE_ROOT; }; + 6EE8F2E42695813500237A5E /* UniMPSDK */ = { + isa = PBXGroup; + children = ( + 6EE8F2EC2695815C00237A5E /* Headers */, + 6EE8F3382695816000237A5E /* Libs */, + 6EE8F2E52695815A00237A5E /* Resources */, + ); + path = UniMPSDK; + sourceTree = SOURCE_ROOT; + }; + 6EE8F2E52695815A00237A5E /* Resources */ = { + isa = PBXGroup; + children = ( + 89319A6726E237A5001EFBD7 /* Resources */, + ); + path = Resources; + sourceTree = ""; + }; + 6EE8F2EC2695815C00237A5E /* Headers */ = { + isa = PBXGroup; + children = ( + 6EE8F2F12695815C00237A5E /* weexHeader */, + ); + path = Headers; + sourceTree = ""; + }; + 6EE8F2F12695815C00237A5E /* weexHeader */ = { + isa = PBXGroup; + children = ( + ); + path = weexHeader; + sourceTree = ""; + }; + 6EE8F3382695816000237A5E /* Libs */ = { + isa = PBXGroup; + children = ( + ); + path = Libs; + sourceTree = ""; + }; + 89319A6726E237A5001EFBD7 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; + 89A626A826A7FFF30004A8F0 /* wx */ = { + isa = PBXGroup; + children = ( + 89A626AA26A8000C0004A8F0 /* Headers */, + 89A626A926A800010004A8F0 /* Libs */, + ); + path = wx; + sourceTree = SOURCE_ROOT; + }; + 89A626A926A800010004A8F0 /* Libs */ = { + isa = PBXGroup; + children = ( + ); + path = Libs; + sourceTree = ""; + }; + 89A626AA26A8000C0004A8F0 /* Headers */ = { + isa = PBXGroup; + children = ( + ); + path = Headers; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -246,7 +316,9 @@ isa = PBXGroup; children = ( 05C5426126BBE82E00D26AC2 /* baidu */, + 89A626A826A7FFF30004A8F0 /* wx */, 89847A4826A14482008C8077 /* Runner.entitlements */, + 6EE8F2E42695813500237A5E /* UniMPSDK */, 6EE8F2E32695806400237A5E /* Class */, 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 7AFFD8EE1D35381100E5BB4D /* AppDelegate.mm */, @@ -544,7 +616,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 61; + CURRENT_PROJECT_VERSION = 78; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -594,11 +666,27 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.61; + MARKETING_VERSION = 1.0.78; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", + "-l\"c++\"", + "-l\"image_pickers\"", + "-l\"path_provider\"", + "-l\"flutter_bmflocation\"", + "-l\"flutter_baidu_mapapi_utils\"", + "-l\"flutter_baidu_mapapi_search\"", + "-l\"flutter_baidu_mapapi_map\"", + "-l\"flutter_baidu_mapapi_base\"", + "-l\"permission_handler\"", + "-l\"sqlite3\"", + "-l\"video_player\"", + "-l\"wakelock\"", + "-l\"webview_flutter\"", + "-l\"z\"", + "-fcxx-modules", + "-fmodules", ); PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -728,7 +816,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 61; + CURRENT_PROJECT_VERSION = 78; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -778,11 +866,27 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.61; + MARKETING_VERSION = 1.0.78; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", + "-l\"c++\"", + "-l\"image_pickers\"", + "-l\"path_provider\"", + "-l\"flutter_bmflocation\"", + "-l\"flutter_baidu_mapapi_utils\"", + "-l\"flutter_baidu_mapapi_search\"", + "-l\"flutter_baidu_mapapi_map\"", + "-l\"flutter_baidu_mapapi_base\"", + "-l\"permission_handler\"", + "-l\"sqlite3\"", + "-l\"video_player\"", + "-l\"wakelock\"", + "-l\"webview_flutter\"", + "-l\"z\"", + "-fcxx-modules", + "-fmodules", ); PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -803,7 +907,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 61; + CURRENT_PROJECT_VERSION = 78; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -853,11 +957,27 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.61; + MARKETING_VERSION = 1.0.78; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", + "-l\"c++\"", + "-l\"image_pickers\"", + "-l\"path_provider\"", + "-l\"flutter_bmflocation\"", + "-l\"flutter_baidu_mapapi_utils\"", + "-l\"flutter_baidu_mapapi_search\"", + "-l\"flutter_baidu_mapapi_map\"", + "-l\"flutter_baidu_mapapi_base\"", + "-l\"permission_handler\"", + "-l\"sqlite3\"", + "-l\"video_player\"", + "-l\"wakelock\"", + "-l\"webview_flutter\"", + "-l\"z\"", + "-fcxx-modules", + "-fmodules", ); PRODUCT_BUNDLE_IDENTIFIER = com.zsw.hx; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/ios/Runner/AppDelegate.mm b/ios/Runner/AppDelegate.mm index ebfd6726..d7a1f2e5 100644 --- a/ios/Runner/AppDelegate.mm +++ b/ios/Runner/AppDelegate.mm @@ -9,8 +9,10 @@ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [GeneratedPluginRegistrant registerWithRegistry:self]; // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; + } diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index a89c5c57..cd31160b 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -65,8 +65,8 @@ class _EditAddressPage extends State { child: Column( children: [ Container( - margin: EdgeInsets.only(bottom: 26.h), - padding: EdgeInsets.only(top: 16.h, bottom: 16.h), + margin: EdgeInsets.only(bottom: 23.h), + padding: EdgeInsets.only(top: 16.h, bottom: 15.h), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -82,7 +82,7 @@ class _EditAddressPage extends State { bottomRight: Radius.circular(8), ), ), - child: Expanded(child:Column( + child:Column( children: [ editItem( S.of(context).xingming, @@ -114,7 +114,7 @@ class _EditAddressPage extends State { houseNumberController, false), ], - ),), + ), ), InkWell( diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 449d5701..968a0140 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -10,8 +10,10 @@ import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class CommunityChildPage extends StatefulWidget { final String typeStr; @@ -60,6 +62,7 @@ class _CommunityChildPage extends State with AutomaticKeepAl } else pageNum = 1; BaseData> baseData = await apiService.trendList({ + "mid":"", "onlyFollow": widget.typeStr == "关注" ? true : false, "onlyMe": false, "pageNum": pageNum, @@ -81,11 +84,12 @@ class _CommunityChildPage extends State with AutomaticKeepAl article.id = element.id; article.content = jsonEncode(element.subjectInfo); article.mainTitle =element.subject; - article.liked = element.selfFollow; + article.followed = element.selfFollow; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; + article.location = element.location; article.createTime = element.createTime; - article.updateUser = element.memberInfo?.mid; + article.author = element.memberInfo?.mid; article.viewers = element?.viewers; article.likes = element?.likes; article.comments = element?.comments; @@ -121,7 +125,13 @@ class _CommunityChildPage extends State with AutomaticKeepAl isLoadMore = true; setState(() {}); }, - child: ListView.builder( + child: (articles == null || articles.length == 0)? NoDataView( + src: "assets/image/guan_zhu.png", + isShowBtn: false, + text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), + ):ListView.builder( physics: NeverScrollableScrollPhysics(), itemBuilder: (context, position) { return InkWell( @@ -145,7 +155,9 @@ class _CommunityChildPage extends State with AutomaticKeepAl }, ).then((value) { _onRefresh(); + setState(() {}); }); + setState(() {}); }, ); }, diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index c9c4a42b..391b8702 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -127,7 +127,7 @@ class _CommunityDetails extends State with WidgetsBindingObser exitFull: () { setState(() {}); }, - userId:widget.arguments !=null ? widget.arguments["userId"] ??widget.arguments["mid"]:"", + userId:widget.arguments !=null ? widget.arguments["userId"] :widget.arguments["mid"], itemCount: 3, isDetails: true, heightFun: (height) { diff --git a/lib/community/community_view/class_list_view.dart b/lib/community/community_view/class_list_view.dart index 4622a8e8..1d98a33f 100644 --- a/lib/community/community_view/class_list_view.dart +++ b/lib/community/community_view/class_list_view.dart @@ -94,7 +94,7 @@ class _ClassListView extends State { child: ClipRRect( child: Opacity( - opacity: 0.6, + opacity: 0.7, child:MImage( classList.coverImg, width: double.infinity, diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 148d6d8a..116c55ed 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -4,6 +4,8 @@ import 'package:chewie/chewie.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:chewie/src/chewie_progress_colors.dart' as chewie; @@ -14,7 +16,11 @@ import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/icon_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/share_dialog.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_defines.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; +import 'package:sharesdk_plugin/sharesdk_map.dart'; import 'package:video_player/video_player.dart'; import '../photo_view_gallery_screen.dart'; @@ -121,7 +127,7 @@ class _CommunityDynamic extends State { alignment: Alignment.center); setState(() {}); } else { - // SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -171,29 +177,36 @@ class _CommunityDynamic extends State { child: Row( children: [ GestureDetector( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PhotoViewGalleryScreen( - images: [(widget?.article?.authorHeadImg ?? "").isEmpty? - "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":widget?.article?.authorHeadImg - ], //传入图片list - index: 0, //传入当前点击的图片的index - ), - )); - }, - child: - MImage( - (widget?.article?.authorHeadImg ?? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"), - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", - ), - ), + onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => PhotoViewGalleryScreen( + // images: [(widget?.article?.authorHeadImg ?? "").isEmpty? + // "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":widget?.article?.authorHeadImg + // ], //传入图片list + // index: 0, //传入当前点击的图片的index + // ), + // )); + Navigator.of(context) + .pushNamed('/router/personal_page', arguments: { + "memberId": + (widget.article.author == widget.userId) + ? "0" + : widget.article.author, + }); + }, + child: MImage( + (widget?.article?.authorHeadImg ?? + "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"), + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), + ), SizedBox( width: 8, ), @@ -222,15 +235,15 @@ class _CommunityDynamic extends State { ], ), ), - if (widget?.article?.updateUser != widget.userId ?? "") + if (widget?.article?.author != widget.userId ?? "") GestureDetector( onTap: () { setState(() { if (widget.commentType == 0) { - widget.article.isFollow = - !(widget.article.isFollow ?? false); - _vipFollow(widget.article.updateUser, - widget.article.isFollow ?? false); + widget.article.followed = + !(widget.article.followed ?? false); + _vipFollow(widget.article.author, + widget.article.followed ?? false); } else { showDeleteDialog(); } @@ -243,21 +256,21 @@ class _CommunityDynamic extends State { alignment: Alignment.center, child: RoundButton( height: 25.h, - backgroup: (widget?.article?.isFollow ?? false) + backgroup: (widget?.article?.followed ?? false) ? Color(0xFFE6E6E6) : Color(0xFF32A060), - textColor: (widget?.article?.isFollow ?? false) + textColor: (widget?.article?.followed ?? false) ? Color(0xFF808080) : Colors.white, - text: (widget?.article?.isFollow ?? false) + text: (widget?.article?.followed ?? false) ? "已关注" : "关注", radius: 20, icons: Icon( - (widget?.article?.isFollow ?? false) + (widget?.article?.followed ?? false) ? Icons.check : Icons.add, - color: (widget?.article?.isFollow ?? false) + color: (widget?.article?.followed ?? false) ? Color(0xFF808080) : Colors.white, size: 15, @@ -288,47 +301,134 @@ class _CommunityDynamic extends State { ), ), buildMedia(widget?.article?.content), + SizedBox( + height:8.h, + ), + if (widget.article.location != "") + 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: 12.h, + height: 5.h, ), if (!widget.isDetails) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - IconText( - (widget.article != null) - ? "${widget.article.viewers}" - : "", - space: 4.w, - leftImage: "assets/svg/liulanliang.svg", - iconSize: 16, - textStyle: TextStyle( - fontSize: 14.sp, - ), - ), - IconText( - "${widget.article.comments ?? 0}", - space: 4.w, - leftImage: "assets/svg/pinglun.svg", - iconSize: 16, - textStyle: TextStyle( - fontSize: 14.sp, + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/svg/liulanliang.svg", + width: 16, + height: 16, + ), + SizedBox( + width: 5, + ), + Text( + (widget.article != null) + ? "${widget.article.viewers}" + : "", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], ), ), - GestureDetector( - onTap: () {}, - child: IconText( - "${widget.article.likes ?? 0}", - space: 4.w, - leftImage: "assets/svg/xihuan.svg", - iconSize: 16, - textStyle: TextStyle( - fontSize: 14.sp, + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/svg/pinglun.svg", + width: 16, + height: 16, + ), + SizedBox( + width: 5, ), + Text( + "${widget.article.comments ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + )), + Expanded( + child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/svg/xihuan.svg", + width: 16, + height: 16, + ), + SizedBox( + width: 5, + ), + Text( + "${widget.article.likes ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], ), ), + // Expanded( + // child: GestureDetector( + // behavior: HitTestBehavior.opaque, + // onTap: () { + // setState(() { + // choiceShowBottomSheet(); + // }); + // }, + // child: Container( + // alignment: Alignment.center, + // child: Text( + // "...", + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.black, + // ), + // ), + // ))), ], ), ], @@ -342,6 +442,59 @@ class _CommunityDynamic extends State { ); } + share() async { + SSDKMap params = SSDKMap() + ..setGeneral( + widget?.article?.mainTitle ?? "", + "", + [ + widget?.article?.content != null && + widget.article.content.contains("images\":[\"") + ? jsonDecode(widget.article.content)["images"][0] + : "", + widget?.article?.content != null && + widget.article.content.contains("video\":[\"") + ? jsonDecode(widget.article.content)["video"][0] + : "", + ], + widget?.article?.content != null && + widget.article.content.contains("images\":[\"") + ? jsonDecode(widget.article.content)["images"][0] + : "", + widget?.article?.content != null && + widget.article.content.contains("video\":[\"") + ? jsonDecode(widget.article.content)["video"][0] + : "", + buildShareUrl(), + "", + "", + "", + "", + SSDKContentTypes.webpage, + ); + + showModalBottomSheet( + context: context, + backgroundColor: Colors.transparent, + builder: (context) { + return ShareDialog((platform) { + if (platform == ShareSDKPlatforms.line) { + params.map["type"] = SSDKContentTypes.text.value; + params.map["text"] = + "${widget?.article?.mainTitle ?? ""} ${buildShareUrl()}"; + } + SharesdkPlugin.share(platform, params, + (state, userData, contentEntity, error) { + print("share!$state"); + }); + }); + }); + } + + String buildShareUrl() { + return "https://hx.lotus-wallet.com/index.html?id=${widget.article.id}&type="; + } + ///动态内容 Widget buildMedia(String subjectInfo) { if (subjectInfo == null || !subjectInfo.startsWith("{")) { @@ -371,7 +524,7 @@ class _CommunityDynamic extends State { cnt["images"][0], fit: BoxFit.contain, radius: BorderRadius.circular(2), - height:MediaQuery.of(context).size.width/1.5, + height: MediaQuery.of(context).size.width / 1.5, errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", )), @@ -593,6 +746,106 @@ class _CommunityDynamic extends State { ); } + ///更多选择弹窗 + choiceShowBottomSheet() { + showModalBottomSheet( + builder: (BuildContext context) { + return buildBottomSheetWidget(context); + }, + backgroundColor: Colors.transparent, + context: context); + } + + Widget buildBottomSheetWidget(BuildContext context) { + return Container( + padding: EdgeInsets.all(16), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: new BorderRadius.only( + topLeft: const Radius.circular(25.0), + topRight: const Radius.circular(25.0))), + child: Container( + width: 100.w, + height: 100.h, + child: Column( + children: [ + SizedBox( + height: 10, + ), + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context).pop(); + share(); + }); + }, + child: Container( + child: Row( + children: [ + SizedBox( + width: 4, + ), + Image.asset( + "assets/image/icon_share.png", + fit: BoxFit.cover, + width: 25, + height: 25, + color: Color(0xff515151), + ), + SizedBox( + width: 12, + ), + Text( + "分享", + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), + )), + Container( + margin: EdgeInsets.symmetric(vertical: 12), + height: 1.h, + color: Color(0xFFF7F7F7), + ), + GestureDetector( + onTap: () { + setState(() { + Navigator.of(context) + .popAndPushNamed('/router/report_page'); + }); + }, + child: Row( + children: [ + SizedBox( + width: 4, + ), + SvgPicture.asset( + "assets/svg/ju_b.svg", + width: 20, + height: 20, + ), + SizedBox( + width: 15, + ), + Text( + "举报", + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + )) + ], + ), + )); + } + @override void didChangeDependencies() { if (widget.heightFun != null) diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index 78435916..c7651740 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -51,7 +51,7 @@ class _HomeClass extends State { // height: 250, margin: EdgeInsets.symmetric( horizontal: 6.w, - vertical: 10, + vertical: 10.h, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -149,7 +149,7 @@ class _HomeClass extends State { ), child: ClipRRect( child: Opacity( - opacity: 0.6, + opacity: 0.7, child: MImage( collect.coverImg, width: double.infinity, diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index c3feaabf..1154dab6 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -3,7 +3,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:huixiang/community/headlines/headlines_banner.dart'; import 'package:huixiang/community/headlines/headlines_collection.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/article.dart'; diff --git a/lib/community/new_community_details.dart b/lib/community/new_community_details.dart index 9c441cd3..3c5afc10 100644 --- a/lib/community/new_community_details.dart +++ b/lib/community/new_community_details.dart @@ -216,13 +216,13 @@ class _NewCommunityDetails extends State with WidgetsBindin ], ), ), - if (article?.updateUser != userId) + if (article?.author != userId) GestureDetector( onTap: () { setState(() { article.liked = !(article.liked ?? false); - _vipFollow(article.updateUser, + _vipFollow(article.author, article.liked ?? false); }); }, diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 6cffea20..6360522b 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -6,6 +6,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/upload_result.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -28,8 +29,12 @@ class _ReleaseDynamic extends State { List mediaPaths = []; bool isRelease = false; int dynamicType = 0; - TextEditingController textEditingController = TextEditingController(); + TextEditingController textController = TextEditingController(); + TextEditingController addressController = TextEditingController(); + // TextEditingController houseNumberController = TextEditingController(); ApiService apiService; + Map addressMap; + Address preAddress; @override void initState() { @@ -88,7 +93,7 @@ class _ReleaseDynamic extends State { Container( width: double.infinity, margin: EdgeInsets.all(16), - padding: EdgeInsets.only(left: 16,right: 16), + padding: EdgeInsets.only(left: 16, right: 16), child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, @@ -98,21 +103,25 @@ class _ReleaseDynamic extends State { overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.semi_bold, - fontSize:18.sp, + fontSize: 18.sp, color: Colors.red, ), ), - SizedBox(width: 10,), - Expanded(child: Text( - "用户发布内容需要等待系统审核,审核通过后才会在推荐广场展示", - maxLines:2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Color(0xFFA0A0A0), + SizedBox( + width: 10, + ), + Expanded( + child: Text( + "用户发布内容需要等待系统审核,审核通过后才会在推荐广场展示", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Colors.black, + ), ), - ),) + ) ], ), ), @@ -150,7 +159,7 @@ class _ReleaseDynamic extends State { } releaseDynamic() async { - String dynamicText = textEditingController.text; + String dynamicText = textController.text; if (dynamicText == null || dynamicText == "") { SmartDialog.showToast("请输入您此刻的想法!"); return; @@ -185,6 +194,11 @@ class _ReleaseDynamic extends State { "subjectType": subjectType, "video": remoteVideoUrl, "coverImg": remoteVideoCoverImg, + "latitude": "", + "location": addressController.text == "" + ? "" + : addressController.text, + "longitude": "", }).catchError((onError) { EasyLoading.dismiss(); }); @@ -225,10 +239,7 @@ class _ReleaseDynamic extends State { thumbnail != "" && await File(thumbnail).exists()) { BaseData baseData = await apiService.upload( - File(thumbnail), - 123123123, - dynamicType == 2 - ); + File(thumbnail), 123123123, dynamicType == 2); if (baseData != null && baseData.isSuccess) { UploadResult uploadResult = baseData.data; mediaPaths[mediaPaths.indexOf(element)].thumbPath = @@ -236,11 +247,8 @@ class _ReleaseDynamic extends State { } } } - BaseData baseData = await apiService.upload( - file, - 123123123, - dynamicType == 2 - ); + BaseData baseData = + await apiService.upload(file, 123123123, dynamicType == 2); if (baseData != null && baseData.isSuccess) { UploadResult uploadResult = baseData.data; mediaPaths[mediaPaths.indexOf(element)].remotePath = @@ -278,7 +286,6 @@ class _ReleaseDynamic extends State { ///显示图片选择方式 showImagePicker() { - FocusScope.of(context).requestFocus(FocusNode()); if (dynamicType == 1) { @@ -422,50 +429,136 @@ class _ReleaseDynamic extends State { setState(() {}); } + toMap() async { + Navigator.of(context).pushNamed('/router/address_map_page').then( + (value) => { + setState(() { + if (value != null) { + addressMap = value; + addressController.text = "${(value as Map)['cityInfo']}"; + if (preAddress != null) { + preAddress.cityInfo = addressMap['cityInfo']; + } + // houseNumberController.text = "${(value as Map)['address']}"; + } + }) + }, + ); + } + + + ///动态输入框 Widget buildEdit() { return Container( - height: 174.h, - margin: EdgeInsets.symmetric(horizontal: 16.w), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1.w, - color: Color(0xFFD8D8D8), - style: BorderStyle.solid, - ), - ), - ), - child: TextField( - controller: textEditingController, - maxLines: 5, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF4C4C4C), - ), - onChanged: (text) { - bool release = text != "" && text != null; - if (release != isRelease) { - isRelease = release; - setState(() {}); - } - }, - decoration: InputDecoration( - contentPadding: EdgeInsets.symmetric( - vertical: 18.h, - ), - errorBorder: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - hintText: "此时此刻的想法~", - hintStyle: TextStyle( - fontSize: 14.sp, - color: Color(0xFFA29E9E), + // height: 174.h, + margin: EdgeInsets.symmetric(horizontal: 16.w), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 1.w, + color: Color(0xFFD8D8D8), + style: BorderStyle.solid, + ), ), ), - ), - ); + child: Column( + children: [ + TextField( + controller: textController, + maxLines: 5, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + onChanged: (text) { + bool release = text != "" && text != null; + if (release != isRelease) { + isRelease = release; + setState(() {}); + } + }, + decoration: InputDecoration( + contentPadding: EdgeInsets.symmetric( + vertical: 18.h, + ), + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: "此时此刻的想法~", + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFFA29E9E), + ), + ), + ), + Container( + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: GestureDetector( + onTap: () { + toMap(); + }, + child:Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon( + Icons.place, + size: 16, + color: Color(0xFFB3B2B2), + ), + SizedBox( + width: 2, + ), + Text( + addressController.text == "" + ? "你在哪里呢?" + : addressController.text , + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFB3B2B2), + ), + ), + ], + ), + )), + addressController.text == "" + ? Container() + : GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + addressController.text = ""; + }); + }, + child: Container( + // color: Colors.red, + height: 21.h, + padding: EdgeInsets.only(left: 10, right: 10), + alignment: Alignment.centerRight, + child: Icon( + Icons.close, + color: Colors.black, + size: 16, + ), + ), + ), + ], + ), + ), + SizedBox( + height: 5, + ) + ], + )); } } diff --git a/lib/community/report/report_notice.dart b/lib/community/report/report_notice.dart new file mode 100644 index 00000000..197fd882 --- /dev/null +++ b/lib/community/report/report_notice.dart @@ -0,0 +1,98 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ReportNotice extends StatefulWidget { + @override + State createState() { + return _ReportNotice(); + } +} + +class _ReportNotice extends State { + ApiService apiService; + int checkIndex = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + background: Color(0xFFFFFFFFF), + leadingColor: Colors.black, + title: "", + titleSize: 18, + titleColor: Colors.black, + ), + body: Container( + width: double.infinity, + color: Color(0xFFFFFFFFF), + padding: EdgeInsets.only(left: 16, top: 10, right: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + alignment: Alignment.center, + padding: EdgeInsets.only(top: 14, bottom: 16), + child: Text( + "投诉须知", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF1A1A1A), + ), + )), + Text( + "     为了更好地帮助您解决问题,保障您使用产品和服务的良好体验,首先您要保证您的投诉行为是基于客观事实的,是为了营造良好的社群环境,并代表您的真实感想。平台作为中立的服务者,在收到您的投诉申请后,我们会在7~15个工作日内按照相关的法律法规的规定来进行核实和处理。平台会采取合理的措施保护你的个人信息:除法律法规规定的情形外,未经用户许可,我们不会向第三方公开、透露您的相关信息。", + style: TextStyle( + fontSize: 14.sp, + height: 1.5, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + SizedBox(height: 4), + Text( + "     为了各用户的合法权益得以保障,相关投诉能有效提交,如平台有合理理由相信投诉存在以下情形,将有权根据实际情况调整处理方式。包括但不限于:" + "\n    (1)明知、应知不构成内容违规 而进行投诉;" + "\n    (2)平台已告知未发现内容存在违规仍不断重复投诉且无实质补充等情形;" + "\n    (3)多次或大量提交投诉,但整体通过率低或涉嫌滥用投诉;" + "\n    (4)非合理且正当理由,对平台正常处理其他用户人投诉造成不利影响的情形;" + "\n   上述行为一经发现,将不排除采取特殊的处理机制或限制措施,包括但不限于限制频次、记入非正常投诉名单、调整侵权投诉单处理顺序等,由此将可能导致侵权投诉不可高频提交、无法通过或审核评估时效延长等效果。", + style: TextStyle( + fontSize: 14.sp, + height: 1.5, + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), + ), + flex: 1, + ), + ], + ), + ), + ); + } +} diff --git a/lib/community/report/report_page.dart b/lib/community/report/report_page.dart new file mode 100644 index 00000000..fdebdfe7 --- /dev/null +++ b/lib/community/report/report_page.dart @@ -0,0 +1,195 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ReportPage extends StatefulWidget { + final Map arguments; + + ReportPage({this.arguments}); + + @override + State createState() { + return _ReportPage(); + } +} + +class _ReportPage extends State { + ApiService apiService; + int checkIndex = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + background: Color(0xFFFFFFFFF), + leadingColor: Colors.black, + title: "举报", + titleSize: 18, + titleColor: Colors.black, + ), + body: Container( + height: double.infinity, + color: Color(0xFFFFFFFF), + child: Stack( + children: [ + SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + color: Color(0XFFFFFFFF), + padding: EdgeInsets.only(bottom: 4, left: 16, right: 16), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "举报", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + TextSpan( + text: "@百花谷", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF319E5F), + ), + ), + TextSpan( + text: "的动态", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), + ), + ), + report(), + ], + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, + height:95, + child: Column( + children: [ + GestureDetector( + onTap: () { + Navigator.of(context) + .pushNamed('/router/report_notice'); + }, + child: Container( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom:25), + child: Text( + "投诉须知", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF3C425C), + ), + ), + )), + Expanded(child: + GestureDetector( + onTap: (){ + Navigator.of(context) + .pushNamed('/router/report_success'); + }, + child: Container( + width: double.infinity, + height:double.infinity, + color: Color(0xFF319E5F), + alignment: Alignment.center, + child: Text( + "提交", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFFFFFF), + ), + ), + ),)) + ], + ), + )) + ], + ), + ), + ); + } + + Widget report() { + return Container( + padding: EdgeInsets.only(left: 16, right: 16), + child: + // (articles == null || articles.length == 0) + // ? NoDataView( + // src: "assets/image/dong_tai.png", + // isShowBtn: false, + // text: "目前暂无发布动态,要把开心的事讲出来哦~", + // fontSize: 16.sp, + // margin: EdgeInsets.only(left: 60.w, right: 60.w), + // ) : + ListView.builder( + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: reportList(), + ); + }, + itemCount: 9, + ), + ); + } + + Widget reportList() { + return Container( + padding: EdgeInsets.only(top: 18, bottom: 20), + color: Color(0xFFFFFFFF), + child: Row( + children: [ + Image.asset( + "assets/image/icon_radio_unselected.png", + width: 16, + height: 16, + ), + SizedBox( + width: 8, + ), + Expanded( + child: Text( + "色情低俗", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular), + )) + ], + )); + } +} diff --git a/lib/community/report/report_success.dart b/lib/community/report/report_success.dart new file mode 100644 index 00000000..e6965ba3 --- /dev/null +++ b/lib/community/report/report_success.dart @@ -0,0 +1,51 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class ReportSuccess extends StatefulWidget { + @override + State createState() { + return _ReportSuccess(); + } +} + +class _ReportSuccess extends State { + ApiService apiService; + int checkIndex = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + background: Color(0xFFFFFFFFF), + leadingColor: Colors.black, + title: "", + titleSize: 18, + titleColor: Colors.black, + ), + body: Container( + width: double.infinity, + color: Color(0xFFFFFFFFF), + padding: EdgeInsets.only(left: 16, top: 10, right: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ], + ), + ), + ); + } +} diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index e8231bf3..5b4d213e 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -16,6 +16,7 @@ import 'package:huixiang/home/home_view/sign_view.dart'; import 'package:huixiang/home/points_mall_view/points_goods_title.dart'; import 'package:huixiang/home/points_mall_view/points_goods_view.dart'; import 'package:huixiang/main.dart'; +import 'package:huixiang/retrofit/data/activity_pos.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -30,6 +31,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/activity_coupons.dart'; +import 'package:huixiang/view_widget/activity_poster.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/invite_success_dialog.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -71,6 +73,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { } }); queryMsgStats(); + queryActivity(); if ((widget.invite ?? "") != "" || widget.interviewCouponList != null && @@ -78,6 +81,8 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) showNew = true; + + } ///邀请成功弹窗 @@ -102,6 +107,22 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { ); } + ///活动海报弹窗 + posterShowAlertDialog(ActivityPos activityPos) { + SharedPreferences.getInstance().then((value) { + if((value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) + return; + value.setString("ActivityPosCode", "${(value.getString("ActivityPosCode")??"")}${activityPos.code}_${value.getString("userId")};"); + //显示对话框 + showDialog( + context: context, + builder: (BuildContext context) { + return ActivityPoster(activityPos); + }, + ); + }); + } + final SwiperController controller = SwiperController(); String categoryId; @@ -273,6 +294,26 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { EasyLoading.dismiss(); } + ///活动弹窗 + queryActivity() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + showLoading: true + ); + } + BaseData baseData = + await apiService.appPopup().catchError((onError) { + }); + if (baseData != null && baseData.isSuccess) { + if(baseData.data?.enabled ?? true) + posterShowAlertDialog(baseData.data); + } + } + ///核销用户优惠券 queryWiped(memberCouponId) async { if (apiService == null) { @@ -283,7 +324,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { token: value.getString("token"), ); } - BaseData baseData = await apiService.wiped(memberCouponId); + BaseData baseData = await apiService.wiped(memberCouponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("核销成功", alignment: Alignment.center); } else { @@ -326,6 +367,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { totalMsg = 0; }); }); + // Navigator.of(context).pushNamed('/router/web_turntable_activity'); }, child: Container( height: 24, diff --git a/lib/home/home_view/coupon.dart b/lib/home/home_view/coupon.dart index 7114a1d7..4eabcbf3 100644 --- a/lib/home/home_view/coupon.dart +++ b/lib/home/home_view/coupon.dart @@ -277,7 +277,7 @@ class _CouponView extends State { } receiveCoupon(couponId) async { - BaseData baseData = await apiService.receiveCoupon(couponId); + BaseData baseData = await apiService.receiveCoupon(couponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { queryCoupon(); showAlertDialog(); diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 4e18c64f..e3c86fba 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -72,7 +72,7 @@ class _PointsMallPage extends State queryUser() async { BaseData> banner = await client.queryBanner({ "model": {"type": "CREDIT_INDEX"}, - }); + }).catchError((onError) {}); if (banner != null && banner.isSuccess && diff --git a/lib/integral/integral_detailed_page.dart b/lib/integral/integral_detailed_page.dart index 390dcd7c..0f03ac05 100644 --- a/lib/integral/integral_detailed_page.dart +++ b/lib/integral/integral_detailed_page.dart @@ -246,7 +246,7 @@ class _IntegralDetailedPage extends State ), Expanded( child: Container( - height: 34.h, + // height: 34.h, alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, diff --git a/lib/integral/intergra_view/integral_task.dart b/lib/integral/intergra_view/integral_task.dart index ecb3ce43..d573df6f 100644 --- a/lib/integral/intergra_view/integral_task.dart +++ b/lib/integral/intergra_view/integral_task.dart @@ -59,7 +59,7 @@ class _IntegralTask extends State { child: Container( child: ListView.builder( padding: EdgeInsets.only(left: 10.w, top: 20.h), - physics: NeverScrollableScrollPhysics(), + physics: BouncingScrollPhysics(), // loop: false, // pagination: SwiperPagination( // alignment: Alignment.bottomCenter, diff --git a/lib/main.dart b/lib/main.dart index e7d49859..c15c3daa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -63,12 +63,14 @@ import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/test_page.dart'; import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; +import 'package:huixiang/view_widget/activity_poster.dart'; import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/union/union_details_page.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/web/web_turntable_activity.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:sharesdk_plugin/sharesdk_interface.dart'; import 'package:sharesdk_plugin/sharesdk_register.dart'; @@ -80,10 +82,14 @@ import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; import 'community/new_community_details.dart'; import 'community/photo_view_gallery_screen.dart'; +import 'community/report/report_notice.dart'; +import 'community/report/report_page.dart'; +import 'community/report/report_success.dart'; import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; import 'main_page.dart'; import 'message/system_details.dart'; +import 'mine/edit_signature.dart'; import 'mine/invitation_record.dart'; import 'mine/manage_address_page.dart'; import 'mine/mine_view/community_follow.dart'; @@ -92,6 +98,7 @@ import 'mine/mine_vip/legal_right_details.dart'; import 'mine/mine_vip/mine_attainment_page.dart'; import 'mine/mine_vip/mine_vip_core.dart'; import 'order/bargain_group_order.dart'; +import 'mine/personal_page.dart'; import 'order/exchange_write_off_page.dart'; import 'mine/release_page.dart'; import 'mine/roll_center_page.dart'; @@ -315,10 +322,12 @@ Map routers = { '/router/login_page': (context, {arguments}) => LoginPage(arguments: arguments), '/router/edit_name': (context, {arguments}) => EditName(arguments: arguments), + '/router/edit_signature': (context, {arguments}) => EditSignature(arguments: arguments), '/router/mine_card_invalid': (context, {arguments}) => MineCardInvalidPage(), '/router/store_selector_page': (context, {arguments}) => StoreSelectorPage(), '/router/video_playback_page': (context, {arguments}) => VideoPlaybackPage(), '/router/web_page': (context, {arguments}) => WebPage(arguments: arguments), + '/router/web_turntable_activity': (context, {arguments}) => WebTurntableActivity(), '/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(), '/router/founder_story_page': (context, {arguments}) => FounderStoryPage(), '/router/system_msg_page': (context, {arguments}) => SystemMessagePage(), @@ -368,4 +377,12 @@ Map routers = { SystemDetails(arguments: arguments), '/router/invitation_record': (context, {arguments}) => InvitationRecord(), + '/router/personal_page': (context, {arguments}) => + PersonalPage(arguments:arguments), + '/router/report_page': (context, {arguments}) => + ReportPage(arguments:arguments), + '/router/report_notice': (context, {arguments}) => + ReportNotice(), + '/router/report_success': (context, {arguments}) => + ReportSuccess(), }; diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index ac855641..c3593d90 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -323,7 +323,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src: "assets/image/icon_empty.png", + src:"assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -459,7 +459,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src: "assets/image/icon_empty.png", + src:"assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -606,7 +606,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src: "assets/image/icon_empty.png", + src:"assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, @@ -850,7 +850,7 @@ class _SystemDetails extends State { children: [ (messages == null || messages.length == 0) ? NoDataView( - src: "assets/image/icon_empty.png", + src:"assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).haimeiyouxiaoxi, fontSize: 16.sp, diff --git a/lib/mine/edit_signature.dart b/lib/mine/edit_signature.dart new file mode 100644 index 00000000..77a30c47 --- /dev/null +++ b/lib/mine/edit_signature.dart @@ -0,0 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class EditSignature extends StatefulWidget { + final Map arguments; + + EditSignature({this.arguments}); + + @override + State createState() { + return _EditSignature(); + } +} + +class _EditSignature extends State { + TextEditingController _controller = TextEditingController(); + int textLength = 0; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "个性签名", + titleColor: Colors.black, + leadingColor: Colors.black, + action: Container( + alignment: Alignment.center, + margin: EdgeInsets.only(right: 16.w), + child: GestureDetector( + onTap: () { + String signature = _controller.text; + if (signature != null && signature != "") { + Navigator.of(context).pop(signature); + } else { + SmartDialog.showToast("请输入个性签名~", alignment: Alignment.center); + } + }, + child:Container( + width: 46.w, + height: 24.h, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF319E5F), + borderRadius: BorderRadius.all(Radius.circular(4))), + child: Text( + "保存", + style: TextStyle( + color: Colors.white, + fontSize:14.sp, + fontWeight: FontWeight.bold), + ), + ), + ), + ), + ), + body: Container( + margin: EdgeInsets.all(16), + child: Column( + children: [ + TextField( + maxLines: 5, + controller: _controller, + keyboardType: TextInputType.text, + onChanged: (value) { + setState(() { + textLength = value.length; + }); + }, + maxLength: 50, + decoration: InputDecoration( + errorBorder: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + hintText: widget.arguments['signature'], + // contentPadding: EdgeInsets.only(top: 12, bottom: 12, left: 12), + hintStyle: TextStyle( + fontSize: 10.sp, + color: Color(0xFFA29E9E), + ), + ), + textInputAction: TextInputAction.next, + ), + Container( + height: 1.h, + color: Color(0xFFD8D8D8), + ), + ], + ), + ), + ); + } + + +} diff --git a/lib/mine/fans_page.dart b/lib/mine/fans_page.dart index 0aedc064..d73f6595 100644 --- a/lib/mine/fans_page.dart +++ b/lib/mine/fans_page.dart @@ -19,7 +19,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; class FansPage extends StatefulWidget { final Function refresh; - FansPage(this.refresh); + FansPage( + this.refresh + ); @override State createState() { @@ -80,13 +82,12 @@ class _FansPage extends State { } //关注/取关会员 - _vipFollow(followId, isFollow) async { - BaseData baseData = await apiService.follow(followId); + _vipFollow(followId,isFollow) async { + BaseData baseData = await apiService.follow(followId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { widget.refresh(); _queryFollowList(); - SmartDialog.showToast(isFollow ? "取关成功" : "关注成功", - alignment: Alignment.center); + SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } @@ -94,44 +95,48 @@ class _FansPage extends State { @override Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(top: 2), - color: Colors.white, - child: SmartRefresher( - enablePullDown: true, - enablePullUp: false, - header: MyHeader(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - controller: _refreshController, - onRefresh: () { - _queryFollowList(); - }, - physics: BouncingScrollPhysics(), - child: (list == null || list.length == 0) - ? NoDataView( - src: "assets/image/fen_si.png", - isShowBtn: false, - text: "目前暂无粉丝,听说多发动态可以涨粉哦~", - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), - ) - : ListView.builder( - itemCount: list == null ? 0 : list.length, - padding: EdgeInsets.symmetric(vertical: 8.h), - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - itemBuilder: (context, position) { - return GestureDetector( - onTap: () {}, - child: fansItem(list[position]), - ); - }, - ), + return Scaffold( + body: Container( + margin: EdgeInsets.only(top: 2), + color: Colors.white, + child: SmartRefresher( + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + controller: _refreshController, + onRefresh: (){_queryFollowList();}, + physics: BouncingScrollPhysics(), + child: (list == null || list.length == 0)? NoDataView( + src: "assets/image/fen_si.png", + isShowBtn: false, + text: "目前暂无粉丝,听说多发动态可以涨粉哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), + ):ListView.builder( + itemCount: list == null ? 0 : list.length, + padding: EdgeInsets.symmetric(vertical: 8.h), + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: fansItem(list[position]), + ); + }, + ) + // NoDataView( + // isShowBtn: false, + // text: "共关注0人", + // fontSize: 16.sp, + // margin: EdgeInsets.only(top: 120.h), + // ), + ), ), ); } @@ -156,15 +161,15 @@ class _FansPage extends State { width: 8, ), Expanded( - flex: 1, + flex: 1, child: Text( - list != null ? (list.nickname ?? "") : "", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - )), + list != null ? (list.nickname ?? "") : "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + )), Container( width: 56.w, height: 25.h, @@ -175,7 +180,7 @@ class _FansPage extends State { child: GestureDetector( onTap: () { setState(() { - _vipFollow(list.mid, list?.isFollow ?? false); + _vipFollow(list.mid,list?.isFollow ?? false); }); }, child: RoundButton( @@ -188,7 +193,9 @@ class _FansPage extends State { text: (list?.isFollow ?? false) ? "已关注" : "关注", radius: 20, icons: Icon( - (list?.isFollow ?? false) ? Icons.check : Icons.add, + (list?.isFollow ?? false) + ? Icons.check + : Icons.add, color: (list?.isFollow ?? false) ? Color(0xFF808080) : Colors.white, diff --git a/lib/mine/follow_page.dart b/lib/mine/follow_page.dart index 8cf32b9c..4142d91c 100644 --- a/lib/mine/follow_page.dart +++ b/lib/mine/follow_page.dart @@ -112,15 +112,13 @@ class _FollowPage extends State { controller: _refreshController, onRefresh: (){_queryFollowList();}, physics: BouncingScrollPhysics(), - child: (list == null || list.length == 0) - ? NoDataView( + child:(list == null || list.length == 0)? NoDataView( src: "assets/image/guan_zhu.png", isShowBtn: false, text: "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", fontSize: 16.sp, margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), - ) - : ListView.builder( + ):ListView.builder( itemCount: list == null ? 0 : list.length, shrinkWrap: true, physics: NeverScrollableScrollPhysics(), @@ -131,7 +129,7 @@ class _FollowPage extends State { child: followItem(list[position]), ); }, - ), + ) ), ), ); diff --git a/lib/mine/invitation_record.dart b/lib/mine/invitation_record.dart index 359a2698..c401ab63 100644 --- a/lib/mine/invitation_record.dart +++ b/lib/mine/invitation_record.dart @@ -305,6 +305,7 @@ class _InvitationRecord extends State Expanded(child: (invitationList.length == null || invitationList.length == 0) ? NoDataView( + src: "assets/image/icon_empty.png", isShowBtn: false, text:"还没有邀请记录哦~", fontSize: 16.sp, diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index cf27ea7d..2334148c 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -271,7 +271,7 @@ class _ManageAddressPage extends State { return AlertDialog( content: Container( width: MediaQuery.of(context).size.width - 84, - height: 110.h, + height: 120.h, child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index d1c12a1b..b4290805 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -46,7 +46,8 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { .pushNamed('/router/login_page', arguments: {"login": "login"}); return; } - await Navigator.of(context).pushNamed('/router/user_info_page'); + // await Navigator.of(context).pushNamed('/router/user_info_page'); + await Navigator.of(context).pushNamed('/router/personal_page',arguments:{"memberId":"0",}); setState(() {}); } diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index cfd1ea06..03954eae 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -16,8 +16,8 @@ class _MineItem extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 6.h), - padding: EdgeInsets.only(top: 12,bottom: 12), + margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 28.h), + // padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), @@ -50,7 +50,7 @@ class _MineItem extends State { // ), // ), Container( - padding: EdgeInsets.symmetric(vertical: 4.h,horizontal: 20.w), + padding: EdgeInsets.only(left: 16,top:16,bottom:4), child: Text( S.of(context).wodegongju, style: TextStyle( @@ -62,24 +62,27 @@ class _MineItem extends State { ), Row( children: [ - Expanded(child: InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString("token") == null || - value.getString("token") == "") { - LoginTipsDialog().show(context); - return; - } - Navigator.of(context) - .pushNamed('/router/releasePage', - arguments: {}); - }); - }, - child: mineItem( - S.of(context).wodedongtai, - "assets/image/dynamic.png", - ), - )), + ///我的动态 + // Expanded(child: + // InkWell( + // onTap: () { + // SharedPreferences.getInstance().then((value) { + // if (value.getString("token") == null || + // value.getString("token") == "") { + // LoginTipsDialog().show(context); + // return; + // } + // Navigator.of(context) + // .pushNamed('/router/releasePage', + // arguments: {}); + // }); + // }, + // child: mineItem( + // S.of(context).wodedongtai, + // "assets/image/dynamic.png", + // ), + // ), + // ), Expanded(child: InkWell( onTap: () { SharedPreferences.getInstance().then((value) { @@ -167,6 +170,33 @@ class _MineItem extends State { ),), Expanded(child: Text("")), ], + ),), + Expanded(child:InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + }, + child: mineItem( + S.of(context).tuiguangma, + "assets/image/icon_mine_promotion_code.png", + ), + ),), + ], + ), + Row( + children: [ + Expanded(child:InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); + }, + child: mineItem( + "邀请记录", + "assets/image/yao_q.png", + ), + ),), + Expanded(child:Container()), + Expanded(child:Container()), + Expanded(child:Container()) + ], ), // mineItem( // S.of(context).bangzhuyufankui, @@ -178,58 +208,21 @@ class _MineItem extends State { } ///我的页面下面条目 - // Widget mineItem(text, icon) { - // return Container( - // color: Colors.white, - // margin: EdgeInsets.symmetric(vertical: 6.h), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Image.asset( - // icon, - // width: 28.w, - // height: 28.h, - // ), - // SizedBox( - // width: 8.w, - // ), - // Expanded( - // flex: 1, - // child: Text( - // text, - // style: TextStyle( - // fontWeight: MyFontWeight.medium, - // fontSize: 16.sp, - // color: Color(0xFF353535), - // ), - // ), - // ), - // Icon( - // Icons.keyboard_arrow_right, - // size: 20, - // color: Colors.black, - // ) - // ], - // ), - // ); - // } Widget mineItem(text, icon) { return Container( color: Colors.white, - margin: EdgeInsets.symmetric(vertical:4.h), - child: Column( + margin: EdgeInsets.symmetric(vertical: 6.h), + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( icon, - width: 36.w, - height: 36.w, - fit: BoxFit.contain, + width: 32.w, + height: 32.w, ), SizedBox( - height:4.h, + height: 2.h, ), Text( text, diff --git a/lib/mine/mine_vip/binding_assistant_card.dart b/lib/mine/mine_vip/binding_assistant_card.dart index 2dca7b69..fd774a30 100644 --- a/lib/mine/mine_vip/binding_assistant_card.dart +++ b/lib/mine/mine_vip/binding_assistant_card.dart @@ -45,7 +45,7 @@ class _BindingAssistantCard extends State { token: value.getString("token"), ); } - BaseData baseData = await apiService.bindSecondCard(phone); + BaseData baseData = await apiService.bindSecondCard(phone).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("绑定成功", alignment: Alignment.center); Navigator.of(context).pop(true); diff --git a/lib/mine/mine_vip/legal_right_details.dart b/lib/mine/mine_vip/legal_right_details.dart index 21a2ae9d..e1498099 100644 --- a/lib/mine/mine_vip/legal_right_details.dart +++ b/lib/mine/mine_vip/legal_right_details.dart @@ -88,7 +88,7 @@ class _LegalRightDetails extends State { token: value.getString("token"), ); } - BaseData baseData = await apiService.unbindSecondCard(phone); + BaseData baseData = await apiService.unbindSecondCard(phone).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { querySecondCardList(); SmartDialog.showToast("解绑成功", alignment: Alignment.center); diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 5e357a41..6d2546d4 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,6 +17,7 @@ import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -80,7 +83,7 @@ class _MineVipCore extends State { } queryVipLevel() async { - BaseData> rankData = await apiService.rankList(); + BaseData> rankData = await apiService.rankList().catchError((onError) {}); if (rankData != null && rankData.isSuccess) { ranks.clear(); ranks.addAll(rankData.data); @@ -120,15 +123,18 @@ class _MineVipCore extends State { ///购买会员等级 buyRank() async { - // if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - // await Min.initialize(); - // } + + if(Platform.isAndroid) { + if (!(await Min.isInitialize())) { + //小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + //然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + //故而在此初始化一下 + await Min.initialize(); + } + } BaseData baseData = await apiService - .rankBuy({"buyType": 2, "rankId": ranks[checkIndex].id}); + .rankBuy({"buyType": 2, "rankId": ranks[checkIndex].id}).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { WxPay wxPay = WxPay.fromJson(baseData.data); await registerWxApi( diff --git a/lib/mine/mine_vip_level_page.dart b/lib/mine/mine_vip_level_page.dart index 59690df6..f52db033 100644 --- a/lib/mine/mine_vip_level_page.dart +++ b/lib/mine/mine_vip_level_page.dart @@ -42,7 +42,7 @@ class _MineVipLevelPage extends State { } queryVipLevel() async { - BaseData> rankData = await apiService.rankList(); + BaseData> rankData = await apiService.rankList().catchError((onError) {}); if (rankData != null && rankData.isSuccess) { ranks.clear(); ranks.addAll(rankData.data); diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 048c1755..eb9b2ee0 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -172,9 +172,9 @@ class _MineWalletPage extends State { margin: EdgeInsets.only(top: 14.h), child: (userBills == null || userBills.length == 0) ? NoDataView( - src: "assets/image/ding_dan.png", + src: "assets/image/xiao_fei.png", isShowBtn: false, - text: "目前暂无记录哦~", + text: "目前暂未记录哦", fontSize: 16.sp, margin: EdgeInsets.only(top: 120.h), ) diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart new file mode 100644 index 00000000..cbc87bd5 --- /dev/null +++ b/lib/mine/personal_page.dart @@ -0,0 +1,748 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:huixiang/community/community_view/community_dynamic.dart'; +import 'package:huixiang/community/photo_view_gallery_screen.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/article.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/comunity_comment.dart'; +import 'package:huixiang/retrofit/data/member_Infor.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/social_info.dart'; +import 'package:huixiang/retrofit/data/upload_result.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; +import 'package:image_pickers/image_pickers.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class PersonalPage extends StatefulWidget { + final Map arguments; + + PersonalPage({this.arguments}); + @override + State createState() { + return _PersonalPage(); + } +} + +class _PersonalPage extends State with WidgetsBindingObserver { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + var isShrink = false; + int pageNum = 1; + String userId; + List
articles = []; + MemberInfor memberInfor; + String filePath; + bool isLoadMore = false; + String memberId; + Map modifyInfo = { + "background": "" + }; + + @override + void initState() { + super.initState(); + memberId = widget.arguments["memberId"]; + WidgetsBinding.instance.addObserver(this); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService(Dio(), + context: context, token: value.getString('token')), + _onRefresh(), + }); + } + + _onRefresh() async { + queryCommunity(); + queryMember(memberId); + } + + ///查询会员信息 + queryMember(id) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = + await apiService.memberDetail(id).catchError((error) { + refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + setState(() { + memberInfor = baseData.data; + }); + refreshController.refreshCompleted(); + }else { + refreshController.refreshFailed(); + } + } + + ///动态列表 + queryCommunity() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + userId = value.getString('userId'); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + if(isLoadMore){ + pageNum += 1; + isLoadMore = false; + } + else pageNum = 1; + BaseData> baseData = await apiService.trendList({ + "mid":memberId == "0" ? userId : memberId, + "onlyFollow": false, + "onlyMe": true, + "pageNum": pageNum, + "pageSize": 10, + "searchKey": "" + }).catchError((error) { + refreshController.refreshFailed(); + refreshController.loadFailed(); + }); + if (baseData.isSuccess) { + refreshController.refreshCompleted(); + refreshController.loadComplete(); + if (pageNum == 1) { + articles.clear(); + } + baseData.data.list.forEach((element) { + var article = Article(); + article.id = element.id; + article.content = jsonEncode(element.subjectInfo); + article.mainTitle = element.subject; + article.followed = element.selfFollow; + article.authorHeadImg = element.memberInfo?.avatar; + article.authorName = element.memberInfo?.nickname; + article.location = element.location; + article.createTime = element.createTime; + article.author = element.memberInfo?.mid; + article.viewers = element?.viewers; + article.likes = element?.likes; + article.comments = element?.comments; + articles.add(article); + }); + // print("comments: ${comments.length}"); + if (int.tryParse(baseData.data.total) < (pageNum * 10)) { + refreshController.loadNoData(); + } + } + } + + ///去编辑个人资料 + _toUserInfo() async { + SharedPreferences shared = await SharedPreferences.getInstance(); + if (shared.getString("token") == null || shared.getString("token") == "") { + Navigator.of(context) + .pushNamed('/router/login_page', arguments: {"login": "login"}); + return; + } + await Navigator.of(context).pushNamed('/router/user_info_page').then((value) { + _onRefresh(); + setState(() {}); + }); + setState(() {}); + } + + ///显示图片选择方式 + showImagePicker() { + showCupertinoModalPopup( + context: context, + builder: (contetx) { + return CupertinoActionSheet( + title: Text(S.of(context).genghuantouxiang), + actions: [ + CupertinoActionSheetAction( + child: Text(S.of(context).paizhao), + onPressed: () { + openCamera(); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + CupertinoActionSheetAction( + child: Text(S.of(context).xiangce), + onPressed: () { + openStorage(); + Navigator.of(context).pop(); + }, + isDefaultAction: true, + isDestructiveAction: false, + ), + ], + cancelButton: CupertinoActionSheetAction( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(S.of(context).quxiao), + isDestructiveAction: true, + ), + ); + }); + } + + ///拍照 + openCamera() async { + if (await Permission.camera.isGranted) { + Media medias = await ImagePickers.openCamera( + cameraMimeType: CameraMimeType.photo, + cropConfig: CropConfig( + enableCrop: true, + width: 200, + height: 200, + ), + compressSize: 500, + ); + if (medias == null) return; + filePath = medias.path; + fileUpload(); + } else { + await Permission.camera.request(); + openCamera(); + } + } + + ///打开相册 + openStorage() async { + if (await Permission.storage.isGranted) { + List medias = await ImagePickers.pickerPaths( + galleryMode: GalleryMode.image, + selectCount: 1, + showGif: true, + showCamera: false, + compressSize: 500, + uiConfig: UIConfig( + uiThemeColor: Color(0xFFFFFFFF), + ), + cropConfig: CropConfig( + enableCrop: true, + width: 200, + height: 200, + ), + ); + if (medias == null || medias.length == 0) return; + filePath = medias[0].path; + setState(() {}); + fileUpload(); + } else { + await Permission.storage.request(); + openStorage(); + } + } + + ///调用修改用户信息接口 + modifyInfos() async { + var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); + if (info.isSuccess) { + setState(() { + SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); + }); + _onRefresh(); + } + } + + ///文件上传 + fileUpload() async { + if (filePath != null && filePath != "" && await File(filePath).exists()) { + BaseData baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + UploadResult uploadResult = baseData.data; + modifyInfo["background"] = uploadResult.url; + modifyInfos(); + } + } + } + + @override + Widget build(BuildContext context) { + return SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: true, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: _onRefresh, + onLoading: () { + isLoadMore = true; + setState(() { + _onRefresh(); + }); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child:Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 248, + color: Color(0xFFFFFFFF), + // color: Colors.red, + child: + Stack( + // alignment: Alignment.bottomLeft, + children: [ + Positioned( + top:0, + left: 0, + bottom: 36, + right: 0, + child:Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + color: Colors.black, + child: Opacity( + opacity: 0.9, + child: MImage( + memberInfor?.background ?? "", + width: double.infinity, + height: 260.h, + fit: BoxFit.cover, + errorSrc: + "assets/image/default_1.png", + fadeSrc: + "assets/image/default_1.png", + ))), + Container( + margin: EdgeInsets.only( + top: 50.h, left: 16.w, right: 16.w), + alignment: Alignment.topLeft, + decoration: BoxDecoration( + color: Colors.transparent, + ), + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.png", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop(); + }, + ), + ], + ), + ), + if(memberId == "0") + Positioned( + bottom: 9, + right: 16.w, + child:GestureDetector( + onTap: (){ + showImagePicker(); + }, + child:Container( + padding: EdgeInsets.only(left: 2, right: 2), + width: 59.w, + height: 23.h, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0x80000000), + ), + child: Text( + "更换背景", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ), + ), + ), + ], + ), + ), + homeInfo(), + ], + ), + ), + Container( + color: Color(0xFFFFFFFF), + child: + Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 86, top: 12, right: 16), + child: GestureDetector( + onTap: () { + setState(() { + isShrink = !isShrink; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: Text( + memberId == "0" ? ((memberInfor?.signature == "") ? "还未编辑个性签名~" : memberInfor?.signature ?? "") + :"个性签名: ${(memberInfor?.signature == "") ? "还未编辑个性签名~" :memberInfor?.signature ?? ""}", + overflow: isShrink + ? TextOverflow.visible + : TextOverflow.ellipsis, + maxLines: isShrink ? 10 : 2, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF868686), + fontWeight: + MyFontWeight.regular, + height: 1.5), + )), + Icon( + (isShrink != null && !isShrink) + ? Icons.chevron_right + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, + ), + ], + ), + )), + Container( + margin: EdgeInsets.only(left: 16, right: 16), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + memberInfor != null ? memberInfor.follow.toString() : "0", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4, + ), + Text( + S.of(context).guanzhu, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + memberInfor != null ? memberInfor.fans.toString() : "0", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4, + ), + Text( + S.of(context).fensi, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + (memberInfor?.trendTotal??0).toString(), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4, + ), + Text( + "动态", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + (memberInfor?.gainLikeTotal ?? 0).toString(), + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 4, + ), + Text( + "获赞", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: + MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(16), + height: 1.h, + color: Color(0xFFF7F7F7), + ), + Padding( + padding: EdgeInsets.only(left: 16), + child: Text( + memberId != "0" ? + "TA的动态": + "我的动态", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + )), + dynamicList() + ], + ), + ), + ], + )), + ); + } + + Widget homeInfo() { + return Positioned( + top: 0, + bottom: 0, + left: 0, + right: 0, + child: Container( + padding: EdgeInsets.only( + left: 16, + right: 16, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + GestureDetector( + onTap: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PhotoViewGalleryScreen( + images: [(memberInfor?.headimg ?? "").isEmpty? + "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg":memberInfor?.headimg + ], //传入图片list + index: 0, //传入当前点击的图片的index + ), + )); + }, + child: MImage( + memberInfor?.headimg ?? "", + isCircle: true, + width: 66, + height: 66, + fit: BoxFit.cover, + errorSrc: "assets/image/default_user.png", + fadeSrc: "assets/image/default_user.png", + ), + ), + SizedBox(width: 10.w), + Text( + memberInfor?.nickname ?? "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + SizedBox(width: 4.w), + Image.asset( + "assets/image/vip_yk.png", + width: 20, + height: 20, + ), + Spacer(), + if(memberId == "0") + GestureDetector( + onTap: () { + setState(() { + _toUserInfo(); + }); + }, + child: Container( + height: 23, + padding: EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1, + color: Color(0xFF353535), + style: BorderStyle.solid, + ), + ), + child: Text( + "编辑个人资料", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ), + ) + ], + ),)); + } + + Widget dynamicList() { + return Container( + child: (articles == null || articles.length == 0)? NoDataView( + src: "assets/image/dong_tai.png", + isShowBtn: false, + text: "目前暂无发布动态,要把开心的事讲出来哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(left: 60.w,right: 60.w), + ):ListView.builder( + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return InkWell( + child: CommunityDynamic( + articles[position], + memberId == "0" ? 1 : 0, + exitFull: () { + setState(() { + _onRefresh(); + }); + }, + removalDynamic: () { + setState(() { + _onRefresh(); + }); + }, + ), + onTap: () { + Navigator.of(context).pushNamed( + '/router/community_details', + arguments: { + "businessId": articles[position].id, + "userId": userId, + }, + ).then((value) { + _onRefresh(); + }); + }, + ); + }, + itemCount: articles.length, + ), + ); + } +} diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index e44217cc..863a5f7a 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -50,10 +52,10 @@ class _RechargePage extends State { Navigator.of(context).pop(); SmartDialog.showToast("充值成功", alignment: Alignment.center); } - else{ - SmartDialog.showToast("充值失败", alignment: Alignment.center); - return; - } + // else{ + // SmartDialog.showToast("充值失败", alignment: Alignment.center); + // return; + // } }); } @@ -387,15 +389,16 @@ class _RechargePage extends State { return; } + if(Platform.isAndroid){ if (!(await Min.isInitialize())) { // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, // 故而在此初始化一下 await Min.initialize(); - } + }} BaseData baseData = - await apiService.recharge({"amount": amount, "rechargeType": 2}); + await apiService.recharge({"amount": amount, "rechargeType": 2}).catchError((error) {}); if (baseData != null && baseData.isSuccess) { WxPay wxPay = WxPay.fromJson(baseData.data); await registerWxApi( diff --git a/lib/mine/release_page.dart b/lib/mine/release_page.dart index 6a25c224..dce80309 100644 --- a/lib/mine/release_page.dart +++ b/lib/mine/release_page.dart @@ -55,6 +55,7 @@ class _ReleasePage extends State { } pageNum += 1; BaseData> baseData = await apiService.trendList({ + "mid":"", "onlyFollow": false, "onlyMe": true, "pageNum": pageNum, @@ -76,11 +77,11 @@ class _ReleasePage extends State { article.id = element.id; article.content = jsonEncode(element.subjectInfo); article.mainTitle =element.subject; - article.liked = element.selfFollow; + article.followed = element.selfFollow; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; article.createTime = element.createTime; - article.updateUser = element.memberInfo?.mid; + article.author = element.memberInfo?.mid; article.viewers = element?.viewers; article.likes = element?.likes; article.comments = element?.comments; @@ -132,7 +133,9 @@ class _ReleasePage extends State { _onRefresh(); });}, removalDynamic: () { - _onRefresh(); + setState(() { + _onRefresh(); + }); }, ), onTap: () { @@ -141,7 +144,9 @@ class _ReleasePage extends State { arguments: { "businessId": articles[position].id,"userId":userId, }, - ); + ).then((value) { + _onRefresh(); + }); }, ); }, diff --git a/lib/mine/roll_center_page.dart b/lib/mine/roll_center_page.dart index 9a7b1966..582a5291 100644 --- a/lib/mine/roll_center_page.dart +++ b/lib/mine/roll_center_page.dart @@ -152,7 +152,7 @@ class _RollCenterPage extends State { itemCount: (coupons != null && coupons.length > 0) ? coupons.length : 0, ) : NoDataView( - src: "assets/image/icon_empty.png", + src: "assets/image/ka.png", isShowBtn: false, text: S.of(context).haimeiyouyouhuiquankeyilingqu, fontSize: 16.sp, diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index e774a7aa..53e495c0 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/upload_result.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/cupertino_date_picker.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; @@ -33,7 +34,8 @@ class _UserInfoPage extends State { "birth": "", "headimg": "", "nickname": "", - "sex": "" + "sex": "", + "signature":"" }; @override @@ -44,6 +46,7 @@ class _UserInfoPage extends State { user = UserInfo.fromJson(jsonDecode(value.getString('user'))), mobile = value.getString('mobile'), modifyInfo["nickname"] = user.nickname, + modifyInfo["signature"] = user.signature, modifyInfo["birth"] = user.birth, modifyInfo["headimg"] = user.headimg, modifyInfo["sex"] = user.sex, @@ -173,17 +176,24 @@ class _UserInfoPage extends State { child: avatarItem(1, (modifyInfo["nickname"]) == "" ? "回乡" : modifyInfo["nickname"]), ), + InkWell( + onTap: () { + editSignature(); + }, + child:avatarItem(2, + (modifyInfo["signature"]) == "" ? "还未编辑个性签名~" : modifyInfo["signature"]), + ), InkWell( onTap:(modifyInfo["birth"] == "")?showDateSelector:(){}, child: avatarItem( - 2, + 3, (modifyInfo["birth"] != null && modifyInfo["birth"] != "") ? modifyInfo["birth"] : S.of(context).wanshanshengrixinxi_yhq), ), - avatarItem(3, mobile), + avatarItem(4, mobile), avatarItem( - 4, + 5, (age == null || age == "") ? S.of(context).wanshanshengrixinxi_nl : S.of(context).sui(age)), @@ -202,9 +212,20 @@ class _UserInfoPage extends State { } } + editSignature() async { + dynamic signature = await Navigator.of(context).pushNamed('/router/edit_signature', + arguments: {"signature": modifyInfo['signature']}); + if (signature != null && signature != "") { + modifyInfo["signature"] = signature; + setState(() {}); + modifyInfos(); + } + } + List itemLefts = [ S.current.touxiang, S.current.yonghuming, + "个性签名", S.current.wodeshengri, S.current.shoujihao, S.current.wodenianling, @@ -347,6 +368,9 @@ class _UserInfoPage extends State { modifyInfos() async { var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); if (info.isSuccess) { + SharedPreferences.getInstance().then((value){ + value.setString('user', jsonEncode(modifyInfo)); + }); setState(() { SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); }); @@ -365,6 +389,8 @@ class _UserInfoPage extends State { } } + + Widget avatarItem(type, value) { print("object: $value"); return Container( @@ -383,7 +409,8 @@ class _UserInfoPage extends State { flex: 1, ), buildValue(type, value), - if (type != 4 && type != 3 && (((modifyInfo["birth"] == "")) || type != 2)) valueEnd(), + if (type != 5 && type != 4 && type != 3 && (((modifyInfo["birth"] == "")) || type != 3)) + valueEnd(), ], ), ); @@ -391,17 +418,10 @@ class _UserInfoPage extends State { Widget valueEnd() { return Container( - child: Row( - children: [ - SizedBox( - width: 8.w, - ), - Icon( - Icons.keyboard_arrow_right, - size: 20.sp, - ) - ], - ), + child: Icon( + Icons.keyboard_arrow_right, + size: 20.sp, + ) ); } @@ -433,6 +453,8 @@ class _UserInfoPage extends State { } else if (type == 1) { return Text( value, + maxLines: 1, + overflow:TextOverflow.ellipsis, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, @@ -440,14 +462,17 @@ class _UserInfoPage extends State { ), ); } else { - return Text( + return Expanded(child: Text( value, + maxLines: 1, + overflow:TextOverflow.ellipsis, + textAlign: TextAlign.right, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.sp, color: Color(0xFF727272), ), - ); + )); } } } diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index 362d87ce..6715b87b 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -92,7 +92,7 @@ class _VipBalancePage extends State { body: Container( child: (userBills == null || userBills.length == 0) ? NoDataView( - src: "assets/image/icon_empty.png", + src: "assets/image/icon_empty.png", isShowBtn: false, text: S.of(context).nihaimeiyouchongzhihuoxiaofeijilu, fontSize: 16.sp, diff --git a/lib/mine/vip_card_page.dart b/lib/mine/vip_card_page.dart index 2d645ee9..4055c93b 100644 --- a/lib/mine/vip_card_page.dart +++ b/lib/mine/vip_card_page.dart @@ -166,7 +166,7 @@ class _VipCardPage extends State { ), Expanded( child: Container( - height: 54.h, + // height: 54.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index e394fb0a..d6f96e15 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -49,7 +49,7 @@ class _VipDetailPage extends State { } startLocation() async { - EasyLoading.show(status: S.current.zhengzaijiazai); + // EasyLoading.show(status: S.current.zhengzaijiazai); Location.getInstance() .aMapFlutterLocation .onResultCallback() @@ -83,7 +83,7 @@ class _VipDetailPage extends State { "id": widget.arguments["id"], "latitude": "$latitude", "longitude": "$longitude", - }); + }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { vipCard = baseData.data; refreshController.loadComplete(); diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index ccf80c64..d2857d10 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -12,6 +13,7 @@ import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/receiving_method_dialog.dart'; @@ -1084,11 +1086,13 @@ class _ExchangeOrderPage extends State { (widget.arguments["payType"] == 2 && widget.arguments["money"] != "0.00")) && checkIndex == 3) { - // if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - // await Min.initialize(); + // if(Platform.isAndroid){ + // if (!(await Min.isInitialize())) { + // // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // // 故而在此初始化一下 + // await Min.initialize(); + // } // } WxPay wxPay = WxPay.fromJson(baseDate.data); await registerWxApi( diff --git a/lib/order/logistics_information_page.dart b/lib/order/logistics_information_page.dart index 897cf39e..8af795c2 100644 --- a/lib/order/logistics_information_page.dart +++ b/lib/order/logistics_information_page.dart @@ -153,7 +153,7 @@ class _LogisticsInformationPage extends State { position, logistics.length); }) : NoDataView( - src: "assets/image/icon_empty.png", + src: "assets/image/ding_dan.png", isShowBtn: false, text: "暂无物流信息~", fontSize: 16.sp, diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 807fcdfa..18cec76c 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -497,7 +497,7 @@ class _OrderDetailPage extends State { } _orderCancel() async { - BaseData baseData = await apiService.orderCancel(widget.arguments["id"]); + BaseData baseData = await apiService.orderCancel(widget.arguments["id"]).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("订单取消成功"); Future.delayed(Duration(milliseconds: 300), () { diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 1eafe3b5..ad770558 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -435,7 +435,8 @@ class _OrderHistoryList extends State ), ), TextSpan( - text: totalPrice(orderInfo), + // text: totalPrice(orderInfo), + text:orderInfo.finalPayPrice, style: TextStyle( fontSize: 12.sp, fontWeight: FontWeight.bold, @@ -561,7 +562,7 @@ class _OrderHistoryList extends State payResult(BaseData baseData) {} orderCancel(String orderId) async { - BaseData baseData = await apiService.orderCancel(orderId); + BaseData baseData = await apiService.orderCancel(orderId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("订单取消成功"); _onRefresh(); diff --git a/lib/order/order_utils.dart b/lib/order/order_utils.dart index 743b21f5..e8ae5452 100644 --- a/lib/order/order_utils.dart +++ b/lib/order/order_utils.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:fluwx/fluwx.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; @@ -37,11 +39,13 @@ class OrderUtils { placeOrderFirst.tableId = orderInfo.tableId; if (placeOrderFirst.payChannel == 1) { - if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - await Min.initialize(); + if(Platform.isAndroid){ + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } } BaseData baseData = await minService .settlementWx(placeOrderFirst.toJson()) diff --git a/lib/order/order_view/order_address.dart b/lib/order/order_view/order_address.dart index 536b12de..363fd09f 100644 --- a/lib/order/order_view/order_address.dart +++ b/lib/order/order_view/order_address.dart @@ -87,7 +87,7 @@ class _OrderAddress extends State { ), ), SizedBox( - width: 12.w, + width:7.w, ), Expanded( child: Text( diff --git a/lib/order/write_off_page.dart b/lib/order/write_off_page.dart index 1b3ecc8c..94626289 100644 --- a/lib/order/write_off_page.dart +++ b/lib/order/write_off_page.dart @@ -201,7 +201,7 @@ class _WriteOffPage extends State { ), Expanded( child: Container( - padding: EdgeInsets.fromLTRB(20.w, 15.h, 20.w, 24.h), + padding: EdgeInsets.fromLTRB(20.w, 15.h, 20.w, 15.h), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/qr/qr_share.dart b/lib/qr/qr_share.dart index 66bb89ce..7fd13b48 100644 --- a/lib/qr/qr_share.dart +++ b/lib/qr/qr_share.dart @@ -81,7 +81,7 @@ class _QrSharePage extends State { children: [ Positioned( child: Image.asset( - "assets/image/qr_share_bg_yq.png", + "assets/image/qr_share_bg.png", fit: BoxFit.fill, ), top: 0, @@ -153,25 +153,26 @@ class _QrSharePage extends State { S.of(context).fenxiangyaoqingma, textAlign: TextAlign.center, style: TextStyle( + height: 1.5, color: Color(0xFF2E3552), fontSize: 16.sp, fontWeight: MyFontWeight.regular, ), ), ), - Container( - margin: EdgeInsets.only(left: 16.w, right: 24.w), - child: Text( - // S.of(context).fenxiangyaoqing, - S.of(context).beiyaoqingdejiangli, - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xFF2E3552), - fontSize: 16.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ), + // Container( + // margin: EdgeInsets.only(left: 16.w, right: 24.w), + // child: Text( + // // S.of(context).fenxiangyaoqing, + // S.of(context).beiyaoqingdejiangli, + // textAlign: TextAlign.center, + // style: TextStyle( + // color: Color(0xFF2E3552), + // fontSize: 16.sp, + // fontWeight: MyFontWeight.regular, + // ), + // ), + // ), SizedBox( height: 1.h, ), diff --git a/lib/qr/qr_share_image.dart b/lib/qr/qr_share_image.dart index 68aa47f2..445c66a4 100644 --- a/lib/qr/qr_share_image.dart +++ b/lib/qr/qr_share_image.dart @@ -136,7 +136,7 @@ class _QrShareImagePage extends State { margin: EdgeInsets.only(left: 16.w, right: 24.w), child: Text( // S.of(context).saomashibieguanzhugongzonghao, - S.of(context).beiyaoqingdejiangli, + S.of(context).fenxiangyaoqingma, textAlign: TextAlign.center, style: TextStyle( color: Color(0xFF2E3552), diff --git a/lib/retrofit/data/activity_pos.dart b/lib/retrofit/data/activity_pos.dart new file mode 100644 index 00000000..2578591b --- /dev/null +++ b/lib/retrofit/data/activity_pos.dart @@ -0,0 +1,50 @@ +/// enabled : true +/// code : "1111" +/// showImage : "https://pos.upload.gznl.top/0000/2022/03/4ca95160-aa19-46e5-ad07-8a16ca11c697.jpg" +/// jumpType : 1 +/// jumpUrl : "1417675188681572352" + +class ActivityPos { + ActivityPos({ + bool enabled, + String code, + String showImage, + int jumpType, + String jumpUrl,}){ + _enabled = enabled; + _code = code; + _showImage = showImage; + _jumpType = jumpType; + _jumpUrl = jumpUrl; +} + + ActivityPos.fromJson(dynamic json) { + _enabled = json['enabled']; + _code = json['code']; + _showImage = json['showImage']; + _jumpType = json['jumpType']; + _jumpUrl = json['jumpUrl']; + } + bool _enabled; + String _code; + String _showImage; + int _jumpType; + String _jumpUrl; + + bool get enabled => _enabled; + String get code => _code; + String get showImage => _showImage; + int get jumpType => _jumpType; + String get jumpUrl => _jumpUrl; + + Map toJson() { + final map = {}; + map['enabled'] = _enabled; + map['code'] = _code; + map['showImage'] = _showImage; + map['jumpType'] = _jumpType; + map['jumpUrl'] = _jumpUrl; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/article.dart b/lib/retrofit/data/article.dart index 5af314d9..e1a3be86 100644 --- a/lib/retrofit/data/article.dart +++ b/lib/retrofit/data/article.dart @@ -1,269 +1,359 @@ import 'dart:convert'; -import 'package:huixiang/retrofit/data/author.dart'; - +import 'author.dart'; + +/// id : "1498607093517647872" +/// createTime : "2022-03-01 18:32:29" +/// createUser : "1495959790726152192" +/// updateTime : "2022-03-01 18:45:04" +/// updateUser : "1495959790726152192" +/// storeId : "0" +/// categoryId : "0" +/// mainTitle : "哈哈哈哈" +/// viceTitle : null +/// content : "{\"images\":[],\"video\":\"\",\"type\":\"text\"}" +/// coverImg : "" +/// author : "1495959790726152192" +/// type : 3 +/// likes : 0 +/// viewers : 2 +/// startTime : "2022-03-01 18:32:28" +/// endTime : "2121-03-01 18:32:28" +/// isHot : false +/// state : 1 +/// location : "" +/// longitude : "0.000000" +/// latitude : "0.000000" +/// remark : "" +/// isDelete : 0 +/// tenantCode : "" +/// storeName : null +/// liked : false +/// followed : false +/// comments : null +/// authorName : "小帽子" +/// authorHeadImg : "https://pos.upload.gznl.top/admin/2022/02/5877a3fe-0d25-405b-a86b-7bac293ab048.jpeg" class Article { + Article({ + String id, + String createTime, + String createUser, + String updateTime, + String updateUser, + String storeId, + String categoryId, + String mainTitle, + dynamic viceTitle, + String content, + String coverImg, + dynamic author, + int type, + int likes, + int viewers, + String startTime, + String endTime, + bool isHot, + int state, + String location, + String longitude, + String latitude, + String remark, + int isDelete, + String tenantCode, + dynamic storeName, + bool liked, + bool followed, + dynamic comments, + String authorName, + String authorHeadImg,}){ + _id = id; + _createTime = createTime; + _createUser = createUser; + _updateTime = updateTime; + _updateUser = updateUser; + _storeId = storeId; + _categoryId = categoryId; + _mainTitle = mainTitle; + _viceTitle = viceTitle; + _content = content; + _coverImg = coverImg; + _author = author; + _type = type; + _likes = likes; + _viewers = viewers; + _startTime = startTime; + _endTime = endTime; + _isHot = isHot; + _state = state; + _location = location; + _longitude = longitude; + _latitude = latitude; + _remark = remark; + _isDelete = isDelete; + _tenantCode = tenantCode; + _storeName = storeName; + _liked = liked; + _followed = followed; + _comments = comments; + _authorName = authorName; + _authorHeadImg = authorHeadImg; + } + + Article.fromJson(dynamic json) { + _id = json['id']; + _createTime = json['createTime']; + _createUser = json['createUser']; + _updateTime = json['updateTime']; + _updateUser = json['updateUser']; + _storeId = json['storeId']; + _categoryId = json['categoryId']; + _mainTitle = json['mainTitle']; + _viceTitle = json['viceTitle']; + _content = json['content']; + _coverImg = json['coverImg']; + _author = json["author"] == null ? author : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):json["author"]; + _type = json['type']; + _likes = json['likes']; + _viewers = json['viewers']; + _startTime = json['startTime']; + _endTime = json['endTime']; + _isHot = json['isHot']; + _state = json['state']; + _location = json['location']; + _longitude = json['longitude']; + _latitude = json['latitude']; + _remark = json['remark']; + _isDelete = json['isDelete']; + _tenantCode = json['tenantCode']; + _storeName = json['storeName']; + _liked = json['liked']; + _followed = json['followed']; + _comments = json['comments']; + _authorName = json['authorName']; + _authorHeadImg = json['authorHeadImg']; + } String _id; String _createTime; - dynamic _createUser; + String _createUser; String _updateTime; - dynamic _updateUser; + String _updateUser; String _storeId; + String _categoryId; String _mainTitle; dynamic _viceTitle; String _content; String _coverImg; dynamic _author; int _type; + int _likes; + int _viewers; String _startTime; - String _categoryId; String _endTime; + bool _isHot; int _state; + String _location; + String _longitude; + String _latitude; + String _remark; int _isDelete; - int _likes; - bool _isHot; + String _tenantCode; + dynamic _storeName; bool _liked; - int _viewers; - int _comments; + bool _followed; + dynamic _comments; String _authorName; String _authorHeadImg; - bool isFollow; - dynamic _storeName; String get id => _id; String get createTime => _createTime; - dynamic get createUser => _createUser; + String get createUser => _createUser; String get updateTime => _updateTime; - dynamic get updateUser => _updateUser; + String get updateUser => _updateUser; String get storeId => _storeId; + String get categoryId => _categoryId; String get mainTitle => _mainTitle; dynamic get viceTitle => _viceTitle; String get content => _content; String get coverImg => _coverImg; dynamic get author => _author; int get type => _type; + int get likes => _likes; + int get viewers => _viewers; String get startTime => _startTime; - String get categoryId => _categoryId; String get endTime => _endTime; + bool get isHot => _isHot; int get state => _state; + String get location => _location; + String get longitude => _longitude; + String get latitude => _latitude; + String get remark => _remark; int get isDelete => _isDelete; - int get likes => _likes; - bool get isHot => _isHot; + String get tenantCode => _tenantCode; + dynamic get storeName => _storeName; bool get liked => _liked; - int get viewers => _viewers; - int get comments => _comments; + bool get followed => _followed; + dynamic get comments => _comments; String get authorName => _authorName; String get authorHeadImg => _authorHeadImg; - dynamic get storeName => _storeName; - set id(String value) { - _id = value; + Map toJson() { + final map = {}; + map['id'] = _id; + map['createTime'] = _createTime; + map['createUser'] = _createUser; + map['updateTime'] = _updateTime; + map['updateUser'] = _updateUser; + map['storeId'] = _storeId; + map['categoryId'] = _categoryId; + map['mainTitle'] = _mainTitle; + map['viceTitle'] = _viceTitle; + map['content'] = _content; + map['coverImg'] = _coverImg; + map["author"] = _author.toJson() ?? _author; + map['type'] = _type; + map['likes'] = _likes; + map['viewers'] = _viewers; + map['startTime'] = _startTime; + map['endTime'] = _endTime; + map['isHot'] = _isHot; + map['state'] = _state; + map['location'] = _location; + map['longitude'] = _longitude; + map['latitude'] = _latitude; + map['remark'] = _remark; + map['isDelete'] = _isDelete; + map['tenantCode'] = _tenantCode; + map['storeName'] = _storeName; + map['liked'] = _liked; + map['followed'] = _followed; + map['comments'] = _comments; + map['authorName'] = _authorName; + map['authorHeadImg'] = _authorHeadImg; + return map; } - set likes(int value) { - _likes = value; + set authorHeadImg(String value) { + _authorHeadImg = value; + } + + set authorName(String value) { + _authorName = value; + } + + set comments(dynamic value) { + _comments = value; + } + + set followed(bool value) { + _followed = value; } set liked(bool value) { _liked = value; } - set viewers(int value) { - _viewers = value; + set storeName(dynamic value) { + _storeName = value; } - set comments(int value) { - _comments = value; + set tenantCode(String value) { + _tenantCode = value; } - set authorName(String value) { - _authorName = value; + set isDelete(int value) { + _isDelete = value; } - set authorHeadImg(String value) { - _authorHeadImg = value; + set remark(String value) { + _remark = value; } - Article({ - String id, - String createTime, - dynamic createUser, - String updateTime, - dynamic updateUser, - String storeId, - String mainTitle, - dynamic viceTitle, - String content, - String coverImg, - Author author, - int type, - String startTime, - String endTime, - int state, - int isDelete, - int likes, - bool isHot, - int viewers, - int comments, - String authorName, - String authorHeadImg, - - dynamic storeName}){ - _id = id; - _createTime = createTime; - _createUser = createUser; - _updateTime = updateTime; - _updateUser = updateUser; - _storeId = storeId; - _mainTitle = mainTitle; - _viceTitle = viceTitle; - _content = content; - _coverImg = coverImg; - _author = author; - _type = type; - _startTime = startTime; - _categoryId = categoryId; - _endTime = endTime; - _state = state; - _isDelete = isDelete; - _likes = likes; - _isHot = isHot; - _liked = liked; - _viewers = viewers; - _comments = comments; - _authorName = authorName; - _authorHeadImg = authorHeadImg; - _storeName = storeName; -} + set latitude(String value) { + _latitude = value; + } - Article.fromJson(dynamic json) { - _id = json["id"]; - _createTime = json["createTime"]; - _createUser = json["createUser"]; - _updateTime = json["updateTime"]; - _updateUser = json["updateUser"]; - _storeId = json["storeId"]; - _mainTitle = json["mainTitle"]; - _viceTitle = json["viceTitle"]; - _content = json["content"]; - _coverImg = json["coverImg"]; - _author = json["author"] == null ? null : json["author"].toString().startsWith("{") ? Author.fromJson(jsonDecode(json["author"])):null; - _type = json["type"]; - _startTime = json["startTime"]; - _categoryId = json["categoryId"]; - _endTime = json["endTime"]; - _state = json["state"]; - _isDelete = json["isDelete"]; - _likes = json["likes"]; - _isHot = json["isHot"]; - _liked = json["liked"]; - _viewers = json["viewers"]; - _comments = json["comments"]; - _authorName = json["authorName"]; - _authorHeadImg = json["authorHeadImg"]; - _storeName = json["storeName"]; + set longitude(String value) { + _longitude = value; } - Map toJson() { - var map = {}; - map["id"] = _id; - map["createTime"] = _createTime; - map["createUser"] = _createUser; - map["updateTime"] = _updateTime; - map["updateUser"] = _updateUser; - map["storeId"] = _storeId; - map["mainTitle"] = _mainTitle; - map["viceTitle"] = _viceTitle; - map["content"] = _content; - map["coverImg"] = _coverImg; - map["author"] = _author.toJson(); - map["type"] = _type; - map["startTime"] = _startTime; - map["categoryId"] = _categoryId; - map["endTime"] = _endTime; - map["state"] = _state; - map["isDelete"] = _isDelete; - map["likes"] = _likes; - map["isHot"] = _isHot; - map["liked"] = _liked; - map["viewers"] = _viewers; - map["comments"] = _comments; - map["authorName"] = _authorName; - map["authorHeadImg"] = _authorHeadImg; - map["storeName"] = _storeName; - return map; + set location(String value) { + _location = value; } - set createTime(String value) { - _createTime = value; + set state(int value) { + _state = value; } - set createUser(dynamic value) { - _createUser = value; + set isHot(bool value) { + _isHot = value; } - set updateTime(String value) { - _updateTime = value; + set endTime(String value) { + _endTime = value; } - set updateUser(dynamic value) { - _updateUser = value; + set startTime(String value) { + _startTime = value; } - set storeId(String value) { - _storeId = value; + set viewers(int value) { + _viewers = value; } - set mainTitle(String value) { - _mainTitle = value; + set likes(int value) { + _likes = value; } - set viceTitle(dynamic value) { - _viceTitle = value; + set type(int value) { + _type = value; } - set content(String value) { - _content = value; + set author(dynamic value) { + _author = value; } set coverImg(String value) { _coverImg = value; } - set author(dynamic value) { - _author = value; + set content(String value) { + _content = value; } - set type(int value) { - _type = value; + set viceTitle(dynamic value) { + _viceTitle = value; } - set startTime(String value) { - _startTime = value; + set mainTitle(String value) { + _mainTitle = value; } set categoryId(String value) { _categoryId = value; } - set endTime(String value) { - _endTime = value; + set storeId(String value) { + _storeId = value; } - set state(int value) { - _state = value; + set updateUser(String value) { + _updateUser = value; } - set isDelete(int value) { - _isDelete = value; + set updateTime(String value) { + _updateTime = value; } - set isHot(bool value) { - _isHot = value; + set createUser(String value) { + _createUser = value; } - set storeName(dynamic value) { - _storeName = value; + set createTime(String value) { + _createTime = value; + } + + set id(String value) { + _id = value; } } \ No newline at end of file diff --git a/lib/retrofit/data/base_data.g.dart b/lib/retrofit/data/base_data.g.dart index 8c7d9178..3a4ba372 100644 --- a/lib/retrofit/data/base_data.g.dart +++ b/lib/retrofit/data/base_data.g.dart @@ -10,16 +10,6 @@ BaseData _$BaseDataFromJson( Map json, T Function(Object json) fromJsonT, ) { - if(!(json['isSuccess'] as bool)) - return BaseData() - ..code = json['code'] as int - ..data = null - ..extra = json['extra'] - ..isError = json['isError'] as bool - ..isSuccess = json['isSuccess'] as bool - ..msg = json['msg'] as String - ..path = json['path'] as String - ..timestamp = json['timestamp'] as String; return BaseData() ..code = json['code'] as int ..data = fromJsonT(json['data']) diff --git a/lib/retrofit/data/comunity_comment.dart b/lib/retrofit/data/comunity_comment.dart index 3cb78955..ba218cd3 100644 --- a/lib/retrofit/data/comunity_comment.dart +++ b/lib/retrofit/data/comunity_comment.dart @@ -11,16 +11,19 @@ class ComunityComment { ComunityComment({ - String id, - String subject, - SubjectInfo subjectInfo, - MemberInfo memberInfo, - int likes, - int viewers, - int comments, - bool selfLike, + String id, + String subject, + SubjectInfo subjectInfo, + MemberInfo memberInfo, + int likes, + int viewers, + int comments, + bool selfLike, bool selfFollow, String createTime, + String location, + String longitude, + String latitude, String coverImg,}){ this.id = id; this.subject = subject; @@ -32,6 +35,9 @@ class ComunityComment { this.selfLike = selfLike; this.selfFollow = selfFollow; this.createTime = createTime; + this.location = location; + this.longitude = longitude; + this.latitude = latitude; this.coverImg = coverImg; } @@ -46,6 +52,9 @@ class ComunityComment { this.selfLike = json['selfLike']; this.selfFollow = json['selfFollow']; this.createTime = json['createTime']; + this.location = json['location']; + this.longitude = json['longitude']; + this.latitude = json['latitude']; this.coverImg = json['coverImg']; } String id; @@ -58,6 +67,9 @@ class ComunityComment { bool selfLike; bool selfFollow; String createTime; + String location; + String longitude; + String latitude; String coverImg; Map toJson() { @@ -76,6 +88,9 @@ class ComunityComment { map['selfLike'] = this.selfLike; map['selfFollow'] = this.selfFollow; map['createTime'] = this.createTime; + map['location'] = this.location; + map['longitude'] = this.longitude; + map['latitude'] = this.latitude; map['coverImg'] = this.coverImg; return map; } @@ -88,8 +103,8 @@ class ComunityComment { class MemberInfo { MemberInfo({ - dynamic mid, - dynamic nickname, + dynamic mid, + dynamic nickname, String avatar,}){ this.mid = mid; this.nickname = nickname; @@ -121,8 +136,8 @@ class MemberInfo { class SubjectInfo { SubjectInfo({ - String type, - List images, + String type, + List images, String video, String coverImg,}){ this.type = type; diff --git a/lib/retrofit/data/member_Infor.dart b/lib/retrofit/data/member_Infor.dart new file mode 100644 index 00000000..c9daf168 --- /dev/null +++ b/lib/retrofit/data/member_Infor.dart @@ -0,0 +1,134 @@ +/// id : "1379254113602109440" +/// nickname : "哈哈哈" +/// headimg : "https://pos.upload.gznl.top/admin/2021/08/1f8d55ed-85d2-42a2-b155-6737a66226e8.jpg" +/// userType : true +/// sex : "0" +/// level : 1 +/// remark : "" +/// createTime : "2021-04-06 10:06:21" +/// birth : "1998-09-17" +/// organic : 0 +/// age : 23 +/// signature : "" +/// background : "" +/// follow : 1 +/// fans : 0 +/// trendTotal : 4 +/// gainLikeTotal : 9 + +class MemberInfor { + MemberInfor({ + String id, + String nickname, + String headimg, + bool userType, + String sex, + int level, + String remark, + String createTime, + String birth, + int organic, + int age, + String signature, + String background, + int follow, + int fans, + int trendTotal, + int gainLikeTotal,}){ + _id = id; + _nickname = nickname; + _headimg = headimg; + _userType = userType; + _sex = sex; + _level = level; + _remark = remark; + _createTime = createTime; + _birth = birth; + _organic = organic; + _age = age; + _signature = signature; + _background = background; + _follow = follow; + _fans = fans; + _trendTotal = trendTotal; + _gainLikeTotal = gainLikeTotal; +} + + MemberInfor.fromJson(dynamic json) { + _id = json['id']; + _nickname = json['nickname']; + _headimg = json['headimg']; + _userType = json['userType']; + _sex = json['sex']; + _level = json['level']; + _remark = json['remark']; + _createTime = json['createTime']; + _birth = json['birth']; + _organic = json['organic']; + _age = json['age']; + _signature = json['signature']; + _background = json['background']; + _follow = json['follow']; + _fans = json['fans']; + _trendTotal = json['trendTotal']; + _gainLikeTotal = json['gainLikeTotal']; + } + String _id; + String _nickname; + String _headimg; + bool _userType; + String _sex; + int _level; + String _remark; + String _createTime; + String _birth; + int _organic; + int _age; + String _signature; + String _background; + int _follow; + int _fans; + int _trendTotal; + int _gainLikeTotal; + + String get id => _id; + String get nickname => _nickname; + String get headimg => _headimg; + bool get userType => _userType; + String get sex => _sex; + int get level => _level; + String get remark => _remark; + String get createTime => _createTime; + String get birth => _birth; + int get organic => _organic; + int get age => _age; + String get signature => _signature; + String get background => _background; + int get follow => _follow; + int get fans => _fans; + int get trendTotal => _trendTotal; + int get gainLikeTotal => _gainLikeTotal; + + Map toJson() { + final map = {}; + map['id'] = _id; + map['nickname'] = _nickname; + map['headimg'] = _headimg; + map['userType'] = _userType; + map['sex'] = _sex; + map['level'] = _level; + map['remark'] = _remark; + map['createTime'] = _createTime; + map['birth'] = _birth; + map['organic'] = _organic; + map['age'] = _age; + map['signature'] = _signature; + map['background'] = _background; + map['follow'] = _follow; + map['fans'] = _fans; + map['trendTotal'] = _trendTotal; + map['gainLikeTotal'] = _gainLikeTotal; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/min_order_info.dart b/lib/retrofit/data/min_order_info.dart index 6979e2d9..d2370a0a 100644 --- a/lib/retrofit/data/min_order_info.dart +++ b/lib/retrofit/data/min_order_info.dart @@ -62,8 +62,8 @@ class MinOrderInfo { String totalDiscountPrice, int orderSource, dynamic address, - dynamic discountPercent, - dynamic discountAmount, + dynamic discountPercent, + String discountAmount, dynamic discountType, dynamic discountMoney, dynamic overTime, @@ -315,7 +315,7 @@ class MinOrderInfo { int orderSource; dynamic address; dynamic discountPercent; - dynamic discountAmount; + String discountAmount; dynamic discountType; dynamic discountMoney; dynamic overTime; @@ -451,8 +451,8 @@ class OrderInfoVo { MemberVO memberVO, String postAge, String price, - String orderSum, - dynamic discountAmount, + String orderSum, + String discountAmount, dynamic promotionInfoList, dynamic couponList, String threshold, @@ -495,7 +495,7 @@ class OrderInfoVo { String postAge; String price; String orderSum; - dynamic discountAmount; + String discountAmount; dynamic promotionInfoList; dynamic couponList; String threshold; diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index ad65f6f7..2eb63867 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -41,6 +41,10 @@ class UserInfo { String masterCardRankName; MemberRank memberRankVo; String inviteCode; + String signature; + String background; + + factory UserInfo.fromJson(Map json) => UserInfo() @@ -65,6 +69,8 @@ class UserInfo { ..todayInviteNumber = json['todayInviteNumber'] as int ..masterCardRankName = json['masterCardRankName'] as String ..inviteCode = json['inviteCode'] as String + ..signature = json['signature'] as String + ..background = json['background'] as String ..memberRankVo = json['memberRankVo'] == null ? null : MemberRank.fromJson(json['memberRankVo'] as Map); @@ -91,6 +97,8 @@ class UserInfo { "todayInviteNumber": this.todayInviteNumber, 'masterCardRankName': this.masterCardRankName, 'inviteCode' : this.inviteCode, - 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), + 'signature' : this.signature, + 'background' : this.background, + 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), }; } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index ea00a142..1ddffe68 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -19,6 +19,7 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; import 'data/achievement_detail_list.dart'; +import 'data/activity_pos.dart'; import 'data/address.dart'; import 'data/banner.dart'; import 'data/brand_data.dart'; @@ -36,6 +37,7 @@ import 'data/headlines_list.dart'; import 'data/headlines_list_details.dart'; import 'data/invitation_list.dart'; import 'data/logistics.dart'; +import 'data/member_Infor.dart'; import 'data/member_comment_list.dart'; import 'data/message.dart'; import 'data/msg_stats.dart'; @@ -88,8 +90,8 @@ abstract class ApiService { headers["Environment"] = "app"; } dio.options = BaseOptions( - connectTimeout: 20000, - receiveTimeout: 20000, + connectTimeout: 60000, + receiveTimeout: 60000, headers: headers, responseType: ResponseType.json, ); @@ -496,9 +498,15 @@ abstract class ApiService { Future wiped(@Path("memberCouponId") String memberCouponId); ///查询优惠券详情 - @GET("coupon/detail/") + @GET("/coupon/detail/") Future> couponDetail(@Path("") String memberCouponId); + ///查询会员信息 + @GET("/member/detail/{id}") + Future> memberDetail(@Path("id") String id); + ///活动弹窗 + @GET("/home/appPopup") + Future> appPopup(); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 944d89cd..aaa817ba 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -92,7 +92,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => LoginInfo.fromJson(json), + (json) => LoginInfo.fromJson(json), ); return value; } @@ -293,7 +293,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -352,15 +352,13 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _headers = {}; - _headers.addAll({"Environment":"app"}); _data.addAll(param ?? {}); final _result = await _dio.request>( '/creditOrder/create', queryParameters: queryParameters, options: RequestOptions( method: 'POST', - headers: _headers, + headers: {}, extra: _extra, baseUrl: baseUrl), data: _data); @@ -1015,8 +1013,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>( - '/app-msg/stats', + final _result = await _dio.request>('/app-msg/stats', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -1026,7 +1023,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) + (json) => (json as List) .map((i) => MsgStats.fromJson(i as Map)) .toList()); return value; @@ -1192,7 +1189,7 @@ class _ApiService implements ApiService { } @override - Future> orderCancel(id) async { + Future> orderCancel(id) async { ArgumentError.checkNotNull(id, 'id'); const _extra = {}; final queryParameters = {}; @@ -1206,9 +1203,9 @@ class _ApiService implements ApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, - (json) => json as bool, + (json) => json as dynamic, ); return value; } @@ -1392,8 +1389,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => CategorySelectList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => CategorySelectList.fromJson(i as Map)) .toList()); return value; } @@ -1415,7 +1413,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) + (json) => (json as List) .map((i) => Chapter.fromJson(i as Map)) .toList()); return value; @@ -1428,8 +1426,7 @@ class _ApiService implements ApiService { final queryParameters = {}; final _data = {}; _data.addAll(map ?? {}); - final _result = await _dio.request>( - '/course/list', + final _result = await _dio.request>('/course/list', queryParameters: queryParameters, options: RequestOptions( method: 'POST', @@ -1439,9 +1436,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => PageInfo.fromJson( + (json) => PageInfo.fromJson( json, - (json) => CourseList.fromJson(json), + (json) => CourseList.fromJson(json), ), ); return value; @@ -1463,8 +1460,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => CollectClassList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => CollectClassList.fromJson(i as Map)) .toList()); return value; } @@ -1486,8 +1484,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => CourseList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => CourseList.fromJson(i as Map)) .toList()); return value; } @@ -1498,8 +1497,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>( - '/course/$id', + final _result = await _dio.request>('/course/$id', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -1509,7 +1507,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => CourseDetails.fromJson(json), + (json) => CourseDetails.fromJson(json), ); return value; } @@ -1531,19 +1529,20 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @override - Future>> findBadges(param) async { - ArgumentError.checkNotNull(param, 'param'); + Future>> findBadges(map) async { + ArgumentError.checkNotNull(map, 'map'); const _extra = {}; final queryParameters = {}; final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('/app-memberAchievement/findBadges', + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/app-memberAchievement/findBadges', queryParameters: queryParameters, options: RequestOptions( method: 'POST', @@ -1553,14 +1552,16 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => VipBadgesList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => VipBadgesList.fromJson(i as Map)) .toList()); return value; } @override - Future>> getAchievementDetail(achievementCategoryId) async { + Future>> getAchievementDetail( + achievementCategoryId) async { ArgumentError.checkNotNull(achievementCategoryId, 'achievementCategoryId'); const _extra = {}; final queryParameters = {}; @@ -1576,8 +1577,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => AchievementDetailList.fromJson(i as Map)) + (json) => (json as List) + .map((i) => + AchievementDetailList.fromJson(i as Map)) .toList()); return value; } @@ -1598,8 +1600,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => VipBenefitList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => VipBenefitList.fromJson(i as Map)) .toList()); return value; } @@ -1609,8 +1612,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>( - '/home/vipBenefit', + final _result = await _dio.request>('/home/vipBenefit', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -1620,7 +1622,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => VipRuleDetails.fromJson(json), + (json) => VipRuleDetails.fromJson(json), ); return value; } @@ -1641,8 +1643,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => SecondCardList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => SecondCardList.fromJson(i as Map)) .toList()); return value; } @@ -1664,7 +1667,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -1686,7 +1689,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -1708,7 +1711,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => Logistics.fromJson(json), + (json) => Logistics.fromJson(json), ); return value; } @@ -1730,7 +1733,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -1751,8 +1754,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => (json as List) - .map((i) => HeadlinesList.fromJson(i as Map)) + (json) => (json as List) + .map( + (i) => HeadlinesList.fromJson(i as Map)) .toList()); return value; } @@ -1774,7 +1778,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => HeadlinesListDetails.fromJson(json), + (json) => HeadlinesListDetails.fromJson(json), ); return value; } @@ -1797,9 +1801,9 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => PageInfo.fromJson( + (json) => PageInfo.fromJson( json, - (json) => InvitationList.fromJson(json), + (json) => InvitationList.fromJson(json), ), ); return value; @@ -1822,7 +1826,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => json as dynamic, ); return value; } @@ -1833,8 +1837,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>( - 'coupon/detail/$memberCouponId', + final _result = await _dio.request>('coupon/detail/', queryParameters: queryParameters, options: RequestOptions( method: 'GET', @@ -1844,9 +1847,51 @@ class _ApiService implements ApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => CouponDetail.fromJson(json), + (json) => CouponDetail.fromJson(json), + ); + return value; + } + + @override + Future> memberDetail(id) async { + ArgumentError.checkNotNull(id, 'id'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>('/member/detail/$id', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => MemberInfor.fromJson(json), ); return value; } + + @override + Future> appPopup() async { + const _extra = {}; + final queryParameters = {}; + final _data = {}; + final _result = await _dio.request>( + '/home/appPopup', + queryParameters: queryParameters, + options: RequestOptions( + method: 'GET', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData.fromJson( + _result.data, + (json) => ActivityPos.fromJson(json), + ); + return value; + } } diff --git a/lib/setting/help_feedback_page.dart b/lib/setting/help_feedback_page.dart index 8bfc9949..b45d46b1 100644 --- a/lib/setting/help_feedback_page.dart +++ b/lib/setting/help_feedback_page.dart @@ -167,7 +167,7 @@ class _HelpFeedbackPage extends State { BaseData baseData = await apiService.report({ "mobile": phone, "reportContent": content, - }); + }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("反馈成功"); Navigator.of(context).pop(); diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 54624a1d..2bd3eaa7 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -57,7 +57,7 @@ class _Settlement extends State { String remakers = ""; String parentCode = ""; String parentId = ""; - int payChannel = 4; + int payChannel = 1; int tableId = 0; int numberOfPeople = 0; String pageType = "1"; @@ -170,6 +170,8 @@ class _Settlement extends State { setState(() { minOrderInfo = baseData.data; }); + }else{ + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -306,6 +308,8 @@ class _Settlement extends State { this.downOrder = baseData.data; querySettlement(); } else { + baseData?.isSuccess ?? false ? + SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center) : SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } else { @@ -354,11 +358,13 @@ class _Settlement extends State { ? minOrderInfo.orderProductVOList : downOrder.orderProductVOList; if (placeOrderFirst.payChannel == 1) { - if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - await Min.initialize(); + if(Platform.isAndroid){ + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } } BaseData baseData = await minService .settlementWx(placeOrderFirst.toJson()) diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 2eab3dbf..1d112d39 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -200,7 +200,7 @@ class _ActivityCouponRemarks extends State { ), Expanded( child: Text( - widget.remark != ""? widget.remark:"口味、面包硬度等", + widget.remark != "" ? widget.remark:"点击添加备注", textAlign: TextAlign.end, style: TextStyle( fontSize: 14.sp, diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index e6a74e04..84b90b7f 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -190,7 +190,7 @@ class _PayMethod extends State { ); } - var checkIndex = 1; + var checkIndex = 3; Widget checkView(var index) { return Container( diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 2dcbdef4..93e8a0f5 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -385,7 +385,7 @@ class _SettlementOrderCommodity extends State { String discountPrice(){ if(widget.minOrderInfo != null){ - return (widget.minOrderInfo.discountAmount ?? "0") + double.parse(widget.settleOrderInfo.benefitDiscountAmount ?? "0"); + return (widget.minOrderInfo.discountAmount ?? "0") + (widget.settleOrderInfo.benefitDiscountAmount ?? "0"); }else if(widget.tableId < 0){ return "0"; }else { diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index f6dc08ee..dcd83b2a 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -232,10 +232,10 @@ class _StoreOrderPage extends State handle: NestedScrollView.sliverOverlapAbsorberHandleFor( context), sliver: SliverAppBar( - expandedHeight: - (storeInfo != null && storeInfo.couponVOList != null) - ? 470.h - : 365.h, + expandedHeight: (storeInfo != null && + storeInfo.couponVOList != null) + ? 495.h + : 395.h, floating: false, snap: false, pinned: true, @@ -317,7 +317,7 @@ class _StoreOrderPage extends State ], ), ), - top: 100.h, + top:105.h, bottom: 0, left: 0, right: 0, @@ -488,8 +488,7 @@ class _StoreOrderPage extends State ), ], ), - ), - ); + ); } ///领取优惠券 @@ -561,15 +560,15 @@ class _StoreOrderPage extends State "tableId": tableId, "parentCode": parentCode, "parentId": parentId, - "pName":pName, - "pid":pid, - "cName":cName, - "cid":cid, + "pName": pName, + "pid": pid, + "cName": cName, + "cid": cid, "shoppingCart": shopCarGoods, "numberOfPeople": numberOfPeople, }, ); - if(tableId >0){ + if (tableId > 0) { getParentInfo(); } queryShopCar().then((value) { @@ -650,7 +649,7 @@ class _StoreOrderPage extends State } ///选规格 - _queryMiNiDetail(String id,int count) async { + _queryMiNiDetail(String id, int count) async { EasyLoading.show(status: S.current.zhengzaijiazai); if(count < 0){ shopCarGoods.shoppingCartSkuItemList.forEach((element) { @@ -753,28 +752,28 @@ class _StoreOrderPage extends State ///查询购物车 Future queryShopCar() async { - pName="";//活动 - pid="";//活动 - cName="";//优惠券 - cid="";//优惠券 + pName = ""; //活动 + pid = ""; //活动 + cName = ""; //优惠券 + cid = ""; //优惠券 BaseData> baseDate = await minService.getShoppingCart(tableId); if (baseDate != null && baseDate.isSuccess && baseDate.data != null && baseDate.data.length > 0) { - if( baseDate.data[0].selectDiscount ==1){ + if (baseDate.data[0].selectDiscount == 1) { baseDate.data[0].couponList.forEach((element) { - if(element.isMaxCoupon){ + if (element.isMaxCoupon) { cName = element.promotionName; cid = element.id; } }); - }else if(baseDate.data[0].selectDiscount==2){ + } else if (baseDate.data[0].selectDiscount == 2) { baseDate.data[0].promotionInfoList.forEach((element) { - if(element.isMaxPromotion){ - pName=element.name; - pid=element.id; + if (element.isMaxPromotion) { + pName = element.name; + pid = element.id; } }); } diff --git a/lib/store/store_view/store_info.dart b/lib/store/store_view/store_info.dart index efb45ac3..4409c874 100644 --- a/lib/store/store_view/store_info.dart +++ b/lib/store/store_view/store_info.dart @@ -30,7 +30,7 @@ class _StoreInfoView extends State { top: 5.h, bottom: 6.h, ), - height: 143.h, + height: 154.h, padding: EdgeInsets.all(12.w), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 0dd1def7..bf0798d7 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -170,7 +170,7 @@ class _UnionDetailsPage extends State { ///领取优惠券 _receiveCoupon(couponId) async { - BaseData baseData = await apiService.receiveCoupon(couponId); + BaseData baseData = await apiService.receiveCoupon(couponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { queryStoreInfo(); showAlertDialog(); @@ -192,7 +192,7 @@ class _UnionDetailsPage extends State { ///领取VIP _receiveVip() async { - BaseData baseData = await apiService.minLogin(storeInfo.id); + BaseData baseData = await apiService.minLogin(storeInfo.id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast(S.of(context).lingquchenggong, alignment: Alignment.center); @@ -217,7 +217,7 @@ class _UnionDetailsPage extends State { alignment: Alignment.center); return; } - BaseData baseData = await apiService.minLogin(storeInfo.id); + BaseData baseData = await apiService.minLogin(storeInfo.id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { UserEntity userEntity = UserEntity.fromJson(baseData.data); startMin(userEntity.token, userEntity.userId); @@ -227,8 +227,13 @@ class _UnionDetailsPage extends State { startMin(token, userId) async { if (storeInfo == null) return; if (storeInfo.mini == null) return; - if (!(await Min.isInitialize())) { - await Min.initialize(); + if(Platform.isAndroid){ + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } } printMin(); String miniAppId = storeInfo.mini.miniAppId; diff --git a/lib/view_widget/activity_poster.dart b/lib/view_widget/activity_poster.dart new file mode 100644 index 00000000..c4baf746 --- /dev/null +++ b/lib/view_widget/activity_poster.dart @@ -0,0 +1,113 @@ + + +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/data/activity_pos.dart'; + +import 'custom_image.dart'; + +class ActivityPoster extends StatefulWidget { + final ActivityPos activityPos; + + ActivityPoster(this.activityPos); + + @override + State createState() { + return _ActivityPoster(); + } +} + +class _ActivityPoster extends State { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: 289, + alignment: Alignment.center, + margin: EdgeInsets.only( + left:37, + right:37, + ), + child: Stack( + children: [ + GestureDetector( + onTap: (){ + jumpClick(widget.activityPos); + }, + child: + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + ), + child:MImage( + widget?.activityPos?.showImage ?? "", + width: double.infinity, + height: MediaQuery.of(context).size.height / 2, + fit: BoxFit.cover, + radius: BorderRadius.all(Radius.circular(12)), + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ),), + ), + Container( + padding: EdgeInsets.only(top: 8,right: 8,bottom:8), + child:GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pop(); + }, + child: Row(children: [ + Spacer(), + Image.asset( + "assets/image/cancel.png", + width: 24, + height: 24, + color: Colors.white, + ) + ],) + ) ) + ], + ), + ); + } + + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) + jumpClick(ActivityPos activityPos) async { + switch (activityPos.jumpType) { + case 1: + Navigator.of(context).pushNamed('/router/integral_store_page', + arguments: {"goodsId": widget.activityPos.jumpUrl}); + break; + case 2: + Navigator.of(context) + .pushNamed('/router/web_page', arguments: { + "activityId": widget.activityPos.jumpUrl, + }); + break; + case 3: + Navigator.of(context) + .pushNamed('/router/web_page', arguments: { + "articleId": widget.activityPos.jumpUrl, + }); + break; + case 4: + String router = widget.activityPos.jumpUrl; + if (router.contains("?")) { + String params = router.substring(router.indexOf("?")); + params = params.replaceAll("?", ""); + Map map = jsonDecode(params); + Navigator.of(context).pushNamed(router, arguments: map); + } else { + Navigator.of(context).pushNamed(router); + } + break; + case 5: + Navigator.of(context) + .pushNamed('/router/class_details', arguments: { + "id": widget.activityPos.jumpUrl, + }); + break; + } + } +} diff --git a/lib/view_widget/hot_item.dart b/lib/view_widget/hot_item.dart index 6a8bb590..ea02621b 100644 --- a/lib/view_widget/hot_item.dart +++ b/lib/view_widget/hot_item.dart @@ -38,7 +38,7 @@ class _HotArticleItem extends State { ///关注/取关会员 _vipFollow(followId) async { - BaseData baseData = await apiService.follow(followId); + BaseData baseData = await apiService.follow(followId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("关注成功"); } diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index 6766255e..7cc2e01b 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -183,7 +183,7 @@ class MineVipView extends StatelessWidget { style: TextStyle( color: textColor, fontWeight: MyFontWeight.semi_bold, - fontSize: 23.sp, + fontSize:22.sp, ), ), ), @@ -228,7 +228,7 @@ class MineVipView extends StatelessWidget { style: TextStyle( color: textColor, fontWeight: MyFontWeight.regular, - fontSize: 14.sp, + fontSize: 12.sp, ), ), flex: 1, @@ -239,7 +239,7 @@ class MineVipView extends StatelessWidget { TextSpan( text: !(showRank??true)?(vipLevel == 3?"":rankMax.toString()):((vipLevel < curLevel)?rankMax.toString():rank.toString()), style: TextStyle( - fontSize: 26.sp, + fontSize: 20.sp, fontWeight: MyFontWeight.semi_bold, color: textColor, ), @@ -257,7 +257,7 @@ class MineVipView extends StatelessWidget { TextSpan( text: rankMax > 0 ? "/$rankMax" : "/0", style: TextStyle( - fontSize: 14.sp, + fontSize: 12.sp, fontWeight: MyFontWeight.regular, color: textColor, ), diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index b381c0f8..afc6e94c 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -28,7 +28,7 @@ class NewCouponWidget extends StatelessWidget { // } return Container( - height: (coupon != null && coupon.isEx) ? 152.h : 140.h, + height: (coupon != null && coupon.isEx) ? 168.h : 151.h, width: double.infinity, margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), decoration: BoxDecoration( @@ -155,7 +155,7 @@ class NewCouponWidget extends StatelessWidget { Expanded( flex: (coupon != null && coupon.isEx) ? 56 : 42, child: Container( - margin: EdgeInsets.symmetric(horizontal: 23.w, vertical: 8.h), + margin: EdgeInsets.symmetric(horizontal: 23.w, vertical: 7.h), child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ @@ -197,7 +197,7 @@ class NewCouponWidget extends StatelessWidget { (coupon.useStartTime == null && coupon.useEndTime == null) ? S.of(context).quantian - : "${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]} - ${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}", + : "${coupon.useStartTime} - ${coupon.useEndTime}", style: TextStyle( color: Color(0xFF353535), fontSize: 10.sp, diff --git a/lib/view_widget/new_people_reward.dart b/lib/view_widget/new_people_reward.dart index d2f89108..6fb311ec 100644 --- a/lib/view_widget/new_people_reward.dart +++ b/lib/view_widget/new_people_reward.dart @@ -108,7 +108,7 @@ class _NewPeopleReward extends State { Widget rewardItem(FirstLoginCouponList firstLoginCouponList) { return Container( - height:90.h, + // height:90.h, width: double.infinity, decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/view_widget/no_data_view.dart b/lib/view_widget/no_data_view.dart index 6dc7f808..6ad3d0b2 100644 --- a/lib/view_widget/no_data_view.dart +++ b/lib/view_widget/no_data_view.dart @@ -64,4 +64,4 @@ class NoDataView extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/lib/view_widget/receive_success.dart b/lib/view_widget/receive_success.dart index 90cd3fcf..81d600b9 100644 --- a/lib/view_widget/receive_success.dart +++ b/lib/view_widget/receive_success.dart @@ -25,7 +25,7 @@ class ReceiveSuccess extends StatelessWidget { color: Colors.white, borderRadius: BorderRadius.circular(8),), width: 218.w, - height: 210.h, + height: 250.h, child: Column( children: [ Padding( diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 5b0463ba..0e137ec9 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -318,7 +318,7 @@ class _WebPage extends State with WidgetsBindingObserver { ///删除评论 delComment() async { BaseData baseData = await apiService.delComment( - widget.arguments["activityId"] ?? widget.arguments["articleId"]); + widget.arguments["activityId"] ?? widget.arguments["articleId"]).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { CommentListState _commentList = commentKey.currentState; _commentList.queryMemberCommentList(); diff --git a/lib/web/web_turntable_activity.dart b/lib/web/web_turntable_activity.dart new file mode 100644 index 00000000..edc642d8 --- /dev/null +++ b/lib/web/web_turntable_activity.dart @@ -0,0 +1,73 @@ +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'; +import 'package:flutter/cupertino.dart'; + +class WebTurntableActivity extends StatefulWidget { + final Map arguments; + + ///转盘活动 + WebTurntableActivity({this.arguments}); + + @override + State createState() { + return _WebTurntableActivity(); + } +} + +class _WebTurntableActivity extends State with WidgetsBindingObserver { + final ScrollController scrollController = ScrollController(); + String token; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addObserver(this); + + SharedPreferences.getInstance().then((value) => { + token = value.getString('token'), + }); + if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); + + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + action: Container( + margin: EdgeInsets.only(right: 10), + child: GestureDetector( + onTap: () { + // share(); + }, + child: Icon( + Icons.share, + size: 24, + color: Colors.black, + ), + ), + ), + title: "", + background: Color(0xFFFFFFFFF), + leadingColor: Colors.black, + ), + body: Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + alignment: Alignment.center, + child: + WebView( + initialUrl: "http://192.168.10.90:5500/lottery.html?token=${token}", + javascriptMode: JavascriptMode.unrestricted, + )), + ); + } +} diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart index 16227c23..fcbc63f9 100644 --- a/lib/web/web_view/web_content.dart +++ b/lib/web/web_view/web_content.dart @@ -59,7 +59,7 @@ class _WebContent extends State { // + "立即购买", style: { "html": Style( - backgroundColor: Colors.white + backgroundColor: Color(0xffffffff) ) }, onLinkTap: (url, ct, attributes, element) {