From 147f87f92c49ed8279ccebd159dca15961317340 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Sat, 25 Dec 2021 15:08:49 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=96=87=E7=AB=A0html=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=82=B9=E5=87=BB=E8=B7=B3=E8=BD=AC,=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F:ubb=20?= =?UTF-8?q?=E8=BD=AC=20html=20,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.lock b/pubspec.lock index 22191450..7de2881f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -269,7 +269,7 @@ packages: name: flutter_screenutil url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.1+3" + version: "5.0.2" flutter_smart_dialog: dependency: "direct main" description: From b49eefb65ed572863e8139727099b10c03fcffff Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 5 Jan 2022 16:39:02 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/retrofit/min_api.dart | 8 ++++---- lib/retrofit/min_api.g.dart | 2 +- lib/retrofit/retrofit_api.dart | 8 ++++---- lib/retrofit/retrofit_api.g.dart | 2 +- pubspec.lock | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 5b7f9a02..6a3061ec 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,8 +21,8 @@ import 'data/shoppingCart.dart'; part 'min_api.g.dart'; -// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 -// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 +const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 +const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -32,8 +32,8 @@ part 'min_api.g.dart'; // const baseUrl = "http://192.168.10.236:8765/app/";///费韬 -const base_url = "http://192.168.10.142:8765/app/";///詹云久 -const baseUrl = "http://192.168.10.142:8765/app/";///詹云久 +// const base_url = "http://192.168.10.142:8765/app/";///詹云久 +// const baseUrl = "http://192.168.10.142:8765/app/";///詹云久 // const base_url = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index ef360ca1..02d9988a 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.142:8765/app/'; + baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index fc8414cb..cf056f6e 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -53,8 +53,8 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -66,8 +66,8 @@ part 'retrofit_api.g.dart'; // const baseUrl = "http://192.168.10.37:8766/app/"; -const base_url = "http://192.168.10.142:8766/app/";///詹云久 -const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 +// const base_url = "http://192.168.10.142:8766/app/";///詹云久 +// const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 0adf7d45..d1a64c02 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.142:8766/app/'; + baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/pubspec.lock b/pubspec.lock index 7de2881f..8bac3749 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -269,7 +269,7 @@ packages: name: flutter_screenutil url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.2" + version: "5.0.3" flutter_smart_dialog: dependency: "direct main" description: @@ -552,7 +552,7 @@ packages: name: provider url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.1" + version: "6.0.2" pull_to_refresh: dependency: "direct main" description: From 21969316eb92b801be44ab2d0153fc9b3bb43c62 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 5 Jan 2022 18:47:18 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/src/main/AndroidManifest.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1cf9e0da..0b8a9c10 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,11 +1,11 @@ - + - - + + From 7c4b4f72276b81c795a67d67cd86cdc6f2f337d9 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 7 Jan 2022 11:24:56 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/retrofit/retrofit_api.g.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index d1a64c02..9dee0b09 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -27,6 +27,7 @@ class _ApiService implements ApiService { 'file', MultipartFile.fromFileSync(data.path, filename: data.path.split(Platform.pathSeparator).last))); + print("filename:${data.path}"); if (folderId != null) { _data.fields.add(MapEntry('folderId', folderId.toString())); } From c28ea9ce556f6c32a32bc483c22378fb3fea712d Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 7 Jan 2022 11:51:53 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/release_dynamic.dart | 2 +- lib/retrofit/retrofit_api.g.dart | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/community/release_dynamic.dart b/lib/community/release_dynamic.dart index 7e649ea8..cacbb575 100644 --- a/lib/community/release_dynamic.dart +++ b/lib/community/release_dynamic.dart @@ -186,7 +186,7 @@ class _ReleaseDynamic extends State { } else { thumbnail = await Thumbnails.getThumbnail( videoFile: file.path, - imageType: ThumbFormat.WEBP, + imageType: ThumbFormat.JPEG, quality: 10, ); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 9dee0b09..70952c93 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -23,11 +23,14 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = FormData(); + String fileName = data.path.split(Platform.pathSeparator).last; + if(!fileName.contains(".jpeg")) + fileName += ".jpeg"; _data.files.add(MapEntry( 'file', MultipartFile.fromFileSync(data.path, - filename: data.path.split(Platform.pathSeparator).last))); - print("filename:${data.path}"); + filename: fileName))); + print("filename:$fileName"); if (folderId != null) { _data.fields.add(MapEntry('folderId', folderId.toString())); } From 4e7e4cf898c03337f48e1578fa1910d200a00463 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 7 Jan 2022 11:57:06 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/retrofit/retrofit_api.g.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 70952c93..d221d3b7 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -24,7 +24,7 @@ class _ApiService implements ApiService { final queryParameters = {}; final _data = FormData(); String fileName = data.path.split(Platform.pathSeparator).last; - if(!fileName.contains(".jpeg")) + if(!fileName.contains(".jpeg") && !fileName.contains(".mp4") && !fileName.contains(".png")) fileName += ".jpeg"; _data.files.add(MapEntry( 'file', From db275a94bc114a09f8d7d1fb37ba7cff20f2e27e Mon Sep 17 00:00:00 2001 From: fmk Date: Fri, 7 Jan 2022 13:53:47 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=BC=98=E5=8C=96=EF=BC=9B=20=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=A7=86=E9=A2=91=E6=9B=B4=E6=94=B9=EF=BC=9B=EF=BC=88?= =?UTF-8?q?ios=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=90=8E=E7=BC=80=E5=90=8D=EF=BC=8C=E6=89=80=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=A4=B1=E8=B4=A5=EF=BC=9B=E5=8A=A0=E5=90=8E=E7=BC=80?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=90=8E=E6=AD=A3=E5=B8=B8=EF=BC=9B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ lib/community/community_details.dart | 2 +- lib/community/community_view/community_dynamic.dart | 5 +---- lib/mine/fans_page.dart | 6 +++--- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index b94d898c..2f996806 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -930,7 +930,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 54; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -980,7 +980,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.54; + MARKETING_VERSION = 1.0.59; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -1168,7 +1168,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 54; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1218,7 +1218,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.54; + MARKETING_VERSION = 1.0.59; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -1297,7 +1297,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 54; + CURRENT_PROJECT_VERSION = 59; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -1347,7 +1347,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.54; + MARKETING_VERSION = 1.0.59; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 776df1fa..ded19a6e 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -211,7 +211,7 @@ class _CommunityDetails extends State with WidgetsBindingObser "content": content, "parentId": parenId, "relationalId": comunity.id, - "relationalType":4 + "relationalType":1 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { CommentListState state = commentKey.currentState; diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index a24ac327..34fe2eda 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -221,11 +221,8 @@ class _CommunityDynamic extends State { width: 56.w, height: 25.h, alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11.w), - color: Color(0xFF32A060), - ), child: RoundButton( + height: 25.h, backgroup: (widget.comment.selfFollow ?? false) ? Color(0xFFE6E6E6) : Color(0xFF32A060), diff --git a/lib/mine/fans_page.dart b/lib/mine/fans_page.dart index bd888992..c69c6ccb 100644 --- a/lib/mine/fans_page.dart +++ b/lib/mine/fans_page.dart @@ -167,9 +167,9 @@ class _FansPage extends State { width: 56.w, height: 25.h, alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(11.w), - ), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(11.w), + // ), child: GestureDetector( onTap: () { setState(() { From e823db7b27357e14cc778c425fcbb043a07fd9c1 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Sat, 8 Jan 2022 18:07:27 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_view/community_dynamic.dart | 2 + lib/mine/mine_page.dart | 39 ++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 34fe2eda..c9e4bc24 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -335,6 +335,7 @@ class _CommunityDynamic extends State { child: MImage( subjectInfo.images[0], fit: BoxFit.cover, + radius: BorderRadius.circular(2), width: MediaQuery.of(context).size.width / 1.5, height: MediaQuery.of(context).size.width / 1.5, errorSrc: "assets/image/default_2_1.png", @@ -365,6 +366,7 @@ class _CommunityDynamic extends State { subjectInfo.images[position], fit: BoxFit.cover, aspectRatio: 1, + radius: BorderRadius.circular(1), errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", ), diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index c6397f88..59e35f52 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -7,9 +7,7 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/rank.dart'; -import 'package:huixiang/retrofit/data/sign_info.dart'; import 'package:huixiang/retrofit/data/social_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -34,7 +32,7 @@ class MinePage extends StatefulWidget { } } -class _MinePage extends State with AutomaticKeepAliveClientMixin { +class _MinePage extends State with AutomaticKeepAliveClientMixin ,WidgetsBindingObserver{ ApiService apiService; UserInfo userInfo; List ranks = []; @@ -55,12 +53,31 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { @override void dispose() { super.dispose(); - if (_refreshController != null) _refreshController.dispose(); + if (_refreshController != null) + _refreshController.dispose(); + WidgetsBinding.instance.removeObserver(this); //销毁观察者 + } + + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + print("-didChangeAppLifecycleState-" + state.toString()); + switch (state) { + case AppLifecycleState.inactive: // 处于这种状态的应用程序应该假设它们可能在任何时候暂停。 + break; + case AppLifecycleState.resumed: //从后台切换前台,界面可见 + querySocialInfo(); + break; + case AppLifecycleState.paused: // 界面不可见,后台 + break; + case AppLifecycleState.detached: // APP结束时调用 + break; + } } @override void initState() { super.initState(); + WidgetsBinding.instance.addObserver(this); querySocialInfo(); eventBus.on().listen((event) { @@ -117,6 +134,11 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { EasyLoading.dismiss(); } + _onRefresh(){ + queryUserInfo(); + querySocialInfo(); + } + ///个人社交信息(粉丝/关注数量/成就数量) querySocialInfo() async { SharedPreferences value = await SharedPreferences.getInstance(); @@ -128,9 +150,12 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { ); BaseData baseData = - await apiService.socialInfo().catchError((onError) {}); + await apiService.socialInfo().catchError((onError) { + _refreshController.refreshFailed(); + }); if (baseData != null && baseData.isSuccess) { infoNumber = baseData.data; + _refreshController.refreshCompleted(); } EasyLoading.dismiss(); } @@ -150,7 +175,9 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { header: MyHeader(), physics: BouncingScrollPhysics(), onRefresh: () { - setState(() {}); + setState(() { + _onRefresh(); + }); }, child: SingleChildScrollView( child: Container( From 132033c083252a2196b3c64f0d38e01e304cd545 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 10 Jan 2022 09:51:43 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integral_store_details_page.dart | 3 +- lib/mine/mine_page.dart | 20 +- lib/mine/mine_vip/mine_vip_core.dart | 201 +++++++++--------- lib/mine/user_info_page.dart | 3 +- lib/view_widget/hot_item.dart | 2 +- lib/view_widget/icon_text.dart | 4 +- lib/view_widget/message_item.dart | 4 +- lib/view_widget/mine_vip_view.dart | 1 - 8 files changed, 116 insertions(+), 122 deletions(-) diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index d8792447..812533ec 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -12,6 +12,7 @@ import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -296,7 +297,7 @@ class _IntegralStoreDetailsPage extends State { itemBuilder: (context, position) { return goods == null ? Container() - : Image.network( + : MImage( goods.viceImgPaths.elementAt(position), fit: BoxFit.cover, ) diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 59e35f52..6a118fd1 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -32,7 +32,7 @@ class MinePage extends StatefulWidget { } } -class _MinePage extends State with AutomaticKeepAliveClientMixin ,WidgetsBindingObserver{ +class _MinePage extends State with AutomaticKeepAliveClientMixin { ApiService apiService; UserInfo userInfo; List ranks = []; @@ -55,29 +55,13 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin ,Widg super.dispose(); if (_refreshController != null) _refreshController.dispose(); - WidgetsBinding.instance.removeObserver(this); //销毁观察者 } - @override - void didChangeAppLifecycleState(AppLifecycleState state) { - print("-didChangeAppLifecycleState-" + state.toString()); - switch (state) { - case AppLifecycleState.inactive: // 处于这种状态的应用程序应该假设它们可能在任何时候暂停。 - break; - case AppLifecycleState.resumed: //从后台切换前台,界面可见 - querySocialInfo(); - break; - case AppLifecycleState.paused: // 界面不可见,后台 - break; - case AppLifecycleState.detached: // APP结束时调用 - break; - } - } + @override void initState() { super.initState(); - WidgetsBinding.instance.addObserver(this); querySocialInfo(); eventBus.on().listen((event) { diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index c92bc3d6..94bcaf5b 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -152,28 +152,30 @@ class _MineVipCore extends State { @override Widget build(BuildContext context) { - return Stack( - children: [ - Container( - // padding: EdgeInsets.only(top: 40.h), - height:260.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFF000000), - Color(0xFF585858), - ]), - // border: Border.all(color: Colors.white,width: 0.5), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(35), - bottomLeft: Radius.circular(35), + return Container( + color: Color(0xFFF7F7F7), + child: Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height:260.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color(0xFF000000), + Color(0xFF585858), + ]), + // border: Border.all(color: Colors.white,width: 0.5), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(35), + bottomLeft: Radius.circular(35), + ), + ), ), - ), - ), - Column( + Column( children: [ SizedBox(height: 40), Container( @@ -232,48 +234,49 @@ class _MineVipCore extends State { child: Column( children: [ ///会员卡 - Container( - height: (MediaQuery.of(context).size.width) / - 1.78 * - AppUtils.textScale(context), - child: Swiper( - viewportFraction: 0.95, - loop: false, - physics: BouncingScrollPhysics(), - controller: controller, - onIndexChanged: (index) { - setState(() { - checkIndex = index; - }); - }, - itemBuilder: (context, position) { - return MineVipView( - vipLevel: !(ranks != null && ranks.isNotEmpty) - ? widget.arguments["rankLevel"] - : position + 1, - curLevel: widget.arguments["rankLevel"], - tag: (widget.arguments["rankLevel"] == (position + 1) || - !(ranks != null && ranks.isNotEmpty)) - ? "vip" - : "", - padding: 6.w, - // rank: !(ranks != null && ranks.isNotEmpty) - // ? 0 - // : widget.arguments["expendAmount"] ?? 0, - rankMax: !(ranks != null && ranks.isNotEmpty) - ? 0 - : ranks[position].rankOrigin, - createTime: widget.arguments["createTime"], - showRank: false, - price: !(ranks != null && ranks.isNotEmpty) - ? "0" - : ranks[position].price, - ); - }, - itemCount: - (ranks != null && ranks.isNotEmpty) ? ranks.length : 1, + if(ranks.length > 0) + Container( + height: (MediaQuery.of(context).size.width) / + 1.78 * + AppUtils.textScale(context), + child: Swiper( + viewportFraction: 0.95, + loop: false, + physics: BouncingScrollPhysics(), + controller: controller, + onIndexChanged: (index) { + setState(() { + checkIndex = index; + }); + }, + itemBuilder: (context, position) { + return MineVipView( + vipLevel: !(ranks != null && ranks.isNotEmpty) + ? widget.arguments["rankLevel"] + : position + 1, + curLevel: widget.arguments["rankLevel"], + tag: (widget.arguments["rankLevel"] == (position + 1) || + !(ranks != null && ranks.isNotEmpty)) + ? "vip" + : "", + padding: 6.w, + // rank: !(ranks != null && ranks.isNotEmpty) + // ? 0 + // : widget.arguments["expendAmount"] ?? 0, + rankMax: !(ranks != null && ranks.isNotEmpty) + ? 0 + : ranks[position].rankOrigin, + createTime: widget.arguments["createTime"], + showRank: false, + price: !(ranks != null && ranks.isNotEmpty) + ? "0" + : ranks[position].price, + ); + }, + itemCount: + (ranks != null && ranks.isNotEmpty) ? ranks.length : 1, + ), ), - ), ///会员权益 Container( @@ -528,45 +531,47 @@ class _MineVipCore extends State { )), ], ), - if (ranks.length > checkIndex && - widget.arguments["rankLevel"] < ranks[checkIndex].level && - ranks[checkIndex].price != "0.00") - Align( - alignment: Alignment.bottomCenter, - child: InkWell( - onTap: () { - setState(() { - buyRank(); - }); - }, - child: Container( - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - Color(0xFFFFDCA1), - Color(0xFFFAE4C0), - ]), - ), - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(16), - height: 54, - alignment: Alignment.center, - child: Text( - "${S.of(context).lijikaitong}¥${ranks.length > checkIndex ? ranks[checkIndex].price : ""}/永久", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16.sp, - color: Color(0xFF4A4748), + if (ranks.length > checkIndex && + widget.arguments["rankLevel"] < ranks[checkIndex].level && + ranks[checkIndex].price != "0.00") + Align( + alignment: Alignment.bottomCenter, + child: InkWell( + onTap: () { + setState(() { + buyRank(); + }); + }, + child: Container( + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color(0xFFFFDCA1), + Color(0xFFFAE4C0), + ]), + ), + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(16), + height: 54, + alignment: Alignment.center, + child: Text( + "${S.of(context).lijikaitong}¥${ranks.length > checkIndex ? ranks[checkIndex].price : ""}/永久", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Color(0xFF4A4748), + ), + ), ), ), - ), - ), - ) + ) + + ], + ), + ); - ], - ); } diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 55a8234e..72bd318d 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -11,6 +11,7 @@ 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/view_widget/cupertino_date_picker.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:image_pickers/image_pickers.dart'; import 'package:intl/intl.dart'; @@ -410,7 +411,7 @@ class _UserInfoPage extends State { borderRadius: BorderRadius.circular(4), child: filePath == null || filePath == "" ? (modifyInfo["headimg"] != null && modifyInfo["headimg"] != "" - ? Image.network( + ? MImage( modifyInfo["headimg"], width: 42, height: 42, diff --git a/lib/view_widget/hot_item.dart b/lib/view_widget/hot_item.dart index 3ff50286..6a8bb590 100644 --- a/lib/view_widget/hot_item.dart +++ b/lib/view_widget/hot_item.dart @@ -176,7 +176,7 @@ class _HotArticleItem extends State { child:Stack( alignment: Alignment.center, children: [ - Image.network( + MImage( widget.article?.coverImg ?? "", fit: BoxFit.fill, height: double.infinity, diff --git a/lib/view_widget/icon_text.dart b/lib/view_widget/icon_text.dart index 5e90ce53..19cdbd38 100644 --- a/lib/view_widget/icon_text.dart +++ b/lib/view_widget/icon_text.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'custom_image.dart'; + class IconText extends StatelessWidget { final String leftImage; final String rightImage; @@ -48,7 +50,7 @@ class IconText extends StatelessWidget { widgets.add(Padding( padding: EdgeInsets.only(left: 2), child: leftImage.startsWith("http") - ? Image.network( + ? MImage( leftImage, width: iconSize, height: iconSize, diff --git a/lib/view_widget/message_item.dart b/lib/view_widget/message_item.dart index e35a40f8..ff840734 100644 --- a/lib/view_widget/message_item.dart +++ b/lib/view_widget/message_item.dart @@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'custom_image.dart'; + class MessageItem extends StatefulWidget { final int stStatus; @@ -19,7 +21,7 @@ class _MessageItemState extends State { if (widget.stStatus != 0) checkView(), Container( margin: EdgeInsets.only(left: widget.stStatus == 0 ? 16 : 0), - child: Image.network( + child: MImage( "https://t7.baidu.com/it/u=1297102096,3476971300&fm=193&f=GIF", width: 44.w, fit: BoxFit.cover, diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index aa4693cb..6766255e 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -331,7 +331,6 @@ class MineVipView extends StatelessWidget { .pushNamed('/router/mine_vip_core', arguments: { "rankLevel": curLevel, "userInfo":userInfo.masterCardRankName, - "createTime": (userInfo != null) ? "${userInfo.createTime}" : "", "expendAmount": double.tryParse(userInfo?.expendAmount??"0").toInt(), }); From a90843232040b637f420bafd53497e2154cf4851 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 10 Jan 2022 11:27:29 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E5=A4=9A=E5=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_view/community_dynamic.dart | 30 ++++-- lib/community/photo_view_gallery_screen.dart | 93 +++++++++++++++++++ lib/main.dart | 3 + pubspec.lock | 2 +- pubspec.yaml | 2 +- 5 files changed, 119 insertions(+), 11 deletions(-) create mode 100644 lib/community/photo_view_gallery_screen.dart diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index c9e4bc24..556654a0 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -17,6 +17,9 @@ import 'package:image_pickers/image_pickers.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:video_player/video_player.dart'; +import '../photo_view_gallery_screen.dart'; + + class CommunityDynamic extends StatefulWidget { final int itemCount; final Function(double height) heightFun; @@ -166,14 +169,19 @@ class _CommunityDynamic extends State { height: 44, child: Row( children: [ - MImage( - widget?.comment?.memberInfo?.avatar ?? "", - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.png", - fadeSrc: "assets/image/default_1.png", + GestureDetector( + onTap: (){ + // ImagePickers.previewImages(widget.comment.memberInfo.avatar); + }, + child: MImage( + widget?.comment?.memberInfo?.avatar ?? "", + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.png", + fadeSrc: "assets/image/default_1.png", + ), ), SizedBox( width: 8, @@ -360,7 +368,11 @@ class _CommunityDynamic extends State { return Container( child: InkWell( onTap: () { - ImagePickers.previewImages(subjectInfo.images, position); + // ImagePickers.previewImages(subjectInfo.images, position); + Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen( + images:subjectInfo.images,//传入图片list + index: position,//传入当前点击的图片的index + ), ), ); }, child: MImage( subjectInfo.images[position], diff --git a/lib/community/photo_view_gallery_screen.dart b/lib/community/photo_view_gallery_screen.dart new file mode 100644 index 00000000..08c0e0f7 --- /dev/null +++ b/lib/community/photo_view_gallery_screen.dart @@ -0,0 +1,93 @@ +import 'package:flutter/material.dart'; +import 'package:photo_view/photo_view.dart'; +import 'package:photo_view/photo_view_gallery.dart'; + +class PhotoViewGalleryScreen extends StatefulWidget { + List images=[]; + int index=0; + String heroTag; + PageController controller; + + PhotoViewGalleryScreen({Key key,@required this.images,this.index,this.controller,this.heroTag}) : super(key: key){ + controller=PageController(initialPage: index); + } + + @override + _PhotoViewGalleryScreenState createState() => _PhotoViewGalleryScreenState(); +} + +class _PhotoViewGalleryScreenState extends State { + int currentIndex=0; + + @override + void initState() { + // TODO: implement initState + super.initState(); + currentIndex=widget.index; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + Positioned( + top: 0, + left: 0, + bottom: 0, + right: 0, + child: Container( + child: PhotoViewGallery.builder( + scrollPhysics: const BouncingScrollPhysics(), + builder: (BuildContext context, int index) { + return PhotoViewGalleryPageOptions( + imageProvider: NetworkImage(widget.images[index]), + + ); + }, + itemCount: widget.images.length, + loadingBuilder: (context, progress) => Center( + child: Container( + width: 20.0, + height: 20.0, + child: CircularProgressIndicator( + value: progress == null + ? null + : progress.cumulativeBytesLoaded / + progress.expectedTotalBytes, + ), + ), + ), + backgroundDecoration: null, + pageController: widget.controller, + enableRotation: true, + onPageChanged: (index){ + setState(() { + currentIndex=index; + }); + }, + ) + ), + ), + Positioned(//图片index显示 + top: MediaQuery.of(context).padding.top+15, + width: MediaQuery.of(context).size.width, + child: Center( + child: Text("${currentIndex+1}/${widget.images.length}",style: TextStyle(color: Colors.white,fontSize: 16)), + ), + ), + Positioned(//右上角关闭按钮 + right: 10, + top: MediaQuery.of(context).padding.top, + child: IconButton( + icon: Icon(Icons.close,size: 30,color: Colors.white,), + onPressed: (){ + Navigator.of(context).pop(); + }, + ), + ), + ], + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 72f074a7..4d59a3ca 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -70,6 +70,7 @@ import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; +import 'community/photo_view_gallery_screen.dart'; import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; import 'main_page.dart'; @@ -325,4 +326,6 @@ Map routers = { MineAttainmentPage(arguments: arguments), '/router/headlines_column_details': (context, {arguments}) => HeadlinesColumnDetails(arguments: arguments), + '/router/photo_view_gallery_screen': (context, {arguments}) => + PhotoViewGalleryScreen(), }; diff --git a/pubspec.lock b/pubspec.lock index 8bac3749..189e0f23 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -524,7 +524,7 @@ packages: name: photo_view url: "https://pub.flutter-io.cn" source: hosted - version: "0.11.1" + version: "0.13.0" platform: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b82c67f6..6a5c371b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -68,7 +68,7 @@ dependencies: flutter_html: ^2.1.5 #2.1.0 chewie_audio: ^1.1.2 - photo_view: ^0.11.1 + photo_view: ^0.13.0 video_player: ^2.2.3 thumbnails: ^1.0.1 # media_info: ^0.9.0 From b2ec5d500b9d5c9b6a5fea325db69a0c0cf6052b Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 10 Jan 2022 14:04:55 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=BC=98=E5=8C=96;=20=E6=88=91=E7=9A=84=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_view/community_dynamic.dart | 10 +++- lib/integral/intergra_view/integral_vip.dart | 2 +- lib/mine/mine_view/mine_view.dart | 59 +++++++++++-------- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 556654a0..b65c6da1 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -14,6 +14,7 @@ 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:image_pickers/image_pickers.dart'; +import 'package:photo_view/photo_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:video_player/video_player.dart'; @@ -171,7 +172,10 @@ class _CommunityDynamic extends State { children: [ GestureDetector( onTap: (){ - // ImagePickers.previewImages(widget.comment.memberInfo.avatar); + Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen( + images:[widget?.comment?.memberInfo?.avatar ?? ""],//传入图片list + index: 0,//传入当前点击的图片的index + ), ), ); }, child: MImage( widget?.comment?.memberInfo?.avatar ?? "", @@ -339,6 +343,10 @@ class _CommunityDynamic extends State { child: InkWell( onTap: () { ImagePickers.previewImages(subjectInfo.images,0); + // Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen( + // images:subjectInfo.images,//传入图片list + // index: 0,//传入当前点击的图片的index + // ), ), ); }, child: MImage( subjectInfo.images[0], diff --git a/lib/integral/intergra_view/integral_vip.dart b/lib/integral/intergra_view/integral_vip.dart index 813aac89..2295200e 100644 --- a/lib/integral/intergra_view/integral_vip.dart +++ b/lib/integral/intergra_view/integral_vip.dart @@ -44,7 +44,7 @@ class _IntegralVip extends State { Expanded( child: Container( margin: EdgeInsets.only(left: 15.w), - height: 50.h, + height: 53.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 57b3d053..b5f418ea 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -98,7 +98,12 @@ class _MineView extends State { String tableId = uri.queryParameters["tableId"]; String tenantCode = uri.queryParameters["tenantCode"]; String shopId = uri.queryParameters["shopId"]; - if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") { + if (tableId != null && + tableId != "" && + tenantCode != null && + tenantCode != "" && + shopId != null && + shopId != "") { Navigator.of(context).pushNamed( '/router/store_order', arguments: { @@ -156,7 +161,7 @@ class _MineView extends State { Expanded( flex: 1, child: Container( - height: 50.h, + height: 53.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.stretch, @@ -211,7 +216,7 @@ class _MineView extends State { : Text( widget.userInfo == null ? "" - : "NO.${widget.userInfo.vipNo}", + : "我的积分:${widget.userInfo.points}", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, @@ -236,28 +241,34 @@ class _MineView extends State { alignment: Alignment.bottomRight, height: 50.h, child: GestureDetector( - onTap: () { - widget.toIntegralPage(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - S.of(context).jifenxiangqing, - style: TextStyle( - color: Colors.black, - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - ), + onTap: () { + widget.toIntegralPage(); + }, + child: Container( + padding: EdgeInsets.only(top: 4, bottom: 4, right: 16,left: 7), + decoration: BoxDecoration( + color: Color(0xFF87E8B0), + borderRadius: BorderRadius.only(topLeft: Radius.circular(100),bottomLeft:Radius.circular(100)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + S.of(context).jifenxiangqing, + style: TextStyle( + color: Colors.black, + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Icon( + Icons.keyboard_arrow_right, + size: 16, + color: Colors.black, + ) + ], ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Colors.black, - ) - ], - ), - ), + )), ), ], ),