From d84af4049467c50da74b0ca534f46651fc614a27 Mon Sep 17 00:00:00 2001 From: boom <953969641@qq.com> Date: Fri, 18 Nov 2022 15:03:05 +0800 Subject: [PATCH 01/12] ios,z --- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Runner.xcodeproj/project.pbxproj | 6 +- pubspec.lock | 278 +++++++++++++-------------- 3 files changed, 143 insertions(+), 143 deletions(-) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 8d4492f9..9625e105 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 4c6caf70..57de9040 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -667,7 +667,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.7; + MARKETING_VERSION = 3.1.8; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -869,7 +869,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.7; + MARKETING_VERSION = 3.1.8; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -962,7 +962,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.7; + MARKETING_VERSION = 3.1.8; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/pubspec.lock b/pubspec.lock index 2c9578aa..a8db37df 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,147 +5,147 @@ packages: dependency: "direct main" description: name: ai_decimal_accuracy - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" android_intent_plus: dependency: "direct main" description: name: android_intent_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" barcode: dependency: transitive description: name: barcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" barcode_widget: dependency: "direct main" description: name: barcode_widget - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" bubble_tab_indicator: dependency: "direct main" description: name: bubble_tab_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" chewie: dependency: transitive description: name: chewie - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.3" chewie_audio: dependency: "direct main" description: name: chewie_audio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.16.0" csslib: dependency: transitive description: name: csslib - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.5" dio: dependency: "direct main" description: name: dio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.10" event_bus: dependency: "direct main" description: name: event_bus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.4" flare_flutter: dependency: "direct main" description: name: flare_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.2" flutter: @@ -157,56 +157,56 @@ packages: dependency: "direct main" description: name: flutter_baidu_mapapi_base - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" flutter_baidu_mapapi_map: dependency: "direct main" description: name: flutter_baidu_mapapi_map - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.1" flutter_baidu_mapapi_search: dependency: "direct main" description: name: flutter_baidu_mapapi_search - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" flutter_baidu_mapapi_utils: dependency: "direct main" description: name: flutter_baidu_mapapi_utils - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.0" flutter_bmflocation: dependency: "direct main" description: name: flutter_bmflocation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.2.1" flutter_easyloading: dependency: "direct main" description: name: flutter_easyloading - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.5" flutter_html: dependency: "direct main" description: name: flutter_html - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.1" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.6" flutter_localizations: @@ -218,70 +218,70 @@ packages: dependency: transitive description: name: flutter_math_fork - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.2+2" flutter_page_indicator: dependency: transitive description: name: flutter_page_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.7" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.0+1" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.2" flutter_smart_dialog: dependency: "direct main" description: name: flutter_smart_dialog - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.8" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.0" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.1" flutter_svg: dependency: "direct main" description: name: flutter_svg - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.22.0" flutter_swiper: dependency: "direct main" description: name: flutter_swiper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.6" flutter_test: @@ -298,385 +298,385 @@ packages: dependency: "direct main" description: name: fluwx - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.9.0+2" font_awesome_flutter: dependency: "direct main" description: name: font_awesome_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "9.2.0" gradient_widgets: dependency: "direct main" description: name: gradient_widgets - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.0" graphs: dependency: transitive description: name: graphs - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0" html: dependency: transitive description: name: html - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.15.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.4" image_pickers: dependency: "direct main" description: name: image_pickers - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0+2" intl: dependency: "direct main" description: name: intl - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.17.0" js: dependency: transitive description: name: js - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.4" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" keframe: dependency: "direct main" description: name: keframe - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" like_button: dependency: "direct main" description: name: like_button - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.5" logger: dependency: "direct main" description: name: logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.1.5" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" nested: dependency: transitive description: name: nested - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" network_to_file_image: dependency: "direct main" description: name: network_to_file_image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.1" number_precision: dependency: "direct main" description: name: number_precision - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2+1" numerus: dependency: transitive description: name: numerus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.5.1+1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.7" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.3" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.0" photo_view: dependency: "direct main" description: name: photo_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.13.0" pin_input_text_field: dependency: "direct main" description: name: pin_input_text_field - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.0" platform: dependency: transitive description: name: platform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" process: dependency: transitive description: name: process - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.4" provider: dependency: transitive description: name: provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.0.4" pull_to_refresh: dependency: "direct main" description: name: pull_to_refresh - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" qr: dependency: transitive description: name: qr - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.0.0" quiver: dependency: transitive description: name: quiver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" retrofit: dependency: "direct main" description: name: retrofit - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.4+1" rive: dependency: "direct main" description: name: rive - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.8" rxdart: dependency: "direct main" description: name: rxdart - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.26.0" scan: dependency: "direct main" description: name: scan - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.6.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.15" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.14" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.4" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" sharesdk_plugin: dependency: "direct main" description: name: sharesdk_plugin - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.5" simple_gesture_detector: dependency: transitive description: name: simple_gesture_detector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" sky_engine: @@ -688,63 +688,63 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.9.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" table_calendar: dependency: "direct main" description: name: table_calendar - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.3" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.12" thumbnails: dependency: "direct main" description: name: thumbnails - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" tobias: dependency: "direct main" description: name: tobias - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.4.1" tpns_flutter_plugin: @@ -760,168 +760,168 @@ packages: dependency: transitive description: name: transformer_page_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" tuple: dependency: transitive description: name: tuple - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.1" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.7.10" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.1+4" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.1+9" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.9" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.5+3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.1+3" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.2" video_player: dependency: "direct main" description: name: video_player - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.19" video_player_android: dependency: transitive description: name: video_player_android - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.4" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.3.7" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.0" video_player_web: dependency: transitive description: name: video_player_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.12" wakelock: dependency: transitive description: name: wakelock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.2" wakelock_macos: dependency: transitive description: name: wakelock_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.0" wakelock_platform_interface: dependency: transitive description: name: wakelock_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.0" wakelock_web: dependency: transitive description: name: wakelock_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.0" wakelock_windows: dependency: transitive description: name: wakelock_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.1" webview_flutter: dependency: transitive description: name: webview_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.14" win32: dependency: transitive description: name: win32 - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.1" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0+2" xml: dependency: transitive description: name: xml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.4.1" sdks: From 738c1acabfb105b2a5e1a43e82acd809ba5528fe Mon Sep 17 00:00:00 2001 From: boom <953969641@qq.com> Date: Sat, 19 Nov 2022 15:33:35 +0800 Subject: [PATCH 02/12] ios --- ios/Podfile | 2 +- ios/Podfile.lock | 4 ++-- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index 14ddc14b..f94d6072 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project - platform :ios, '10.0' + platform :ios, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8719b45b..778797f1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -325,7 +325,7 @@ SPEC CHECKSUMS: AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce BaiduMapKit: f227cfb43581e91466fb4f1344f655eab5788777 BMKLocationKit: 688d8e1194980b96fc9a6585c0eb42e62fbaf780 - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_baidu_mapapi_base: cb406be78c3a949fb58a45dc6627f139d580bd37 flutter_baidu_mapapi_map: 81c4e6e93dc668e311d9b521421deaf292390434 flutter_baidu_mapapi_search: 13a360334e91abea0bcf820546b2ef4548e42e08 @@ -355,6 +355,6 @@ SPEC CHECKSUMS: webview_flutter: 5fb4def2bbd4339889ee14d045b605cefc5bc232 ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736 -PODFILE CHECKSUM: 77c662d4cd560e96445691f5bf7f29e2b140072c +PODFILE CHECKSUM: 27a0f08c504497d82c425d2ccb28d9958a6e156a COCOAPODS: 1.11.3 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 57de9040..eb90f659 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -617,7 +617,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -819,7 +819,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -912,7 +912,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( From 4ce745015fc093b4fda9a8f3cb88ddeb52008e59 Mon Sep 17 00:00:00 2001 From: boom <953969641@qq.com> Date: Thu, 1 Dec 2022 15:34:49 +0800 Subject: [PATCH 03/12] =?UTF-8?q?ios=20=E6=9B=B4=E6=94=B9=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=88=97=E8=A1=A8=E7=AE=80=E4=BB=8B=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=EF=BC=9B=20=E6=9B=B4=E6=94=B9ios=E5=9C=B0=E5=9B=BE=E5=88=97?= =?UTF-8?q?=E8=A1=A8bug=EF=BC=9B=20=E4=BC=98=E5=8C=96=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E5=8A=A9=E5=86=9C=E7=A7=AF=E5=88=86=E6=9D=BF=E5=9D=97=EF=BC=9B?= =?UTF-8?q?=20=E6=9B=B4=E6=94=B9iOS=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97?= =?UTF-8?q?=EF=BC=8Cvip=E4=BC=98=E6=83=A0=E6=8C=89=E9=92=AE=EF=BC=9B=20?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=A6=96=E9=A1=B5bug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ ios/Runner/Info.plist | 1 + lib/community/community_view/class_list_view.dart | 2 +- lib/home/home_page.dart | 7 +++++-- lib/main_page.dart | 2 +- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/settlement/settlement.dart | 15 +++++++++++++++ .../settlement_view/activity_coupon_remarks.dart | 2 +- 9 files changed, 32 insertions(+), 13 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index eb90f659..e9017843 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -617,7 +617,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -667,7 +667,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.8; + MARKETING_VERSION = 3.1.9; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -819,7 +819,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -869,7 +869,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.8; + MARKETING_VERSION = 3.1.9; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -912,7 +912,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -962,7 +962,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.8; + MARKETING_VERSION = 3.1.9; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 3deca04c..4887210d 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -144,6 +144,7 @@ UIBackgroundModes + location remote-notification UILaunchStoryboardName diff --git a/lib/community/community_view/class_list_view.dart b/lib/community/community_view/class_list_view.dart index 3bf6d6a3..7d3c1982 100644 --- a/lib/community/community_view/class_list_view.dart +++ b/lib/community/community_view/class_list_view.dart @@ -217,7 +217,7 @@ class _ClassListView extends State { maxLines: 2, style: TextStyle( fontSize: 13.sp, - height: 1.2.h, + height: 1.5.h, fontWeight: MyFontWeight.medium, color: Colors.black, ), diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index e418f8ad..57e69726 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -503,7 +503,10 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { }, child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), - child: Column( + child: FutureBuilder( + future: queryHome(), + builder: (context, snapshot) { + return Column( children: [ ///banner HomeBanner(bannerData, controller), @@ -579,7 +582,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { }, ), ], - ), + );}) ), ), ), diff --git a/lib/main_page.dart b/lib/main_page.dart index 69255113..3390b4f0 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -204,7 +204,7 @@ class _MainPage extends State with WidgetsBindingObserver { myLocPlugin.authAK("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); BMFMapSDK.setApiKeyAndCoordType( 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', - BMF_COORD_TYPE.COMMON, + BMF_COORD_TYPE.BD09LL, ); } else if (Platform.isAndroid) { BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 7e9d7012..f7e60731 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index e1507418..06429ed5 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 41a039fc..463b5186 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -122,6 +122,7 @@ class _Settlement extends State { storeId: storeId, showLoading: false ); + queryMemberInfo(); if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, @@ -256,6 +257,20 @@ class _Settlement extends State { } } + ///会员信息 + queryMemberInfo() async { + BaseData baseData = await minService.memberInfo().catchError((error) { + debugPrint(error); + }); + if (baseData != null && baseData.isSuccess) { + SharedPreferences.getInstance().then( + (value) => { + value.setString('minMember', jsonEncode(baseData.data)), + }, + ); + } + } + ///查看订单详情 queryOrderDetails(id) async { BaseData baseData = await minService.getOrderDetails({ diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index b9767cea..282f23ff 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if(!widget?.settleOrderInfo?.isRaise ?? false) + if(!(widget?.settleOrderInfo?.isRaise ?? false)) Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, From 1cc6aaf56e5a949089c8a8a37c166b95d7a4986d Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 26 Dec 2022 15:11:04 +0800 Subject: [PATCH 04/12] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=9B=202.=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E6=9C=AC=EF=BC=9B=203.=E6=9B=B4=E6=94=B9=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=9F=A5=E7=9C=8B=E8=83=8C=E6=99=AF=EF=BC=9B?= =?UTF-8?q?=204.=E5=8A=A8=E6=80=81=E5=88=97=E8=A1=A8"..."=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=BA=8B=E4=BB=B6=E8=8C=83=E5=9B=B4=EF=BC=9B=205.?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E8=AF=84=E8=AE=BA=E9=94=AE=E7=9B=98=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=8F=91=E9=80=81=E4=BA=8B=E4=BB=B6=EF=BC=9B=206.?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E7=82=B9?= =?UTF-8?q?=E8=B5=9E=E5=8A=9F=E8=83=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/base_state.dart | 21 +- lib/community/community_child_page.dart | 7 + .../community_view/class_details.dart | 515 +++++++++--------- .../community_view/community_dynamic.dart | 408 ++++++++------ lib/community/photo_view_gallery_screen.dart | 72 +-- lib/generated/intl/messages_en.dart | 6 + lib/generated/intl/messages_en_US.dart | 10 +- lib/generated/intl/messages_zh_CN.dart | 6 + lib/generated/intl/messages_zh_Hans_CN.dart | 6 + lib/generated/intl/messages_zh_Hant_CN.dart | 8 +- lib/generated/intl/messages_zh_TW.dart | 6 + lib/generated/l10n.dart | 60 ++ lib/home/home_page.dart | 163 +++--- lib/home/welfare_exchange.dart | 86 +-- lib/l10n/intl_en.arb | 9 + lib/l10n/intl_en_US.arb | 8 + lib/l10n/intl_zh_CN.arb | 8 + lib/l10n/intl_zh_Hans_CN.arb | 8 + lib/l10n/intl_zh_Hant_CN.arb | 8 + lib/l10n/intl_zh_TW.arb | 8 + lib/login/new_login_page.dart | 59 +- lib/main_page.dart | 2 +- lib/mine/mine_page.dart | 111 ++-- lib/mine/mine_view/mine_view.dart | 2 +- lib/mine/personal_page.dart | 100 ++-- lib/mine/recharge_page.dart | 62 +-- lib/mine/user_info_page.dart | 103 ++-- lib/retrofit/data/settleOrderInfo.dart | 8 + lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/settlement/settlement.dart | 417 +++++++------- lib/union/union_page.dart | 2 + lib/view_widget/activity_coupons.dart | 4 +- lib/view_widget/coupon_details_dialog.dart | 2 +- lib/view_widget/cupertino_date_picker.dart | 2 +- lib/view_widget/new_coupon_widget.dart | 4 +- lib/view_widget/pay_selected_dialog.dart | 4 +- lib/view_widget/receiving_method_dialog.dart | 2 +- lib/view_widget/update_dialog.dart | 117 ++-- lib/view_widget/vip_dialog.dart | 4 +- lib/vip/user_vip_service_page.dart | 2 +- lib/vip/vip_view/vip_top.dart | 252 +++++---- lib/web/web_turntable_activity.dart | 2 - lib/web/web_view/input_comment.dart | 8 + pubspec.yaml | 2 +- 45 files changed, 1506 insertions(+), 1192 deletions(-) diff --git a/lib/base_state.dart b/lib/base_state.dart index 8d293697..8262544f 100644 --- a/lib/base_state.dart +++ b/lib/base_state.dart @@ -1,12 +1,11 @@ - import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:huixiang/utils/bridge.dart'; import 'package:shared_preferences/shared_preferences.dart'; -abstract class BaseState extends State with WidgetsBindingObserver { - +abstract class BaseState extends State + with WidgetsBindingObserver { @override void dispose() { super.dispose(); @@ -71,6 +70,18 @@ abstract class BaseState extends State with Widgets routeName = "/router/order_details"; params["id"] = pushMap["info"]; break; + case 6: + routeName = "/router/community_details"; + params["businessId"] = pushMap["info"]; + break; + case 8: + routeName = "/router/mine_wallet"; + params["id"] = pushMap["info"]; + break; + case 9: + routeName = "/router/welfare_page"; + params["id"] = pushMap["info"]; + break; } sharedPreferences.setString("pushData", ""); print("xgPushClickAction: routeName: $routeName"); @@ -79,6 +90,4 @@ abstract class BaseState extends State with Widgets } } } - - -} \ No newline at end of file +} diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index b154c9d4..37018099 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/community/community_view/community_dynamic.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -15,6 +16,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../utils/flutter_utils.dart'; + class CommunityChildPage extends StatefulWidget { final String typeStr; final Function onScroll; @@ -84,6 +87,8 @@ class CommunityChildPageState extends State "pageSize": 10, "searchKey": searchKey ?? "" }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); if (searchKey == null) { refreshController.refreshFailed(); refreshController.loadFailed(); @@ -101,6 +106,7 @@ class CommunityChildPageState extends State element.content = jsonEncode(baseData.data.list[0].subjectInfo); element.mainTitle = baseData.data.list[0].subject; element.followed = baseData.data.list[0].selfFollow; + element.liked = baseData.data.list[0].selfLike; element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar; element.authorName = baseData.data.list[0].memberInfo?.nickname; element.location = baseData.data.list[0].location; @@ -123,6 +129,7 @@ class CommunityChildPageState extends State article.content = jsonEncode(element.subjectInfo); article.mainTitle = element.subject; article.followed = element.selfFollow; + article.liked = element.selfLike; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; article.location = element.location; diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index e1632f2d..d7058800 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -131,277 +131,298 @@ class _ClassDetails extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { return AnnotatedRegion( - value: SystemUiOverlayStyle.light, - child: Material(child: Scaffold( - body: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - FocusScope.of(context).requestFocus(FocusNode()); - }, - child:Container( - // margin: EdgeInsets.only(top:25), - child: Column( - children: [ - Expanded( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - Container( - child:Stack( + value: SystemUiOverlayStyle.light, + child: Material( + child: Scaffold( + body: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Container( + // margin: EdgeInsets.only(top:25), + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( children: [ - ClassDetailsVideo(key:videoKey,exitFull: (){setState(() {});}, - coverImg: chapterList.length > chapterIndex - ? chapterList[chapterIndex].content.coverImg - : "",isShowImg: this.isShowImg, - changeShowImg: (isShowImg){setState(() { - this.isShowImg = isShowImg; - });},heightFun: (height) { - this.height = height + - MediaQuery - .of(context) - .padding - .top + - kToolbarHeight + - 24; - if (mounted) setState(() {}); - },), Container( - margin: EdgeInsets.only( - top: 40.h, left: 16.w, right: 16.w), - decoration: BoxDecoration( - color: Colors.transparent, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + child: Stack( children: [ - GestureDetector( - child: Image.asset( - "assets/image/integral_return.webp", - width: 24, - height: 24, - ), - onTap: () { - Navigator.of(context).pop( - course != null ? course.viewers + 1 : 0); + ClassDetailsVideo( + key: videoKey, + exitFull: () { + setState(() {}); + }, + coverImg: + chapterList.length > chapterIndex + ? chapterList[chapterIndex] + .content + .coverImg + : "", + isShowImg: this.isShowImg, + changeShowImg: (isShowImg) { + setState(() { + this.isShowImg = isShowImg; + }); + }, + heightFun: (height) { + this.height = height + + MediaQuery.of(context).padding.top + + kToolbarHeight + + 24; + if (mounted) setState(() {}); }, ), - ], - ), - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(bottom: 16.h), - padding: EdgeInsets.only(left: 16, top: 16, right: 10), - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - // height: 22.h, - padding:EdgeInsets.only(left:2,right:2), - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(2), - border: Border.all( - width: 1, - color: Color(0xFFFF7A1A), - style: BorderStyle.solid, - ), - ), - child: Text( - (course?.tags != null && - course.tags.length > 0) - ? course.tags[0] - : "", - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFFF7A1A), + Container( + margin: EdgeInsets.only( + top: 40.h, left: 16.w, right: 16.w), + decoration: BoxDecoration( + color: Colors.transparent, ), - ), - ), - SizedBox( - width: 6.w, - ), - Expanded( - child: Text( - course != null ? course.subject : "", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF1A1A1A), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.webp", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop( + course != null + ? course.viewers + 1 + : 0); + }, + ), + ], ), ), - flex: 1, - ), - // GestureDetector( - // onTap: () { - // share(); - // }, - // child: Icon( - // Icons.share, - // size: 24, - // color: Colors.black, - // ), - // ), - // SizedBox(width: 15.w,), - ], - ), - SizedBox( - height: 10.h, + ], + ), ), - Padding( - padding: EdgeInsets.only(right: 16), - child: Row( + Container( + margin: EdgeInsets.only(bottom: 16.h), + padding: EdgeInsets.only( + left: 16, top: 16, right: 10), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - child: Text( - "${S.of(context).jiangshi}:${course != null ? course.author.name : ""}", - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Colors.black, + Row( + children: [ + Container( + // height: 22.h, + padding: EdgeInsets.only( + left: 2, right: 2), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(2), + border: Border.all( + width: 1, + color: Color(0xFFFF7A1A), + style: BorderStyle.solid, + ), ), - )), - Text( - "${S.of(context).bofangcishu}:", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), + child: Text( + (course?.tags != null && + course.tags.length > 0) + ? course.tags[0] + : "", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFFF7A1A), + ), + ), + ), + SizedBox( + width: 6.w, + ), + Expanded( + child: Text( + course != null + ? course.subject + : "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 16.sp, + fontWeight: + MyFontWeight.semi_bold, + color: Color(0xFF1A1A1A), + ), + ), + flex: 1, + ), + // GestureDetector( + // onTap: () { + // share(); + // }, + // child: Icon( + // Icons.share, + // size: 24, + // color: Colors.black, + // ), + // ), + // SizedBox(width: 15.w,), + ], + ), + SizedBox( + height: 10.h, + ), + Padding( + padding: EdgeInsets.only(right: 16), + child: Row( + children: [ + Expanded( + child: Text( + "${S.of(context).jiangshi}:${course != null ? course.author.name : ""}", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + )), + Text( + "${S.of(context).bofangcishu}:", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + ), + SizedBox( + width: 4, + ), + Text( + course != null + ? course.viewers.toString() + : "", + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + ), + ], ), ), SizedBox( - width: 4, + height: 10.h, ), Text( - course != null - ? course.viewers.toString() - : "", - overflow: TextOverflow.ellipsis, - maxLines: 2, + course != null ? course.introduce : "", + overflow: isShowMore + ? TextOverflow.visible + : TextOverflow.ellipsis, + maxLines: isShowMore ? 10 : 2, style: TextStyle( fontSize: 12.sp, + height: 1.2.h, fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), + color: Colors.black, ), ), + SizedBox(height: 3.h), + GestureDetector( + onTap: () { + setState(() { + isShowMore = !isShowMore; + }); + }, + child: Align( + alignment: Alignment.center, + child: Icon( + (isShowMore != null && !isShowMore) + ? Icons.keyboard_arrow_down + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 24, + ), + ), + ), + SizedBox(height: 3.h), ], ), ), - SizedBox( - height: 10.h, - ), - Text( - course != null ? course.introduce : "", - overflow: isShowMore - ? TextOverflow.visible - : TextOverflow.ellipsis, - maxLines: isShowMore ? 10 : 2, - style: TextStyle( - fontSize: 12.sp, - height: 1.2.h, - fontWeight: MyFontWeight.regular, - color: Colors.black, - ), - ), - SizedBox(height: 3.h), - GestureDetector( - onTap: () { + anthology(), + CommentList( + commentKey, + course?.likes ?? course?.likes ?? 0, + widget.arguments["id"], + 3, + isKeyBoardShow, + _reply, + _delCommentTips, + 12.sp, + requestApiFinish: (total) { setState(() { - isShowMore = !isShowMore; + commentTotal = total; }); }, - child:Align( - alignment: Alignment.center, - child: Icon( - (isShowMore != null && !isShowMore) - ? Icons.keyboard_arrow_down - : Icons.keyboard_arrow_up, - color: Colors.black, - size: 24, + ), + if (commentTotal == 0) + Container( + width: double.infinity, + alignment: Alignment.topCenter, + margin: EdgeInsets.only(top: 40), + padding: EdgeInsets.all(22.h), + child: Text( + S.of(context).zanwupinglun, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Color(0xFFA0A0A0), + ), ), ), - ), - SizedBox(height: 3.h), ], ), ), - anthology(), - CommentList( - commentKey, - course?.likes ?? course?.likes ?? 0, - widget.arguments["id"], - 3, - isKeyBoardShow, - _reply, - _delCommentTips, - 12.sp, - requestApiFinish: (total) { - setState(() { - commentTotal = total; - }); - }, - ), - if (commentTotal == 0) - Container( - width: double.infinity, - alignment: Alignment.topCenter, - margin: EdgeInsets.only(top: 40), - padding: EdgeInsets.all(22.h), - child: Text( - S.of(context).zanwupinglun, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.bold, - color: Color(0xFFA0A0A0), - ), - ), - ), - ], - ), + flex: 1, + ), + + /// 富文本评论的输入框 + InputComment( + inputKey, + hintText, + isKeyBoardShow, + commentFocus, + commentTextController, + _toComment, + _queryMemberComment, + _queryCourseLikes, + isLike: course?.selfLiked, + ), + ], ), - flex: 1, - ), - /// 富文本评论的输入框 - InputComment( - inputKey, - hintText, - isKeyBoardShow, - commentFocus, - commentTextController, - _toComment, - _queryMemberComment, - _queryCourseLikes, - isLike: course?.selfLiked, - ), - ], - ), - )), - ),) - ); + )), + ), + )); } Widget anthology() { @@ -563,16 +584,16 @@ class _ClassDetails extends State with WidgetsBindingObserver { share() async { SSDKMap params = SSDKMap() ..setGeneral( - course.subject != null - ? course.subject - : "", + course.subject != null ? course.subject : "", course != null ? course.introduce : "", [ chapterList[chapterIndex].content.coverImg != null - ? chapterList[chapterIndex].content.coverImg:"", + ? chapterList[chapterIndex].content.coverImg + : "", ], chapterList[chapterIndex].content.fileUrl != null - ? chapterList[chapterIndex].content.fileUrl:"", + ? chapterList[chapterIndex].content.fileUrl + : "", "", buildShareUrl(), "", @@ -590,12 +611,12 @@ class _ClassDetails extends State with WidgetsBindingObserver { if (platform == ShareSDKPlatforms.line) { params.map["type"] = SSDKContentTypes.text.value; params.map["text"] = - "${course.subject ?? ""} ${buildShareUrl()}"; + "${course.subject ?? ""} ${buildShareUrl()}"; } SharesdkPlugin.share(platform, params, - (state, userData, contentEntity, error) { - print("share!$state"); - }); + (state, userData, contentEntity, error) { + print("share!$state"); + }); }); }); } diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 22260e31..2e31ffc9 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -37,7 +37,7 @@ class CommunityDynamic extends StatefulWidget { CommunityDynamic( this.article, - this.commentType, { + this.commentType,{ Key key, this.itemCount = 9, this.heightFun, @@ -149,11 +149,28 @@ class _CommunityDynamic extends State { } } - goPersonalPage()async{ - await Navigator.of(context) - .pushNamed('/router/personal_page', arguments: { - "memberId": - (widget.article.author == widget.userId) + ///给文章/活动点赞 + _queryInformationLikes(isLikes) async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseData = await apiService + .informationLikes(widget.article.id) + .catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + widget.exitFull(); + setState(() {}); + } + } + + goPersonalPage() async { + await Navigator.of(context).pushNamed('/router/personal_page', arguments: { + "memberId": (widget.article.author == widget.userId) ? "0" : widget.article.author, }); @@ -168,7 +185,7 @@ class _CommunityDynamic extends State { margin: EdgeInsets.only(top: 2.h), key: globalKey, alignment: Alignment.topCenter, - padding: EdgeInsets.only(left: 16.w,top: 16.h,right: 16.w), + padding: EdgeInsets.only(left: 16.w, top: 16.h, right: 16.w), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -228,7 +245,10 @@ class _CommunityDynamic extends State { Text( widget?.article?.authorName ?? "", style: TextStyle( - fontSize: MediaQuery.of(context).size.width >= 650 ? 12.sp :15.sp, + fontSize: + MediaQuery.of(context).size.width >= 650 + ? 12.sp + : 15.sp, fontWeight: MyFontWeight.semi_bold, color: Color(0xFF1A1A1A), ), @@ -236,7 +256,10 @@ class _CommunityDynamic extends State { Text( widget?.article?.createTime ?? "", style: TextStyle( - fontSize: MediaQuery.of(context).size.width >= 650 ? 10.sp :13.sp, + fontSize: + MediaQuery.of(context).size.width >= 650 + ? 10.sp + : 13.sp, fontWeight: MyFontWeight.regular, color: Color(0xFF808080), ), @@ -301,52 +324,56 @@ class _CommunityDynamic extends State { SizedBox( height: 12.h, ), - widget.isList ? Text( - widget?.article?.mainTitle ?? "", - maxLines:5, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular, - fontSize: 15.sp, - ), - ) :Text( - widget?.article?.mainTitle ?? "", - style: TextStyle( - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.regular, - fontSize: 15.sp, - ), - ), + widget.isList + ? Text( + widget?.article?.mainTitle ?? "", + maxLines: 5, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + ), + ) + : Text( + widget?.article?.mainTitle ?? "", + style: TextStyle( + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + ), + ), buildMedia(widget?.article?.content), SizedBox( - height:8.h, + height: 8.h, ), if (widget.article.location != "") - Padding(padding:EdgeInsets.only(bottom:7), - child: Row( - children: [ - Icon( - Icons.place, - size: 16, - color: Color(0xFFB3B2B2), - ), - SizedBox( - width: 2, - ), - Expanded( - child: Text( - widget?.article?.location ?? "", - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFFB3B2B2), - ), - )), - ], - ),), + Padding( + padding: EdgeInsets.only(bottom: 7), + child: Row( + children: [ + Icon( + Icons.place, + size: 16, + color: Color(0xFFB3B2B2), + ), + SizedBox( + width: 2, + ), + Expanded( + child: Text( + widget?.article?.location ?? "", + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFB3B2B2), + ), + )), + ], + ), + ), if (!widget.isDetails) SizedBox( height: 5.h, @@ -355,111 +382,125 @@ class _CommunityDynamic extends State { Container( // padding: EdgeInsets.only(bottom: 16), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(bottom: 16.h), - child:Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - "assets/svg/liulanliang.svg", - width: 16, - height: 16, - ), - SizedBox( - width: 5.w, - ), - Text( - (widget.article != null) - ? "${widget.article.viewers}" - : "", - style: TextStyle( - fontSize: 14.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFF1A1A1A), - ), - ), - ], - )), - ), - Expanded( - child:Container( - padding: EdgeInsets.only(bottom: 16.h), - child:Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - "assets/svg/pinglun.svg", - width: 16, - height: 16, - ), - SizedBox( - width: 5.w, - ), - Text( - "${widget.article.comments ?? 0}", - style: TextStyle( - fontSize: 14.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFF1A1A1A), - ), - ), - ], - ))), - Expanded( - child:Container( - padding: EdgeInsets.only(bottom: 16.h), - child:Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - "assets/svg/xihuan.svg", - width: 16, - height: 16, - ), - SizedBox( - width: 5.w, - ), - Text( - "${widget.article.likes ?? 0}", - style: TextStyle( - fontSize: 14.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFF1A1A1A), - ), - ), - ], - )), - ), - if (widget?.article?.author != widget.userId ?? "") + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - choiceShowBottomSheet(); - }); - }, - child: Container( - padding: EdgeInsets.only(top:3.h,bottom: 16.h), - alignment: Alignment.center, - // color: Colors.red, - child: Icon( - Icons.more_horiz, - color: Colors.black, + child: Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + SvgPicture.asset( + "assets/svg/liulanliang.svg", + width: 16, + height: 16, ), + SizedBox( + width: 5.w, + ), + Text( + (widget.article != null) + ? "${widget.article.viewers}" + : "", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + )), + ), + Expanded( + child: Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + SvgPicture.asset( + "assets/svg/pinglun.svg", + width: 16, + height: 16, + ), + SizedBox( + width: 5.w, + ), + Text( + "${widget.article.comments ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], ))), - ], - ),), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + widget.article.liked = + !(widget.article.liked ?? false); + _queryInformationLikes( + widget.article.liked ?? false); + }); + }, + child: Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + (widget.article.liked ?? false) + ? Image.asset( + "assets/image/icon_like.webp", + width: 16, + height: 16, + ) + : Image.asset( + "assets/image/icon_like_h.webp", + width: 16, + height: 16, + ), + SizedBox( + width: 5.w, + ), + Text( + "${widget.article.likes ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + )), + ) + ), + if ((widget?.article?.author != widget.userId ?? "") && + widget.commentType == 0) + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + choiceShowBottomSheet(); + }); + }, + child: Container( + padding: + EdgeInsets.only(top: 3.h, bottom: 16.h), + alignment: Alignment.center, + // color: Colors.red, + child: Icon( + Icons.more_horiz, + color: Colors.black, + ), + ))), + ], + ), + ), ], ), ), @@ -794,14 +835,11 @@ class _CommunityDynamic extends State { topLeft: const Radius.circular(25.0), topRight: const Radius.circular(25.0))), child: Container( - width: 130.w, height: 130.h, child: Column( children: [ - SizedBox( - height: 10.h, - ), GestureDetector( + behavior: HitTestBehavior.translucent, onTap: () { setState(() { Navigator.of(context).pop(); @@ -809,6 +847,9 @@ class _CommunityDynamic extends State { }); }, child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10.h), + padding: EdgeInsets.symmetric(vertical: 5.h), child: Row( children: [ SizedBox( @@ -841,37 +882,42 @@ class _CommunityDynamic extends State { color: Color(0xFFF7F7F7), ), GestureDetector( + behavior: HitTestBehavior.translucent, onTap: () { setState(() { Navigator.of(context) - .popAndPushNamed('/router/report_page',arguments: { - "userName":widget?.article?.authorName ?? "", - "authorId":widget?.article?.author ?? "", + .popAndPushNamed('/router/report_page', arguments: { + "userName": widget?.article?.authorName ?? "", + "authorId": widget?.article?.author ?? "", }); }); }, - child: Row( - children: [ - SizedBox( - width: 4.w, - ), - SvgPicture.asset( - "assets/svg/ju_b.svg", - width: 20, - height: 20, - ), - SizedBox( - width: 15.w, - ), - Text( - S.of(context).jubaogaineirong, - style: TextStyle( - fontSize: 17.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF1A1A1A), + child: Container( + width: double.infinity, + padding: EdgeInsets.symmetric(vertical: 5.h), + child: Row( + children: [ + SizedBox( + width: 4.w, ), - ), - ], + SvgPicture.asset( + "assets/svg/ju_b.svg", + width: 20, + height: 20, + ), + SizedBox( + width: 15.w, + ), + Text( + S.of(context).jubaogaineirong, + style: TextStyle( + fontSize: 17.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF1A1A1A), + ), + ), + ], + ), )) ], ), diff --git a/lib/community/photo_view_gallery_screen.dart b/lib/community/photo_view_gallery_screen.dart index 78d91382..5b301b22 100644 --- a/lib/community/photo_view_gallery_screen.dart +++ b/lib/community/photo_view_gallery_screen.dart @@ -42,41 +42,47 @@ class _PhotoViewGalleryScreenState extends State { left: 0, bottom: 0, right: 0, - child: Container( - child: PhotoViewGallery.builder( - scrollPhysics: const BouncingScrollPhysics(), - builder: (BuildContext context, int index) { - return PhotoViewGalleryPageOptions( - imageProvider: NetworkToFileImage( - url: widget.images[index], - file: fileFromDocsDir(widget.images[index].toString() - .replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")), - debug: true, - ), - ); - }, - itemCount: widget.images.length, - loadingBuilder: (context, progress) => Center( - child: Container( - width: 20.0, - height: 20.0, - child: CircularProgressIndicator( - value: progress == null - ? null - : progress.cumulativeBytesLoaded / - progress.expectedTotalBytes, + child: GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child: Container( + color: Colors.black, + child: PhotoViewGallery.builder( + scrollPhysics: const BouncingScrollPhysics(), + builder: (BuildContext context, int index) { + return PhotoViewGalleryPageOptions( + imageProvider: NetworkToFileImage( + url: widget.images[index], + file: fileFromDocsDir(widget.images[index].toString() + .replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")), + debug: true, + ), + ); + }, + itemCount: widget.images.length, + loadingBuilder: (context, progress) => Center( + child: Container( + width: 20.0, + height: 20.0, + child: CircularProgressIndicator( + value: progress == null + ? null + : progress.cumulativeBytesLoaded / + progress.expectedTotalBytes, + ), ), ), - ), - backgroundDecoration: null, - pageController: widget.controller, - enableRotation: false, - onPageChanged: (index){ - setState(() { - currentIndex=index; - }); - }, - ) + backgroundDecoration: null, + pageController: widget.controller, + enableRotation: false, + onPageChanged: (index){ + setState(() { + currentIndex=index; + }); + }, + ) + ), ), ), Positioned(//图片index显示 diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 1486d54c..9a698a61 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), + "huozan" : MessageLookupByLibrary.simpleMessage("获赞"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), diff --git a/lib/generated/intl/messages_en_US.dart b/lib/generated/intl/messages_en_US.dart index 0bddbe0b..fd59232d 100644 --- a/lib/generated/intl/messages_en_US.dart +++ b/lib/generated/intl/messages_en_US.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("For:Any store dedicated to returning home"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("Homecoming Headlines"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("Home Return VIP Card Exclusive Rights"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("Homecoming VIP Membership Card Rules Agreement"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("Membership Level"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("Member Level Description"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("Member Rules Description"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("Activity information"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("The goods have been delivered"), + "huozan" : MessageLookupByLibrary.simpleMessage("liked"), "input_code" : MessageLookupByLibrary.simpleMessage("Mobile phone verification code"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("Please enter the verification code"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("Fill in the invitation code"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("Open now"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("Get it now"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("Sign in immediately"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("Use Now"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("Experience Now"), "likekaitong" : MessageLookupByLibrary.simpleMessage("Open now"), "likexufei" : MessageLookupByLibrary.simpleMessage("Renew now"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("Use Date"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("Instructions for Use"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("Use Conditions"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("Use Details"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("Ship To Address"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("Please enter the detailed receiving address"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("Delivery address"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("finish"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("Place an order once"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("Forgot password"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("Play healthy"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("Automatically generated after improving birthday information"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("Exclusive coupon for improving birthday information"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("Modify User Name"), "xuanguige" : MessageLookupByLibrary.simpleMessage("Select specs"), "xuanji" : MessageLookupByLibrary.simpleMessage("Selection"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("Please select the picking method of goods"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("Renewal member"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("Learning Health"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("Renewal Home VIP"), @@ -751,8 +757,8 @@ class MessageLookup extends MessageLookupByLibrary { "zaituzhong" : MessageLookupByLibrary.simpleMessage("In transit"), "zaixiankefu" : MessageLookupByLibrary.simpleMessage("Online Customer Service"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("Online ordering is not supported temporarily"), - "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("Not yet unlocked"), - "zanweikaifang" : MessageLookupByLibrary.simpleMessage("Not yet open"), + "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("Not unlocked"), + "zanweikaifang" : MessageLookupByLibrary.simpleMessage("Not open"), "zanweikaitong" : MessageLookupByLibrary.simpleMessage("Not yet open"), "zanwupinglun" : MessageLookupByLibrary.simpleMessage("No comment, please comment"), "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("Temporary wireless shopping"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 11f7b57c..bf6757c5 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), + "huozan" : MessageLookupByLibrary.simpleMessage("获赞"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index 59c93d09..b5bd83c7 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -293,6 +293,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回乡头条"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回乡VIP卡专享权益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回乡VIP会员卡规则协议"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("会员等级"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("会员等级说明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("会员规则说明"), @@ -317,6 +318,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活动资讯"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("货品已送达"), + "huozan" : MessageLookupByLibrary.simpleMessage("获赞"), "input_code" : MessageLookupByLibrary.simpleMessage("手机验证码"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填写邀请码"), @@ -389,6 +391,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即开通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即领取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即签到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即体验"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻开通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻续费"), @@ -565,6 +568,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用详情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收货地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("请输入详细收货地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收货地址"), @@ -607,6 +611,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下单"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘记密码"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日信息后自动生成"), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日信息得专属优惠劵"), @@ -676,6 +681,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用户名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("选规格"), "xuanji" : MessageLookupByLibrary.simpleMessage("选集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("请选择商品的领取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("续费会员"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("学习健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("续费回乡VIP"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index e4a0deaf..ec37d6fd 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -289,6 +289,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回鄉VIP會員卡規則協定"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"), @@ -313,6 +314,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), + "huozan" : MessageLookupByLibrary.simpleMessage("獲贊"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), @@ -385,6 +387,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"), @@ -560,6 +563,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用詳情"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuorenshoujihao" : MessageLookupByLibrary.simpleMessage("請輸入收貨人手機號"), @@ -601,6 +605,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "), @@ -670,6 +675,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanji" : MessageLookupByLibrary.simpleMessage("選集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("請選擇商品的領取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"), @@ -746,7 +752,7 @@ class MessageLookup extends MessageLookupByLibrary { "zaixiankefu" : MessageLookupByLibrary.simpleMessage("在線客服"), "zanbuzhichixianshangdiancan" : MessageLookupByLibrary.simpleMessage("暫不支持線上點餐"), "zanweijiesuo" : MessageLookupByLibrary.simpleMessage("暫未解鎖"), - "zanweikaifang" : MessageLookupByLibrary.simpleMessage("暂未开放"), + "zanweikaifang" : MessageLookupByLibrary.simpleMessage("暫未開放"), "zanweikaitong" : MessageLookupByLibrary.simpleMessage("暫未開通"), "zanwupinglun" : MessageLookupByLibrary.simpleMessage("暫無評論,快去評論吧~"), "zanwuxianshangjindian" : MessageLookupByLibrary.simpleMessage("暫無綫上門店"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index a011baca..0abb2099 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -291,6 +291,7 @@ class MessageLookup extends MessageLookupByLibrary { "huixiangrenyimendian" : MessageLookupByLibrary.simpleMessage("适用于:一心回乡任意门店"), "huixiangtoutiao" : MessageLookupByLibrary.simpleMessage("回鄉頭條"), "huixiangvipkazhuanxiang" : MessageLookupByLibrary.simpleMessage("回鄉VIP卡專享權益"), + "huixiangxieyi" : MessageLookupByLibrary.simpleMessage("回鄉VIP會員卡規則協定"), "huiyuandengji" : MessageLookupByLibrary.simpleMessage("會員等級"), "huiyuandengjishuoming" : MessageLookupByLibrary.simpleMessage("會員等級説明"), "huiyuanguize" : MessageLookupByLibrary.simpleMessage("會員規則説明"), @@ -315,6 +316,7 @@ class MessageLookup extends MessageLookupByLibrary { "huodongyue_" : m11, "huodongzixun" : MessageLookupByLibrary.simpleMessage("活動資訊"), "huopinyisongda" : MessageLookupByLibrary.simpleMessage("貨品已送達"), + "huozan" : MessageLookupByLibrary.simpleMessage("獲贊"), "input_code" : MessageLookupByLibrary.simpleMessage("手機驗證碼"), "input_code_hide" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "input_invite_code_hide" : MessageLookupByLibrary.simpleMessage("填寫邀請碼"), @@ -387,6 +389,7 @@ class MessageLookup extends MessageLookupByLibrary { "lijikaitong" : MessageLookupByLibrary.simpleMessage("立即開通"), "lijilingqu" : MessageLookupByLibrary.simpleMessage("立即領取"), "lijiqiandao" : MessageLookupByLibrary.simpleMessage("立即簽到"), + "lijishiyong" : MessageLookupByLibrary.simpleMessage("立即使用"), "lijitiyan" : MessageLookupByLibrary.simpleMessage("立即體驗"), "likekaitong" : MessageLookupByLibrary.simpleMessage("立刻開通"), "likexufei" : MessageLookupByLibrary.simpleMessage("立刻續費"), @@ -562,6 +565,7 @@ class MessageLookup extends MessageLookupByLibrary { "shiyongriqi" : MessageLookupByLibrary.simpleMessage("使用日期"), "shiyongshuoming" : MessageLookupByLibrary.simpleMessage("使用说明"), "shiyongtiaojian" : MessageLookupByLibrary.simpleMessage("使用条件"), + "shiyongxiangqing" : MessageLookupByLibrary.simpleMessage("使用詳情"), "shouhuodi" : MessageLookupByLibrary.simpleMessage("收貨地址"), "shouhuodizhi" : MessageLookupByLibrary.simpleMessage("請輸入詳細收貨地址"), "shouhuodizhi1" : MessageLookupByLibrary.simpleMessage("收貨地址"), @@ -604,6 +608,7 @@ class MessageLookup extends MessageLookupByLibrary { "wancheng" : MessageLookupByLibrary.simpleMessage("完成"), "wancheng_" : m32, "wanchengyicixiadan" : MessageLookupByLibrary.simpleMessage("完成一次下單"), + "wangjimima" : MessageLookupByLibrary.simpleMessage("忘記密碼"), "wanjiankang" : MessageLookupByLibrary.simpleMessage("玩健康"), "wanshanshengrixinxi_nl" : MessageLookupByLibrary.simpleMessage("完善生日資訊後自動生成 "), "wanshanshengrixinxi_yhq" : MessageLookupByLibrary.simpleMessage("完善生日資訊得專屬優惠劵 "), @@ -673,6 +678,7 @@ class MessageLookup extends MessageLookupByLibrary { "xiugaiyonghuming" : MessageLookupByLibrary.simpleMessage("修改用戶名"), "xuanguige" : MessageLookupByLibrary.simpleMessage("選規格"), "xuanji" : MessageLookupByLibrary.simpleMessage("選集"), + "xuanzeshangpinlingqufangshi" : MessageLookupByLibrary.simpleMessage("請選擇商品的領取方式"), "xuefeihuiyuan" : MessageLookupByLibrary.simpleMessage("續費會員"), "xuexijiankang" : MessageLookupByLibrary.simpleMessage("學習健康"), "xufeihuixiangVIP" : MessageLookupByLibrary.simpleMessage("續費回鄉VIP"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index de8d5e66..ff27cb82 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -6875,6 +6875,66 @@ class S { ); } + /// `回乡VIP会员卡规则协议` + String get huixiangxieyi { + return Intl.message( + '回乡VIP会员卡规则协议', + name: 'huixiangxieyi', + desc: '', + args: [], + ); + } + + /// `获赞` + String get huozan { + return Intl.message( + '获赞', + name: 'huozan', + desc: '', + args: [], + ); + } + + /// `使用详情` + String get shiyongxiangqing { + return Intl.message( + '使用详情', + name: 'shiyongxiangqing', + desc: '', + args: [], + ); + } + + /// `立即使用` + String get lijishiyong { + return Intl.message( + '立即使用', + name: 'lijishiyong', + desc: '', + args: [], + ); + } + + /// `忘记密码` + String get wangjimima { + return Intl.message( + '忘记密码', + name: 'wangjimima', + desc: '', + args: [], + ); + } + + /// `请选择商品的领取方式` + String get xuanzeshangpinlingqufangshi { + return Intl.message( + '请选择商品的领取方式', + name: 'xuanzeshangpinlingqufangshi', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index e418f8ad..4956f22c 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -163,8 +163,6 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { final BaseData brand = await apiService.queryHomeBrand().catchError((onError) { - SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), - alignment: Alignment.center); refreshController.refreshFailed(); }); if (brand != null && brand.isSuccess) { @@ -289,7 +287,9 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { queryUserBalance() async { BaseData baseData = - await apiService.queryInfo().catchError((onError) {}); + await apiService.queryInfo().catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center);}); if (baseData != null && baseData.isSuccess) { userInfo = baseData.data; mRaiseMoney = double.tryParse(userInfo.raiseMoney); @@ -503,83 +503,87 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { }, child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), - child: Column( - children: [ - ///banner - HomeBanner(bannerData, controller), - - ///吃喝玩 - UnionEntry((int jpIndex) { - widget.changeTab(1,jpIndex); + child: FutureBuilder( + future:queryHome(), + builder: (context, snapshot) { + return Column( + children: [ + ///banner + HomeBanner(bannerData, controller), + + ///吃喝玩 + UnionEntry((int jpIndex) { + widget.changeTab(1,jpIndex); + }), + + ///快捷操作 + ShortcutOperation((int jpIndex) { + widget.changeTab(1,jpIndex); + }), + + ///推广图 + spread(), + + // ///签到 + // SignView(isSigned, (value) { + // setState(() { + // isSigned = value; + // }); + // }), + + ///特惠专区 + DiscountZone(coupons), + + ///特惠专区-推荐商品展示 + HomeRecommendGoods(homeRank), + + ///助农专区 + if(mRaiseMoney != 0.0) + HappyHelpFarmers(), + + ///福利中心 + WelfareCore(), + + ///吃喝玩商品热销榜 + TopSellingList(homeRank), + + // ///店铺推荐 + // QuickOrder(), + + // ///超级优惠券 + // CouponView(), + + // ///精选活动 + // FeaturedActivity(), + + // ///积分商城 + // HomeIntegralStore(gooods), + + ///积分商品头Tab + PointsGoodsTitle( + gooodsCategorys, + (orderType, orderDesc) { + this.orderType = orderType; + this.orderDesc = orderDesc; + setState(() {}); + }, + (index) { + categoryId = gooodsCategorys[index].id; + pageNum = 1; + setState(() {}); + }, + ), + + ///积分商品列表 + PointGoods( + goods, + (index) { + _toDetails(index); + }, + ), + ], + ); }), - - ///快捷操作 - ShortcutOperation((int jpIndex) { - widget.changeTab(1,jpIndex); - }), - - ///推广图 - spread(), - - // ///签到 - // SignView(isSigned, (value) { - // setState(() { - // isSigned = value; - // }); - // }), - - ///特惠专区 - DiscountZone(coupons), - - ///特惠专区-推荐商品展示 - HomeRecommendGoods(homeRank), - - ///助农专区 - if(mRaiseMoney != 0) - HappyHelpFarmers(), - - ///福利中心 - WelfareCore(), - - ///吃喝玩商品热销榜 - TopSellingList(homeRank), - - // ///店铺推荐 - // QuickOrder(), - - // ///超级优惠券 - // CouponView(), - - // ///精选活动 - // FeaturedActivity(), - - // ///积分商城 - // HomeIntegralStore(gooods), - - ///积分商品头Tab - PointsGoodsTitle( - gooodsCategorys, - (orderType, orderDesc) { - this.orderType = orderType; - this.orderDesc = orderDesc; - setState(() {}); - }, - (index) { - categoryId = gooodsCategorys[index].id; - pageNum = 1; - setState(() {}); - }, - ), - - ///积分商品列表 - PointGoods( - goods, - (index) { - _toDetails(index); - }, - ), - ], - ), ), ), ), @@ -599,7 +603,6 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { child: GestureDetector( onTap: (){ Navigator.of(context).pushNamed('/router/invite_friends'); - // Navigator.of(context).pushNamed('/router/mine_greenery'); }, child: ClipRRect( child:Image.asset( diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index 16a1aeba..ae017223 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -28,7 +28,8 @@ class WelfareExchange extends StatefulWidget { } } -class _WelfareExchange extends State with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin{ +class _WelfareExchange extends State + with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { ApiService apiService; final ScrollController scrollController = ScrollController(); final RefreshController refreshController = RefreshController(); @@ -195,28 +196,28 @@ class _WelfareExchange extends State with SingleTickerProvider ), ), flexibleSpace: FlexibleSpaceBar( - background:Stack( - children: [ - Container( - // padding: EdgeInsets.only(top: 40.h), - height: 172.h, - decoration: BoxDecoration( - // border: Border.all(color: Colors.white,width: 0.5), - color: Color(0xFF277D4B), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(40.r), - bottomLeft: Radius.circular(40.r), - ), - ), - ), - Container( - alignment: Alignment.topCenter, - margin: EdgeInsets.only(top: 110.h), - child: pointUser(), + background: Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height: 172.h, + decoration: BoxDecoration( + // border: Border.all(color: Colors.white,width: 0.5), + color: Color(0xFF277D4B), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(40.r), + bottomLeft: Radius.circular(40.r), ), - ], - )), + ), + ), + Container( + alignment: Alignment.topCenter, + margin: EdgeInsets.only(top: 110.h), + child: pointUser(), + ), + ], + )), expandedHeight: 258.h, bottom: PreferredSize( preferredSize: Size(double.infinity, 0), @@ -408,27 +409,28 @@ class _WelfareExchange extends State with SingleTickerProvider SizedBox( height: 4.h, ), - Expanded(child: Row( - children: [ - Text( - (userInfo != null) ? "${userInfo.points}" : "", - style: TextStyle( - fontSize: 16.sp, - color: Color(0xFF32A060), - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium, - ), - ), - SizedBox( - width: 6.w, + Expanded( + child: Row( + children: [ + Text( + (userInfo != null) ? "${userInfo.points}" : "", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF32A060), + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, ), - Image.asset( - "assets/image/icon_gold_coin.webp", - width: 18, - height: 18, - ) - ], - )) + ), + SizedBox( + width: 6.w, + ), + Image.asset( + "assets/image/icon_gold_coin.webp", + width: 18, + height: 18, + ) + ], + )) ], ), ) diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index cbd7d680..8ee66699 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -713,6 +713,15 @@ "canyingfuwu":"餐饮服务", "qiyetuanjian":"企业团建", "zhunongjifen":"助农积分", + "huixiangxieyi":"回乡VIP会员卡规则协议", + "zanweikaifang":"暂未开放", + "zanweijiesuo":"暂未解锁", + "huozan":"获赞", + "shiyongxiangqing":"使用详情", + "lijishiyong":"立即使用", + "wangjimima":"忘记密码", + "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", + diff --git a/lib/l10n/intl_en_US.arb b/lib/l10n/intl_en_US.arb index a5283cf8..076d6fbb 100644 --- a/lib/l10n/intl_en_US.arb +++ b/lib/l10n/intl_en_US.arb @@ -714,6 +714,14 @@ "canyingfuwu":"catering service", "qiyetuanjian":"Enterprise League Building", "zhunongjifen":"Farming aid points", + "huixiangxieyi":"Homecoming VIP Membership Card Rules Agreement", + "zanweikaifang":"Not open", + "zanweijiesuo":"Not unlocked", + "huozan":"liked", + "shiyongxiangqing":"Use Details", + "lijishiyong":"Use Now", + "wangjimima":"Forgot password", + "xuanzeshangpinlingqufangshi":"Please select the picking method of goods", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index edb9f2a0..4a53c7b4 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -714,6 +714,14 @@ "canyingfuwu":"餐饮服务", "qiyetuanjian":"企业团建", "zhunongjifen":"助农积分", + "huixiangxieyi":"回乡VIP会员卡规则协议", + "zanweikaifang":"暂未开放", + "zanweijiesuo":"暂未解锁", + "huozan":"获赞", + "shiyongxiangqing":"使用详情", + "lijishiyong":"立即使用", + "wangjimima":"忘记密码", + "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 5d24beec..6c615ef0 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -714,6 +714,14 @@ "canyingfuwu":"餐饮服务", "qiyetuanjian":"企业团建", "zhunongjifen":"助农积分", + "huixiangxieyi":"回乡VIP会员卡规则协议", + "zanweikaifang":"暂未开放", + "zanweijiesuo":"暂未解锁", + "huozan":"获赞", + "shiyongxiangqing":"使用详情", + "lijishiyong":"立即使用", + "wangjimima":"忘记密码", + "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index 9c107d87..be665571 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -705,6 +705,14 @@ "canyingfuwu":"餐飲服務", "qiyetuanjian":"企業團建", "zhunongjifen":"助農積分", + "huixiangxieyi":"回鄉VIP會員卡規則協定", + "zanweikaifang":"暫未開放", + "zanweijiesuo":"暫未解鎖", + "huozan":"獲贊", + "shiyongxiangqing":"使用詳情", + "lijishiyong":"立即使用", + "wangjimima":"忘記密碼", + "xuanzeshangpinlingqufangshi":"請選擇商品的領取方式", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 467affc4..1e4c6b0f 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -707,6 +707,14 @@ "canyingfuwu":"餐飲服務", "qiyetuanjian":"企業團建", "zhunongjifen":"助農積分", + "huixiangxieyi":"回鄉VIP會員卡規則協定", + "zanweikaifang":"暫未開放", + "zanweijiesuo":"暫未解鎖", + "huozan":"獲贊", + "shiyongxiangqing":"使用詳情", + "lijishiyong":"立即使用", + "wangjimima":"忘記密碼", + "xuanzeshangpinlingqufangshi":"請選擇商品的領取方式", diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 50c904ac..4edfb2e4 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -123,7 +123,7 @@ class _NewLoginPage extends State { } if (_sendCodeStatus == 0) { apiService - .sendVerify(area,mobile) + .sendVerify(area, mobile) .then((value) => { if (value.isSuccess) {_sendCodeStatus = 1, countdown()} @@ -207,7 +207,12 @@ class _NewLoginPage extends State { return; } var invite = _controllerInviteCode.text; - var param = {"capcha": code, "mobile": mobile, "invite": invite,"areaCode":area}; + var param = { + "capcha": code, + "mobile": mobile, + "invite": invite, + "areaCode": area + }; EasyLoading.show(status: S.of(context).zhengzaijiazai); BaseData value = await apiService.memberLogin(param).catchError((error) { print(error.message); @@ -217,7 +222,8 @@ class _NewLoginPage extends State { // EasyLoading.show(status: S.of(context).zhengzaijiazai); if (value != null && value.isSuccess) { var userInfo = LoginInfo.fromJson(value.data); - ExamineInstance.instance.isExamine = userInfo.authInfo.account == "13800138000"; + ExamineInstance.instance.isExamine = + userInfo.authInfo.account == "13800138000"; saveUserJson(userInfo.authInfo.toJson()); eventBus.fire(EventType(3)); @@ -257,7 +263,8 @@ class _NewLoginPage extends State { if (sharedPreferences.containsKey('token') && sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != "") { - ExamineInstance.instance.isExamine = sharedPreferences.getString("mobile") == "13800138000"; + ExamineInstance.instance.isExamine = + sharedPreferences.getString("mobile") == "13800138000"; Navigator.of(context).popAndPushNamed('/router/main_page'); } else { initController(); @@ -383,22 +390,24 @@ class _NewLoginPage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ GestureDetector( - onTap: (){ - Navigator.of(context).pushNamed('/router/phone_address_page').then((value) { - if(value != null) - setState(() { - area = value; + onTap: () { + Navigator.of(context) + .pushNamed('/router/phone_address_page') + .then((value) { + if (value != null) + setState(() { + area = value; + }); }); - }); - }, - child: Text( - area, - style: TextStyle( - fontWeight: MyFontWeight.regular, - fontSize: 16.sp, - color: Color(0xFF1A1A1A), - ), - )), + }, + child: Text( + area, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 16.sp, + color: Color(0xFF1A1A1A), + ), + )), Icon( Icons.keyboard_arrow_right, size: 18, @@ -454,7 +463,9 @@ class _NewLoginPage extends State { height: 1.h, width: MediaQuery.of(context).size.width - 80.h, // color: statusPhoneLineColor, - color: _controllerPhone.text== "" ? Color(0xFFE7E3E3):Color(0xFF32A060), + color: _controllerPhone.text == "" + ? Color(0xFFE7E3E3) + : Color(0xFF32A060), ), SizedBox( height: 30.h, @@ -680,8 +691,8 @@ class _NewLoginPage extends State { // Navigator.of(context).pop(); // } else { ExamineInstance.instance.isExamine = true; - Navigator.of(context) - .popAndPushNamed('/router/main_page'); + Navigator.of(context) + .popAndPushNamed('/router/main_page'); // } }, child: Container( @@ -732,7 +743,7 @@ class _NewLoginPage extends State { showDialog( context: context, builder: (BuildContext context) { - return WillPopScope( + return WillPopScope( onWillPop: () async => false, child: SimpleDialog( titlePadding: EdgeInsets.all(10), @@ -855,7 +866,7 @@ class _NewLoginPage extends State { }); SharesdkPlugin.uploadPrivacyPermissionStatus( 1, - (success) => { + (success) => { Navigator.of(context).pop(), }, ); diff --git a/lib/main_page.dart b/lib/main_page.dart index 69255113..3390b4f0 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -204,7 +204,7 @@ class _MainPage extends State with WidgetsBindingObserver { myLocPlugin.authAK("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); BMFMapSDK.setApiKeyAndCoordType( 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', - BMF_COORD_TYPE.COMMON, + BMF_COORD_TYPE.BD09LL, ); } else if (Platform.isAndroid) { BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 153ad73e..e5577168 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -31,8 +31,8 @@ import 'mine_view/mine_item.dart'; import 'mine_view/mine_view.dart'; class MinePage extends StatefulWidget { + MinePage(Key key) : super(key: key); - MinePage(Key key): super(key: key); @override State createState() { return MinePageState(); @@ -50,13 +50,16 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { _toUserInfo() async { SharedPreferences shared = await SharedPreferences.getInstance(); if (shared.getString("token") == null || shared.getString("token") == "") { - Navigator.of(context) - .pushReplacementNamed('/router/new_login_page', arguments: {"login": "login"}); + Navigator.of(context).pushReplacementNamed('/router/new_login_page', + arguments: {"login": "login"}); return; } - (Platform.isAndroid&&ExamineInstance.instance.isExamine)? - await Navigator.of(context).pushNamed('/router/user_info_page'): - await Navigator.of(context).pushNamed('/router/personal_page',arguments:{"memberId":"0",}); + (Platform.isAndroid && ExamineInstance.instance.isExamine) + ? await Navigator.of(context).pushNamed('/router/user_info_page') + : await Navigator.of(context) + .pushNamed('/router/personal_page', arguments: { + "memberId": "0", + }); setState(() {}); } @@ -101,8 +104,8 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { BaseData> rankData = await apiService.rankList().catchError((onError) { - SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), - alignment: Alignment.center); + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); _refreshController.refreshFailed(); }); if (rankData != null && rankData.isSuccess) { @@ -165,7 +168,8 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { token: value.getString("token"), ); } - BaseData> baseData = await apiService.stats().catchError((onError) {}); + BaseData> baseData = + await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { totalMsg = 0; @@ -203,48 +207,38 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { children: [ Container( height: 502.h, - decoration: BoxDecoration( - // color: Color(0xFF32A060) - image: DecorationImage( - fit: BoxFit.cover, - image: AssetImage("assets/image/settlement_bg.webp"), + decoration: BoxDecoration( + // color: Color(0xFF32A060) + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/image/settlement_bg.webp"), + ), ), - ), ), FutureBuilder( future: queryUserInfo(), builder: (context, snapshot) { return Column( children: [ - ///我的 用户信息 - MineView( - userInfo, - () { - _toUserInfo(); - }, - () { - toIntegralPage(); - }, - (){ - setState(() { - totalMsg =0; - }); - }, - totalMsg, - infoNumber - ), + MineView(userInfo, () { + _toUserInfo(); + }, () { + toIntegralPage(); + }, () { + setState(() { + totalMsg = 0; + }); + }, totalMsg, infoNumber), ///我的 VIP等级信息 MineVipEntry( tag: "vip", ranks: ranks, userInfo: userInfo, - rank: double.tryParse( - userInfo?.expendAmount ?? "0") + rank: double.tryParse(userInfo?.expendAmount ?? "0") .toInt(), - rankMax: - userInfo?.memberRankVo?.nextOrigin ?? 0, + rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0, createTime: userInfo?.createTime ?? "", ), @@ -286,15 +280,16 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { Widget attainment() { return GestureDetector( behavior: HitTestBehavior.opaque, - onTap: (){ + onTap: () { Navigator.of(context).pushNamed( '/router/mine_attainment_page', arguments: {"userInfo": userInfo}, ); }, - child:Container( - margin: EdgeInsets.only(left:16.w,right:16.w,bottom:15.h), - padding: EdgeInsets.only(left:12.w, top:12.h, right:10.w,bottom: 17.h), + child: Container( + margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 15.h), + padding: + EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h), width: double.infinity, decoration: BoxDecoration( color: Colors.white, @@ -320,34 +315,38 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { color: Color(0xFF0D0D0D), ), ), - SizedBox(height: 9.h,), + SizedBox( + height: 9.h, + ), Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ Image.asset( "assets/image/icon_attainment.webp", - width:54, - height:54, + width: 54, + height: 54, fit: BoxFit.cover, ), - SizedBox(width: 7.w,), - Expanded(child: - Column( + SizedBox( + width: 7.w, + ), + Expanded( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - "已解锁${infoNumber != null - ? infoNumber.achievementNumber.toString() - : "0"}个成就", + "已解锁${infoNumber != null ? infoNumber.achievementNumber.toString() : "0"}个成就", style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 14.sp, color: Color(0xFF262626), ), ), - SizedBox(height:4.w,), + SizedBox( + height: 4.w, + ), Text( "完成任务解锁更多成就", style: TextStyle( @@ -390,17 +389,17 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ///推广图 Widget spreadImage() { return Container( - margin: EdgeInsets.only(right:14.w,bottom:15.h,left: 14.w), + margin: EdgeInsets.only(right: 14.w, bottom: 15.h, left: 14.w), child: GestureDetector( - onTap: (){ + onTap: () { Navigator.of(context).pushNamed('/router/invite_friends'); }, - child:ClipRRect( - child:Image.asset( + child: ClipRRect( + child: Image.asset( "assets/image/welfare_spread.webp", - width:double.infinity, + width: double.infinity, fit: BoxFit.fill, - height:80.h, + height: 80.h, ), borderRadius: BorderRadius.circular(6.w), ), diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index d5bd0531..8780951d 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -300,7 +300,7 @@ class _MineView extends State { child: Text( widget.userInfo == null ? S.of(context).denglu - : "${widget.userInfo.nickname??""}", + : "${widget.userInfo.nickname==""?"回乡":widget.userInfo.nickname}", style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.bold, diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index 95fa8e8f..b2cccb9b 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -98,54 +98,52 @@ class _PersonalPage extends State with WidgetsBindingObserver { ///动态列表 queryCommunity(String searchKey) async { - if(!isRefresh){ + if (!isRefresh) { isRefresh = true; return; } - if(isLoadingData){ + if (isLoadingData) { return; } isLoadingData = true; if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); userId = value.getString('userId'); - apiService = ApiService( - Dio(), + apiService = ApiService(Dio(), context: context, token: value.getString("token"), - showLoading: false - ); + showLoading: false); } - if(isLoadMore){ + if (isLoadMore) { pageNum += 1; isLoadMore = false; - } - else if(searchKey == null)pageNum = 1; + } else if (searchKey == null) pageNum = 1; BaseData> baseData = await apiService.trendList({ "mid": memberId == "0" ? userId : memberId, "onlyFollow": false, "onlyMe": true, - "pageNum": searchKey == null?pageNum:1, + "pageNum": searchKey == null ? pageNum : 1, "pageSize": 10, - "searchKey": searchKey??"" + "searchKey": searchKey ?? "" }).catchError((error) { - if(searchKey == null) { + if (searchKey == null) { refreshController.refreshFailed(); refreshController.loadFailed(); } }); - if(searchKey == null){ - refreshController.refreshCompleted(); - refreshController.loadComplete(); + if (searchKey == null) { + refreshController.refreshCompleted(); + refreshController.loadComplete(); } if (baseData.isSuccess) { - if(searchKey != null){ - if(baseData?.data?.list != null && baseData.data.list.isNotEmpty) + if (searchKey != null) { + if (baseData?.data?.list != null && baseData.data.list.isNotEmpty) articles.forEach((element) { - if(element.id == searchKey){ + if (element.id == searchKey) { element.content = jsonEncode(baseData.data.list[0].subjectInfo); - element.mainTitle =baseData.data.list[0].subject; + element.mainTitle = baseData.data.list[0].subject; element.followed = baseData.data.list[0].selfFollow; + element.liked = baseData.data.list[0].selfLike; element.authorHeadImg = baseData.data.list[0].memberInfo?.avatar; element.authorName = baseData.data.list[0].memberInfo?.nickname; element.location = baseData.data.list[0].location; @@ -155,12 +153,10 @@ class _PersonalPage extends State with WidgetsBindingObserver { element.likes = baseData.data.list[0]?.likes; element.comments = baseData.data.list[0]?.comments; this.isRefresh = false; - setState(() { - }); + setState(() {}); } }); - } - else{ + } else { if (pageNum == 1) { articles.clear(); } @@ -168,8 +164,9 @@ class _PersonalPage extends State with WidgetsBindingObserver { var article = Article(); article.id = element.id; article.content = jsonEncode(element.subjectInfo); - article.mainTitle =element.subject; + article.mainTitle = element.subject; article.followed = element.selfFollow; + article.liked = element.selfLike; article.authorHeadImg = element.memberInfo?.avatar; article.authorName = element.memberInfo?.nickname; article.location = element.location; @@ -180,8 +177,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { article.comments = element?.comments; articles.add(article); }); - setState(() { - }); + setState(() {}); // comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); // print("comments: ${comments.length}"); if (int.tryParse(baseData.data.total) < (pageNum * 10)) { @@ -350,7 +346,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: 248, + height: 248.h, color: Color(0xFFFFFFFF), // color: Colors.red, child: Stack( @@ -359,7 +355,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { Positioned( top: 0, left: 0, - bottom: 36, + bottom: 36.h, right: 0, child: Stack( alignment: Alignment.bottomRight, @@ -402,7 +398,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), if (memberId == "0") Positioned( - bottom: 9, + bottom: 9.h, right: 16.w, child: GestureDetector( onTap: () { @@ -438,12 +434,14 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), Container( color: Color(0xFFFFFFFF), + margin: EdgeInsets.only(bottom:30.h), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 86, top: 12, right: 16), + margin: + EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w), child: GestureDetector( onTap: () { setState(() { @@ -470,7 +468,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { fontSize: 12.sp, color: Color(0xFF868686), fontWeight: MyFontWeight.regular, - height: 1.5), + height: 1.5.h), )), Icon( (isShrink != null && !isShrink) @@ -483,7 +481,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), )), Container( - margin: EdgeInsets.only(left: 16, right: 16), + margin: EdgeInsets.only(left: 16.w, right: 16.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, @@ -508,7 +506,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( S.of(context).guanzhu, @@ -542,7 +540,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( S.of(context).fensi, @@ -575,7 +573,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( S.of(context).dongtai, @@ -608,10 +606,10 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), ), SizedBox( - height: 4, + height: 4.h, ), Text( - "获赞", + S.of(context).huozan, style: TextStyle( color: Color(0xFF353535), fontSize: 12.sp, @@ -631,7 +629,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { color: Color(0xFFF7F7F7), ), Padding( - padding: EdgeInsets.only(left: 16), + padding: EdgeInsets.only(left: 16.w), child: Text( memberId != "0" ? "TA的动态" : "我的动态", style: TextStyle( @@ -640,7 +638,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { fontWeight: MyFontWeight.semi_bold, ), )), - dynamicList() + dynamicList(), ], ), ), @@ -657,8 +655,8 @@ class _PersonalPage extends State with WidgetsBindingObserver { right: 0, child: Container( padding: EdgeInsets.only( - left: 16, - right: 16, + left: 16.w, + right: 16.w, ), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -691,7 +689,9 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), SizedBox(width: 10.w), Text( - memberInfor?.nickname ?? "", + ((memberInfor?.nickname ?? "") == "") + ? "回乡" + : memberInfor?.nickname, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16.sp, @@ -714,14 +714,14 @@ class _PersonalPage extends State with WidgetsBindingObserver { }); }, child: Container( - height: 23, - padding: - EdgeInsets.only(left: 6, right: 6, bottom: 2, top: 2), + height: 23.h, + padding: EdgeInsets.only( + left: 6.w, right: 6.w, bottom: 2.h, top: 2.h), alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), border: Border.all( - width: 1, + width: 1.w, color: Color(0xFF353535), style: BorderStyle.solid, ), @@ -749,7 +749,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { isShowBtn: false, text: "目前暂无发布动态,要把开心的事讲出来哦~", fontSize: 16.sp, - margin: EdgeInsets.only(left: 60.w, right: 60.w), + margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 75.h), ) : ListView.builder( physics: NeverScrollableScrollPhysics(), @@ -760,9 +760,9 @@ class _PersonalPage extends State with WidgetsBindingObserver { articles[position], memberId == "0" ? 1 : 0, exitFull: () { - // setState(() { - // _onRefresh(); - // }); + setState(() { + _onRefresh(); + }); }, removalDynamic: () { setState(() { diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 1889cb9e..b511fea3 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -327,37 +327,37 @@ class _RechargePage extends State { ), ), SizedBox(height:10.h), - GestureDetector( - onTap: () { - setState(() { - checkIndex = 3; - }); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Image.asset( - "assets/image/icon_alipay.webp"), - Expanded( - flex: 1, - child: Padding( - padding: EdgeInsets.only(left: 8.w), - child: Text( - S.of(context).zhifubao, - style: TextStyle( - fontSize: 14.sp, - color: Color(0xff353535), - ), - ), - ), - ), - checkView(3), - ], - ), - ), + // GestureDetector( + // onTap: () { + // setState(() { + // checkIndex = 3; + // }); + // }, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Image.asset( + // "assets/image/icon_alipay.webp"), + // Expanded( + // flex: 1, + // child: Padding( + // padding: EdgeInsets.only(left: 8.w), + // child: Text( + // S.of(context).zhifubao, + // style: TextStyle( + // fontSize: 14.sp, + // color: Color(0xff353535), + // ), + // ), + // ), + // ), + // checkView(3), + // ], + // ), + // ), ], ), ), diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index da182e8b..096cff0a 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -35,7 +35,7 @@ class _UserInfoPage extends State { "headimg": "", "nickname": "", "sex": "", - "signature":"" + "signature": "" }; @override @@ -52,7 +52,8 @@ class _UserInfoPage extends State { modifyInfo["sex"] = user.sex, age = AppUtils.getAgeByString(user.birth), refresh(), - apiService = ApiService(Dio(), context: context, token: value.getString('token')), + apiService = ApiService(Dio(), + context: context, token: value.getString('token')), }); } @@ -89,7 +90,7 @@ class _UserInfoPage extends State { Widget userInfo() { return Container( - margin: EdgeInsets.only(left:14.w,right: 14.w), + margin: EdgeInsets.only(left: 14.w, right: 14.w), child: Column( children: [ InkWell( @@ -97,7 +98,8 @@ class _UserInfoPage extends State { showImagePicker(); }, child: avatarItem(0, ""), - ),Container( + ), + Container( margin: EdgeInsets.symmetric(vertical: 12.h), width: double.infinity, height: 1, @@ -120,8 +122,11 @@ class _UserInfoPage extends State { onTap: () { editSignature(); }, - child:avatarItem(2, - (modifyInfo["signature"]) == "" ? "还未编辑个性签名~" : modifyInfo["signature"]), + child: avatarItem( + 2, + (modifyInfo["signature"]) == "" + ? "还未编辑个性签名~" + : modifyInfo["signature"]), ), Container( margin: EdgeInsets.symmetric(vertical: 12.h), @@ -130,7 +135,7 @@ class _UserInfoPage extends State { color: Color(0xFFF2F2F2), ), InkWell( - onTap:(modifyInfo["birth"] == "")?showDateSelector:(){}, + onTap: (modifyInfo["birth"] == "") ? showDateSelector : () {}, child: avatarItem( 3, (modifyInfo["birth"] != null && modifyInfo["birth"] != "") @@ -171,7 +176,8 @@ class _UserInfoPage extends State { } editSignature() async { - dynamic signature = await Navigator.of(context).pushNamed('/router/edit_signature', + dynamic signature = await Navigator.of(context).pushNamed( + '/router/edit_signature', arguments: {"signature": modifyInfo['signature']}); if (signature != null && signature != "") { modifyInfo["signature"] = signature; @@ -196,7 +202,7 @@ class _UserInfoPage extends State { builder: (_) { return CupertinoDatePickerWidget(); }); - if (dateTime != null ) { + if (dateTime != null) { modifyInfo["birth"] = DateFormat("yyyy-MM-dd").format(dateTime); user.birth = modifyInfo["birth"]; age = AppUtils.getAge(dateTime); @@ -295,38 +301,38 @@ class _UserInfoPage extends State { } // Future cropImage(imagePath) async { - // File croppedFile = await ImageCropper.cropImage( - // sourcePath: imagePath, - // aspectRatioPresets: [ - // CropAspectRatioPreset.square, - // // CropAspectRatioPreset.ratio3x2, - // // CropAspectRatioPreset.original, - // // CropAspectRatioPreset.ratio4x3, - // // CropAspectRatioPreset.ratio16x9 - // ], - // aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1), - // androidUiSettings: AndroidUiSettings( - // toolbarTitle: 'Cropper', - // toolbarColor: Colors.black, - // toolbarWidgetColor: Colors.white, - // initAspectRatio: CropAspectRatioPreset.square, - // hideBottomControls: true, - // lockAspectRatio: false), - // iosUiSettings: IOSUiSettings( - // minimumAspectRatio: 1.0, - // resetAspectRatioEnabled: false, - // aspectRatioPickerButtonHidden: true, - // rectWidth: 500.w, - // rectHeight: 500.h, - // )); - // return croppedFile; + // File croppedFile = await ImageCropper.cropImage( + // sourcePath: imagePath, + // aspectRatioPresets: [ + // CropAspectRatioPreset.square, + // // CropAspectRatioPreset.ratio3x2, + // // CropAspectRatioPreset.original, + // // CropAspectRatioPreset.ratio4x3, + // // CropAspectRatioPreset.ratio16x9 + // ], + // aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1), + // androidUiSettings: AndroidUiSettings( + // toolbarTitle: 'Cropper', + // toolbarColor: Colors.black, + // toolbarWidgetColor: Colors.white, + // initAspectRatio: CropAspectRatioPreset.square, + // hideBottomControls: true, + // lockAspectRatio: false), + // iosUiSettings: IOSUiSettings( + // minimumAspectRatio: 1.0, + // resetAspectRatioEnabled: false, + // aspectRatioPickerButtonHidden: true, + // rectWidth: 500.w, + // rectHeight: 500.h, + // )); + // return croppedFile; // } ///调用修改用户信息接口 modifyInfos() async { var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); if (info.isSuccess) { - SharedPreferences.getInstance().then((value){ + SharedPreferences.getInstance().then((value) { value.setString('user', jsonEncode(modifyInfo)); }); setState(() { @@ -338,7 +344,9 @@ class _UserInfoPage extends State { ///文件上传 fileUpload() async { if (filePath != null && filePath != "" && await File(filePath).exists()) { - BaseData baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {}); + BaseData baseData = await apiService + .upload(File(filePath), 123123123, false) + .catchError((onError) {}); if (baseData != null && baseData.isSuccess) { UploadResult uploadResult = baseData.data; modifyInfo["headimg"] = uploadResult.url; @@ -347,8 +355,6 @@ class _UserInfoPage extends State { } } - - Widget avatarItem(type, value) { print("object: $value"); return Container( @@ -366,7 +372,10 @@ class _UserInfoPage extends State { flex: 1, ), buildValue(type, value), - if (type != 5 && type != 4 && type != 3 && (((modifyInfo["birth"] == "")) || type != 3)) + if (type != 5 && + type != 4 && + type != 3 && + (((modifyInfo["birth"] == "")) || type != 3)) valueEnd(), ], ), @@ -375,11 +384,10 @@ class _UserInfoPage extends State { Widget valueEnd() { return Container( - child: Icon( - Icons.keyboard_arrow_right, - size: 20.sp, - ) - ); + child: Icon( + Icons.keyboard_arrow_right, + size: 20.sp, + )); } Widget buildValue(type, value) { @@ -411,7 +419,7 @@ class _UserInfoPage extends State { return Text( value, maxLines: 1, - overflow:TextOverflow.ellipsis, + overflow: TextOverflow.ellipsis, style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 13.sp, @@ -419,10 +427,11 @@ class _UserInfoPage extends State { ), ); } else { - return Expanded(child: Text( + return Expanded( + child: Text( value, maxLines: 1, - overflow:TextOverflow.ellipsis, + overflow: TextOverflow.ellipsis, textAlign: TextAlign.right, style: TextStyle( fontWeight: MyFontWeight.regular, diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index 24b7c920..26204a46 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -543,6 +543,7 @@ class MemberVo { String money, String activityMoney, String greenMoney, + String raiseMoney, String expendAmount, dynamic organic, String points, @@ -577,6 +578,7 @@ class MemberVo { _money = money; _activityMoney = activityMoney; _greenMoney = greenMoney; + _raiseMoney = raiseMoney; _expendAmount = expendAmount; _organic = organic; _points = points; @@ -614,6 +616,7 @@ class MemberVo { _money = json['money']; _activityMoney = json['activityMoney']; _greenMoney = json['greenMoney']; + _raiseMoney = json['raiseMoney']; _expendAmount = json['expendAmount']; _organic = json['organic']; _points = json['points']; @@ -649,6 +652,7 @@ class MemberVo { String _money; String _activityMoney; String _greenMoney; + String _raiseMoney; String _expendAmount; dynamic _organic; String _points; @@ -683,6 +687,7 @@ class MemberVo { String money, String activityMoney, String greenMoney, + String raiseMoney, String expendAmount, dynamic organic, String points, @@ -717,6 +722,7 @@ class MemberVo { money: money ?? _money, activityMoney: activityMoney ?? _activityMoney, greenMoney: greenMoney ?? _greenMoney, + raiseMoney: raiseMoney ?? _raiseMoney, expendAmount: expendAmount ?? _expendAmount, organic: organic ?? _organic, points: points ?? _points, @@ -752,6 +758,7 @@ class MemberVo { String get money => _money; String get activityMoney => _activityMoney; String get greenMoney => _greenMoney; + String get raiseMoney => _raiseMoney; String get expendAmount => _expendAmount; dynamic get organic => _organic; String get points => _points; @@ -789,6 +796,7 @@ class MemberVo { map['money'] = _money; map['activityMoney'] = _activityMoney; map['greenMoney'] = _greenMoney; + map['raiseMoney'] = _raiseMoney; map['expendAmount'] = _expendAmount; map['organic'] = _organic; map['points'] = _points; diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 7e9d7012..f7e60731 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index e1507418..06429ed5 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 41a039fc..aea82211 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -120,8 +120,8 @@ class _Settlement extends State { token: minToken, tenant: tenant, storeId: storeId, - showLoading: false - ); + showLoading: false); + queryMemberInfo(); if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, @@ -189,73 +189,87 @@ class _Settlement extends State { try { EasyLoading.show(status: S.current.zhengzaijiazai); - BaseData baseData = await minService.getOrderInfo({ - "addressId": addressId, - "isTake": isTake, - "memberCouponId": memberCouponId, - "orderId": orderId, - "promotionId": promotionId, - "productSkuId": productSkuId, - "actProductId": actProductId, - "actProductSkuId": actProductSkuId, - "useVipPrice":useVipPriceSelect, - "buyNum": buyNum, - "payChannel":payChannel, - "tableId": tableId - }).catchError((error) {}); - this.promotion = null; - promotions = ""; - this.couponListBean = null; - coupons = ""; - if (baseData != null && baseData.isSuccess) { - settleOrderInfo = baseData.data; - if ((settleOrderInfo?.promotionId ?? "") != "") { - settleOrderInfo.promotionInfoList.forEach((element) { - if (element.id == settleOrderInfo.promotionId) { - this.promotion = element; - promotions = promotion?.name ?? ""; - } - }); - } - if ((settleOrderInfo?.memberCouponId ?? "") != "") { - settleOrderInfo.couponList.forEach((element) { - if (element.id == settleOrderInfo.memberCouponId) { - this.couponListBean = element; - coupons = couponListBean?.promotionName ?? ""; - } - }); - } - if (settleOrderInfo.orderProductList == null || - settleOrderInfo.orderProductList.length == 0) { - placeOrder = true; - queryOrderDetails( - pageType != null ? widget.arguments["orderId"] : parentId); - } - if(!isRaiseChannel && settleOrderInfo.isRaise){ - isRaiseChannel = true; - queryOrderInfo( - address?.id, - selectedBtn, - couponListBean?.id, - 0, - promotion?.id ?? productId, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - settleOrderInfo.isRaise ? 7 :payChannel, - tableId); + BaseData baseData = await minService.getOrderInfo({ + "addressId": addressId, + "isTake": isTake, + "memberCouponId": memberCouponId, + "orderId": orderId, + "promotionId": promotionId, + "productSkuId": productSkuId, + "actProductId": actProductId, + "actProductSkuId": actProductSkuId, + "useVipPrice": useVipPriceSelect, + "buyNum": buyNum, + "payChannel": payChannel, + "tableId": tableId + }).catchError((error) {}); + this.promotion = null; + promotions = ""; + this.couponListBean = null; + coupons = ""; + if (baseData != null && baseData.isSuccess) { + settleOrderInfo = baseData.data; + if ((settleOrderInfo?.promotionId ?? "") != "") { + settleOrderInfo.promotionInfoList.forEach((element) { + if (element.id == settleOrderInfo.promotionId) { + this.promotion = element; + promotions = promotion?.name ?? ""; + } + }); + } + if ((settleOrderInfo?.memberCouponId ?? "") != "") { + settleOrderInfo.couponList.forEach((element) { + if (element.id == settleOrderInfo.memberCouponId) { + this.couponListBean = element; + coupons = couponListBean?.promotionName ?? ""; + } + }); + } + if (settleOrderInfo.orderProductList == null || + settleOrderInfo.orderProductList.length == 0) { + placeOrder = true; + queryOrderDetails( + pageType != null ? widget.arguments["orderId"] : parentId); + } + if (!isRaiseChannel && settleOrderInfo.isRaise) { + isRaiseChannel = true; + queryOrderInfo( + address?.id, + selectedBtn, + couponListBean?.id, + 0, + promotion?.id ?? productId, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + settleOrderInfo.isRaise ? 7 : payChannel, + tableId); + } + } else { + SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); } - } else { - SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); - } - }finally{ + } finally { setState(() {}); EasyLoading.dismiss(); } } + ///会员信息 + queryMemberInfo() async { + BaseData baseData = await minService.memberInfo().catchError((error) { + debugPrint(error); + }); + if (baseData != null && baseData.isSuccess) { + SharedPreferences.getInstance().then( + (value) => { + value.setString('minMember', jsonEncode(baseData.data)), + }, + ); + } + } + ///查看订单详情 queryOrderDetails(id) async { BaseData baseData = await minService.getOrderDetails({ @@ -298,76 +312,76 @@ class _Settlement extends State { } queryAddress(int selectedBtn) async { + setState(() { + this.selectedBtn = selectedBtn; + }); + if (address != null) { + queryOrderInfo( + address.id, + selectedBtn, + null, + 0, + productId ?? null, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + payChannel, + tableId); + return; + } + BaseData> baseDate = + await minService.queryAddress().catchError((error) {}); + + BMFCoordinate bmfCoordinate = BMFCoordinate( + double.tryParse(storeInfo.latitude), + double.tryParse(storeInfo.longitude), + ); + if (baseDate != null && baseDate.isSuccess) { setState(() { - this.selectedBtn = selectedBtn; + address = baseDate.data[0]; }); - if (address != null) { - queryOrderInfo( - address.id, - selectedBtn, - null, - 0, - productId ?? null, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - payChannel, - tableId); - return; - } - BaseData> baseDate = - await minService.queryAddress().catchError((error) {}); - - BMFCoordinate bmfCoordinate = BMFCoordinate( - double.tryParse(storeInfo.latitude), - double.tryParse(storeInfo.longitude), - ); - if (baseDate != null && baseDate.isSuccess) { - setState(() { - address = baseDate.data[0]; - }); - for (int i = 1; i < baseDate.data.length; i++) { - Address address1 = baseDate.data[i]; + for (int i = 1; i < baseDate.data.length; i++) { + Address address1 = baseDate.data[i]; - BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert( - coordinate: BMFCoordinate( - double.tryParse(address.longitude), - double.tryParse(address.latitude), - ), - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL); - BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert( - coordinate: BMFCoordinate( - double.tryParse(address1.longitude), - double.tryParse(address1.latitude), - ), - fromType: BMF_COORD_TYPE.COMMON, - toType: BMF_COORD_TYPE.BD09LL); + BMFCoordinate coordinate = await BMFCalculateUtils.coordConvert( + coordinate: BMFCoordinate( + double.tryParse(address.longitude), + double.tryParse(address.latitude), + ), + fromType: BMF_COORD_TYPE.COMMON, + toType: BMF_COORD_TYPE.BD09LL); + BMFCoordinate coordinate1 = await BMFCalculateUtils.coordConvert( + coordinate: BMFCoordinate( + double.tryParse(address1.longitude), + double.tryParse(address1.latitude), + ), + fromType: BMF_COORD_TYPE.COMMON, + toType: BMF_COORD_TYPE.BD09LL); - double mi = await BMFCalculateUtils.getLocationDistance( - bmfCoordinate, coordinate); - double mi1 = await BMFCalculateUtils.getLocationDistance( - bmfCoordinate, coordinate1); - if (mi1 < mi) { - address = address1; - } + double mi = await BMFCalculateUtils.getLocationDistance( + bmfCoordinate, coordinate); + double mi1 = await BMFCalculateUtils.getLocationDistance( + bmfCoordinate, coordinate1); + if (mi1 < mi) { + address = address1; } - await queryOrderInfo( - address.id, - selectedBtn, - null, - 0, - productId ?? null, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - payChannel, - tableId); } + await queryOrderInfo( + address.id, + selectedBtn, + null, + 0, + productId ?? null, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + payChannel, + tableId); + } } ///选择收货地址 @@ -484,7 +498,9 @@ class _Settlement extends State { placeOrderFirst.orderTypeId = 0; placeOrderFirst.parentCode = parentCode; // 火锅加菜 placeOrderFirst.parentId = parentId; // 火锅加菜 - placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") ? payChannel = 0 : (settleOrderInfo.isRaise ? 7:payChannel)); + placeOrderFirst.payChannel = ((placeOrderFirst.cartSum == "0.00") + ? payChannel = 0 + : (settleOrderInfo.isRaise ? 7 : payChannel)); placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean(); placeOrderFirst.promotionInfoDTO.promotionId = (promotion != null && tableId <= 0) ? promotion.id : ""; @@ -737,8 +753,8 @@ class _Settlement extends State { child: Container( child: Column( children: [ - DistributionMode((addressId, isTake, memberCouponId, - orderId, promotionId) { + DistributionMode((addressId, isTake, + memberCouponId, orderId, promotionId) { setState(() { this.selectedBtn = 0; }); @@ -769,50 +785,58 @@ class _Settlement extends State { // ), ///订单商品 - if(settleOrderInfo != null || minOrderInfo != null) - SettlementOrderCommodity( - selectedBtn, - settleOrderInfo, - minOrderInfo, - tableId, - pageType, - (coupons != "" || promotions!="") ? false :useVipPriceSelect, - this.showVipTips - ), + if (settleOrderInfo != null || + minOrderInfo != null) + SettlementOrderCommodity( + selectedBtn, + settleOrderInfo, + minOrderInfo, + tableId, + pageType, + (coupons != "" || promotions != "") + ? false + : useVipPriceSelect, + this.showVipTips), ///优惠券/备注/会员优惠金额 - if(settleOrderInfo != null || minOrderInfo != null) - ActivityCouponRemarks( - couponCart, - activityCart, - settleOrderInfo, - minOrderInfo, - coupons, - promotions, - couponCount(), - placeOrder, - remakers, + if (settleOrderInfo != null || + minOrderInfo != null) + ActivityCouponRemarks( + couponCart, + activityCart, + settleOrderInfo, + minOrderInfo, + coupons, + promotions, + couponCount(), + placeOrder, + remakers, () { - Navigator.of(context).pushNamed( - '/router/edit_remarks_page', - arguments: {}, - ).then((value) => { - setState(() { - if (value != null) remakers = value; - }) - });}, - tableId, - vipPriceSelect, - (){ - setState(() { - this.showVipTips = true; - }); - } - ), + Navigator.of(context).pushNamed( + '/router/edit_remarks_page', + arguments: {}, + ).then((value) => { + setState(() { + if (value != null) + remakers = value; + }) + }); + }, + tableId, + vipPriceSelect, + () { + setState(() { + this.showVipTips = true; + }); + }), - if (settleOrderInfo != null && placeOrder && joinA != JoinActivity.BargainBug) - ///支付方式 - PayMethod(payChannelCheck,coupons,promotions,useVipPriceSelect,settleOrderInfo), + if (settleOrderInfo != null && + placeOrder && + joinA != JoinActivity.BargainBug) + + ///支付方式 + PayMethod(payChannelCheck, coupons, promotions, + useVipPriceSelect, settleOrderInfo), ], ), ), @@ -882,10 +906,10 @@ class _Settlement extends State { orderButton = true; pageType != null ? bargainOrderId != null - ? activityPay() - : joinA == JoinActivity.GoJoin - ? queryJoinAct() - : queryLaunchAct() + ? activityPay() + : joinA == JoinActivity.GoJoin + ? queryJoinAct() + : queryLaunchAct() : queryPlaceOrderFirst(); }, ), @@ -906,23 +930,23 @@ class _Settlement extends State { payChannelCheck(int payChannel) { this.payChannel = payChannel; - if (tableId > 0) { - queryOrderDetails(parentId); - } else { - queryOrderInfo( - address?.id, - selectedBtn, - couponListBean?.id, - 0, - promotion?.id ?? productId, - productSkuId ?? "", - actProductId ?? "", - actProductSkuId ?? "", - useVipPriceSelect, - count1, - payChannel, - tableId);} - + if (tableId > 0) { + queryOrderDetails(parentId); + } else { + queryOrderInfo( + address?.id, + selectedBtn, + couponListBean?.id, + 0, + promotion?.id ?? productId, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + useVipPriceSelect, + count1, + payChannel, + tableId); + } } vipPriceSelect(bool useVipPriceSelect) { @@ -942,7 +966,8 @@ class _Settlement extends State { useVipPriceSelect, count1, payChannel, - tableId);} + tableId); + } } mobileChange(String mobile) { @@ -982,10 +1007,8 @@ class _Settlement extends State { // promotions = ""; // this.promotion = null; if (tableId > 0) { - if(couponBean == null) - queryCancelMemberCoupon(parentId); - if (couponBean.id != null) - queryUseMemberCoupon(couponBean.id); + if (couponBean == null) queryCancelMemberCoupon(parentId); + if (couponBean.id != null) queryUseMemberCoupon(couponBean.id); } else { queryOrderInfo( address?.id, @@ -1025,7 +1048,7 @@ class _Settlement extends State { selectedBtn, null, 0, - (pro.id??"")??productId, + (pro.id ?? "") ?? productId, productSkuId ?? "", actProductId ?? "", actProductSkuId ?? "", diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 37696e6e..67519db7 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -257,6 +257,8 @@ class UnionPageState extends State ? "DRINKSTORE" : "HAPPYSTORE")), }).catchError((error) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), + alignment: Alignment.center); if (index == -1) tabRefresh().refreshFailed(); }); if (baseData != null && baseData.isSuccess) { diff --git a/lib/view_widget/activity_coupons.dart b/lib/view_widget/activity_coupons.dart index a5be7841..c6e5c87f 100644 --- a/lib/view_widget/activity_coupons.dart +++ b/lib/view_widget/activity_coupons.dart @@ -11,6 +11,8 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../generated/l10n.dart'; + class ActivityCoupons extends StatefulWidget { final String result; @@ -196,7 +198,7 @@ class _ActivityCoupons extends State { ), if (listData["type"] == 3) Text( - "兑换券", + S.of(context).duihuanquan, overflow: TextOverflow.ellipsis, maxLines: 2, style: TextStyle( diff --git a/lib/view_widget/coupon_details_dialog.dart b/lib/view_widget/coupon_details_dialog.dart index 2ef4c28e..663ec786 100644 --- a/lib/view_widget/coupon_details_dialog.dart +++ b/lib/view_widget/coupon_details_dialog.dart @@ -49,7 +49,7 @@ class _CouponDetailsWidget extends State { alignment: Alignment.center, margin: EdgeInsets.symmetric(vertical: 12), child: Text( - "使用详情", + S.of(context).shiyongxiangqing, style: TextStyle( fontWeight: MyFontWeight.bold, fontSize: 15.sp, diff --git a/lib/view_widget/cupertino_date_picker.dart b/lib/view_widget/cupertino_date_picker.dart index 1ed41312..104914d3 100644 --- a/lib/view_widget/cupertino_date_picker.dart +++ b/lib/view_widget/cupertino_date_picker.dart @@ -33,7 +33,7 @@ class CupertinoDatePickerWidget extends StatelessWidget { }, child: Container( child: Text( - "取消", + S.of(context).quxiao, style: TextStyle( fontSize: 16, fontWeight: MyFontWeight.semi_bold, diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index e00a17fc..aa1b0b78 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -156,7 +156,7 @@ class NewCouponWidget extends StatelessWidget { child: Row( children: [ Text( - "使用详情", + S.of(context).shiyongxiangqing, style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, @@ -639,7 +639,7 @@ class NewCouponWidget extends StatelessWidget { ), alignment: Alignment.center, child:Text( - "立即使用", + S.of(context).lijishiyong, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( diff --git a/lib/view_widget/pay_selected_dialog.dart b/lib/view_widget/pay_selected_dialog.dart index d64ba68d..56eb810a 100644 --- a/lib/view_widget/pay_selected_dialog.dart +++ b/lib/view_widget/pay_selected_dialog.dart @@ -52,7 +52,7 @@ class _PaySelectedDialog extends State { child: Align( alignment: Alignment.center, child: Text( - "请输入支付密码", + S.of(context).qingshuruzhifumima, style: TextStyle( fontWeight: MyFontWeight.bold, fontSize: 15.sp, @@ -94,7 +94,7 @@ class _PaySelectedDialog extends State { GestureDetector( onTap: (){}, child: Text( - "忘记密码?", + "${S.of(context).wangjimima}?", style: TextStyle( fontWeight: MyFontWeight.medium, fontSize: 12.sp, diff --git a/lib/view_widget/receiving_method_dialog.dart b/lib/view_widget/receiving_method_dialog.dart index 9007d97e..b945ec67 100644 --- a/lib/view_widget/receiving_method_dialog.dart +++ b/lib/view_widget/receiving_method_dialog.dart @@ -52,7 +52,7 @@ class _ReceivingMethodDialog extends State { child: Column( children: [ Text( - "请选择商品的领取方式", + S.of(context).xuanzeshangpinlingqufangshi, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.regular, diff --git a/lib/view_widget/update_dialog.dart b/lib/view_widget/update_dialog.dart index 4fb563a7..8c951cf1 100644 --- a/lib/view_widget/update_dialog.dart +++ b/lib/view_widget/update_dialog.dart @@ -13,10 +13,10 @@ import 'package:url_launcher/url_launcher.dart'; import '../generated/l10n.dart'; class UpdateDialog extends StatefulWidget { - final String version; - final AppUpdate appUpdate; + final String version; + final AppUpdate appUpdate; - UpdateDialog(this.version,this.appUpdate); + UpdateDialog(this.version, this.appUpdate); @override State createState() { @@ -30,8 +30,7 @@ class _UpdateDialog extends State { return Material( type: MaterialType.transparency, child: Center( - child: - Container( + child: Container( width: MediaQuery.of(context).size.width - 80.w, decoration: BoxDecoration( color: Colors.transparent, @@ -50,8 +49,7 @@ class _UpdateDialog extends State { border: Border.all( color: Colors.white, width: 0, - style: BorderStyle.solid - ), + style: BorderStyle.solid), // borderRadius: BorderRadius.only( // topLeft: Radius.circular(8.r), // topRight: Radius.circular(8.r), @@ -61,7 +59,7 @@ class _UpdateDialog extends State { Image.asset( "assets/image/update.webp", width: MediaQuery.of(context).size.width - 80.w, - fit:BoxFit.cover, + fit: BoxFit.cover, ) ], ), @@ -69,10 +67,7 @@ class _UpdateDialog extends State { decoration: BoxDecoration( color: Colors.white, border: Border.all( - color: Colors.white, - width: 0, - style: BorderStyle.solid - ), + color: Colors.white, width: 0, style: BorderStyle.solid), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(8.r), bottomRight: Radius.circular(8.r), @@ -80,63 +75,70 @@ class _UpdateDialog extends State { ), padding: EdgeInsets.symmetric(horizontal: 14.w), child: Column( - children: [ - SizedBox(height:32.h,), - Text( - widget.appUpdate.appLastVersionExplain ?? "", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 17.sp, - height: 1.2, - fontWeight: MyFontWeight.regular, - color: Color(0xFF333333), + children: [ + SizedBox( + height: 32.h, ), - ), - SizedBox(height: 57.h,), - InkWell( - onTap: () { - updateApp(); - }, - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: Color(0xFF32A060), - borderRadius: BorderRadius.circular(27), - ), - margin: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 8.h), - padding: EdgeInsets.symmetric(vertical: 11.h), - alignment: Alignment.center, - child: Text( - S.of(context).lijigengxin, - style: TextStyle( - fontSize: 17.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFFFFFFF), - ), + Text( + widget.appUpdate.appLastVersionExplain ?? "", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 17.sp, + height: 1.2, + fontWeight: MyFontWeight.regular, + color: Color(0xFF333333), ), ), - ), - if(!AppUtils.versionCompare(widget.version,widget.appUpdate.appLastVersionUp)) + SizedBox( + height: 57.h, + ), InkWell( - onTap:() { - doNotUpdate(); + onTap: () { + updateApp(); }, child: Container( width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(27), + ), + margin: EdgeInsets.only( + left: 14.w, right: 14.w, bottom: 8.h), + padding: EdgeInsets.symmetric(vertical: 11.h), alignment: Alignment.center, - padding: EdgeInsets.only(top: 8.h,bottom: 15.h), child: Text( - S.of(context).yihouzaishuo, + S.of(context).lijigengxin, style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF8C8C8C), + fontSize: 17.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFFFFFFF), ), ), ), ), - ], - ),) + if (!AppUtils.versionCompare( + widget.version, widget.appUpdate.appLastVersionUp)) + InkWell( + onTap: () { + doNotUpdate(); + }, + child: Container( + width: double.infinity, + alignment: Alignment.center, + padding: EdgeInsets.only(top: 8.h, bottom: 15.h), + child: Text( + S.of(context).yihouzaishuo, + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF8C8C8C), + ), + ), + ), + ), + ], + ), + ) ], ), ), @@ -151,12 +153,13 @@ class _UpdateDialog extends State { } updateApp() async { - String url = Platform.isIOS ? "itms-apps://itunes.apple.com/app/id1575124838":"http://application.lotus-wallet.com/huixiang?release_id="; + String url = Platform.isIOS + ? "itms-apps://itunes.apple.com/app/id1575124838" + : "http://application.lotus-wallet.com/huixiang?release_id="; if (await canLaunch(url)) { await launch(url); } else { throw 'Could not launch $url'; } } - } diff --git a/lib/view_widget/vip_dialog.dart b/lib/view_widget/vip_dialog.dart index e107b306..61b7193a 100644 --- a/lib/view_widget/vip_dialog.dart +++ b/lib/view_widget/vip_dialog.dart @@ -241,7 +241,7 @@ class _VipDialog extends State { size: 10, ), Text( - "暂未开放", + S.of(context).zanweikaifang, style: TextStyle( color: Color(0xFFFFDCA1), fontWeight: MyFontWeight.regular, @@ -269,7 +269,7 @@ class _VipDialog extends State { size: 10, ), Text( - "暂未解锁", + S.of(context).zanweijiesuo, style: TextStyle( color: Color(0xFFFFDCA1), fontWeight: MyFontWeight.regular, diff --git a/lib/vip/user_vip_service_page.dart b/lib/vip/user_vip_service_page.dart index 416e70de..29a2d908 100644 --- a/lib/vip/user_vip_service_page.dart +++ b/lib/vip/user_vip_service_page.dart @@ -34,7 +34,7 @@ class _UserVipServicePage extends State with WidgetsBindingO Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( - title:"回乡VIP会员卡规则协议", + title:S.of(context).huixiangxieyi, titleColor: Colors.black, background: Color(0xFFFFFFFF), leadingColor: Colors.black, diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index bdd7317e..b7b05e97 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -135,118 +135,124 @@ class _VipTop extends State { (!(widget?.vipCardHome?.member?.isVip ?? false)) ? vipCardList() : Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), - child: Row( - children: [ - Expanded( - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - horizontal: 10.w, vertical: 15.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.w), - color: Color(0xffffffff), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: S.of(context).yixianghuiyuanquanyi, - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), - ), + padding: EdgeInsets.symmetric(horizontal: 16.w), + child: Row( + children: [ + Expanded( + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + horizontal: 10.w, vertical: 15.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.w), + color: Color(0xffffffff), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], ), - TextSpan( - text: widget - ?.vipCardHome?.member?.vipDuration - .toString() ?? - "0", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 18.sp, - color: Color(0xffF96519), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: S + .of(context) + .yixianghuiyuanquanyi, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xff32A060), + ), + ), + TextSpan( + text: widget?.vipCardHome?.member + ?.vipDuration + .toString() ?? + "0", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 18.sp, + color: Color(0xffF96519), + ), + ), + TextSpan( + text: " 天", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 15.sp, + color: Color(0xff32A060), + ), + ), + ], ), - ), - TextSpan( - text: " 天", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 15.sp, - color: Color(0xff32A060), + textDirection: TextDirection.ltr, + ))), + SizedBox( + width: 10.w, + ), + Expanded( + child: GestureDetector( + onTap: () { + setState(() { + vipRenewShowBottomSheet(); + }); + }, + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric( + horizontal: 10.w, vertical: 15.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4.w), + color: Color(0xffffffff), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], ), - ), - ], - ), - textDirection: TextDirection.ltr, - ))), - SizedBox( - width: 10.w, + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Text( + "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", + style: TextStyle( + color: Color((widget + ?.vipCardHome + ?.member + ?.isVipSubscribe ?? + false) + ? 0xff3A3936 + : 0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + width: 6.w, + ), + Image.asset( + "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", + width: 16, + height: 16, + fit: BoxFit.fill, + color: Color(0xff32A060), + ), + ], + ))), + ) + ], + ), ), - Expanded( - child: GestureDetector( - onTap: () { - setState(() { - vipRenewShowBottomSheet(); - }); - }, - child: Container( - alignment: Alignment.center, - padding: EdgeInsets.symmetric( - horizontal: 10.w, vertical: 15.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.w), - color: Color(0xffffffff), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", - style: TextStyle( - color: Color((widget?.vipCardHome - ?.member?.isVipSubscribe ?? - false) - ? 0xff3A3936 - : 0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - SizedBox( - width: 6.w, - ), - Image.asset( - "${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", - width: 16, - height: 16, - fit: BoxFit.fill, - color: Color(0xff32A060), - ), - ], - ))), - ) - ], - ), - ), ], ), ) @@ -258,7 +264,7 @@ class _VipTop extends State { Widget vipCard() { return Container( margin: EdgeInsets.fromLTRB( - 14.w,( MediaQuery.of(context).padding.top + 50.h), 14.w, 8.h), + 14.w, (MediaQuery.of(context).padding.top + 50.h), 14.w, 8.h), width: double.infinity, height: 207.h, decoration: BoxDecoration( @@ -279,11 +285,11 @@ class _VipTop extends State { Image.asset( "assets/image/vip_card.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( - padding: EdgeInsets.only(top: 24.h,right:16.w), + padding: EdgeInsets.only(top: 24.h, right: 16.w), alignment: Alignment.topRight, child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -410,18 +416,21 @@ class _VipTop extends State { TextSpan( text: "¥", style: TextStyle( - fontSize: 20.sp, - color: Color(0xff32A060), - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium,), + fontSize: 20.sp, + color: Color(0xff32A060), + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.medium, + ), ), TextSpan( - text: "${AppUtils.calculateDouble(double.tryParse(cards?.price ?? ""))}", + text: + "${AppUtils.calculateDouble(double.tryParse(cards?.price ?? ""))}", style: TextStyle( - fontSize: 36.sp, - color: Color(0xff32A060), + fontSize: 36.sp, + color: Color(0xff32A060), fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.medium,), + fontWeight: MyFontWeight.medium, + ), ), ]), ), @@ -700,7 +709,8 @@ class _VipTop extends State { Widget buildBottomSheetWidget(BuildContext context, state) { return Container( - padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,bottom:35.h), + padding: + EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w, bottom: 35.h), decoration: new BoxDecoration( color: Colors.white, borderRadius: new BorderRadius.only( @@ -789,6 +799,8 @@ class _VipTop extends State { ), ), ), + if (widget?.vipCardHome?.cards[selectIndex]?.autoSubscribe ?? + false) GestureDetector( onTap: () { state(() { diff --git a/lib/web/web_turntable_activity.dart b/lib/web/web_turntable_activity.dart index 6fe1cf8c..3c4b49db 100644 --- a/lib/web/web_turntable_activity.dart +++ b/lib/web/web_turntable_activity.dart @@ -1,10 +1,8 @@ import 'dart:io'; import 'dart:ui'; -import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:webview_flutter/webview_flutter.dart'; diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart index 96e6d003..d89346f4 100644 --- a/lib/web/web_view/input_comment.dart +++ b/lib/web/web_view/input_comment.dart @@ -73,6 +73,14 @@ class _InputComment extends State { margin: EdgeInsets.symmetric(horizontal: 4.w), alignment: Alignment.topLeft, child: TextField( + textInputAction:TextInputAction.send, + onEditingComplete: () { + var commentText = widget.commentTextController.text; + if (commentText.trim() == "") { + return; + } + widget.queryMemberComment(commentText); + }, maxLines: 8, minLines: 1, focusNode: widget.commentFocus, diff --git a/pubspec.yaml b/pubspec.yaml index 386d551b..0afefa75 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.1.8+36 +version: 3.1.9+39 environment: sdk: ">=2.7.0 <3.0.0" From db9c79b8b6fbfa70a20b2fe97411ad4eb4f6723f Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Tue, 10 Jan 2023 15:47:02 +0800 Subject: [PATCH 05/12] =?UTF-8?q?1.=E6=89=AB=E7=A0=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AEhttp=E6=88=96=E8=80=85https=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=BD=91=E9=A1=B5=EF=BC=9B=202.=E5=9B=9E?= =?UTF-8?q?=E4=B9=A1=E9=92=B1=E5=8C=85-=E6=B6=88=E8=B4=B9=E5=88=97?= =?UTF-8?q?=E8=A1=A8-=E6=B6=88=E8=B4=B9=E5=90=8D=E5=AD=97=E6=94=B9?= =?UTF-8?q?=E4=B8=BAtype=EF=BC=88=E6=9C=80=E8=AF=A6=E7=BB=86=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=AD=97=E6=AE=B5=EF=BC=89=203.=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=90=8D=E5=AD=97=E4=BF=AE=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=204.=E9=83=A8=E5=88=86=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_details.dart | 186 +++++++++--------- lib/community/community_list.dart | 175 ++++++++-------- .../community_view/community_dynamic.dart | 83 ++++---- lib/generated/intl/messages_en.dart | 2 + lib/generated/intl/messages_en_US.dart | 2 + lib/generated/intl/messages_zh_CN.dart | 2 + lib/generated/intl/messages_zh_Hans_CN.dart | 2 + lib/generated/intl/messages_zh_Hant_CN.dart | 2 + lib/generated/intl/messages_zh_TW.dart | 2 + lib/generated/l10n.dart | 20 ++ lib/l10n/intl_en.arb | 2 + lib/l10n/intl_en_US.arb | 2 + lib/l10n/intl_zh_CN.arb | 2 + lib/l10n/intl_zh_Hans_CN.arb | 2 + lib/l10n/intl_zh_Hant_CN.arb | 2 + lib/l10n/intl_zh_TW.arb | 2 + lib/main.dart | 3 + lib/mine/mine_page.dart | 2 +- lib/mine/mine_view/mine_view.dart | 135 +++++++------ lib/mine/mine_wallet_page.dart | 2 +- lib/mine/personal_page.dart | 2 +- lib/mine/scan_web.dart | 49 +++++ lib/order/order_history_page.dart | 94 +++++---- lib/order/order_view/order_pay_selected.dart | 8 +- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/retrofit/retrofit_api.g.dart | 2 +- .../activity_coupon_remarks.dart | 2 +- .../settlement_view/pay_method.dart | 6 +- 29 files changed, 444 insertions(+), 353 deletions(-) create mode 100644 lib/mine/scan_web.dart diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 89bf4e40..d68c1d52 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -26,9 +26,11 @@ class CommunityDetails extends StatefulWidget { } } -class _CommunityDetails extends State with WidgetsBindingObserver { +class _CommunityDetails extends State + with WidgetsBindingObserver { double height = 0; double commentHeight = 60.h; + // ComunityComment comunity; String parenId = "0"; final GlobalKey commentKey = GlobalKey(); @@ -44,15 +46,11 @@ class _CommunityDetails extends State with WidgetsBindingObser Article article; String businessId; - @override void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { if (!mounted) return; - if (MediaQuery - .of(context) - .viewInsets - .bottom == 0) { + if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); if (mounted) @@ -90,8 +88,8 @@ class _CommunityDetails extends State with WidgetsBindingObser context: context, token: value.getString("token"), ); - BaseData
baseData = await apiService.informationInfo(id) - .catchError((onError) { + BaseData
baseData = + await apiService.informationInfo(id).catchError((onError) { debugPrint(onError.toString()); }); if (baseData != null && baseData.isSuccess) { @@ -117,91 +115,92 @@ class _CommunityDetails extends State with WidgetsBindingObser onTap: () { FocusScope.of(context).requestFocus(FocusNode()); }, - child:Container( - child: Column( - children: [ - Expanded( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - if(article != null) - CommunityDynamic( - article, - 0, - exitFull: () { - setState(() {}); - }, - userId:widget.arguments !=null ? widget.arguments["userId"] :widget.arguments["mid"], - itemCount: 3, - isDetails: true, - heightFun: (height) { - this.height = height + - MediaQuery - .of(context) - .padding - .top + - kToolbarHeight + - 24; - if (mounted) setState(() {}); - }, - ), - CommentList( - commentKey, - article?.likes ?? 0, - businessId, - 4, - isKeyBoardShow, - _reply, - _delCommentTips, - 12.sp, - requestApiFinish: (total){setState(() { - commentTotal = total; - });}, - ), - if (memberList == null || memberList.length == 0) - Container( - width: double.infinity, - alignment: Alignment.topCenter, - margin: EdgeInsets.only(top: 40), - padding: EdgeInsets.all(22.h), - child: Text( - S.of(context) - .zanwupinglun, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.bold, - color: Color(0xFFA0A0A0), + child: Container( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + if (article != null) + CommunityDynamic( + article, + 0, + exitFull: () { + setState(() {}); + }, + userId: widget.arguments != null + ? widget.arguments["userId"] + : widget.arguments["mid"], + itemCount: 3, + isDetails: true, + heightFun: (height) { + this.height = height + + MediaQuery.of(context).padding.top + + kToolbarHeight + + 24; + if (mounted) setState(() {}); + }, ), + CommentList( + commentKey, + article?.likes ?? 0, + businessId, + 4, + isKeyBoardShow, + _reply, + _delCommentTips, + 12.sp, + requestApiFinish: (total) { + setState(() { + commentTotal = total; + }); + }, ), - ), - ], + if (memberList == null || memberList.length == 0) + Container( + width: double.infinity, + alignment: Alignment.topCenter, + margin: EdgeInsets.only(top: 40), + padding: EdgeInsets.all(22.h), + child: Text( + S.of(context).zanwupinglun, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Color(0xFFA0A0A0), + ), + ), + ), + ], + ), + ), + flex: 1, ), - ), - flex: 1, - ), - /// 富文本评论的输入框 - InputComment( - inputKey, - hintText, - isKeyBoardShow, - commentFocus, - commentTextController, - _toComment, - _queryMemberComment, - _queryInformationLikes, - isLike: article?.liked ?? false, + /// 富文本评论的输入框 + InputComment( + inputKey, + hintText, + isKeyBoardShow, + commentFocus, + commentTextController, + _toComment, + _queryMemberComment, + _queryInformationLikes, + isLike: article?.liked ?? false, + ), + ], ), - ], - ), - )), + )), ); } ///给文章/活动点赞 _queryInformationLikes() async { - BaseData baseData = await apiService.informationLikes(businessId).catchError((onError) {}); + BaseData baseData = + await apiService.informationLikes(businessId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { commentKey.currentState.setState(() {}); setState(() { @@ -222,7 +221,7 @@ class _CommunityDetails extends State with WidgetsBindingObser "content": content, "parentId": parenId, "relationalId": businessId, - "relationalType":4 + "relationalType": 4 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { CommentListState state = commentKey.currentState; @@ -241,10 +240,7 @@ class _CommunityDetails extends State with WidgetsBindingObser scrollController.animateTo( first.dy + scrollController.offset - - (kToolbarHeight + MediaQuery - .of(context) - .padding - .top), + (kToolbarHeight + MediaQuery.of(context).padding.top), duration: Duration(milliseconds: 300), curve: Curves.easeIn, ); @@ -254,15 +250,9 @@ class _CommunityDetails extends State with WidgetsBindingObser final TextEditingController commentTextController = TextEditingController(); contentHeight() { - double contentHeight = MediaQuery - .of(context) - .size - .height - + double contentHeight = MediaQuery.of(context).size.height - kToolbarHeight - - MediaQuery - .of(context) - .padding - .top - + MediaQuery.of(context).padding.top - 160.h; if ((contentHeight - 60.h) > (128.h * memberList.length)) { commentHeight = contentHeight - (128.h * memberList.length); @@ -303,11 +293,11 @@ class _CommunityDetails extends State with WidgetsBindingObser showLoading: false, ); BaseData> baseData = - await apiService.memberCommentList({ + await apiService.memberCommentList({ "pageNum": 1, "pageSize": 100, "relationalId": businessId, - "relationalType":4, + "relationalType": 4, }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { commentTotal = baseData.data.size; diff --git a/lib/community/community_list.dart b/lib/community/community_list.dart index 7c532043..358af6f8 100644 --- a/lib/community/community_list.dart +++ b/lib/community/community_list.dart @@ -24,16 +24,8 @@ class CommunityList extends StatefulWidget { final Function exitFull; final Function removalDynamic; - CommunityList( - this.comments, - this.userId, - this.commentType,{ - this.isList = false, - this.exitFull, - this.removalDynamic - } - - ); + CommunityList(this.comments, this.userId, this.commentType, + {this.isList = false, this.exitFull, this.removalDynamic}); @override State createState() { @@ -88,39 +80,43 @@ class _CommunityList extends State { children: [ (widget.comments == null || widget.comments.length == 0) ? NoDataView( - src: widget.commentType == 1 ? "assets/image/dong_tai.webp" :"assets/image/guan_zhu.webp", - isShowBtn: false, - text:widget.commentType == 1 ? "目前暂无发布动态,要把开心的事讲出来哦~" :"目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), - ): - ListView.builder( - padding: EdgeInsets.zero, - itemCount: widget.comments.length, - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - Navigator.of(context) - .pushNamed('/router/new_community_details', arguments: { - "commentsId": widget.comments[position].id, - "userId":widget.userId, - // exitFull: () { - // setState(() {}); - // }, - }).then((value) { - widget.exitFull(); - setState(() { - }); - }); - setState(() {}); - }, - child: communityItem(widget.comments[position], position), - ); - }, - ), + src: widget.commentType == 1 + ? "assets/image/dong_tai.webp" + : "assets/image/guan_zhu.webp", + isShowBtn: false, + text: widget.commentType == 1 + ? "目前暂无发布动态,要把开心的事讲出来哦~" + : "目前暂无添加关注,可在推荐中关注自己喜欢的人哦~", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w), + ) + : ListView.builder( + padding: EdgeInsets.zero, + itemCount: widget.comments.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/new_community_details', + arguments: { + "commentsId": widget.comments[position].id, + "userId": widget.userId, + // exitFull: () { + // setState(() {}); + // }, + }).then((value) { + widget.exitFull(); + setState(() {}); + }); + setState(() {}); + }, + child: communityItem(widget.comments[position], position), + ); + }, + ), ], )); } @@ -149,7 +145,7 @@ class _CommunityList extends State { fit: BoxFit.contain, radius: BorderRadius.circular(2), width: MediaQuery.of(context).size.width / 1.5, - height: MediaQuery.of(context).size.width/1.5, + height: MediaQuery.of(context).size.width / 1.5, errorSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp", )), @@ -315,54 +311,55 @@ class _CommunityList extends State { ), ), if ((comments?.memberInfo?.mid ?? "") != (widget.userId)) - GestureDetector( - onTap: () { - setState(() { - if (widget.commentType == 0) { - comments.selfFollow = !(comments.selfFollow ?? false); - _vipFollow(comments?.memberInfo?.mid,comments?.selfFollow ?? false); - } else { - showDeleteDialog(position); - } - }); - }, - child: - (widget.commentType == 0) ? - Container( - width: 56.w, - height: 25.h, - alignment: Alignment.center, - child: RoundButton( + GestureDetector( + onTap: () { + setState(() { + if (widget.commentType == 0) { + comments.selfFollow = + !(comments.selfFollow ?? false); + _vipFollow(comments?.memberInfo?.mid, + comments?.selfFollow ?? false); + } else { + showDeleteDialog(position); + } + }); + }, + child: (widget.commentType == 0) + ? Container( + width: 56.w, height: 25.h, - backgroup: (comments?.selfFollow ?? false) - ? Color(0xFFE6E6E6) - : Color(0xFF32A060), - textColor: (comments?.selfFollow ?? false) - ? Color(0xFF808080) - : Colors.white, - text: (comments?.selfFollow ?? false) - ? S.of(context).yiguanzhu - : S.of(context).guanzhu, - radius: 20, - icons: Icon( - (comments?.selfFollow ?? false) - ? Icons.check - : Icons.add, - color: (comments?.selfFollow ?? false) + alignment: Alignment.center, + child: RoundButton( + height: 25.h, + backgroup: (comments?.selfFollow ?? false) + ? Color(0xFFE6E6E6) + : Color(0xFF32A060), + textColor: (comments?.selfFollow ?? false) ? Color(0xFF808080) : Colors.white, - size: 15, + text: (comments?.selfFollow ?? false) + ? S.of(context).yiguanzhu + : S.of(context).guanzhu, + radius: 20, + icons: Icon( + (comments?.selfFollow ?? false) + ? Icons.check + : Icons.add, + color: (comments?.selfFollow ?? false) + ? Color(0xFF808080) + : Colors.white, + size: 15, + ), + )) + : Padding( + padding: EdgeInsets.all(20), + child: Icon( + Icons.close, + color: Colors.black, + size: 16, ), - )) - : Padding( - padding: EdgeInsets.all(20), - child: Icon( - Icons.close, - color: Colors.black, - size: 16, ), - ), - ), + ), ], ), SizedBox( @@ -457,7 +454,7 @@ class _CommunityList extends State { Expanded( child: InkWell( child: BorderText( - text:S.of(context).quxiao, + text: S.of(context).quxiao, textColor: Color(0xFF32A060), fontSize: 16.sp, fontWeight: FontWeight.bold, @@ -478,7 +475,7 @@ class _CommunityList extends State { Expanded( child: InkWell( child: RoundButton( - text:S.of(context).queding, + text: S.of(context).queding, textColor: Colors.white, radius: 4, padding: EdgeInsets.all(12), diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 2e31ffc9..4b7c66a2 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -37,7 +37,7 @@ class CommunityDynamic extends StatefulWidget { CommunityDynamic( this.article, - this.commentType,{ + this.commentType, { Key key, this.itemCount = 9, this.heightFun, @@ -437,47 +437,46 @@ class _CommunityDynamic extends State { ], ))), Expanded( - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () { - setState(() { - widget.article.liked = - !(widget.article.liked ?? false); - _queryInformationLikes( - widget.article.liked ?? false); - }); - }, - child: Container( - padding: EdgeInsets.only(bottom: 16.h), - child: Row( - children: [ - (widget.article.liked ?? false) - ? Image.asset( - "assets/image/icon_like.webp", - width: 16, - height: 16, - ) - : Image.asset( - "assets/image/icon_like_h.webp", - width: 16, - height: 16, - ), - SizedBox( - width: 5.w, - ), - Text( - "${widget.article.likes ?? 0}", - style: TextStyle( - fontSize: 14.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFF1A1A1A), - ), - ), - ], - )), - ) - ), + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + widget.article.liked = + !(widget.article.liked ?? false); + _queryInformationLikes( + widget.article.liked ?? false); + }); + }, + child: Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + (widget.article.liked ?? false) + ? Image.asset( + "assets/image/icon_like.webp", + width: 16, + height: 16, + ) + : Image.asset( + "assets/image/icon_like_h.webp", + width: 16, + height: 16, + ), + SizedBox( + width: 5.w, + ), + Text( + "${widget.article.likes ?? 0}", + style: TextStyle( + fontSize: 14.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFF1A1A1A), + ), + ), + ], + )), + )), if ((widget?.article?.author != widget.userId ?? "") && widget.commentType == 0) Expanded( diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 9a698a61..47f6d6d2 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -409,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"), "lvbiyue_" : m18, + "lvbizhifu" : MessageLookupByLibrary.simpleMessage("绿币支付"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"), @@ -423,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary { "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), + "mendianyue" : MessageLookupByLibrary.simpleMessage("门店余额"), "menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"), "mi" : m21, "mingxi" : MessageLookupByLibrary.simpleMessage("明细"), diff --git a/lib/generated/intl/messages_en_US.dart b/lib/generated/intl/messages_en_US.dart index fd59232d..5f7fea35 100644 --- a/lib/generated/intl/messages_en_US.dart +++ b/lib/generated/intl/messages_en_US.dart @@ -409,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("Welcome Back Home"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("balance of green currency"), "lvbiyue_" : m18, + "lvbizhifu" : MessageLookupByLibrary.simpleMessage("green payment"), "main_menu1" : MessageLookupByLibrary.simpleMessage("Jing Bi"), "main_menu2" : MessageLookupByLibrary.simpleMessage("Union"), "main_menu3" : MessageLookupByLibrary.simpleMessage("Organic Life"), @@ -423,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary { "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("updated every Wednesday"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("Wednesday renewal coupon"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("Store Selection"), + "mendianyue" : MessageLookupByLibrary.simpleMessage("store balance"), "menpaihao" : MessageLookupByLibrary.simpleMessage("Please enter the house number"), "mi" : m21, "mingxi" : MessageLookupByLibrary.simpleMessage("Details"), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index bf6757c5..c6ed4607 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -409,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"), "lvbiyue_" : m18, + "lvbizhifu" : MessageLookupByLibrary.simpleMessage("绿币支付"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"), @@ -423,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary { "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), + "mendianyue" : MessageLookupByLibrary.simpleMessage("门店余额"), "menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"), "mi" : m21, "mingxi" : MessageLookupByLibrary.simpleMessage("明细"), diff --git a/lib/generated/intl/messages_zh_Hans_CN.dart b/lib/generated/intl/messages_zh_Hans_CN.dart index b5bd83c7..39e563c8 100644 --- a/lib/generated/intl/messages_zh_Hans_CN.dart +++ b/lib/generated/intl/messages_zh_Hans_CN.dart @@ -409,6 +409,7 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("欢迎来到一心回乡"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("绿币余额"), "lvbiyue_" : m18, + "lvbizhifu" : MessageLookupByLibrary.simpleMessage("绿币支付"), "main_menu1" : MessageLookupByLibrary.simpleMessage("净弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("联盟"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有机生活"), @@ -423,6 +424,7 @@ class MessageLookup extends MessageLookupByLibrary { "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每周三更新"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每周三更新劵包"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), + "mendianyue" : MessageLookupByLibrary.simpleMessage("门店余额"), "menpaihao" : MessageLookupByLibrary.simpleMessage("请输入门牌号"), "mi" : m21, "mingxi" : MessageLookupByLibrary.simpleMessage("明细"), diff --git a/lib/generated/intl/messages_zh_Hant_CN.dart b/lib/generated/intl/messages_zh_Hant_CN.dart index ec37d6fd..974a5f96 100644 --- a/lib/generated/intl/messages_zh_Hant_CN.dart +++ b/lib/generated/intl/messages_zh_Hant_CN.dart @@ -405,6 +405,7 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("綠幣餘額"), "lvbiyue_" : m18, + "lvbizhifu" : MessageLookupByLibrary.simpleMessage("綠幣支付"), "main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有機生活"), @@ -419,6 +420,7 @@ class MessageLookup extends MessageLookupByLibrary { "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每週三更新"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每週三更新劵包"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), + "mendianyue" : MessageLookupByLibrary.simpleMessage("門店餘額"), "menpaihao" : MessageLookupByLibrary.simpleMessage("請輸入門牌號"), "mi" : m21, "mingxi" : MessageLookupByLibrary.simpleMessage("明細"), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 0abb2099..dc3695e1 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -407,6 +407,7 @@ class MessageLookup extends MessageLookupByLibrary { "login_splash" : MessageLookupByLibrary.simpleMessage("歡迎來到一心回鄉"), "lvbiyue" : MessageLookupByLibrary.simpleMessage("綠幣餘額"), "lvbiyue_" : m18, + "lvbizhifu" : MessageLookupByLibrary.simpleMessage("綠幣支付"), "main_menu1" : MessageLookupByLibrary.simpleMessage("淨弼"), "main_menu2" : MessageLookupByLibrary.simpleMessage("聯盟"), "main_menu3" : MessageLookupByLibrary.simpleMessage("有機生活"), @@ -421,6 +422,7 @@ class MessageLookup extends MessageLookupByLibrary { "meizhousangengxin" : MessageLookupByLibrary.simpleMessage("每週三更新"), "meizhousanquanbao" : MessageLookupByLibrary.simpleMessage("每週三更新劵包"), "mendianxuanzhe" : MessageLookupByLibrary.simpleMessage("门店选择"), + "mendianyue" : MessageLookupByLibrary.simpleMessage("門店餘額"), "menpaihao" : MessageLookupByLibrary.simpleMessage("請輸入門牌號"), "mi" : m21, "mingxi" : MessageLookupByLibrary.simpleMessage("明細"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index ff27cb82..de8a06e8 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -6935,6 +6935,26 @@ class S { ); } + /// `门店余额` + String get mendianyue { + return Intl.message( + '门店余额', + name: 'mendianyue', + desc: '', + args: [], + ); + } + + /// `绿币支付` + String get lvbizhifu { + return Intl.message( + '绿币支付', + name: 'lvbizhifu', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 8ee66699..5a7dc9a8 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -721,6 +721,8 @@ "lijishiyong":"立即使用", "wangjimima":"忘记密码", "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", + "mendianyue":"门店余额", + "lvbizhifu":"绿币支付", diff --git a/lib/l10n/intl_en_US.arb b/lib/l10n/intl_en_US.arb index 076d6fbb..b7d1860b 100644 --- a/lib/l10n/intl_en_US.arb +++ b/lib/l10n/intl_en_US.arb @@ -722,6 +722,8 @@ "lijishiyong":"Use Now", "wangjimima":"Forgot password", "xuanzeshangpinlingqufangshi":"Please select the picking method of goods", + "mendianyue":"store balance", + "lvbizhifu":"green payment", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 4a53c7b4..5f95dbc4 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -722,6 +722,8 @@ "lijishiyong":"立即使用", "wangjimima":"忘记密码", "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", + "mendianyue":"门店余额", + "lvbizhifu":"绿币支付", diff --git a/lib/l10n/intl_zh_Hans_CN.arb b/lib/l10n/intl_zh_Hans_CN.arb index 6c615ef0..7b4fe637 100644 --- a/lib/l10n/intl_zh_Hans_CN.arb +++ b/lib/l10n/intl_zh_Hans_CN.arb @@ -722,6 +722,8 @@ "lijishiyong":"立即使用", "wangjimima":"忘记密码", "xuanzeshangpinlingqufangshi":"请选择商品的领取方式", + "mendianyue":"门店余额", + "lvbizhifu":"绿币支付", diff --git a/lib/l10n/intl_zh_Hant_CN.arb b/lib/l10n/intl_zh_Hant_CN.arb index be665571..ae04fcf5 100644 --- a/lib/l10n/intl_zh_Hant_CN.arb +++ b/lib/l10n/intl_zh_Hant_CN.arb @@ -713,6 +713,8 @@ "lijishiyong":"立即使用", "wangjimima":"忘記密碼", "xuanzeshangpinlingqufangshi":"請選擇商品的領取方式", + "mendianyue":"門店餘額", + "lvbizhifu":"綠幣支付", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index 1e4c6b0f..641c5f9a 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -715,6 +715,8 @@ "lijishiyong":"立即使用", "wangjimima":"忘記密碼", "xuanzeshangpinlingqufangshi":"請選擇商品的領取方式", + "mendianyue":"門店餘額", + "lvbizhifu":"綠幣支付", diff --git a/lib/main.dart b/lib/main.dart index 41c34173..7d937077 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -110,6 +110,7 @@ import 'mine/mine_vip/binding_assistant_card.dart'; 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 'mine/scan_web.dart'; import 'order/bargain_group_order.dart'; import 'mine/personal_page.dart'; import 'order/exchange_write_off_page.dart'; @@ -417,4 +418,6 @@ Map routers = { UserVipServicePage(), '/router/help_farmers_page': (context, {arguments}) => HelpFarmersPage(), + '/router/scan_web': (context, {arguments}) => + ScanWeb(arguments:arguments), }; diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index e5577168..1eb9a3dc 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -259,7 +259,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { // ///关注度/粉丝/发布 // attention(), - // + // /// 钱包或领券中心 // WalletCoupon(), ], diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 8780951d..81f6fb5b 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -21,6 +21,7 @@ import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:webview_flutter/webview_flutter.dart'; // import 'package:qrscan/qrscan.dart' as scanner; class MineView extends StatefulWidget { @@ -29,9 +30,10 @@ class MineView extends StatefulWidget { final GestureTapCallback toIntegralPage; final Function messageZero; final int totalMsg; - final SocialInfo infoNumber; + final SocialInfo infoNumber; - MineView(this.userInfo, this.toUserInfo, this.toIntegralPage,this.messageZero,this.totalMsg,this.infoNumber); + MineView(this.userInfo, this.toUserInfo, this.toIntegralPage, + this.messageZero, this.totalMsg, this.infoNumber); @override State createState() { @@ -60,8 +62,6 @@ class _MineView extends State { } } - - @override Widget build(BuildContext context) { return Column( @@ -77,28 +77,30 @@ class _MineView extends State { alignment: Alignment.center, child: GestureDetector( onTap: () { - Navigator.of(context).pushNamed('/router/system_msg_page').then((value) { + Navigator.of(context) + .pushNamed('/router/system_msg_page') + .then((value) { widget.messageZero(); }); }, child: Container( height: 24.h, - alignment:Alignment.center, - child:Stack( + alignment: Alignment.center, + child: Stack( children: [ Image.asset( "assets/image/icon_notices.webp", - width:32, + width: 32, height: 32, color: Colors.white, ), - if(widget.totalMsg != 0) + if (widget.totalMsg != 0) Container( - width:36.w, + width: 36.w, alignment: Alignment.topRight, - child:Container( - width:22.w, - height:14.h, + child: Container( + width: 22.w, + height: 14.h, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), border: Border.all( @@ -106,23 +108,20 @@ class _MineView extends State { color: Colors.white, style: BorderStyle.solid, ), - color:Color(0xFFFF441A), + color: Color(0xFFFF441A), ), - child:RoundButton( - text:widget.totalMsg.toString(), + child: RoundButton( + text: widget.totalMsg.toString(), textColor: Colors.white, fontWeight: MyFontWeight.regular, backgroup: Color(0xFFFF441A), - fontSize:8.sp, + fontSize: 8.sp, radius: 100, - ) - ), + )), ) ], ), - ) - ) - ), + ))), InkWell( onTap: () { toScan(); @@ -131,7 +130,7 @@ class _MineView extends State { padding: EdgeInsets.all(8.h), child: Image.asset( "assets/image/icon_scan_qr_code.webp", - width:32, + width: 32, height: 32, color: Colors.white, ), @@ -184,11 +183,12 @@ class _MineView extends State { } else if (await Permission.camera.isGranted) { // http://pos.app.gznl.top/placeorder/?tableId=1315903669597634560&tenantCode=1166&shopId=1300372027722432512 var result = await Navigator.of(context).pushNamed('/router/qr_scan'); - if(result.toString().contains("type\":\"coupon")){ + if (result.toString().contains("type\":\"coupon")) { ///活动优惠券赠送弹窗 activityShowAlertDialog(result.toString()); return; - }if(result.toString().contains("type\":\"wiped")){ + } + if (result.toString().contains("type\":\"wiped")) { ///核销券 queryWiped(jsonDecode(result.toString())["memberCouponId"]); return; @@ -213,6 +213,17 @@ class _MineView extends State { "tableId": int.tryParse(tableId), }, ); + return; + } + if (result.toString().contains("http:") || + result.toString().contains("https:")) { + ///扫码跳转任意网页 + Navigator.of(context).pushNamed( + '/router/scan_web', + arguments: { + "result": result, + }, + ); } } else { await Permission.camera.request(); @@ -300,7 +311,7 @@ class _MineView extends State { child: Text( widget.userInfo == null ? S.of(context).denglu - : "${widget.userInfo.nickname==""?"回乡":widget.userInfo.nickname}", + : "${widget.userInfo.nickname == "" ? "回乡" : widget.userInfo.nickname}", style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.bold, @@ -308,12 +319,12 @@ class _MineView extends State { ), ), ), - if(widget.userInfo.level != 1) - Image.asset( - "assets/image/icon_user.webp", - width: 18.w, - height: 18.h, - ), + if (widget.userInfo.level != 1) + Image.asset( + "assets/image/icon_user.webp", + width: 18.w, + height: 18.h, + ), ], ), widget.userInfo == null @@ -326,33 +337,33 @@ class _MineView extends State { ), ) : Row( - children: [ - Text( - "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - fontFamily: 'JDZhengHT', - color: Color(0xFFFFFFFF), - ), - ), - Container( - width: 1.w, - height: 12.h, - margin: EdgeInsets.symmetric(horizontal: 3.w), - color: Color(0xFFFFFFFF), - ), - Text( - "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", - style: TextStyle( - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + children: [ + Text( + "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + fontFamily: 'JDZhengHT', + color: Color(0xFFFFFFFF), + ), + ), + Container( + width: 1.w, + height: 12.h, + margin: EdgeInsets.symmetric(horizontal: 3.w), + color: Color(0xFFFFFFFF), + ), + Text( + "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", + style: TextStyle( + fontSize: 12.sp, + fontFamily: 'JDZhengHT', + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ], ), - ), - ], - ), ], ), ), @@ -375,12 +386,12 @@ class _MineView extends State { widget.toIntegralPage(); }, child: Container( - padding: EdgeInsets.only(top: 4.h, bottom: 4.h, right: 16.w,left: 7.w), + padding: EdgeInsets.only( + top: 4.h, bottom: 4.h, right: 16.w, left: 7.w), margin: EdgeInsets.only(right: 14.w), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white - ), + borderRadius: BorderRadius.circular(12), + color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 04b0b817..11b8a568 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -458,7 +458,7 @@ class _MineWalletPage extends State { Expanded( flex: 7, child: Text( - userBill.title, + userBill.type, style: TextStyle( color: Colors.black, fontSize: 12.sp, diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index b2cccb9b..bde4cf32 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -434,7 +434,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { ), Container( color: Color(0xFFFFFFFF), - margin: EdgeInsets.only(bottom:30.h), + margin: EdgeInsets.only(bottom: 30.h), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/mine/scan_web.dart b/lib/mine/scan_web.dart new file mode 100644 index 00000000..c54e6a66 --- /dev/null +++ b/lib/mine/scan_web.dart @@ -0,0 +1,49 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.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'; +import 'package:webview_flutter/webview_flutter.dart'; + +class ScanWeb extends StatefulWidget { + final Map arguments; + + ScanWeb({this.arguments}); + @override + State createState() { + return _ScanWeb(); + } +} + +class _ScanWeb extends State { + var controller = new ScrollController(); + String result; + + @override + void initState() { + super.initState(); + result = widget.arguments["result"]; + EasyLoading.show(status: S.current.zhengzaijiazai); + } + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top:MediaQuery.of(context).padding.top), + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + alignment: Alignment.center, + child: + WebView( + initialUrl:result, + javascriptMode: JavascriptMode.unrestricted, + onPageFinished: (initialUrl){ + EasyLoading.dismiss(); + }, + )); + } +} diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index eb5ddd9e..682f1c57 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -70,42 +70,42 @@ class _OrderHistoryPage extends State bottom: PreferredSize( preferredSize: Size(double.infinity, 38.h), child: Theme( - data: ThemeData( - splashColor: Colors.transparent, // 点击时的水波纹颜色设置为透明 - highlightColor: Colors.transparent, // 点击时的背景高亮颜色设置为透明 - ), - child: TabBar( - controller: tabController, - isScrollable: false, - indicatorWeight: 2.w, - indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Color(0xFF39B54A), - indicatorPadding: EdgeInsets.only(top: 3.h), - unselectedLabelStyle: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.normal, - ), - labelStyle: TextStyle( - color: Colors.black, - fontSize: 16.sp, - fontWeight: FontWeight.bold, - ), - labelColor: Colors.black, - tabs: [ - MyTab( - text: S.of(context).quanbu, - ), - MyTab( - text: S.of(context).daifukuan, - ), - MyTab( - text: S.of(context).weiwancheng, + data: ThemeData( + splashColor: Colors.transparent, // 点击时的水波纹颜色设置为透明 + highlightColor: Colors.transparent, // 点击时的背景高亮颜色设置为透明 ), - MyTab( - text: S.of(context).yiwancheng, - ) - ], - )), + child: TabBar( + controller: tabController, + isScrollable: false, + indicatorWeight: 2.w, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Color(0xFF39B54A), + indicatorPadding: EdgeInsets.only(top: 3.h), + unselectedLabelStyle: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.normal, + ), + labelStyle: TextStyle( + color: Colors.black, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + labelColor: Colors.black, + tabs: [ + MyTab( + text: S.of(context).quanbu, + ), + MyTab( + text: S.of(context).daifukuan, + ), + MyTab( + text: S.of(context).weiwancheng, + ), + MyTab( + text: S.of(context).yiwancheng, + ) + ], + )), ), ), body: TabBarView( @@ -212,6 +212,7 @@ class _OrderHistoryList extends State } setState(() {}); } else { + SmartDialog.showToast(baseData?.msg ?? "",alignment: Alignment.center); refreshController.refreshFailed(); refreshController.loadFailed(); } @@ -230,9 +231,9 @@ class _OrderHistoryList extends State }); } - String orderAllGoods(OrderInfo orderInfo){ + String orderAllGoods(OrderInfo orderInfo) { int count = 0; - if(orderInfo.productList != null){ + if (orderInfo.productList != null) { orderInfo.productList.forEach((element) { count += element.buyNum; }); @@ -314,7 +315,7 @@ class _OrderHistoryList extends State // ), // ), Container( - margin: EdgeInsets.only(left: 5.w, top: 12.h), + margin: EdgeInsets.only(left: 5.w, top: 12.h), ), Expanded( child: Container( @@ -568,16 +569,11 @@ class _OrderHistoryList extends State queryDetails(id) async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); - apiService = ApiService( - Dio(), - context: context, - token: value.getString("token"), - showLoading: true - ); + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), showLoading: true); } - BaseData baseData = await apiService - .orderDetail(id) - .catchError((error) {}); + BaseData baseData = + await apiService.orderDetail(id).catchError((error) {}); if (baseData != null && baseData.isSuccess) { return baseData.data; } @@ -598,7 +594,9 @@ class _OrderHistoryList extends State minService, orderInfo, (BaseData baseData) { - SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); + SmartDialog.showToast( + baseData?.msg == "ok" ? "订单支付成功" : baseData?.msg, + alignment: Alignment.center); Future.delayed(Duration(seconds: 3), () { _onRefresh(); }); diff --git a/lib/order/order_view/order_pay_selected.dart b/lib/order/order_view/order_pay_selected.dart index b265c09d..c3ea3250 100644 --- a/lib/order/order_view/order_pay_selected.dart +++ b/lib/order/order_view/order_pay_selected.dart @@ -70,7 +70,7 @@ class _OrderPaySelected extends State { Expanded(child: Padding( padding: EdgeInsets.only(left: 8.w), child:Text( - "助农积分", + S.of(context).zhunongjifen, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), @@ -101,7 +101,7 @@ class _OrderPaySelected extends State { Expanded(child: Padding( padding: EdgeInsets.only(left: 8.w), child: Text( - S.of(context).pingtaiyue, + S.of(context).huixiangqianbao, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), @@ -132,7 +132,7 @@ class _OrderPaySelected extends State { Expanded(child: Padding( padding: EdgeInsets.only(left: 8.w), child:Text( - S.of(context).dianpuyue, + S.of(context).mendianyue, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), @@ -164,7 +164,7 @@ class _OrderPaySelected extends State { Expanded(child: Padding( padding: EdgeInsets.only(left: 8.w), child:Text( - "绿币余额", + S.of(context).lvbizhifu, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index f7e60731..1308a39d 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 06429ed5..c1b9a541 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 +const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 40d5e1d9..9d5c20d7 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -866,7 +866,7 @@ class _ApiService implements ApiService { data: _data); final value = BaseData>.fromJson( _result.data, - (json) => PageInfo.fromJson( + (json) => ((json??"") == "")?null:PageInfo.fromJson( json, (json) => OrderInfo.fromJson(json), ), diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 282f23ff..ece002da 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -84,7 +84,7 @@ class _ActivityCouponRemarks extends State { Expanded( flex: 1, child: Text( - "VIP价格", + "VIP权益", style: TextStyle( fontWeight: MyFontWeight.regular, fontSize: 14.sp, diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 481e1fb1..65a11ec1 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -118,7 +118,7 @@ class _PayMethod extends State { width: 10, ), Text( - S.of(context).pingtaiyue, + S.of(context).huixiangqianbao, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), @@ -162,7 +162,7 @@ class _PayMethod extends State { width: 10, ), Text( - S.of(context).dianpuyue, + S.of(context).mendianyue, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), @@ -215,7 +215,7 @@ class _PayMethod extends State { width: 10, ), Text( - "绿币余额", + S.of(context).lvbizhifu, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), From 698bb28c8bfc46822f7df3bc9d2bfd63f097eb7e Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 11 Jan 2023 17:52:18 +0800 Subject: [PATCH 06/12] =?UTF-8?q?vip=E8=A7=84=E5=88=99=E5=BC=B9=E7=AA=97?= =?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/vip/vip_view/exclusive_coupon.dart | 306 ++++++++++++----------- lib/vip/vip_view/vip_goods_discount.dart | 131 +++++----- 2 files changed, 223 insertions(+), 214 deletions(-) diff --git a/lib/vip/vip_view/exclusive_coupon.dart b/lib/vip/vip_view/exclusive_coupon.dart index 0b7038c5..a755ffaf 100644 --- a/lib/vip/vip_view/exclusive_coupon.dart +++ b/lib/vip/vip_view/exclusive_coupon.dart @@ -19,7 +19,8 @@ class _ExclusiveCoupon extends State { return Container( margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 40.h), width: double.infinity, - padding: EdgeInsets.only(top: 20.h,left: 20.h,bottom: 10.h,right: 20.w), + padding: + EdgeInsets.only(top: 20.h, left: 20.h, bottom: 10.h, right: 20.w), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.w), color: Colors.white, @@ -38,14 +39,18 @@ class _ExclusiveCoupon extends State { children: [ Row( children: [ - SizedBox(width: 7.w,), + SizedBox( + width: 7.w, + ), Image.asset( "assets/image/vip_title.webp", fit: BoxFit.fill, //填充剩余空间 - height:13.h, + height: 13.h, width: 27.w, ), - SizedBox(width: 4.w,), + SizedBox( + width: 4.w, + ), Text( S.of(context).zhuanxiangyouhuiquan, style: TextStyle( @@ -56,15 +61,16 @@ class _ExclusiveCoupon extends State { ), GestureDetector( behavior: HitTestBehavior.translucent, - onTap: (){ + onTap: () { showAlertDialog(); }, - child:Container( - padding: EdgeInsets.only(left: 8.w,right:30.w,top: 3.h,bottom: 3.h), + child: Container( + padding: EdgeInsets.only( + left: 8.w, right: 30.w, top: 3.h, bottom: 3.h), child: Image.asset( "assets/image/vip_tips.webp", fit: BoxFit.fill, //填充剩余空间 - height:14, + height: 14, width: 14, ), ), @@ -82,7 +88,7 @@ class _ExclusiveCoupon extends State { Image.asset( "assets/image/vip_shop_bj.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( @@ -90,51 +96,55 @@ class _ExclusiveCoupon extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded(child:Padding( - padding:EdgeInsets.only(top:25.h,left: 19.w), + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "海峡姐妹饮品券", - style: TextStyle( - color: Color(0xff32A060), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "海峡姐妹饮品券", + style: TextStyle( + color: Color(0xff32A060), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), ), - ), - SizedBox(height: 5.h,), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "6", - style: TextStyle( - fontWeight: MyFontWeight.extra_bold, - fontSize: 36.sp, - fontFamily: 'JDZhengHT', - color: Color(0xffFF7E12), + SizedBox( + height: 5.h, + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "6", + style: TextStyle( + fontWeight: MyFontWeight.extra_bold, + fontSize: 36.sp, + fontFamily: 'JDZhengHT', + color: Color(0xffFF7E12), + ), ), - ), - TextSpan( - text: " 折", - style: TextStyle( - fontSize: 24.sp, - color: Color(0xffFF7E12), - fontWeight: MyFontWeight.semi_bold, + TextSpan( + text: " 折", + style: TextStyle( + fontSize: 24.sp, + color: Color(0xffFF7E12), + fontWeight: MyFontWeight.semi_bold, + ), ), - ), - ], + ], + ), + textDirection: TextDirection.ltr, ), - textDirection: TextDirection.ltr, - ), - ], - ),)), + ], + ), + )), Image.asset( "assets/image/vip_shop_hx.webp", fit: BoxFit.fill, //填充剩余空间 - height:85, + height: 85, width: 85, ), ], @@ -151,7 +161,7 @@ class _ExclusiveCoupon extends State { Image.asset( "assets/image/vip_shop_bj.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( @@ -159,8 +169,9 @@ class _ExclusiveCoupon extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded(child:Padding( - padding:EdgeInsets.only(top:25.h,left: 19.w), + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -173,7 +184,9 @@ class _ExclusiveCoupon extends State { fontWeight: MyFontWeight.semi_bold, ), ), - SizedBox(height: 5.h,), + SizedBox( + height: 5.h, + ), Text.rich( TextSpan( children: [ @@ -199,11 +212,12 @@ class _ExclusiveCoupon extends State { textDirection: TextDirection.ltr, ), ], - ),)), + ), + )), Image.asset( "assets/image/vip_shop_qj.webp", fit: BoxFit.fill, //填充剩余空间 - height:85, + height: 85, width: 85, ), ], @@ -220,7 +234,7 @@ class _ExclusiveCoupon extends State { Image.asset( "assets/image/vip_shop_bj.webp", fit: BoxFit.fill, //填充剩余空间 - height:double.infinity, + height: double.infinity, width: double.infinity, ), Container( @@ -228,8 +242,9 @@ class _ExclusiveCoupon extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded(child:Padding( - padding:EdgeInsets.only(top:25.h,left: 19.w), + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 25.h, left: 19.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -242,7 +257,9 @@ class _ExclusiveCoupon extends State { fontWeight: MyFontWeight.semi_bold, ), ), - SizedBox(height: 5.h,), + SizedBox( + height: 5.h, + ), Text.rich( TextSpan( children: [ @@ -268,11 +285,12 @@ class _ExclusiveCoupon extends State { textDirection: TextDirection.ltr, ), ], - ),)), + ), + )), Image.asset( "assets/image/vip_shop_hg.webp", fit: BoxFit.fill, //填充剩余空间 - height:85, + height: 85, width: 85, ), ], @@ -288,104 +306,88 @@ class _ExclusiveCoupon extends State { ///会员优惠规则弹窗 showAlertDialog() { - //显示对话框 - showDialog( - context: context, - builder: (BuildContext context) { - return SimpleDialog( - backgroundColor: Colors.transparent, - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - children: [ - Container( - width: double.infinity, - height:470.h, - padding: EdgeInsets.only(left: 14.w,right: 14.w,bottom: 16.h), - decoration: new BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - child: Scaffold( - appBar: MyAppBar( - title:"", - titleColor: Colors.black, - titleSize: 10.sp, - background: Colors.white, - leadingColor: Colors.white, - actions: [ + showModalBottomSheet( + builder: (BuildContext context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return WillPopScope( + ///点击背景不收起弹窗; + // onWillPop: () async => false, + child:Stack( + alignment: Alignment.topRight, + children: [ + Container( + width: double.infinity, + height: 370.h, + padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + padding: EdgeInsets.only(right: 18.w), + child: + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10.h, + ), + Text( + "VIP会员专享优惠券:" + "\n ①海峡姐妹饮品券" + "\n *用户开通回乡VIP卡,可享全单饮品6折优惠。" + "\n *适用饮品:门店现制奶茶类饮品及现制咖啡类饮品。" + "\n *适用门店:海峡姐妹茶汉街店、前进麦味*海峡姐妹茶哈乐城店" + "\n ②前进麦味烘焙券" + "\n *用户开通回乡VIP卡,可享全单面包7折优惠。" + "\n *适用产品:门店现制面包类产品及甜品类产品。" + "\n *适用门店:前进麦味凯德1818店、前进麦味*海峡姐妹茶哈乐城店" + "\n ③回乡农场火锅券" + "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" + "\n *适用产品:门店现制菜品" + "\n *适用门店:回乡农场火锅汉街店" + "\n ④百年川椒火锅券" + "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" + "\n *适用产品:门店现制菜品" + "\n *适用门店:百年川椒重庆老火锅光谷店", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + height: 1.7.h, + color: Colors.black, + ), + ), + ], + ), + ), + ), + ), GestureDetector( onTap: () { Navigator.of(context).pop(); }, - child: Icon( - Icons.clear, - color: Colors.black, - ), - ) - ], - ), - body: Container( - color: Colors.white, - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - child:Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Row( - // children: [ - // Spacer(), - // GestureDetector( - // onTap: () { - // Navigator.of(context).pop(); - // }, - // child: Icon( - // Icons.clear, - // color: Colors.black, - // ), - // ) - // ], - // ), - SizedBox(height: 10.h,), - Text( - "VIP会员专享优惠券:" - "\n ①海峡姐妹饮品券" - "\n *用户开通回乡VIP卡,可享全单饮品6折优惠。" - "\n *适用饮品:门店现制奶茶类饮品及现制咖啡类饮品。" - "\n *适用门店:海峡姐妹茶汉街店、前进麦味*海峡姐妹茶哈乐城店" - "\n ②前进麦味烘焙券" - "\n *用户开通回乡VIP卡,可享全单面包7折优惠。" - "\n *适用产品:门店现制面包类产品及甜品类产品。" - "\n *适用门店:前进麦味凯德1818店、前进麦味*海峡姐妹茶哈乐城店" - "\n ③回乡农场火锅券" - "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" - "\n *适用产品:门店现制菜品" - "\n *适用门店:回乡农场火锅汉街店" - "\n ④百年川椒火锅券" - "\n *用户开通回乡VIP卡,可享全单菜品(小料、酒水、饮品不参与)8折优惠。" - "\n *适用产品:门店现制菜品" - "\n *适用门店:百年川椒重庆老火锅光谷店", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - height: 1.7.h, - color: Colors.black, - ), - ), - SizedBox(height: 15.h,) - ], + child: Container( + margin: EdgeInsets.only(right: 14.w,top: 16.h), + child: Image.asset( + "assets/image/cancel.webp", + width: 24, + height: 24, + ), ), - ), - ), - ), - ), - ), - ], - ); - }, - ); + )], + )); + }); + }, + backgroundColor: Colors.transparent, + context: context); } } diff --git a/lib/vip/vip_view/vip_goods_discount.dart b/lib/vip/vip_view/vip_goods_discount.dart index 9d7cf19e..e945fa9e 100644 --- a/lib/vip/vip_view/vip_goods_discount.dart +++ b/lib/vip/vip_view/vip_goods_discount.dart @@ -8,7 +8,6 @@ import '../../retrofit/data/vip_card_home.dart'; import '../../utils/flutter_utils.dart'; import '../../view_widget/custom_image.dart'; - class VipGoodsDiscount extends StatefulWidget { final VipCardHome vipCardHome; @@ -194,7 +193,7 @@ class _VipGoodsDiscount extends State { Widget vipGoodsRecommendItem(ProductVips productVips) { return Container( width: 116.w, - margin: EdgeInsets.only(right:4.w,left:3.w), + margin: EdgeInsets.only(right: 4.w, left: 3.w), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -215,8 +214,7 @@ class _VipGoodsDiscount extends State { Container( // width:53.w, // alignment: Alignment.center, - padding: - EdgeInsets.symmetric(vertical: 2.h, horizontal:8.w), + padding: EdgeInsets.symmetric(vertical: 2.h, horizontal: 8.w), margin: EdgeInsets.only(left: 5.w), decoration: BoxDecoration( color: Color(0xffF96519), @@ -264,7 +262,9 @@ class _VipGoodsDiscount extends State { fontWeight: MyFontWeight.medium, ), ), - SizedBox(width: 4.w,), + SizedBox( + width: 4.w, + ), Text( "¥${AppUtils.calculateDouble(double.tryParse(productVips.applyPrice ?? "0.00"))}", textAlign: TextAlign.end, @@ -285,69 +285,76 @@ class _VipGoodsDiscount extends State { ///会员专享价格规则弹窗 showAlertDialog() { - //显示对话框 - showDialog( - context: context, - builder: (BuildContext context) { - return SimpleDialog( - backgroundColor: Colors.transparent, - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - children: [ - Container( - width: double.infinity, - height: 470.h, - padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h), - decoration: new BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + showModalBottomSheet( + builder: (BuildContext context) { + return StatefulBuilder(builder: ( + context, + state, + ) { + return WillPopScope( + ///点击背景不收起弹窗; + // onWillPop: () async => false, + child: Stack( + alignment: Alignment.topRight, + children: [ + Container( + width: double.infinity, + height: 370.h, + padding: + EdgeInsets.symmetric(horizontal: 14.w, vertical: 16.h), + decoration: new BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + padding: EdgeInsets.only(right: 18.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Spacer(), - GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Icon( - Icons.clear, + SizedBox( + height: 10.h, + ), + Text( + "VIP会员专享价格" + "\n*用户开通回乡VIP卡,可享以专享优惠价格购买一心回乡APP入驻商户部分门店商品的会员权益。" + "\n*权益适用产品及专享价格,以会员权益页面公示为准。" + "\n为满足不同用户的需求,一心回乡将可能适时调整权益适用产品及专享价格,具体权益内容以会员权益页面公示为准。", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + height: 1.7.h, color: Colors.black, ), - ) + ), ], ), - SizedBox( - height: 10.h, - ), - Text( - "VIP会员专享价格" - "\n*用户开通回乡VIP卡,可享以专享优惠价格购买一心回乡APP入驻商户部分门店商品的会员权益。" - "\n*权益适用产品及专享价格,以会员权益页面公示为准。" - "\n为满足不同用户的需求,一心回乡将可能适时调整权益适用产品及专享价格,具体权益内容以会员权益页面公示为准。", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - height: 1.7.h, - color: Colors.black, - ), - ), - ], + ), ), ), - ), - ), - ], - ); - }, - ); + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + margin: EdgeInsets.only(right: 14.w, top: 16.h), + child: Image.asset( + "assets/image/cancel.webp", + width: 24, + height: 24, + ), + ), + ) + ], + )); + }); + }, + backgroundColor: Colors.transparent, + context: context); } } From 1d3851e80b60bc2a411c278bb89dd2acd35f634c Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 6 Feb 2023 14:10:45 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E7=BB=93=E7=AE=97=E9=A1=B5VIP=E6=9D=83?= =?UTF-8?q?=E7=9B=8A=E6=94=B9=E6=88=90=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD?= =?UTF-8?q?=EF=BC=9B=20=E8=AE=A2=E5=8D=95=E7=BB=93=E7=AE=97=E5=90=8Eloadin?= =?UTF-8?q?g=E6=9B=B4=E6=94=B9=EF=BC=9B=20=E7=A4=BE=E5=8C=BA=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0EmojiPicker=E8=A1=A8=E6=83=85=EF=BC=9B=20=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E8=A7=86=E9=A2=91=E5=9B=BA=E5=AE=9A=E5=AE=BD=E9=AB=98?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E5=85=A8=E5=B1=8F=EF=BC=9B=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BC=9A=E5=91=98=E4=BA=8C=E7=BB=B4=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E6=9D=A1=E5=BD=A2=E7=A0=81=EF=BC=9B=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A1=B5=E9=9D=A2ui=EF=BC=9B=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=89=AB=E7=A0=81=E8=B7=B3=E8=BD=AC=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/mine_order.webp | Bin 0 -> 866 bytes assets/image/2x/mine_vip_logo.webp | Bin 0 -> 1064 bytes assets/image/2x/set.webp | Bin 0 -> 1316 bytes assets/image/2x/vip_code.webp | Bin 0 -> 1212 bytes assets/image/2x/wallet.webp | Bin 0 -> 1066 bytes assets/image/3x/mine_order.webp | Bin 0 -> 1178 bytes assets/image/3x/mine_vip_logo.webp | Bin 0 -> 1652 bytes assets/image/3x/set.webp | Bin 0 -> 2904 bytes assets/image/3x/vip_code.webp | Bin 0 -> 1800 bytes assets/image/3x/wallet.webp | Bin 0 -> 1456 bytes assets/image/mine_order.webp | Bin 0 -> 642 bytes assets/image/mine_vip_logo.webp | Bin 0 -> 718 bytes assets/image/set.webp | Bin 0 -> 908 bytes assets/image/vip_code.webp | Bin 0 -> 720 bytes assets/image/wallet.webp | Bin 0 -> 710 bytes lib/community/community_child_page.dart | 2 + lib/community/community_details.dart | 113 +++- .../community_view/class_details.dart | 71 +- .../community_view/class_details_video.dart | 12 +- lib/community/new_community_details.dart | 64 ++ lib/home/welfare_exchange.dart | 4 +- lib/main.dart | 5 +- lib/message/system_message.dart | 13 +- lib/mine/mine_page.dart | 65 +- lib/mine/mine_view/community_follow.dart | 8 + lib/mine/mine_view/mine_item.dart | 2 +- lib/mine/mine_view/mine_navbar.dart | 301 +++++++++ lib/mine/mine_view/mine_view.dart | 137 ++-- lib/mine/personal_page.dart | 623 +++++++++--------- lib/mine/scan_web.dart | 43 +- lib/mine/vip_pay_code.dart | 253 +++++++ lib/order/exchange_order_page.dart | 2 +- lib/order/order_detail_page.dart | 2 +- lib/qr/qr_code_scan.dart | 86 ++- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/setting/logout_ing.dart | 6 +- lib/settlement/settlement.dart | 2 +- .../activity_coupon_remarks.dart | 4 +- .../settlement_order_commodity.dart | 2 +- lib/view_widget/mine_vip_entry.dart | 240 ++++--- lib/view_widget/update_dialog.dart | 5 - lib/vip/vip_view/vip_top.dart | 3 +- lib/web/web_page.dart | 65 +- lib/web/web_view/input_comment.dart | 295 +++++---- pubspec.yaml | 4 +- 46 files changed, 1761 insertions(+), 675 deletions(-) create mode 100644 assets/image/2x/mine_order.webp create mode 100644 assets/image/2x/mine_vip_logo.webp create mode 100644 assets/image/2x/set.webp create mode 100644 assets/image/2x/vip_code.webp create mode 100644 assets/image/2x/wallet.webp create mode 100644 assets/image/3x/mine_order.webp create mode 100644 assets/image/3x/mine_vip_logo.webp create mode 100644 assets/image/3x/set.webp create mode 100644 assets/image/3x/vip_code.webp create mode 100644 assets/image/3x/wallet.webp create mode 100644 assets/image/mine_order.webp create mode 100644 assets/image/mine_vip_logo.webp create mode 100644 assets/image/set.webp create mode 100644 assets/image/vip_code.webp create mode 100644 assets/image/wallet.webp create mode 100644 lib/mine/mine_view/mine_navbar.dart create mode 100644 lib/mine/vip_pay_code.dart diff --git a/assets/image/2x/mine_order.webp b/assets/image/2x/mine_order.webp new file mode 100644 index 0000000000000000000000000000000000000000..4d92bd9fcc85956b929461972c429edb66f3e2f5 GIT binary patch literal 866 zcmWIYbaRVhW?%?+bqWXzu!!JdU|=u+Vr?+;baoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AP0MMV^olXG&^uGEmV6AXX^?S`KuR2#_t34q@Pj%PiUKXd)vgrQ!m%%r#~}e+`(;CUc3A4>XWm#4w1M0EHICrWYz6(>x|7FsLzbqzfo{Oj7ZjsB$*5 zC-GTCPv8Ilg&RI?*|falpLWshZHf~fzj!BKc0Lpf(Et7W9X9ZLzwzIdGhf|5xPE5c zJlSVQAD%H&!URd&uwX->8_vGXPD2CFUcY^I_UxLd>-qE2D(Adm Sdv)Zxdop*={=E6Vj{yJ#X8ec% literal 0 HcmV?d00001 diff --git a/assets/image/2x/mine_vip_logo.webp b/assets/image/2x/mine_vip_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..a971662e61c94f97aeb8a64db624998418e7ae05 GIT binary patch literal 1064 zcmWIYbaPW+VPFV%bqWXzu!!JdU|=u+Vo3%DQ3eK2XXk(uj6f~};|UPS0+h&0*?z2y*;?J{ZLa%l$atN)Q z_gqx4lS8HY{`E~d_mvKPw)wwnT_*?QmwoTWTpK%{yi-B6FU}i~Enb*zQt1NoAILw!tXYzQ}3=W=$(yk$%*N%P&RqT-Tbx-i9>qv}zcy`vx z0|xpn(~W#zL`pn&Xg15gG56v$zeUq-Oy%fv%47RlqC9Jwd`eb9@Y^k4qw6no&f8`7 znKw}=|Jj~w^(X$b^XDEZP=33={CX;r*Oe8U`5ymSe&wBx#VKF+1tqGNZXQ2dCC|bD E00mB7u>b%7 literal 0 HcmV?d00001 diff --git a/assets/image/2x/set.webp b/assets/image/2x/set.webp new file mode 100644 index 0000000000000000000000000000000000000000..8bdaa12c5607f3cabf6fccdf47bcf05ad15270da GIT binary patch literal 1316 zcmWIYbaRtoWnc(*bqWXzu!!JdU|=u+VqGxubaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AJRUoMgb6l3JV$)b#;~Rf>R?1KlJ7WQ(Lj*cu>q z5`=97VwaZ`lmOKPfY?PLLC!#S3XrXlj>JwvVkZ|Afzzleds;wu9K^8|!g(o6=1?X3(961NayDhn7G_*)nlww*_a zA;P2}u_zH}J}{7hm?0!FGKgBdV}eRP=_81!`=xCQiCmv74rzk2JtT~RB$md^qv$Br{> zPE!x}m)|Uq@tm~y$sNV`9Sy-h@*A$r$~-C-l|+k06L?Kxcf^oPyt#h265+Rp8_zGm`q&vb3}%gbJT z{r~cReS~k-{D0@yT|RGAYWvFS>d_b1&T?G!dwYLv+2`qwvY-C>R;w;u_VfB*^=Sv$ zYda;+F5DaCByrZddA^{}UL%QJKD|d4Zt-}LwUMW(>ejAQ1xZr9Z^`?%;dV~!qyoUj%=w4w^wkmO*>%Z^6Ah5j)ZB`Hi)E5Y6+BCsGxB*(1uIB znJY_xWwPFchDM&I1OdekrwNV@3=5c z0foRxDVMkXy0tC$cGb79d(Q*uZCB-gC9OB#{H?~(<-hEXTxriX+vD??Ud=os4T-!7 z`@S9cTfYDQo}HB&xFJFx0!%$8sYE7D=y3Ji%%-KTIz97a<^MHnf>$a|HgZ38PvV@Z zy60K-?3x#gn$N46`215T{T~-U|G|R4^&!>Ij(^>|+rLJ^^V0KH|Ks1^?Ed;YXYS-T z(kehBJ%9bb^Yo5`^ofFN)Ar8YQY?MxUDT^6FZs-u@3^<^`fwynU%e(`-r9^ctFoeg zU1`tIDRNW&xm)d`uJ@l)`?W6lm>A8^csaexV#UuuwFW`f)aiF_%W_>RXbAcdt@3l8 zs`l&IcU~v8Ki$?*dC9P8>9g0o<+>!$FlTv`HrtY(thE($T2DmoEnGe6&f+Ims~#^~H0?*px1*n? z{b_oZy1usK*!u6%d**O%+F zt+&fnzW-mH-=BB0^7-wbS*b!tOxJv##j;=Rbu#lRiTOVR%VW-OoE6}#Svq-I>y&zC x{W()#R+yQ7G0>eFnq+YG`O-6yHijWyTIQ7pUf6v2@Ob)pdHFZ*KO`_Q004oH;B^21 literal 0 HcmV?d00001 diff --git a/assets/image/2x/vip_code.webp b/assets/image/2x/vip_code.webp new file mode 100644 index 0000000000000000000000000000000000000000..86e339cf433ada6155ee7baa8731b674839a1889 GIT binary patch literal 1212 zcmWIYbaUIn!oU#j>J$(bU=hK^z`$St#JXVQ>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{^pzILUxBCAByisOtj|s}un(2f9fF$QDV5ur)yJ zBnaCE#4ax>C;_So0I`cgf}DZu6d+q89f_TU#7-_K0;%r-seK zg93vmLmopigC3A&1dLQe1~Xs``y69pV9?if;1&>ntTjm`a%GkJ{u>8W<31J`ryllI z@$8$jclrCf?jQe5+*`d!a!c+iddU;eXhZ`}NMMe^S-XV&_6m)6a_aia6Vsn0J)ich` zI(6#De6dVPZ(m;BO{OwZkDf+O4D8yh&>|HTY|GD~s_FcqqiETmX%`ZF_XYZTGIC}w z_Dj*|ezdhxl&j8FOQ>ZVQ@)e3mdd1MaTA3cmh!T8s%W_=OlFy&>p4luT`>&^rp}l- zbLEoVzy8m^PFY_nf-Zru2Wv*D_BdJ>F_iI-{z^mJ3iVhFIMc;U_?fbPe zFwiEW9Oz^&rK-%=DRimczQ20+^Nn-fzq4I7A;NURe!=5ac2{iLZxkopEiAF@{422g z+)~v(G4+kok96c`bR_ef*w1lq)5W_+9|evdcJco1X5{?;^pU-;C(l@=EpEA2mJ~B@ zl`OBnp<8sTvl0|+-al>ks`SHd&T)aTSSEr#@ZJ8)sa%Uk)2!~VICs}5@{#wJ^W7&3 z9+thTnKXOvsmiOrZ~xkKz>}x0QfRj1l0`Q?->3vlbbJ)G*LHTS-SZ&JlMU0KHa0d+ zy$b?YyJTi~nM-=?(O~yl|Hxxnbol8Cuj&dn*0Z`mU@Xrlv{f==*_Ru0tR~N6X}s3G zu;|y}H+73SGO|`GURWV$vTxSS*p0yvzZ2(oH*V`oIG8D8-Mq;^efi1Uz59R1&SqpQ zE91Wxta0AdSvIaA_{Ev2mHrQ(-~IYEv9hxAdFHvFU$*@Eyg+yNHS14ovv}|QXuflF ozJ%M{gR6{J{PnRk{BqZ2j@!0Bmrq=qJujrfIHu}LZ{9Bk03xHH0{{R3 literal 0 HcmV?d00001 diff --git a/assets/image/2x/wallet.webp b/assets/image/2x/wallet.webp new file mode 100644 index 0000000000000000000000000000000000000000..9b4d7b702cf97869c89613395d09cad16e0f8bbe GIT binary patch literal 1066 zcmWIYbaPW;VPFV%bqWXzu!!JdU|=u+VqGxubaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AJRUoMgb6l3JV$)b#;~Rf>R?1KlJ7WQ(Lj*cu>q z5`=97VwaZ`lmOKPfY?PLLC!#S3XrXlj>JwvVkZ|Afzzleds;wu9K^8|!g(o6=1?X3(961NayDhn7G_*)nlww*_a zA;P2}u_zH}J}{7hm?0!FGKgBdV}eT~p=I`4MZ|jw@RKF?xKAGXs)wA8Z z&Hc|GU;X~F^8V+l?T1g_e>|aZ_3O75alhBA@7P}=xBc<||G6?Reon3_Jt4DS&+{3J zZQtG4uwx!oyHC&P-p^dzVDFusAhfmZ$hz|BtX(OpCmUAJ2wTMyp!+ygdy$9A+7ITE z7aKifnKm}85?sx?ip6V%tb@AXtVENwU5t+c1Q#-fOlsP~X64DiCM9stNQ+Y;<>t1v zRu_-m{rX7ij;`FDyS2=_|F1o9y5hUsieG&%?3uUsiaeb${nkBcD}T>PDoE%_`a;1Q z(~(7h?65|D?{5rIMIYo7l{w;4CY?+%n(3o98AQ!l&-)-_k0c~oK0GU1!n5J=23CWV z-E7n5Ty^&jx%Y5R@j1)qAmaMF!`1#N>q|fXv)<*_oP~E_WU|6w4vZVCBudQTXMNeFAL^ zJk!LIw4A^)Chik()D`<+mRk8062Z~lKe7NsdSD}pcR;pF~9 zyBBlauln&Zu%e?nq-uwIbc6BD-SZYMzQJ$(bU=hK^z`$St#ExL(>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{`fOr5g=P69m3WC zv6CQd8xXs^q@V<-CIG}P3JG!svQvO;jdUb-5)wPPpa`VC2dKs-H>VV27YKk{%#)fI z8Vsa4fLMm1m?4P4oxus=|NKP^3>IG*7?>v@#FAz*Fl=vSV34?l5K~#ez`)m$qafxmJu*g4H?XUG3>LLiGe}i(Lq2U{Lr$AD(<$w`5GU~+s$qNH1qbd zgJzRd)c-EpP{7&yN7hF4fc=IXWzQm`>K8U1oqw1Q1l_amIkYYJ_LS7}^9)RLen0$b zv$Ie4MrqFC_s_NNTm6z>|GYl=RqnsjH>Ur5e)|07XFl=9xl&imyz1OPg}zjqdZ;FE zi%Lt0?jK!e!-@W`|LU^+>f*Cb{$W;K?5OME#CU;O^K8K?mt$TFg`E_W*qLNo7+3Db@HB7UrB4DE>)rB{ zH9vhgl>39z{?E4;wdHug_ut3s|NXf9c_w}^egB>LH?8jdPOq;2{_WR(&-&c=XV1Qk zwg33w^0ux1{C*Y%YD)OPqce=K$RnO^KbM9Z%(MLxX;t&}=EHjpB=_{elGNq5qj&ASJXiPb&%QTh`zpRa1_J_!x2B?=f6+CUzF`_US_rb g>A$yk{M_a9o|?n(I4&E_jjJ>{rtYqbDsD4z3=-YoWS8IG5~nm zVO>02Oub|Q07lSs06+n7!p6p>T>`!WiFUDQDW`$2q4j-KJ!;* zSY<^3{;kz(@Rj)gN!x;gX(X654^2A;E)IKAgsd3)iFL&s_=zpV97m6$!yFee$G8z} zAO}I#4gG=xzhF{Sj5wbGb1bNoSn*ooA?{c%IKtf(&Io8~fCdP_9$+`WKe7Y>(`5j* zWNd1Ic>vU=0-!v&sc9Djup7tw-t(0WXHeS5p0 zN*ZcIf^^Hd#fJCPjSZ;`ysyY{ziS6xDDTCb<;TA>qYUAqXeEoDhqh_TW6vttk%xxv zE^_(J%?9Pa)l}A#&5KNY^aqcc8Z}pqEl=~}&1WYTo<4dLE;KPoykLz*G|iD?&1Z`W zyhi)a%&qmq2m`Yma!|7cdFrZmnMwW@P$=}h<)-K4IzH7W>guY9pmMmip$Vkh7JO;z zVj|m9H{13UJ(Uo4F*MZUh)I22<1zZ93AJ=6rSTuXEF3?UZ+LZ~W&4j2xFkdb3D5VvP8k&t;Fw{ zZe3=KN?z3r1GC>`C!wWD>fRZ4f&#{b^c^ zN+br4Cdo0~1Vkd4QRz%>jN#nC;MCgKqm+)tvzL?s606Uv(hPiVhtafU`}vg}RxuNL zkG>BqeG14``*tZ>;y6;b2=vo0_A$;8B!wkeKJI*=5fj8EK~+ z$LGC~Yb_xw`m zGY4_u5FU3W5Wu`Y*4Ca)L?~CVe9{wX_~scAs{C=R0pJABKMSGCQFz?NZ+l=@`fIu{c^LtI^Bu zZFs$2kP4ViXGvXY-P@(-pn7~l_q?H}%HGTmxA4pFPa12yB)qrV#mx`O5=Lt|HLxst z#Uu12Zw@0o&e(Dv~nr!l8Y;~bG zI(J6CUDP{SvV9!!>x*OHx|g^A5-LSr>oz8|S&nM#?S;DMFp# zByQRVOtPILbHq6!rrqcD`Dn>~R7Lq(1;YhS;~`(y>AKEmbmn!LEXZ0D-YxJcU-{XwFTv1_^Yo{QB*W;M zSnu$8zXP2tzSHmvoVqDR(otk@I~XQPtTw2gT6rkP8!6r=D*1RX@#1&>TKRofb7q^Q zaszX79Jo1?QAt5++wQLrB>*jNSbx-#Al0j#gD-eeqtLx$pnrAd^<#4@FuBvH?2&1> XxoL~^8arOGsO%h<8<)%RK!AS$9*c|V literal 0 HcmV?d00001 diff --git a/assets/image/3x/set.webp b/assets/image/3x/set.webp new file mode 100644 index 0000000000000000000000000000000000000000..394ccc268e4f7143104ec2b733bdc1b5538d4a20 GIT binary patch literal 2904 zcmah}cUV)|5C-_(b2+KV9r>w z0sznuX#;Q`00V7pOeYNb1hCG1eh@NwdHegC=xGUCT3HM4>;4&7M?c&@_$LyI@|6s} z#~PCTiT(enSe%^w93iI_h{S!N#i5+IAk5|ZHi2mJz?pRb z;E6wU*D?U8jRJsY{D)3F4}e3r0U-AM(EaEM4(p4B;zLb_=zxn00IS6SAglm5+z$Zj z)$cZl{g2#)Arn88mk;!~0#D!!gn+0)V_W_yvgw5P3|8 zb&nCB-N^os+CGO?bj^~pIj9(=a-=R2-BC%3Rq5fv@v$g3JETk#bm{S7$g*m5Yl&lMs(pI}O$9 z!po&-`Zbg)8!=9FOv;geamU?rg6M^J@q+mN8(5>}wcAT=_L|UVRsFV{HiUl#kpC3@ zGa20z-QAPu>N+YgM|kh;BW)zg6`_cv(nI+jt12+>~lW{%Z1ru)PwRI$t6S7Z>^g(Cx^ z^XS)=9x~#ziuh%!zHE9I+7wC9VRyEFb&lIdP+%}nusFUABRtG$pa~)$Ciz@xRh@}Z zN>%xSZWc9yJu^|{&EQ;j)QVLbYaRo2SKIuViJ#FM@9hKAwjRHJkW z;wL*}TY>zBu^6QQ9WIvI18)!o?+p_IU&G93MU)dDNK6>FS9h241C z<92UyK3zovx(jzt2)p~z@kPg1=S%UNm_pBc#|Qnu$%5`VPb2k7`Yhums(0)+UL2V> zUNHD#gV;R){!)t&hj+-CV`QM|5{B+~?MFliLXq`%+CVwOg@lwNFT27#&Tveo&YhN| zlw7i?7jQ@xUzF1`L{(V-MF^C7Q}2OVPH7r6VQXf|CzNwo8+W-h)YXQ$U9>+OSC*<0 z{xyivMIr6l6?jYq2inrwYI)dmN?o5 zz?Ewe)B7Na&*_4v5@t1#kAPOc?^fO-}tz%!ZY>j9%}a+xvx9j zF7AvzDdkz_ihlnAA8XiB2s^wo!Leq?|M_H*lzc(}Z_t`Hs$Zx=iQ+fglOB%{`otUZ zq9G68ATMx2+p1!)h_qQ0KbGW^6g2g_z$P)*e1UIW-?Ta9!t(UQuGSSMPy2i^`PCq9 zMvX)zSW!%cn8ms|XW)S%nlQ^&xOsYG2Cr;J`@vKiN4_x%W^2*2+;**QcP+v5*6}ct z1DN0py5LdaFfmEsJ|xuJ7GAkg(=_0Qy9)KK8h0>=Nkw^ngdg+>xuzjqn8v zkxC)+9?}+*kU+hBT7E7As@cqc=}WA6bz4`VeNt51krFr;(y)6s-0GD`3EX>XyU>^U z-J^lc)o|1MStF+8x5En3P3*r^9<${8G8R)8Kus^n(L6rVO+=&~^_{yP`X@M;XF9iT zY^z`w7m^=MF0+4S%TGu6U)^Bescqh)1e zo^PBwDOuo2OY6CvKsnw$RGP{YL5GeklokgKyu=Dpi&HNneK4yuX%;7n8!B3oX;wBE zW+9t)7%;iL#IGBR^ut@Pd#pu}StOAxX}UpGHt6NtHpwOqKTZeiNAZ3f;(#BCtku;4 zGoWU98ZCc%7`sqZtgCn15Db3g&P1^5NzjkW+woAz{4!K7%dQI=WUuqOA<-3qTa$6R z%DY)*{O5m7Fdy_|77BNX*RFC0KBTEV`+|wG+nJ74OZX{5I@gU2x?{`M4yjsn2KAto zkuWmH_*Y>_|EIyXL)MJp(YUv6@i@cqSZiL^%B{Zs;5v@q0&d#WZqIf~l{%La>ZTvF zs(yYVReot^Af83}M6^A(`=>;ygfixO6DMqrsI9~&HCVo;I6r{}$N*g?hdlTOmWEkq z;G!e3S2gclLsL8=HE|Wvdx$B^%+QfMt6U*G0y=SVOV|5>t^K=)fzP8ar>F2b!=(u$ zWt8||;oFQgA!{>B&qnrtH*yF4!(K`kiTc1jPD!~#`6&)?K?$g!YPBT9JGiq*emy-% zHL{C@osuQoXVi>m|GpGlru%oUIK^ra&WCplE@Lwg8`XtNQ?ZV=?G6kK+}t2=Iy>{j z_Haf_*&j8Dv_+riE_L6k>9h5P_5v1bf6X3pkqVeTtU|4uLGuu`w3l@1ZB z(C0SiCGFEwD#OZkLIC_>R{zYhVKrN3!m-K0#mI%yqf7>eYeEdSX7U!x&Gp-5dga_y zeQIveU$Usmy_n=Qm{NRKakZsp`Rd-*&M38sCVZ%E38>Y?-DoN6&DS0mZ0Pg){6&0& zp;PP~cvau@bx&W&7Pl~7=Y4L%=&6}yYMa}Lzo9bXX2e_NYD*7lp-}l7qwMMMs$&|Q kt4J(y@fQnln8Y{$=8=+%<-Q^CcU5rwh->?D4e|i^5AHI{5dZ)H literal 0 HcmV?d00001 diff --git a/assets/image/3x/vip_code.webp b/assets/image/3x/vip_code.webp new file mode 100644 index 0000000000000000000000000000000000000000..f7e16151b831dbad5ca18269c89989cbe261ce7c GIT binary patch literal 1800 zcmbW02UL?+6o4NJ3TTULLa|Ulpdhk`fb3ZWnMS6{NMwZ!Fvzr2PNgi_AWJMQB4QLm zKvIN?1B4JkR=|KqK}JZJVcB5+=<#4%dwNdqfA72BfA2l_-T%GwyE)j}g1rF1Z7f|* zx)`1k1ORA4X8m3rtgKu*d7xLo)5%?Vp;QDa3hQQPDR;`tTaFw1C}#t4=#Tsv4|Q1^ z0`Gf0SN}}@zd`~*!MH%EXc00+EVMZ^lNiKe$PcW-<$w=t!ex9EItr?B;WF04%?jcm zh*glEaKI-Vh{kg3)1exZi129cUR>c$ygwM_=?-~*$YcNxxB)w0x%2&z*8wnO1F-wb zPAs4pfTk1xq(*mQiq`-Txx)a+u6ZBc^S*SmB$dK(qAOKjd2H*=X07RbwAn5Zx z2QB|Hn;evqf#!;Y9wZ0{!9Wf;02BxWM#QYLpOX}m=6FAYao1JVoD_^0$#jX zQF`}#0peM0qce|GJIGJ=OzP*zINX|}9}9VKFM9hc^a=GAHM(uiylTU`S^usq{>!9P)eVhfvR+8pD z7VCAoKT%*^;&HjH*+#bJ3Y#H zlYZ;9t$G>?U#QmD_IT}C>HO40o!g|UIQxd%o*S;ju|qm3`vxV_LJbZ}&p0+1H8^jp zdkqJfh_h?`7ZrOi`Hd3yjbv|}SLr&3^>9+!2lK=jRq?xuS08K<qi?IHip>loDA|^tO$w5luBxUJ<0MokvW@Q8t#KwW}T`iz+n1b)xl`q zGH_U7fflCrIt51a6@$Za3mh=D{eCc-mo&UMr$Ava;G|z<@TBdub}oLM6El~BXjDI< z%4|_yv5adekPvSw%a1h0Ia6xtO7L{m_W1G9#tV#^VOjgwKPp~bu&s*_AO#cS5*2?Q z8sOE@9z7_7*2o>Cy%F#(rv%{%NmKr6$#VREQ<4*B;kXQ?8s$i6x(*Ni_!(om0WR!`XJY)-j;Z!I`>c#q<%OBj*`=?s;f~8ooWu?^{s%GNSfLjS*>cDW zF|v2#F=uLjbt=(67`Of69&Wm~%oraUOSinMa6+)cFm`pO@3avya^il%+coBxhpUQ2 zwd zGy1|v(~5p!6w5locJpfQbnh!3&p>(lUZKsJ%qY&$ z-GlGa+gRhQqKz^~f1AFNRwlMysc-T`@U^bW=HB{d+egA#0n(1RW!(;An@k2hi_w!6 zHc$i`j>(&5BIwOp?wQkNRO`fT&Dfrzq_3?n+&D^Z7alm*kz3?!8me(vvn_urMpb%2 zLvswr85EK=jW;A9C|C8u47T4!|1PSBVVum8F%2JCTxvj4%UjX!7|Bnt@~}5~c}dk; zlN^cOu+xPh@xXUx)dGDx!TYx444HDX`EiXtCgc9*GJB4yQP1x4?@EwZAU&^rs5i&# pUf~M~;H1KJ;=7GT%xHFM>t-7!zvJ$(bU=hK^z`$St#4cdu>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{`fOr5g=P69m3WC zv6CQd8xXs^q@V<-CIG}P3JG!svQvO;jdUb-5)wPPpa`VC2dKs-H>VV27YKk{%#)fI z8Vsa4fLMm1m?4P4oxus=|NKP^3>IG*7?>v@#FAz*Fl=vSV34?l5K~#ez`)m$qafxmJu*g4H?XUG3>L8nSnvyg+Wljp4EI?Zur@I;_nqp6a`~1sVwGO za;Cc2U%EiWGf1WKo7_qs{@wqjGu4esRqx!|78;r@e@F2$U&bW0lO6T1^wJ%3Zo5s8 z5t+Ml_kRY~b?fx3at;&Ug}-M^M8r>Owm;@^iM`kw0RV8QBJAin)6YmTkTwb+c_M(L|QbN zLO7RjoMvj1e;VOZ+cJZJLs8+;`IA;58VX90*E=)%JVX}QO_maF4lz|1Vrnr`NOANK zX$a_?<4dlm{Qnmv-z) z|FAL4MPMGYZCG7y2jd)>*AvU9XK!D7Eh>BMRw!{@M{eTdPI>;>(=-KOvnEpFcHi_3hgEw^S$keB9CIALmXzqifsq-|^P z^!GMJwvJJo3Es2%ksL{ z^LGC}c>T?u_2)LPta^F)_vYg4O2FH=R(b8pe(BHuY8EeEx^(H=SK0YCGt&&W8s9B_r54pI8TR>#c=@sD zw=q-hP1_wT{LlQu1pReATW9Sw-K)FyC})xR|1U>at$*eC=bzT}-1N-*KxB31EuFr* zj{4RXC$r9cSa*8Q?R4{pAFtW}&UwG-Ji|Pp?(=R!wu?HFXV)Cv_~w;vUq_X(;O*yi z-<(t;kNNNWyx?JsQU1*1XR7adGW+;lXPB#Z`E^lzR?4kYvBx*9p7>as?Z;(TRli*) z+MT-HwEvZ_x_Z!OdGs&KJ(KR+-VQxky-IVRZBEG=&6+Ut>ECis#@%%ZN9J1v}(t~|#BzGz?0RRUf6bS$T literal 0 HcmV?d00001 diff --git a/assets/image/mine_order.webp b/assets/image/mine_order.webp new file mode 100644 index 0000000000000000000000000000000000000000..c53b1869f02ec3c4b00d533420bbae92cdb506ad GIT binary patch literal 642 zcmWIYbaSg>Vqge&bqWXzu!!JdU|=u+Vo@;ibaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AP0MMV^olXG&^uGEmV6AXX^?S`KuR2#_t34q(yZgo+i%p OeeQq$|Di{mybJ)gAB8ml literal 0 HcmV?d00001 diff --git a/assets/image/mine_vip_logo.webp b/assets/image/mine_vip_logo.webp new file mode 100644 index 0000000000000000000000000000000000000000..239b516f37d3e624dd0575ab9ece323a17685553 GIT binary patch literal 718 zcmWIYbaOk##J~{l>J$(bU=hK^z`$St#5@cPK&Gd&bHE8kAeVvh1c+n-O6BI26a~3E zDMUm@DS*UaAThbP0LI2b15NpMjR9=dWnC=tgoHR#Qj3#;iar3bN)ga{*b zTLZ*Sg0O8s?DCR=5}=v@5W6TO$Qj5^0kSpHk=RK{?Bs$Xkoq2=8k^jlQjlFB0CF); zYF=nCkmdkl8HQqpAO?2^Cxrj=7cnqcd}Ux@o`4Wbn#sVhy_JDM;ubNe+vV{ zw(|%vM3@vL79|4B2L>__Go__5Fnn6hz`z^Hz#x197#Y!EIUs?#e37J*FWwV zM`h0_Hd3-$8nWv<*V?a^&rOogxViYd%qy0YOlD>fV0ba7Imm0rcctetf`SYTf`Sh= z>=OT5BR26edUP1>iory=U8*_&#=bn n{}!BHk-YDU(M!4W^Qv^OSl#fME$VbK-Dr2!!+y8vz!VAqF$J#h literal 0 HcmV?d00001 diff --git a/assets/image/set.webp b/assets/image/set.webp new file mode 100644 index 0000000000000000000000000000000000000000..1c16f9b6f236d3c0927da45325c2befa63ed91a3 GIT binary patch literal 908 zcmWIYbaQKAW?%?+bqWXzu!!JdU|=u+VlgoCbaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4Jn7z`vP7Zxx$&AP0MMV^olXG&^uGEmV6AXX^?S`KuR2#_t34q z-KPsnA8+|w`)${{x%Vc&{2_b$X~nME{Qmd3fBWlx?|m6rKlkz<|HbwDD-C~ruYaCx z_IGOE#Q)pt@A=vv>&Q~}x-+F~*>#Sq2kImCB^~>pbKzTp*xv9-)1Jkv1m!b6iII%M#6~g2u$BS^R}O6k!%4Z9uT^c!z5V|8{(PI_r}F3QI20HC=V4aJ zb^eycxR;56;Xv{B-8o`$z;F>&os@F(hEjB6t&cso$h9RaW(Nh#TWXf?pFSx>?fLWX zxnc|XC#iV8y%=8M5Oww8cGWs*uEyIYf<3+Kxw^L{YjS>RdACfZ@V!&0fWjYw?TSQgcp~g)dl|XCA7*%rm}bk=^S*H-25+enjI-rX=^0|Ka>? qCv4Z5Nxq!4|HJY#*OoTeF)qpqli0jeBfxO^wCXyGx9M5O7#RRB&Jbq+ literal 0 HcmV?d00001 diff --git a/assets/image/vip_code.webp b/assets/image/vip_code.webp new file mode 100644 index 0000000000000000000000000000000000000000..05bc301bc6c5dca7f1f705f1cb325b21cb3b50c2 GIT binary patch literal 720 zcmWIYbaOkw#J~{l>J$(bU=hK^z`$St#A0CN>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{`fOr5g=P69m3WC zv6CQd8xXs^q@V<-CIG}P3JG!svQvO;jdUb-5)wPPpa`VC2dKs-H>VV27YKk{%#)fI z8Vsa4fLMm1m?4P4oxus=|NKP^3>IG*7?>v@#FAz*Fl=vSV34?l5K~#ez`)m$qafxmJu*g4H?XUG3;{_s8C<5fmL9C!-Cw~7E-;Hu(qd^-cZ4 z&s@LsylZ*a<6a(<^L1nF&($|tg@KL&fdJ$(bU=hK^z`$St#A0CN>FgYEf)U7NU_1dLS%6Zxc_l?b?oJ93 zkx>dDF&IcpE-rwvvCu$MzFlJgn{`fOr5g=P69m3WC zv6CQd8xXs^q@V<-CIG}P3JG!svQvO;jdUb-5)wPPpa`VC2dKs-H>VV27YKk{%#)fI z8Vsa4fLMm1m?4P4oxus=|NKP^3>IG*7?>v@#FAz*Fl=vSV34?l5K~#ez`)m$qafxmJu*g4H?XUG3*00j6q+lfmPu80*y&a(!Ry9uMv*YC;g>$NhJJ$q&CjX8fYTyT7=cm4aJ2-CA4zt_9O^LTDt zc*i)9;f_FwxJ+8&@%4*oq?pY0*cT-B>H4`1eSYRiVsWhJPrSRo-1@-c=f56RTdY1I mdtYw_U;EkWN56j+@4kKicI=Y;i~H}aQ?7e{(BAvkV+H^{Be5C) literal 0 HcmV?d00001 diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 37018099..78734e3f 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -213,6 +213,8 @@ class CommunityChildPageState extends State setState(() {}); }); setState(() {}); + + // Navigator.of(context).pushNamed( '/router/eom'); }, ); }, diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index d68c1d52..30731e72 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; @@ -15,6 +17,8 @@ import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../web/web_view/input_comment_o.dart'; + class CommunityDetails extends StatefulWidget { final Map arguments; @@ -46,14 +50,23 @@ class _CommunityDetails extends State Article article; String businessId; - @override + final GlobalKey inputKey = GlobalKey(); + final TextEditingController commentTextController = TextEditingController(); + bool emojiShowing = false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; + void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { + // isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0; if (!mounted) return; if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); if (mounted) + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -66,6 +79,18 @@ class _CommunityDetails extends State }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } } @override @@ -74,11 +99,45 @@ class _CommunityDetails extends State // comunity = widget.arguments["comment"]; businessId = widget.arguments["businessId"]; WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); _queryMemberCommentList(); queryDetails(businessId); } + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } + } + + @override + void dispose(){ + WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); + super.dispose(); + } + ///详情接口 queryDetails(id) async { SharedPreferences value = await SharedPreferences.getInstance(); @@ -101,21 +160,31 @@ class _CommunityDetails extends State @override Widget build(BuildContext context) { - return Scaffold( - appBar: MyAppBar( - title: S.of(context).dongtaixiangqing, - titleColor: Colors.black, - titleSize: 18.sp, - background: Colors.white, - leading: true, - leadingColor: Colors.black, - ), - body: GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + setState(() { + emojiShowing = false; + isKeyBoardShow = emojiShowing; FocusScope.of(context).requestFocus(FocusNode()); - }, - child: Container( + }); + }, + child: Scaffold( + appBar: MyAppBar( + title: S.of(context).dongtaixiangqing, + titleColor: Colors.black, + titleSize: 18.sp, + background: Colors.white, + leading: true, + leadingColor: Colors.black, + ), + body: Container( child: Column( children: [ Expanded( @@ -184,17 +253,22 @@ class _CommunityDetails extends State inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryInformationLikes, isLike: article?.liked ?? false, ), ], ), - )), - ); + ), + )); } ///给文章/活动点赞 @@ -246,9 +320,6 @@ class _CommunityDetails extends State ); } - final GlobalKey inputKey = GlobalKey(); - final TextEditingController commentTextController = TextEditingController(); - contentHeight() { double contentHeight = MediaQuery.of(context).size.height - kToolbarHeight - @@ -290,7 +361,7 @@ class _CommunityDetails extends State Dio(), context: context, token: sharedPreferences.getString("token"), - showLoading: false, + showLoading: true, ); BaseData> baseData = await apiService.memberCommentList({ diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index d7058800..cc60e937 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:ui'; import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; @@ -53,11 +54,17 @@ class _ClassDetails extends State with WidgetsBindingObserver { int chapterIndex = 0; double height = 0; var isShowMore = false; + bool emojiShowing = false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); courseDetails(widget.arguments["id"]); queryChapterList(widget.arguments["id"]); } @@ -70,6 +77,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { Dio(), context: context, token: value.getString("token"), + showLoading: true ); } BaseData> baseData = @@ -114,6 +122,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); if (mounted) + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -126,10 +135,61 @@ class _ClassDetails extends State with WidgetsBindingObserver { }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } + } + + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } + } + + @override + void dispose(){ + WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); + super.dispose(); } @override Widget build(BuildContext context) { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } return AnnotatedRegion( value: SystemUiOverlayStyle.light, child: Material( @@ -137,7 +197,11 @@ class _ClassDetails extends State with WidgetsBindingObserver { body: GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { - FocusScope.of(context).requestFocus(FocusNode()); + setState(() { + emojiShowing = false; + isKeyBoardShow = emojiShowing; + FocusScope.of(context).requestFocus(FocusNode()); + }); }, child: Container( // margin: EdgeInsets.only(top:25), @@ -411,9 +475,14 @@ class _ClassDetails extends State with WidgetsBindingObserver { inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryCourseLikes, isLike: course?.selfLiked, diff --git a/lib/community/community_view/class_details_video.dart b/lib/community/community_view/class_details_video.dart index abbf7d71..995b5ff6 100644 --- a/lib/community/community_view/class_details_video.dart +++ b/lib/community/community_view/class_details_video.dart @@ -138,16 +138,16 @@ class ClassDetailsVideoState extends State { ? Container( color: Colors.black, width: width, - // height: width / 7 * 5, - height: height, + height:MediaQuery.of(context).size.width / 1.5, + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), child: chewies = Chewie( controller: chewieAudioController, ), ) : Container( width: width, - // height:width / 7 * 5, - height: height, + height:MediaQuery.of(context).size.width / 1.5, + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), )), if (widget.isShowImg) GestureDetector( @@ -160,8 +160,8 @@ class ClassDetailsVideoState extends State { }, child: Container( width: width, - // height: width / 7 * 5, - height: height, + height: MediaQuery.of(context).size.width / 1.5, + margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), color: Colors.black, child: Stack( children: [ diff --git a/lib/community/new_community_details.dart b/lib/community/new_community_details.dart index 62dafc65..f005b3e2 100644 --- a/lib/community/new_community_details.dart +++ b/lib/community/new_community_details.dart @@ -1,3 +1,4 @@ +import 'dart:ui'; import 'dart:convert'; import 'package:dio/dio.dart'; @@ -55,6 +56,11 @@ class _NewCommunityDetails extends State with WidgetsBindin Article article; String commentsId; String userId; + bool emojiShowing =false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; @override void initState() { @@ -62,6 +68,7 @@ class _NewCommunityDetails extends State with WidgetsBindin commentsId = widget.arguments["commentsId"]; userId = widget.arguments["userId"]; WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); queryDetails(commentsId); } @@ -105,6 +112,7 @@ class _NewCommunityDetails extends State with WidgetsBindin if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); if (mounted) + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -117,10 +125,61 @@ class _NewCommunityDetails extends State with WidgetsBindin }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } + } + + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } + } + + @override + void dispose(){ + WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); + super.dispose(); } @override Widget build(BuildContext context) { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } return WillPopScope( onWillPop: () async { Navigator.of(context).pop(true); @@ -312,9 +371,14 @@ class _NewCommunityDetails extends State with WidgetsBindin inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryInformationLikes, isLike: article?.liked ?? false, diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index ae017223..b1ee3566 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -166,7 +166,7 @@ class _WelfareExchange extends State @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.transparent, + backgroundColor: Colors.white, body: NestedScrollView( headerSliverBuilder: (context, inner) { return [ @@ -265,7 +265,7 @@ class _WelfareExchange extends State body: SmartRefresher( controller: refreshController, enablePullDown: true, - enablePullUp: false, + enablePullUp: true, physics: ClampingScrollPhysics(), header: MyHeader(), footer: CustomFooter( diff --git a/lib/main.dart b/lib/main.dart index 7d937077..49f8b9ed 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -111,6 +111,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 'mine/scan_web.dart'; +import 'mine/vip_pay_code.dart'; import 'order/bargain_group_order.dart'; import 'mine/personal_page.dart'; import 'order/exchange_write_off_page.dart'; @@ -349,7 +350,7 @@ Map routers = { '/router/qr_share': (context, {arguments}) => QrSharePage(), '/router/main_page': (context, {arguments}) => MainPage(arguments: arguments), '/router/test_page': (context, {arguments}) => TestPage(), - '/router/communityFollow': (context, {arguments}) => CommunityFollow(), + '/router/communityFollow': (context, {arguments}) => CommunityFollow(arguments:arguments), '/router/releasePage': (context, {arguments}) => ReleasePage(), '/router/activity_list': (context, {arguments}) => ActivityList(), '/router/class_details': (context, {arguments}) => @@ -420,4 +421,6 @@ Map routers = { HelpFarmersPage(), '/router/scan_web': (context, {arguments}) => ScanWeb(arguments:arguments), + '/router/vip_pay_code': (context, {arguments}) => + VipPayCode(), }; diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 46d07411..d4325106 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -124,12 +124,7 @@ class _SystemMessagePage extends State { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async { - Navigator.of(context).pop(true); - return false; - }, - child:Scaffold( + return Scaffold( appBar: MyAppBar( background: Colors.white, leadingColor: Colors.black, @@ -139,7 +134,7 @@ class _SystemMessagePage extends State { actions: [ Container( margin: EdgeInsets.only(right: 16.w), - alignment: Alignment.centerRight, + alignment: Alignment.centerRight, child: GestureDetector( onTap: () { setState(() { @@ -147,7 +142,7 @@ class _SystemMessagePage extends State { }); }, child: Text( - S.of(context).biaojiweiyidu, + S.of(context).biaoweiyidu, style: TextStyle( fontSize: 16.sp, fontWeight:MyFontWeight.semi_bold, @@ -192,7 +187,7 @@ class _SystemMessagePage extends State { ), ), - )); + ); } Widget newsSurvey(){ diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 1eb9a3dc..04157479 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -8,6 +8,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_view/mine_calendar.dart'; +import 'package:huixiang/mine/mine_view/mine_navbar.dart'; import 'package:huixiang/mine/mine_view/mine_order.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/examine_instance.dart'; @@ -26,6 +27,8 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:dio/dio.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../retrofit/data/coupon.dart'; +import '../retrofit/data/page.dart'; import '../utils/flutter_utils.dart'; import 'mine_view/mine_item.dart'; import 'mine_view/mine_view.dart'; @@ -46,6 +49,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { SocialInfo infoNumber; final RefreshController _refreshController = RefreshController(); int totalMsg = 0; + String couponNum; _toUserInfo() async { SharedPreferences shared = await SharedPreferences.getInstance(); @@ -74,6 +78,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { super.initState(); querySocialInfo(); queryMsgStats(); + // queryCard(); eventBus.on().listen((event) { print("EventType: ${event.type}"); @@ -113,6 +118,22 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ranks.addAll(rankData.data); } + BaseData> baseData = await apiService.queryCard({ + "centre": true, + "pageNum": 1, + "pageSize": 10, + "searchKey": "", + "state": 1 + }).catchError((error) { + _refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + couponNum = baseData.data.total; + _refreshController.refreshCompleted(); + } else { + _refreshController.refreshFailed(); + } + BaseData baseDate = await apiService.queryInfo().catchError((onError) { _refreshController.refreshFailed(); @@ -203,14 +224,13 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { child: SingleChildScrollView( child: Container( child: Stack( - // alignment: Alignment.centerRight, children: [ Container( - height: 502.h, + height: 306.h, decoration: BoxDecoration( // color: Color(0xFF32A060) image: DecorationImage( - fit: BoxFit.cover, + fit: BoxFit.fill, image: AssetImage("assets/image/settlement_bg.webp"), ), ), @@ -229,21 +249,34 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { setState(() { totalMsg = 0; }); - }, totalMsg, infoNumber), + }, totalMsg, + infoNumber, + ranks + ), - ///我的 VIP等级信息 - MineVipEntry( - tag: "vip", - ranks: ranks, - userInfo: userInfo, - rank: double.tryParse(userInfo?.expendAmount ?? "0") - .toInt(), - rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0, - createTime: userInfo?.createTime ?? "", + ///订单/钱包/会员码/设置 + MineNavbar( + couponNum, + userInfo, + infoNumber, + () { + toIntegralPage(); + }, ), + ///我的 VIP等级信息 + // MineVipEntry( + // tag: "vip", + // ranks: ranks, + // userInfo: userInfo, + // rank: double.tryParse(userInfo?.expendAmount ?? "0") + // .toInt(), + // rankMax: userInfo?.memberRankVo?.nextOrigin ?? 0, + // createTime: userInfo?.createTime ?? "", + // ), + ///我的订单 - MineOrderView(), + // MineOrderView(), ///推广图 spreadImage(), @@ -287,7 +320,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ); }, child: Container( - margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 15.h), + margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 30.h), padding: EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h), width: double.infinity, @@ -389,7 +422,7 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { ///推广图 Widget spreadImage() { return Container( - margin: EdgeInsets.only(right: 14.w, bottom: 15.h, left: 14.w), + margin: EdgeInsets.only(right: 14.w, bottom: 30.h, left: 14.w), child: GestureDetector( onTap: () { Navigator.of(context).pushNamed('/router/invite_friends'); diff --git a/lib/mine/mine_view/community_follow.dart b/lib/mine/mine_view/community_follow.dart index c5a15b18..b0f7acd6 100644 --- a/lib/mine/mine_view/community_follow.dart +++ b/lib/mine/mine_view/community_follow.dart @@ -14,6 +14,11 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../fans_page.dart'; class CommunityFollow extends StatefulWidget { + + final Map arguments; + + CommunityFollow({this.arguments}); + @override State createState() { return _CommunityFollow(); @@ -24,11 +29,13 @@ class _CommunityFollow extends State with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin { ApiService apiService; SocialInfo infoNumber; + int status; @override void initState() { super.initState(); querySocialInfo(); + status = widget.arguments["status"]; } ///个人社交信息(粉丝/关注数量/成就数量) @@ -51,6 +58,7 @@ class _CommunityFollow extends State Widget build(BuildContext context) { return DefaultTabController( length: 2, + initialIndex: status, child: Scaffold( appBar: MyAppBar( title: "", diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 2e897f8c..6a37dc05 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -20,7 +20,7 @@ class _MineItem extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w, 15.h), + margin: EdgeInsets.fromLTRB(16.w,0.h, 16.w,30.h), // padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/mine/mine_view/mine_navbar.dart b/lib/mine/mine_view/mine_navbar.dart new file mode 100644 index 00000000..4ebd8359 --- /dev/null +++ b/lib/mine/mine_view/mine_navbar.dart @@ -0,0 +1,301 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/login_tips_dialog.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../retrofit/data/social_info.dart'; +import '../../retrofit/data/user_info.dart'; + +class MineNavbar extends StatefulWidget { + final String couponNum; + final UserInfo userInfo; + final SocialInfo infoNumber; + final GestureTapCallback toIntegralPage; + + MineNavbar(this.couponNum,this.userInfo,this.infoNumber,this.toIntegralPage); + + @override + State createState() { + return _MineNavbar(); + } +} + +class _MineNavbar extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.fromLTRB(13.5.w, 15.h, 13.5.w,30.h), + padding: EdgeInsets.only( + top: 26.h, + bottom: 24.h, + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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/order_history_page', + arguments: {"status": 0}); + }); + }, + child: mineTopItem( + S.of(context).dingdan, + "assets/image/mine_order.webp", + ), + ), + ), + + ///钱包 + 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/mine_wallet'); + }); + }, + child: mineTopItem( + "钱包", + "assets/image/wallet.webp", + ), + ), + ), + + ///会员码 + 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/vip_pay_code'); + }); + }, + child: mineTopItem( + "会员码", + "assets/image/vip_code.webp", + ), + ), + ), + + ///设置 + 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/setting_page'); + }); + }, + child: mineTopItem( + S.of(context).shezhi, + "assets/image/set.webp", + ), + ), + ), + ], + ), + Container( + width: double.infinity, + margin: EdgeInsets.only(top:17.h,left: 16.w,right: 16.w,bottom: 27.h), + child: Flex( + children: List.generate(120, (_) { + return SizedBox( + width: 1, + height: 1, + child: DecoratedBox( + decoration: BoxDecoration(color: Color(0xFFEDEDED)), + ), + ); + }), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + direction: Axis.horizontal, + ), + ), + 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/coupon_page'); + }); + }, + child: mineBottomItem( + widget?.couponNum ?? "0", + S.of(context).youhuiquan, + ), + ), + ), + ///积分 + Expanded( + child: InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString("token") == null || + value.getString("token") == "") { + LoginTipsDialog().show(context); + return; + } + widget.toIntegralPage(); + }); + }, + child: mineBottomItem( + widget?.userInfo?.points?? "0", + "积分", + ), + ), + ), + ///关注 + 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/communityFollow',arguments: { + "status":0 + }); + });}, + child: mineBottomItem( + "${widget?.infoNumber?.follow ?? "0"}", + S.of(context).guanzhu, + ), + ), + ), + ///粉丝 + 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/communityFollow',arguments: { + "status":1 + }); + }); + }, + child: mineBottomItem( + "${widget?.infoNumber?.fans ?? "0"}", + S.of(context).fensi, + ), + ), + ), + ], + ) + ], + ), + ); + } + + ///导航栏条目 + Widget mineTopItem(text, icon) { + return Container( + color: Colors.white, + margin: EdgeInsets.symmetric(vertical: 6.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + icon, + width: 23, + height: 23, + ), + SizedBox( + height: 5.h, + ), + Text( + text, + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 12.sp, + color: Color(0xFF0D0D0D), + ), + ), + ], + ), + ); + } + + ///导航栏条目 + Widget mineBottomItem(textTop, text) { + return Container( + color: Colors.white, + margin: EdgeInsets.symmetric(vertical: 6.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + textTop, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 18.sp, + color: Color(0xFF000000), + ), + ), + SizedBox( + height:11.h, + ), + Text( + text, + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 12.sp, + color: Color(0xFF4D4D4D), + ), + ), + ], + ), + ); + } +} diff --git a/lib/mine/mine_view/mine_view.dart b/lib/mine/mine_view/mine_view.dart index 81f6fb5b..e0292ffe 100644 --- a/lib/mine/mine_view/mine_view.dart +++ b/lib/mine/mine_view/mine_view.dart @@ -3,12 +3,9 @@ import 'dart:convert'; 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:flutter_svg/svg.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/retrofit/data/msg_stats.dart'; import 'package:huixiang/retrofit/data/social_info.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -21,7 +18,9 @@ import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:webview_flutter/webview_flutter.dart'; + +import '../../retrofit/data/rank.dart'; +import '../../view_widget/mine_vip_entry.dart'; // import 'package:qrscan/qrscan.dart' as scanner; class MineView extends StatefulWidget { @@ -31,9 +30,10 @@ class MineView extends StatefulWidget { final Function messageZero; final int totalMsg; final SocialInfo infoNumber; + final List ranks; MineView(this.userInfo, this.toUserInfo, this.toIntegralPage, - this.messageZero, this.totalMsg, this.infoNumber); + this.messageZero, this.totalMsg, this.infoNumber,this.ranks); @override State createState() { @@ -43,6 +43,7 @@ class MineView extends StatefulWidget { class _MineView extends State { ApiService apiService; + String levelText = "普通用户"; ///核销用户优惠券 queryWiped(memberCouponId) async { @@ -136,21 +137,21 @@ class _MineView extends State { ), ), ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/setting_page'); - }, - child: Container( - padding: EdgeInsets.all(8.h), - margin: EdgeInsets.only(right: 12.w), - child: Image.asset( - "assets/image/icon_mine_setting.webp", - width: 32, - height: 32, - color: Colors.white, - ), - ), - ), + // InkWell( + // onTap: () { + // Navigator.of(context).pushNamed('/router/setting_page'); + // }, + // child: Container( + // padding: EdgeInsets.all(8.h), + // margin: EdgeInsets.only(right: 12.w), + // child: Image.asset( + // "assets/image/icon_mine_setting.webp", + // width: 32, + // height: 32, + // color: Colors.white, + // ), + // ), + // ), ], ), ), @@ -215,6 +216,7 @@ class _MineView extends State { ); return; } + String title = uri.queryParameters["title"]; if (result.toString().contains("http:") || result.toString().contains("https:")) { ///扫码跳转任意网页 @@ -222,6 +224,7 @@ class _MineView extends State { '/router/scan_web', arguments: { "result": result, + "title":title, }, ); } @@ -259,21 +262,21 @@ class _MineView extends State { MImage( widget.userInfo == null ? "" : widget.userInfo.headimg, isCircle: true, - width: 58, - height: 58, + width: 60, + height: 60, fit: BoxFit.cover, errorSrc: "assets/image/default_user.webp", fadeSrc: "assets/image/default_user.webp", ), - Positioned( - bottom: 0, - right: 2.w, - child: Image.asset( - "assets/image/icon_mine_edit.webp", - width: 17, - height: 17, - ), - ), + // Positioned( + // bottom: 0, + // right: 2.w, + // child: Image.asset( + // "assets/image/icon_mine_edit.webp", + // width: 17, + // height: 17, + // ), + // ), ], ), ), @@ -336,34 +339,35 @@ class _MineView extends State { color: Color(0xFFFFFFFF), ), ) - : Row( - children: [ - Text( - "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - fontFamily: 'JDZhengHT', - color: Color(0xFFFFFFFF), - ), - ), - Container( - width: 1.w, - height: 12.h, - margin: EdgeInsets.symmetric(horizontal: 3.w), - color: Color(0xFFFFFFFF), - ), - Text( - "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", - style: TextStyle( - fontSize: 12.sp, - fontFamily: 'JDZhengHT', - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), - ), - ), - ], - ), + : mineVip(), + // Row( + // children: [ + // Text( + // "${S.of(context).guanzhu} ${widget?.infoNumber?.follow ?? "0"}", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.regular, + // fontFamily: 'JDZhengHT', + // color: Color(0xFFFFFFFF), + // ), + // ), + // Container( + // width: 1.w, + // height: 12.h, + // margin: EdgeInsets.symmetric(horizontal: 3.w), + // color: Color(0xFFFFFFFF), + // ), + // Text( + // "${S.of(context).fensi} ${widget?.infoNumber?.fans ?? "0"}", + // style: TextStyle( + // fontSize: 12.sp, + // fontFamily: 'JDZhengHT', + // fontWeight: MyFontWeight.regular, + // color: Color(0xFFFFFFFF), + // ), + // ), + // ], + // ), ], ), ), @@ -421,4 +425,19 @@ class _MineView extends State { ), ); } + + Widget mineVip(){ + return Container( + child: MineVipEntry( + tag: "vip", + ranks: widget.ranks, + userInfo: widget.userInfo, + rank: double.tryParse(widget.userInfo?.expendAmount ?? "0") + .toInt(), + rankMax: widget.userInfo?.memberRankVo?.nextOrigin ?? 0, + createTime: widget.userInfo?.createTime ?? "", + ), + ); + + } } diff --git a/lib/mine/personal_page.dart b/lib/mine/personal_page.dart index bde4cf32..4d07ff91 100644 --- a/lib/mine/personal_page.dart +++ b/lib/mine/personal_page.dart @@ -320,330 +320,333 @@ class _PersonalPage extends State with WidgetsBindingObserver { @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( + return Scaffold( + backgroundColor: Colors.white, + body: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(), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: 248.h, - color: Color(0xFFFFFFFF), - // color: Colors.red, - child: Stack( - // alignment: Alignment.bottomLeft, - children: [ - Positioned( - top: 0, - left: 0, - bottom: 36.h, - 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.webp", - fadeSrc: "assets/image/default_1.webp", - ))), - 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.webp", - width: 24, - height: 24, - ), - onTap: () { - Navigator.of(context).pop(); - }, + scrollController: scrollController, + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 248.h, + color: Color(0xFFFFFFFF), + // color: Colors.red, + child: Stack( + // alignment: Alignment.bottomLeft, + children: [ + Positioned( + top: 0, + left: 0, + bottom: 36.h, + 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.webp", + fadeSrc: "assets/image/default_1.webp", + ))), + Container( + margin: EdgeInsets.only( + top: 50.h, left: 16.w, right: 16.w), + alignment: Alignment.topLeft, + decoration: BoxDecoration( + color: Colors.transparent, ), - ], - ), - ), - if (memberId == "0") - Positioned( - bottom: 9.h, - 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( - S.of(context).genghuanbeijing, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Image.asset( + "assets/image/integral_return.webp", + width: 24, + height: 24, + ), + onTap: () { + Navigator.of(context).pop(); + }, ), - ), + ], ), ), - ), - ], - ), - ), - homeInfo(), - ], - ), - ), - Container( - color: Color(0xFFFFFFFF), - margin: EdgeInsets.only(bottom: 30.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: - EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w), - 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.h), - )), - Icon( - (isShrink != null && !isShrink) - ? Icons.chevron_right - : Icons.keyboard_arrow_up, - color: Colors.black, - size: 18, - ), - ], - ), - )), - Container( - margin: EdgeInsets.only(left: 16.w, right: 16.w), - 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.h, - ), - 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.h, - ), - 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, - ), + if (memberId == "0") + Positioned( + bottom: 9.h, + 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), ), - SizedBox( - height: 4.h, - ), - Text( - S.of(context).dongtai, + child: Text( + S.of(context).genghuanbeijing, + overflow: TextOverflow.ellipsis, style: TextStyle( - color: Color(0xFF353535), fontSize: 12.sp, fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), ), ), - ], - )), - ), + ), + ), + ), + ], ), - Expanded( + ), + homeInfo(), + ], + ), + ), + Container( + color: Color(0xFFFFFFFF), + margin: EdgeInsets.only(bottom: 30.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 86.w, top: 12.h, right: 16.w), 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.h, - ), - Text( - S.of(context).huozan, + 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( - color: Color(0xFF353535), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - ], - )), - ), + fontSize: 12.sp, + color: Color(0xFF868686), + fontWeight: MyFontWeight.regular, + height: 1.5.h), + )), + Icon( + (isShrink != null && !isShrink) + ? Icons.chevron_right + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, + ), + ], + ), + )), + Container( + margin: EdgeInsets.only(left: 16.w, right: 16.w), + 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.h, + ), + 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.h, + ), + 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.h, + ), + Text( + S.of(context).dongtai, + 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.h, + ), + Text( + S.of(context).huozan, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + )), + ), + ), + ], ), - ], - ), - ), - Container( - margin: EdgeInsets.all(16), - height: 1.h, - color: Color(0xFFF7F7F7), + ), + Container( + margin: EdgeInsets.all(16), + height: 1.h, + color: Color(0xFFF7F7F7), + ), + Padding( + padding: EdgeInsets.only(left: 16.w), + child: Text( + memberId != "0" ? "TA的动态" : "我的动态", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + ), + )), + dynamicList(), + ], ), - Padding( - padding: EdgeInsets.only(left: 16.w), - child: Text( - memberId != "0" ? "TA的动态" : "我的动态", - style: TextStyle( - color: Color(0xFF353535), - fontSize: 15.sp, - fontWeight: MyFontWeight.semi_bold, - ), - )), - dynamicList(), - ], - ), - ), - ], - )), + ), + ], + )), + ) ); } @@ -670,7 +673,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { builder: (context) => PhotoViewGalleryScreen( images: [ (memberInfor?.headimg ?? "").isEmpty - ? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg" + ? "https://i.postimg.cc/Pq6vjfnw/default-1.webp" : memberInfor?.headimg ], //传入图片list index: 0, //传入当前点击的图片的index @@ -749,7 +752,7 @@ class _PersonalPage extends State with WidgetsBindingObserver { isShowBtn: false, text: "目前暂无发布动态,要把开心的事讲出来哦~", fontSize: 16.sp, - margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 75.h), + margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom:80.h), ) : ListView.builder( physics: NeverScrollableScrollPhysics(), diff --git a/lib/mine/scan_web.dart b/lib/mine/scan_web.dart index c54e6a66..b738be34 100644 --- a/lib/mine/scan_web.dart +++ b/lib/mine/scan_web.dart @@ -1,12 +1,8 @@ -import 'dart:io'; - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.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'; import 'package:webview_flutter/webview_flutter.dart'; class ScanWeb extends StatefulWidget { @@ -21,29 +17,42 @@ class ScanWeb extends StatefulWidget { class _ScanWeb extends State { var controller = new ScrollController(); + WebViewController webViewController; String result; + String title; @override void initState() { super.initState(); result = widget.arguments["result"]; + title = widget.arguments["title"]; EasyLoading.show(status: S.current.zhengzaijiazai); } @override Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(top:MediaQuery.of(context).padding.top), - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, - alignment: Alignment.center, - child: - WebView( - initialUrl:result, - javascriptMode: JavascriptMode.unrestricted, - onPageFinished: (initialUrl){ - EasyLoading.dismiss(); - }, - )); + return Scaffold( + appBar: MyAppBar( + title:title ?? "", + titleColor: Colors.black, + background: Colors.transparent, + leadingColor: Colors.black, + ), + body: + WebView( + initialUrl:result, + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: (WebViewController controller){ + webViewController =controller; + }, + onProgress: (int progress) async { + if(widget.arguments["title"] != null) + return; + title = await webViewController?.getTitle(); + setState((){}); + EasyLoading.dismiss(); + }, + ), + ); } } diff --git a/lib/mine/vip_pay_code.dart b/lib/mine/vip_pay_code.dart new file mode 100644 index 00000000..63f18fe4 --- /dev/null +++ b/lib/mine/vip_pay_code.dart @@ -0,0 +1,253 @@ +import 'dart:convert'; + +import 'package:barcode_widget/barcode_widget.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bmflocation/flutter_bmflocation.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/product.dart'; +import 'package:huixiang/retrofit/data/vip_card.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/store/scan.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/location.dart'; +import 'package:huixiang/utils/painter_bg.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:qr_flutter/qr_flutter.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../retrofit/data/user_info.dart'; +import '../view_widget/classic_header.dart'; + +class VipPayCode extends StatefulWidget { + @override + State createState() { + return _VipPayCode(); + } +} + +class _VipPayCode extends State { + ApiService apiService; + + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + Location.getInstance().stopLocation(); + } + + @override + void initState() { + super.initState(); + queryUser(); + } + + UserInfo userInfo; + final RefreshController refreshController = RefreshController(); + bool vipCodeText = false; + + ///查询用户信息 + queryUser() async { + try{ + SharedPreferences value = await SharedPreferences.getInstance(); + if (apiService == null) + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + BaseData baseData = + await apiService.queryInfo().catchError((onError) { + refreshController.refreshFailed();}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + setState(() {}); + SharedPreferences.getInstance().then((value) => { + value.setString('user', jsonEncode(baseData.data)), + }); + refreshController.refreshCompleted(); + }else{ + refreshController.refreshFailed(); + } + }finally{ + setState((){}); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppBar( + title: "会员码", + background: Colors.white, + titleColor: Colors.black, + brightness: Brightness.dark, + leadingColor: Colors.black, + ), + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + onRefresh: () { + queryUser(); + }, + child: SingleChildScrollView( + child: Container( + color: Colors.white, + padding: EdgeInsets.only(top: 45.h), + child: Stack( + alignment: Alignment.topCenter, + children: [ + Container( + padding: EdgeInsets.only(top: 50.h), + child: Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 14.w), + padding: EdgeInsets.only(top: 68.h, bottom: 16.h), + decoration: BoxDecoration( + color: Color(0xFF32A060), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(6), + ), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(6), + ), + margin: EdgeInsets.symmetric(horizontal: 16.w), + padding: EdgeInsets.only( + top: 46.h, left:16.w, right: 15.w, bottom: 79.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: (){ + setState(() { + vipCodeText = !vipCodeText; + }); + }, + child: + vipCodeText ? Text( + userInfo != null + ? "${(userInfo?.vipNo ?? "").substring(0, 4)} " + "${(userInfo?.vipNo ?? "").substring(4, 8)} " + "${(userInfo?.vipNo ?? "").substring(8, 12)} " + "${(userInfo?.vipNo ?? "").substring(12, 16)} " + "${(userInfo?.vipNo ?? "").substring(16, (userInfo?.vipNo ?? "").length)}" + : "", + style: TextStyle( + fontSize: 14.sp, + wordSpacing: userInfo == null + ? 10 + : (MediaQuery.of(context).size.width - 64.w) / + ((((userInfo?.vipNo ?? "") + .length) * + 4)), + letterSpacing: userInfo == null + ? 8 + : (MediaQuery.of(context).size.width - 64.w) / + ((((userInfo?.vipNo ?? "") + .length) * + 4)), + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), + ), + ) + :Text( + "轻触可查看会员码数字", + style: TextStyle( + fontWeight: MyFontWeight.medium, + fontSize: 13.sp, + color: Color(0xFFCACACA), + ), + ), + ), + SizedBox( + height: 12.h, + ), + BarcodeWidget( + barcode: Barcode.code128(useCode128C: true), + data: + userInfo != null ? userInfo?.vipNo : "", + height: 72.h, + color: Colors.black, + drawText: false, + ), + SizedBox( + height: 16.h, + ), + QrImage( + data: userInfo != null + ? (userInfo?.vipNo ?? "") + : "", + version: QrVersions.auto, + size: 200.w, + gapless: true, + ), + ], + ), + ), + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(56), + color: Colors.white, + border: Border.all( + color: Colors.white, + width: 8.w, + ), + ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(56), + color: Colors.white, + border: Border.all( + color: Color(0xFF32A060), + width: 2.w, + ), + ), + child: MImage( + userInfo?.headimg ?? "", + width: 80, + height: 80, + radius: BorderRadius.circular(56), + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index d65341fa..2d348dba 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -878,7 +878,7 @@ class _ExchangeOrderPage extends State { width: 10, ), Text( - S.of(context).pingtaiyue, + S.of(context).huixiangqianbao, style: TextStyle( fontSize: 14.sp, color: Color(0xff353535), diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 260099c0..eb37b90a 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -225,7 +225,7 @@ class _OrderDetailPage extends State { payResult(BaseData baseData) async{ await queryDetails(); - Future.delayed(Duration(milliseconds: 400), () { + Future.delayed(Duration(milliseconds: 800), () { EasyLoading.dismiss(); SmartDialog.showToast(baseData?.msg == "ok" ?"订单支付成功" :baseData?.msg,alignment: Alignment.center); }); diff --git a/lib/qr/qr_code_scan.dart b/lib/qr/qr_code_scan.dart index c575652d..9376b6a1 100644 --- a/lib/qr/qr_code_scan.dart +++ b/lib/qr/qr_code_scan.dart @@ -57,31 +57,81 @@ class _QrCodeScanPage extends State { right: 0, ), Positioned( - child: MyAppBar( - title: "扫码", - titleColor: Colors.white, - leadingColor: Colors.white, - brightness: Brightness.dark, - background: Colors.transparent, - action: Container( - alignment: Alignment.center, - margin: EdgeInsets.only(right: 16.w), - child: GestureDetector( - onTap: () { - pickImage(); - }, - child: Text( - S.of(context).xiangce, + child: Container( + margin: EdgeInsets.only(left:12.w,right: 16.w,top: 16.h), + child:Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pop(); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal:10.w), + alignment: Alignment.centerLeft, + child: Image.asset( + "assets/image/return_left.webp", + fit: BoxFit.fill, + color: Colors.white, + ), + ), + ), + Spacer(), + Expanded(child:Text( + S.of(context).saoma, style: TextStyle( - color: Colors.black, + color: Colors.white, fontSize: 18.sp, fontWeight: FontWeight.bold, ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + pickImage(); + }, + child:Container( + padding: EdgeInsets.symmetric(horizontal:10.w), + child: Text( + S.of(context).xiangce, + style: TextStyle( + color: Colors.black, + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ), ), - ), + ], ), ), - top: 0, + // MyAppBar( + // title: "扫码", + // titleColor: Colors.white, + // leadingColor: Colors.white, + // brightness: Brightness.dark, + // background: Colors.transparent, + // action: Container( + // alignment: Alignment.center, + // margin: EdgeInsets.only(right: 16.w), + // child: GestureDetector( + // onTap: () { + // pickImage(); + // }, + // child: Text( + // S.of(context).xiangce, + // style: TextStyle( + // color: Colors.black, + // fontSize: 18.sp, + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // ), + // ), + top:MediaQuery.of(context).padding.top, left: 0, right: 0, ), diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 1308a39d..f7e60731 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "https://pos.api.lotus-wallet.com/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index c1b9a541..06429ed5 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/setting/logout_ing.dart b/lib/setting/logout_ing.dart index 243f784d..f097aea4 100644 --- a/lib/setting/logout_ing.dart +++ b/lib/setting/logout_ing.dart @@ -422,7 +422,7 @@ class _LogoutIng extends State { Padding( padding: EdgeInsets.only(bottom: 13), child: Text( - (balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的平台余额及店铺余额未使用完!", + (balance == "0.00" && money == "0.00") ? "由于当于帐号已注销,系统将自动退出登录":"您的回乡钱包余额及门店余额未使用完!", textAlign: TextAlign.center, style: TextStyle( fontSize: 16.sp, @@ -434,7 +434,7 @@ class _LogoutIng extends State { ), if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") Text( - "${S.of(context).pingtaiyue}:¥ $money", + "${S.of(context).huixiangqianbao}:¥ $money", textAlign: TextAlign.center, style: TextStyle( fontSize: 16.sp, @@ -444,7 +444,7 @@ class _LogoutIng extends State { ), if(balance != "0.00" && money != "0.00" || balance != "0.00" || money != "0.00") Text( - "${S.of(context).dianpuyue}:¥ $balance", + "${S.of(context).mendianyue}:¥ $balance", textAlign: TextAlign.center, style: TextStyle( fontSize: 16.sp, diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 463b5186..830c108f 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -82,7 +82,7 @@ class _Settlement extends State { int count1 = 0; String productId; bool orderButton = false; - bool useVipPriceSelect = false; + bool useVipPriceSelect = true; bool showVipTips = false; bool isRaiseChannel = false; diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index ece002da..73a5caa6 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -47,7 +47,7 @@ class ActivityCouponRemarks extends StatefulWidget { } class _ActivityCouponRemarks extends State { - bool vipSelect = false; + bool vipSelect = true; @override Widget build(BuildContext context) { @@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ - if(!(widget?.settleOrderInfo?.isRaise ?? false)) + if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false)) Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index 552dbd9e..fa7a2ee1 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -105,7 +105,7 @@ class _SettlementOrderCommodity extends State { ); } - if(widget.useVipPriceSelect ){ + if(widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (!widget.settleOrderInfo.isRaise) && (widget?.settleOrderInfo?.discountAmount!= "0")){ widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); } diff --git a/lib/view_widget/mine_vip_entry.dart b/lib/view_widget/mine_vip_entry.dart index 88f3edd3..2c6ae5a0 100644 --- a/lib/view_widget/mine_vip_entry.dart +++ b/lib/view_widget/mine_vip_entry.dart @@ -32,6 +32,9 @@ class MineVipEntry extends StatelessWidget { String topLeft = ""; String levelText = "普通用户"; + Color logoColor = Color(0xFFCACACA); + Color levelTextColor = Color(0xFFCACACA); + Color levelTextBackdrop = Color(0xFFFFF8EC); @override Widget build(BuildContext context) { @@ -54,109 +57,184 @@ class MineVipEntry extends StatelessWidget { case 1: { levelText = "${S.of(context).yinkahuiyuan}"; + logoColor = Color(0xFFA0C4E7); + levelTextColor = Color(0xFF61ABF3); + levelTextBackdrop = Color(0xFFC1DBF4); break; } case 2: { levelText = "${S.of(context).jinkahuiyuan}"; + logoColor = Color(0xFFFBB43A); + levelTextColor = Color(0xFFFBB43A); + levelTextBackdrop = Color(0xFFFFECD2); break; } case 3: { levelText = "${S.of(context).gongchuanghuiyuan}"; + logoColor = Color(0xFF352822); + levelTextColor = Color(0xFF92755D); + levelTextBackdrop = Color(0xFFFFECD2); break; } } Widget widget = Container( - width: double.infinity, - padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), - margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), - decoration: BoxDecoration( - color: Color(0xFF3D3D5D), - borderRadius: BorderRadius.circular(6), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ) - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Image.asset( - "assets/image/vip_logo.webp", - width: 24, - height: 24, - ), - SizedBox( - width: 5.w, + child: Row( + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal:4.w,vertical: 3.h), + decoration: BoxDecoration( + color: logoColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + bottomLeft: Radius.circular(4),), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, ), - Expanded( - child: Text( - levelText, - style: TextStyle( - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFFFEAD2)), - )), - Container( - padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), - decoration: BoxDecoration( - color: Color(0xFFFFECD2), - borderRadius: BorderRadius.circular(10), - ), - child: Text( - S.of(context).chakanquanyi, - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF92755D), - ), - ), - ) ], ), - SizedBox( - height: 16.h, + child: Image.asset( + "assets/image/mine_vip_logo.webp", + fit: BoxFit.cover, + width: 13.w, + height: 11.h, ), - Container( - height: 4.h, - child: ClipRRect( - borderRadius: BorderRadius.circular(6.5), - child: LinearProgressIndicator( - value: rankMax > (rank ?? 0) - ? ((vipLevel < curLevel) - ? rankMax / rankMax - : (rank ?? 0) / rankMax) - : 0, - backgroundColor: Color(0xFF222233), - color: Color(0xFFFFECD2), + ), + Container( + padding: EdgeInsets.symmetric(horizontal:2.w,vertical:3.h), + decoration: BoxDecoration( + color: levelTextBackdrop, + borderRadius: BorderRadius.only( + topRight: Radius.circular(4), + bottomRight: Radius.circular(4),), + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, ), - ), + ], ), - SizedBox( - height: 8.h, + child:Row( + children: [ + Text( + levelText, + textAlign: TextAlign.center, + style: TextStyle( + color: levelTextColor, + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + ), + ), + Image.asset( + "assets/image/icon_right.webp", + fit: BoxFit.cover, + width: 8.w, + height: 8.h, + color: levelTextColor, + ), + ], ), - Text( - rank > rankMax - ? S.of(context).dangqiandengji - : "消费金额¥${rank.toStringAsFixed(2).toString()} 距${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}", - style: TextStyle( - color: Color(0xFFFFEAD2), - fontWeight: MyFontWeight.light, - fontFamily: 'JDZhengHT', - fontSize: 14.sp, - ), - ) - ], - )); + ) + ], + ), + ); + // Container( + // width: double.infinity, + // padding: EdgeInsets.only(top: 12.h, bottom: 22.h, left: 12.w, right: 12.w), + // margin: EdgeInsets.only(top: 23.h,left: 13.5.w,right: 13.5.w,bottom:15.h), + // decoration: BoxDecoration( + // color: Color(0xFF3D3D5D), + // borderRadius: BorderRadius.circular(6), + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withAlpha(12), + // offset: Offset(0, 3), + // blurRadius: 14, + // spreadRadius: 0, + // ) + // ], + // ), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // children: [ + // Image.asset( + // "assets/image/vip_logo.webp", + // width: 24, + // height: 24, + // ), + // SizedBox( + // width: 5.w, + // ), + // Expanded( + // child: Text( + // levelText, + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFFFFEAD2)), + // )), + // Container( + // padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + // decoration: BoxDecoration( + // color: Color(0xFFFFECD2), + // borderRadius: BorderRadius.circular(10), + // ), + // child: Text( + // S.of(context).chakanquanyi, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFF92755D), + // ), + // ), + // ) + // ], + // ), + // SizedBox( + // height: 16.h, + // ), + // Container( + // height: 4.h, + // child: ClipRRect( + // borderRadius: BorderRadius.circular(6.5), + // child: LinearProgressIndicator( + // value: rankMax > (rank ?? 0) + // ? ((vipLevel < curLevel) + // ? rankMax / rankMax + // : (rank ?? 0) / rankMax) + // : 0, + // backgroundColor: Color(0xFF222233), + // color: Color(0xFFFFECD2), + // ), + // ), + // ), + // SizedBox( + // height: 8.h, + // ), + // Text( + // rank > rankMax + // ? S.of(context).dangqiandengji + // : "消费金额¥${rank.toStringAsFixed(2).toString()} 距${S.of(context).xiayidengji}还需¥${(rankMax - (rank ?? 0)).toStringAsFixed(2)}", + // style: TextStyle( + // color: Color(0xFFFFEAD2), + // fontWeight: MyFontWeight.light, + // fontFamily: 'JDZhengHT', + // fontSize: 14.sp, + // ), + // ) + // ], + // )); return GestureDetector( onTap: () { diff --git a/lib/view_widget/update_dialog.dart b/lib/view_widget/update_dialog.dart index 8c951cf1..2aaad41d 100644 --- a/lib/view_widget/update_dialog.dart +++ b/lib/view_widget/update_dialog.dart @@ -43,17 +43,12 @@ class _UpdateDialog extends State { alignment: Alignment.bottomCenter, children: [ Container( - // height: 100.h, decoration: BoxDecoration( color: Colors.white, border: Border.all( color: Colors.white, width: 0, style: BorderStyle.solid), - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(8.r), - // topRight: Radius.circular(8.r), - // ), ), ), Image.asset( diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index b7b05e97..74fd97ff 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -717,7 +717,8 @@ class _VipTop extends State { topLeft: const Radius.circular(8.0), topRight: const Radius.circular(8.0))), child: Container( - height: 230.h, + // height: 230.h, + height: 160.h, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 9a6ef32b..aa53cb2a 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -51,11 +51,17 @@ class _WebPage extends State with WidgetsBindingObserver { final GlobalKey inputKey = GlobalKey(); final ScrollController scrollController = ScrollController(); final TextEditingController commentTextController = TextEditingController(); + bool emojiShowing = false; + static double keyboard_height=300; + double keyboard = -1; + bool needShowSmiley = false; + bool needHideSmiley = false; @override void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); + commentFocus.addListener(_focusNodeListener); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); queryHtml(); @@ -69,6 +75,7 @@ class _WebPage extends State with WidgetsBindingObserver { if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); + if(!emojiShowing) setState(() { hintText = S.current.liuxianinjingcaidepinglunba; isKeyBoardShow = false; @@ -80,11 +87,50 @@ class _WebPage extends State with WidgetsBindingObserver { }); } }); + if (needShowSmiley && window.viewInsets.bottom <= 0.1) { + needShowSmiley = false; + setState(() { + emojiShowing = true; + }); + } + if(needHideSmiley && window.viewInsets.bottom > 0.1) { + needHideSmiley = false; + setState(() { + emojiShowing = false; + }); + } + } + + void _focusNodeListener() { + /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ + setState(() { + smileyPadGone = true; + }); + }*/ + } + + _onTextFieldTap() { + if(emojiShowing) { + needHideSmiley = true; + } + } + + _onSmileyTap() { + if(!emojiShowing && commentFocus.hasFocus && isKeyBoardShow) { + needShowSmiley = true; + commentFocus.unfocus(); + } else { + setState(() { + emojiShowing = !emojiShowing; + isKeyBoardShow = emojiShowing; + }); + } } @override - void dispose() { + void dispose(){ WidgetsBinding.instance.removeObserver(this); + commentFocus.removeListener(_focusNodeListener); super.dispose(); } @@ -218,10 +264,20 @@ class _WebPage extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { + double h = MediaQuery.of(context).viewInsets.bottom; + if(h > 0 && keyboard <= 0) { + setState(() { + keyboard = h; + }); + } return GestureDetector( behavior: HitTestBehavior.translucent, onTap: () { - FocusScope.of(context).requestFocus(FocusNode()); + setState(() { + emojiShowing = false; + isKeyBoardShow = emojiShowing; + FocusScope.of(context).requestFocus(FocusNode()); + }); }, child:Scaffold( appBar: MyAppBar( @@ -307,9 +363,14 @@ class _WebPage extends State with WidgetsBindingObserver { inputKey, hintText, isKeyBoardShow, + keyboard_height, + keyboard, + emojiShowing, commentFocus, commentTextController, _toComment, + _onSmileyTap, + _onTextFieldTap, _queryMemberComment, _queryInformationLikes, activity: activity, diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart index d89346f4..ad9d7513 100644 --- a/lib/web/web_view/input_comment.dart +++ b/lib/web/web_view/input_comment.dart @@ -4,33 +4,47 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:like_button/like_button.dart'; +import 'dart:io'; + +import 'package:emoji_picker_flutter/emoji_picker_flutter.dart'; class InputComment extends StatefulWidget { final String hintText; final Activity activity; final Article article; final bool isKeyBoardShow; + final double keyboard_height; + final double keyboard; + final bool emojiShowing; final FocusNode commentFocus; final Function toComment; + final Function onSmileyTap; + final Function onTextFieldTap; final Function(String text) queryMemberComment; final Function() queryInformationLikes; final TextEditingController commentTextController; final bool isLike; + final Function(bool emojiShow) emojiShowFunction; InputComment( Key key, this.hintText, this.isKeyBoardShow, + this.keyboard_height, + this.keyboard, + this.emojiShowing, this.commentFocus, this.commentTextController, this.toComment, + this.onSmileyTap, + this.onTextFieldTap, this.queryMemberComment, this.queryInformationLikes, { this.activity, this.article, - this.isLike - + this.isLike, + this.emojiShowFunction } ) : super(key: key); @@ -41,11 +55,12 @@ class InputComment extends StatefulWidget { } class _InputComment extends State { + bool emojiShowing = false; @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.all(16), + padding: EdgeInsets.only(top: 16.h,), decoration: BoxDecoration( color: Colors.white, boxShadow: [ @@ -60,134 +75,188 @@ class _InputComment extends State { top: Radius.circular(8), ), ), - child: Row( + child: Column( children: [ - Expanded( - flex: 1, - child: Container( - decoration: BoxDecoration( - color: Color(0xffF2F2F2), - borderRadius: BorderRadius.circular(2.0), + Row( + children: [ + IconButton( + onPressed: () { + widget.onSmileyTap(); + }, + icon: Icon( + Icons.emoji_emotions, + color: Color(0xFF868686), + ), ), - child: Container( - margin: EdgeInsets.symmetric(horizontal: 4.w), - alignment: Alignment.topLeft, - child: TextField( - textInputAction:TextInputAction.send, - onEditingComplete: () { + Expanded( + flex: 1, + child: Container( + decoration: BoxDecoration( + color: Color(0xffF2F2F2), + borderRadius: BorderRadius.circular(2.0), + ), + child: Container( + margin: EdgeInsets.symmetric(horizontal: 4.w), + alignment: Alignment.topLeft, + child: TextField( + textInputAction:TextInputAction.send, + onTap: (){ + widget.onTextFieldTap(); + }, + onEditingComplete: () { + var commentText = widget.commentTextController.text; + if (commentText.trim() == "") { + return; + } + widget.queryMemberComment(commentText); + }, + maxLines: 8, + minLines: 1, + focusNode: widget.commentFocus, + controller: widget.commentTextController, + decoration: InputDecoration( + border: InputBorder.none, + hintText: widget.hintText, + hintStyle: TextStyle( + fontSize: 14.sp, + color: Color(0xFF868686), + ), + ), + ), + ), + ), + ), + if (widget.isKeyBoardShow) + GestureDetector( + onTap: () { var commentText = widget.commentTextController.text; if (commentText.trim() == "") { return; } widget.queryMemberComment(commentText); }, - maxLines: 8, - minLines: 1, - focusNode: widget.commentFocus, - controller: widget.commentTextController, - decoration: InputDecoration( - border: InputBorder.none, - hintText: widget.hintText, - hintStyle: TextStyle( - fontSize: 14.sp, - color: Color(0xFF868686), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 20.w), + child: Text( + S.of(context).fasong, + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0XFF1A1A1A), + ), ), ), ), - ), - ), - ), - if (widget.isKeyBoardShow) - GestureDetector( - onTap: () { - var commentText = widget.commentTextController.text; - if (commentText.trim() == "") { - return; - } - widget.queryMemberComment(commentText); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 20.w), - child: Text( - S.of(context).fasong, - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0XFF1A1A1A), - ), - ), - ), - ), - if (!widget.isKeyBoardShow) - InkWell( - onTap: widget.toComment, - child: Tooltip( - message: S.of(context).daopinglunliebiaodingbu, - child: Container( - padding: EdgeInsets.only(left: 20.w, right: 10.w), - child: Image.asset( - "assets/image/icon_comment.webp", - width: 24, - height: 24, + if (!widget.isKeyBoardShow) + InkWell( + onTap: widget.toComment, + child: Tooltip( + message: S.of(context).daopinglunliebiaodingbu, + child: Container( + padding: EdgeInsets.only(left: 20.w, right: 10.w), + child: Image.asset( + "assets/image/icon_comment.webp", + width: 24, + height: 24, + ), + ), ), ), - ), - ), - if (!widget.isKeyBoardShow) - Tooltip( - message: S.of(context).dianzanxihuan_(widget.activity == null ? S.of(context).wenzhang : S.of(context).huodong), - child: LikeButton( - padding: EdgeInsets.all(10), - size: 24, - circleSize: 24, - circleColor: CircleColor( - start: Color(0xff00ddff), - end: Color(0xff0099cc), - ), - bubblesColor: BubblesColor( - dotPrimaryColor: Color(0xff33b5e5), - dotSecondaryColor: Color(0xff0099cc), - ), - bubblesSize: 24, - likeBuilder: (bool isLiked) { - return isLiked - ? Image.asset( - "assets/image/icon_like.webp", - width: 24, - height: 24, - ) - : Image.asset( - "assets/image/icon_like_h.webp", - width: 24, - height: 24, - ); - }, - isLiked: (widget.activity != null - ? widget.activity.liked - : widget.article != null + if (!widget.isKeyBoardShow) + Tooltip( + message: S.of(context).dianzanxihuan_(widget.activity == null ? S.of(context).wenzhang : S.of(context).huodong), + child: LikeButton( + padding: EdgeInsets.all(10), + size: 24, + circleSize: 24, + circleColor: CircleColor( + start: Color(0xff00ddff), + end: Color(0xff0099cc), + ), + bubblesColor: BubblesColor( + dotPrimaryColor: Color(0xff33b5e5), + dotSecondaryColor: Color(0xff0099cc), + ), + bubblesSize: 24, + likeBuilder: (bool isLiked) { + return isLiked + ? Image.asset( + "assets/image/icon_like.webp", + width: 24, + height: 24, + ) + : Image.asset( + "assets/image/icon_like_h.webp", + width: 24, + height: 24, + ); + }, + isLiked: (widget.activity != null + ? widget.activity.liked + : widget.article != null ? widget.article.liked : widget.isLike??false), - onTap: (isLiked) async { - await widget.queryInformationLikes(); - return (widget.activity != null - ? widget.activity.liked - : widget.article != null + onTap: (isLiked) async { + await widget.queryInformationLikes(); + return (widget.activity != null + ? widget.activity.liked + : widget.article != null ? widget.article.liked : widget.isLike??false); - }, - countBuilder: (int count, bool isLiked, String text) { - return Text( - text, - style: TextStyle( - color: Color(0xFF1A1A1A), - fontSize: 12.sp, + }, + countBuilder: (int count, bool isLiked, String text) { + return Text( + text, + style: TextStyle( + color: Color(0xFF1A1A1A), + fontSize: 12.sp, + ), + ); + }, + ), + ), + ], + ), + SizedBox(height: 16.h,), + Offstage( + offstage: !widget.emojiShowing, + child: SizedBox( + height: 250.h, + child: + EmojiPicker( + textEditingController: widget.commentTextController, + config: Config( + columns: 7, + emojiSizeMax: 32 * (Platform.isIOS ? 1.30 : 1.0), + verticalSpacing: 0, + horizontalSpacing: 0, + gridPadding: EdgeInsets.zero, + initCategory: Category.RECENT, + bgColor: const Color(0xFFF2F2F2), + // indicatorColor: Colors.blue, + iconColor: Colors.grey, + iconColorSelected: Colors.blue, + backspaceColor: Colors.blue, + skinToneDialogBgColor: Colors.white, + skinToneIndicatorColor: Colors.grey, + enableSkinTones: true, + showRecentsTab: true, + recentsLimit: 28, + replaceEmojiOnLimitExceed: false, + noRecents:Text( + "最近使用", + style: TextStyle(fontSize: 20, color: Colors.black26), + textAlign: TextAlign.center, ), - ); - }, - ), - ), + loadingIndicator: const SizedBox.shrink(), + tabIndicatorAnimDuration: kTabScrollDuration, + categoryIcons: const CategoryIcons(), + buttonMode: ButtonMode.MATERIAL, + checkPlatformCompatibility: true, + ), + )), + ), ], ), ); - } -} + }} diff --git a/pubspec.yaml b/pubspec.yaml index 0afefa75..95525547 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.1.9+39 +version: 3.2.0+41 environment: sdk: ">=2.7.0 <3.0.0" @@ -101,6 +101,8 @@ dependencies: flutter_slidable: ^1.3.0 + emoji_picker_flutter: ^1.4.1 + dev_dependencies: flutter_test: sdk: flutter From f82f61f33818f77f4d16b739721c060e17b67560 Mon Sep 17 00:00:00 2001 From: fmk Date: Mon, 6 Feb 2023 14:29:54 +0800 Subject: [PATCH 08/12] ios --- ios/Podfile.lock | 2 +- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ ios/Runner/Info.plist | 1 - pubspec.lock | 24 ++++++++++++------------ 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 778797f1..8c172f6e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -325,7 +325,7 @@ SPEC CHECKSUMS: AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce BaiduMapKit: f227cfb43581e91466fb4f1344f655eab5788777 BMKLocationKit: 688d8e1194980b96fc9a6585c0eb42e62fbaf780 - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a flutter_baidu_mapapi_base: cb406be78c3a949fb58a45dc6627f139d580bd37 flutter_baidu_mapapi_map: 81c4e6e93dc668e311d9b521421deaf292390434 flutter_baidu_mapapi_search: 13a360334e91abea0bcf820546b2ef4548e42e08 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e9017843..e5bec9b7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -617,7 +617,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -667,7 +667,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.9; + MARKETING_VERSION = 3.2.1; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -819,7 +819,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -869,7 +869,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.9; + MARKETING_VERSION = 3.2.1; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -912,7 +912,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -962,7 +962,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.1.9; + MARKETING_VERSION = 3.2.1; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 4887210d..3deca04c 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -144,7 +144,6 @@ UIBackgroundModes - location remote-notification UILaunchStoryboardName diff --git a/pubspec.lock b/pubspec.lock index a8db37df..661bac50 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.9.0" + version: "2.8.2" barcode: dependency: transitive description: @@ -56,7 +56,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" charcode: dependency: transitive description: @@ -84,7 +84,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" collection: dependency: transitive description: @@ -126,7 +126,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.0" ffi: dependency: transitive description: @@ -391,21 +391,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.12" + version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.4" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.7.0" nested: dependency: transitive description: @@ -447,7 +447,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.8.1" path_drawing: dependency: transitive description: @@ -690,7 +690,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -711,7 +711,7 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" table_calendar: dependency: "direct main" description: @@ -725,14 +725,14 @@ packages: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.12" + version: "0.4.9" thumbnails: dependency: "direct main" description: From a63a15f9e3d8bef6f858a5c22f0889ab27159e0b Mon Sep 17 00:00:00 2001 From: fmk Date: Tue, 14 Feb 2023 18:40:43 +0800 Subject: [PATCH 09/12] =?UTF-8?q?ios=EF=BC=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/write_off_bg.webp | Bin 0 -> 17189 bytes assets/image/3x/write_off_bg.webp | Bin 0 -> 35157 bytes assets/image/write_off_bg.webp | Bin 0 -> 5226 bytes ios/Podfile | 10 + ios/Podfile.lock | 8 +- ios/Runner.xcodeproj/project.pbxproj | 6 +- lib/community/community_child_page.dart | 1 - lib/community/community_details.dart | 11 +- lib/community/community_page.dart | 1 + .../community_view/class_details_video.dart | 6 +- lib/community/community_view/home_class.dart | 2 +- lib/community/new_community_details.dart | 2 +- lib/home/home_page.dart | 4 +- lib/main.dart | 2 +- lib/mine/vip_pay_code.dart | 251 +++--- lib/order/write_off_page.dart | 715 ++++++++++++------ lib/retrofit/data/user_info.dart | 3 + lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 4 +- lib/retrofit/retrofit_api.g.dart | 2 +- lib/view_widget/mine_vip_entry.dart | 16 +- lib/view_widget/my_appbar.dart | 4 +- lib/vip/vip_view/vip_top.dart | 5 +- lib/web/web_page.dart | 2 +- lib/web/web_view/input_comment.dart | 7 +- pubspec.lock | 7 + 26 files changed, 647 insertions(+), 424 deletions(-) create mode 100644 assets/image/2x/write_off_bg.webp create mode 100644 assets/image/3x/write_off_bg.webp create mode 100644 assets/image/write_off_bg.webp diff --git a/assets/image/2x/write_off_bg.webp b/assets/image/2x/write_off_bg.webp new file mode 100644 index 0000000000000000000000000000000000000000..e79aaf50e158f07c3c2a679ed0442fac4bc1cedb GIT binary patch literal 17189 zcmeHP`&Uy}77ig`L@`km(^d)iLMuqoK|n+z-~+MhfH#ReLNrd}sxMkhQRI=J^|6XF zGhK`iP*g^dn*hNVnwSTmWV8;*v^U^jBpNZ2@DSxDl#no?RZX+H z2n1h3Tt77*20!=2wt%>rZ!g`5CVju-neb+jXk**-#EskiR{oH8kbf@Z zBV$uesll#`C>8Bp-n5Lr$~Zl3N#FAblTh`hq#QQMAweFbON8>0A^w!Xb~~R$rus63 z1Q%lF9d#!>6ay*Jp#2b{Iu%^yb9Co(Q`GqkM=BJV3Q<@{$8(d)s`C2ve&-LvglY|h zCPAq*-msN#w}yIZ!;RkMBPq~k2uYnV7-RRx&6D=A^xwl-mtn_W3ToDLrwtE@>tr_A z6eKq7uC@6O^-UbZK_btJ*4IL)LS;d;DzejJ)K)}g%QpF)wR;oC?1^$ncbe}x3^YU3 z{_NKyZsw8?DUc$NY5mG_7&m00wp~G!c?I#U9fK;aF6Rq0Dtj`Q!ci4DyZehF?zd`7 zzi@xb$VT(2x}o7-xr<~l=KktYI(}`Zi+bb}R^E(E4`gT3-3Eg?Jh}8l)fv3~vf83^ zb>!N1sZp+d8)Q#^N!KsJK)MiZ9>Zpup|r8rpKULsdq}IxJ2qp+rEIQEDM@R~M{N)~ z^hy)C4r^gJVZ|g%9k*bg2J2LbZp;TFbSU(Wgu6 z|MLmXxF<2MEnl#FWp~^-pm-9=JZ)_uPW6F_WbKk|ebX?P227<&;%Sl57?h{;ecAGz zig@f=8q1I_**-uX<44FiBjon{9bJN5tEait$&R+n#X+PJ^KZv%<@hxK02lxa00sa9 zfC0e3{{aJ{8pTrM%0$SiJyW2ZdvI?hY!iQJ8?mjyGzH^Qvi@sG0YQCCsr`p;YqIRj zG3@Go?>6O?A+#YoR9I}kea79qB&oE+E)*F)-oFgJSO)Ve?NhVG)$JlXQfkGxAKUS2>vLS|-ivC?q`zx0i{_qI|uu z$d$RBMx$i!_g2c98*G?|%4UXXJG74}Q^JN^m%5CBaSq6n!Ht_`j=yU24ulv7%C^au z8&k*3Gft~(94(S|D_7@uS(Jt=dw-VxJ)@e+uarFaAKVKW7h$*%HXZnF``rYHuc6VaFG?1(b25cU z@q3>!tiEabN5PHXi8U!cPXAWrzNIHua*FWK=qH|W&NhBT7HiXgr%IYx$d8MU4|wCG z*G#?pS>wSkI&Z~0Y5W<1vs7?zQuse>@yI%TO6?B`nrVhi@dA!Bf(nV*TOcFT(>NQC zPu`;R3b>bpwg~6ftuQ`!j+(VlWO_iH=jWK4q)DUGKzcz<&O9|kuXY>ulI53P>Htff=mwJDDb+Q;cl(C>gQbQl*`9-pGs@tJ98u+Zxe+mV2I zvWVEOarFuB<|k2RNaTI)@8U<)Uv~N^uz5DDh1eeTVCcnmETZe}8hN&#|m z)xx}R%(>3lk|O0?hmHG;;>rmg+SKc-WHu3jzv7w|A5!YsbEWoJ$>^NAx*lCN%AB)% z*I}P3_{Yr2msJaKdX0YRS7DAAZq?BGUUXCLdpiRoh>29__z9{6$jU_QP^Y+}R09ux zgm<)^mD&NrR@h{PZs)u~O*F%1UQ_tbSQL|~>t|3U6~)2hBPYbA&P2sMcEydfdmw8v zo=y9*b$F)CxFzJC;uOBbZzhR9!RAHk32&;T#T+~fLoehCTyaz_#Qcz~$YXP{kfloY zVcuo>(v57@>7dzD~A7VJ8Mt#wd8 z0E#3)B?wk>18RCe;S#9M0wrjm&JGk4{vH*RjcY#xXBNPj1#o78Ayk7i3%~1`g##-P uoAa#!n$h+_Lfo27u~pIB{Qm(_yV-jH literal 0 HcmV?d00001 diff --git a/assets/image/3x/write_off_bg.webp b/assets/image/3x/write_off_bg.webp new file mode 100644 index 0000000000000000000000000000000000000000..7a201a300e88fbacedb8d8123a5e64452efbc809 GIT binary patch literal 35157 zcmeHQYg`jo+D}4|03z`o1wnKmUJ#5T7Y&4h6h>}UTR}lcjh0$a5JZUtl6WaAMbJqF z-hkS8;9LDZ%OxV%$bvY_v~(|ImQgu%IpQnb?5!W^vK~-+YL3ZnbQ8ljy<dYr{>>mstfim1p9InHeg?_;tXh(qu3AjNfeno*_Dx&t|AhdLZ#6c zPySFuX|`1FhQcAiG9+H2ISkoas#OeL>+(9yG0p4otb!Laz{J(a1qs_40m0Ooc4LLf zhiBivMEu$y_^jd@(C@Fx1I$f$0$xRDWq)UTAAPlNqee$-2<1SEKCpY4{JW38j6NNB z3fA1!_CUdq!h@IMM2{E^53=C)29Wx)6g^O-9kTgp;xz4P{8Q<$5t!(JWJ7`j8*0{+ zw9}OjfiR|%6LQ$P_i=piKNmMSLHQv=fiv<~u-=>}kaIf|9!^Zlwjpv|%ZQFhZ)`{} z-c6f}|3o>gk?HhstcQ=Xr1|F0A4Lx8jqc6r)(#4{K^ddHTEo!OdH|M^we(ERKKTH!%#pE@cQ0^)g4&4^tx&*2C^l<-Xnv zxX2wI0{HtNnbklNIpaDlZ4-w5)NK~4wdC7}E&2BuU52B1$|ehW8B}@4lX_*BdEPPH zOm=d|kBJ*hd79g0Cq#R*QvFqtVCs&MS|#OQpk0x!ldHe71<(XxDCm zT$X5FUJ5zUV}Yd`b(@v)BAB;cIxMZGN9}?R1Lr#D{z+6?f+&L(WHXMmTo9441&)Do z@^>eOiEMGq=0@rZmLez0p2JgO@99*^bi9Sb~Y@@@ZHCyPgrzKl>%( z0(Qw{3)l!p=_O=~AHII_DNftDiA*rGB2zplZmy56ox<&k<0J=yfCK?uMT7(rTbR&+ z?{y|&L?(>_VMGWkJn6jYNOpEiNXc! z%T$DbW~UX^pr6kgZP^Bs;OC84Rs;A_v-8FMM!vZ^qs8Bm|}sQEh06PsLlR|0o3 zomL`YQbyyCJ;9r3EkjE#?p?nE>4n%#9W@Sw_NNbz^%+8q~Um;{H|J(!zH66Pp$c`3c=PPKn?hZ9-y8(>~Z-Ir{8?7JN| z>UN|nme;0|u0Po125+05DfE>`LYlx?LRTfd%EvYvlk%CjVzu^5Shz{mSgVN@jfD=} zpLoX61u=oxyUs_LrC>(WOtUEc-qBJ<*QGD2G+!i%)M`J!=*VBJsn{GZ9PsD02{ zN${-{f4%Y|egI1Ks=w^b%F9=@0ZIGhODX}Z6qQ7Xvn7>LDFc7(;XEob7w)u>{{@)O zblUS+C*B1&luXG0oMKTCy%buz!wqID?0k(|M+CoiZFBymXDL=#!snE)M|e_(`A%7Q zU>Gg4bMERI-9OH`cyJe89?HRpO35^_dMhR5j6&TT=K!<&Tisxd0+s$uMK0KPb(+8* z#BzSyD&-R(&4d?R{gT-+BoO zLuL=VLXA>Jb76dmuReLuQ@`2{=`S3WOmC{9H~3>H5bwv`6#WU*bBa}6-S@(N3AK)f zZu%PLKoXiic1Z4FVp(B0r`!UGOl5V~q?NrZ_B9}*n#>dGYP#}=E-uY?Pd_+UF~Ccy zoi}uPgYYMGs3%h$1&#IzOgnK*u=kTE1IFl1t*rSwjjhg}N2&LXuD^0oMZ(gF8$+!(;Z;U$4XH0UA!1tb2MgqJi*RGel#6Ms zj%y;>_TSticF^LyAocaR2{W;*sam3Z$dc+g?8)>sBy+x3EX_XJ6^mP_E-lAVI{chs z7G`05b+3gy6A0b@+itVt*lic_Eu1T5IP8;pgZ3+^b;}yo z!TTF(hcKc77oa&{y_VnXd=uAk8*Q3;G5LCNyTR~d(bHKu1&Fy}+iSi$5wqo5?8riE zCCLJo>Fsa5dBhn*j*=j?kVf$8p^Rh#FyZt;$v%v45GS>(_X2KNMrH zE9=D&i%c=3J4U7q+|gy%yP553bb}{&cp72Tusm#;E_O&|)wiT%KoLH)Ow=R-=6=zg zzPAU~2h-tRcY?cQkv8Vvnhx%w3IP0=qIT`}Hqub#d=ojr@vO;R?1-G`?Q<4j+? zFE^11r=fdjaY<7#x<8A(*Jw|XaLxp`*dW+W8mGFI6cj%(%_&9G&dAHh%9Zuz4~phw z!-0oMA*fy|c%cM}eN?|3tKOo;>~$*5bc8bBijOM)?B0cY+AZY20{uSGX|d$E5X`z4 zm$-==toUt=F4bI@o-+1hRE;)yPOElA)=KL7rz>$Kl6SXYjh`q0;E&&O*%Xy)A^!yI zc-BseACo@78rrg1sP0y_u%w>N7T441C2#kO%9!f^iJku130q!(vvkoy%`dT)E4io< zc?I-XIz>EC=H+46Ug$3G26|Fh^`UPi#dcJmMmtU?0@`efeswA7tpLZMW7I3Y(O*H{ zGDhR2kmgJ7@Br9xS~2tT!iR%6Su&az7YePFG6ITTuDfE5zV_hf(03B{{fpGXZ>sW= zFmtdE=8n%13wh}4 zyILLz+-$t2ry9miSWcfa{0+ou9nm@JeTwXDL=LK%q0AWUS(;2rk}o)dU`Cg05<5++ zT#4A)3^r5KXHiOB7RmF#@g<1=l`Riqa7xWRSl$n5wm=QmU5(Uq)HABljXDG+sqc!C zhShvE_Ql_b)yA}H4x;9zc+VSC7#g7!!$oHlPr$r0iWZNWK)frJjFMS(AFws&wf*w* z&H3n5DDW7h34tUM)6$>kKRWvVoG|AeN;aIoP34Zy;|0K zto8^@hr=Y5ETmTw%#vmb6S$tC8)l$$`rzL>2o1TO?_1iKP#S+vH5JG~z z6*cxz@I=Y_5r`5<2hu2;E|PLGcaL8X;Vd#q{MMjOxKXJp@?S9Qg+>J$8KZ0D>5=Va z@5Ln{h$HV@iHu3=gqq0l^TP4S&a;Z2fv1Ujw~s7hsQAGZE#U=Tn~B?FE@*LX6;Aev;@kv5h}sfSTbfcJM17q~ z)RrbgAfmQJ)Rrb)BcirM)Rv~gDx$VT)Rw0FXQH-5)RrbQDF1G4i7+CB5h0Ao`{V=B z={uQ7CyWSTL8U#1f8f;X!G<*pKlB1%3jah@LPRA*R5B?8Q_Y}6R6;~0lNyrflOg(Kh(4M3UC>0I z4ACbusTGN+gosN1V^Ikai4d0=(f-RCjl|mU{{8NyHNERog^4DP&80uK=;UUlF7cQd zaP+T%b3C$6IvILi-~R3=6YI!jpOwz>MV3`syyylUY$B1;jp3he{+@gC{%+q_Ggz@F z3zw9w3o8%RJTonPbY*95&jC}dHZ~!oXX{}znRav}F+Vu6VUYdbMqx6ANFEYqnlRIZ znVysZq7#YeM4FNTqMdar&q?I`iJU)?^CxotA8AD*=TGGPr_Q1iok;)RJCV-a&AI-e z7l7zaC%V%oqa?y7Bz!``CnS7A!Y3rqAP6`O;)Kqm9w2(*h`5-Di;1}SqdpDdgbr~+ zhd7}#Rahj7>_m~BD6$hp_9+>d(uzbvl}M-(3Dv2+FhK|6&M4Y{VKRYtF1DV(8H)5# z{Q#u-sLCghQno|SgriwN=vl=|Z593&XYN+YT1056ZUD6D3iJYR9+WK+tUxj#O(UbL zbnE!t#Crbko9S^85Q=!9+H4wl^v~!rJH^k;haIfcTqq4t$3ZpdE!~O2wAfayu{LM0 z5(v#u%mfpy5MwJRVLQJHfA931^0i2XM6(0(XR3!-(w!HV9%!|YSKHe6pn%ZclHfdr z1z7K#>+q)YeLK}Z?4E4aa5U6ldD8~zl`-R6)3wh{O_kp2I1M*O1*P~)16quzK5=25Vsc-G@*L~B=%iwl! z+zzRQ1b-Y9YP6pp-=I$((x;$zihF=Ir5ip@cAdeV3vC3P3P6slZ>Y(0Fx``$;9FRIhvbIX-tARv|HlJK*PbC4F;(Z3f&Z{8m` z|Lq$W%!^&Q$55)@T!D-Z4ZI)?IrM+x4m%sOdMd4u%TUhs+a7Uvc$r9Xg`_e%Wgsh| z=21eZu!tTN0`*GRV-I!WIavCYki{taO?=9M=JWY`&eBV!JM{?eJnC5*68-#qmHAY* zV(Kg_3U$6&o(?oHc!G#iVS#I@)||N|8rrYkf@FB%<)J*xluM4ns^#QJujmI0IYuRQ z6+6)73F`UVp&=`Ni@|UQ^s$?RqAl!@UkCG?q~!w-BLxkkMT=0p5|tFN4K{>FG3+CW zbqp$*?MXRRDXvA*AF%#4RsLHcC>O{!+l?2X9(73ZG@Xp$0Pd2j|K7-e+1 zhjT`@xxwy|;QZbCf5Mh|Vx@EdZBW4W{jYDA&Z4BJ&C)yrI2G@h3ks{~{a9?7uw2*& z1%^Vg05n6bjr*2Rt!Xj!&xU}+rHF3$g*YLOXYS$+kmm0Uo_aLyvT)yWDw~A@LJ!YTKD5Bq z-8ubU(f8(Y**IjGmNW2E86%+Y`3*nKnjk|miu#c}+y9v^jehjpon#V;)(LL>qn0Xu7@9UgGkNVr7Y78sl>&O=JIVR^~Mjnfbb{1kG zq0nbhh?&vZIWZ$VG1J+$6U*gApf39Bzr&Sg`>kDwdZ5@p<8tWy?i;cRmv#qm!n*t6=Xp6_fh2m898w) zY(Hp+_m7k=jq--VPO)6Bo$zekLMvZ^6f?Icu7Ur|%Jh8d@C%moMiArc*%sV-ehAcT z$=_`Mrq>`S@N^hv2I93L+zGRjaf;QqBR;F>xG2f$rVAoznl>NKjTX45szZV}E;h$_{$=IARI@lq^lg(El4(v|5zZ6^(n*;2nv94=!t zgvOUYc87BY{{}cPorL?Q<90Ch-Lj}K$P-<6jch0m&Imzq&YT)1m6!l#zBR{**4j|{ z12BXw9ainQP`HR<%b6bw;I7C;m9NA z2PV#v8-Z80_g`EDEb+1vQwkaouUvts&raf{m z$*gGfD{1&%3|3kH+hM7{Y)wktrtgP;jo5s2Ak&_qAr$6XNL= zodETtb|q;?F?O){l%aM066Jg_&skdDMQ=EAn!dUR1(>UV*kg2ezA<+5M}4bbxdAam z#rgH<%^}n#EP+)?WZ@d**pTz-W*nkZ*bnf0iKhFJIlV1>dP_LXaU@pM8RTNVnd+$1 z@Ng*>cFICGouRA-IJX)?XSaBxV-Jc@U*|Q@8RNCCABP20A0_5^tGYm!>uLV8TLNf- zFmD3N=AxxjSb*{KSd2V~P;i-cup?jb40O5r-QuVpQR<<1 zgIyA~En>{%2M$E1_~ERjC5i?Y>91-698R&)L(LtVny*gn4qM-7K9n>ZM3Sk7e6eyO zKd757)Cg^mSTKYm9ag+Z?5fgMG|nJlhcz-kx7P@?$^8cZ83__Kd|2F?Y?7bDpd zkZ)SY_D~bYJ+#c2kW583#I`}oOcM;?JzzS=;Q4o0*Mc4xz*R3j>R^^|ANG{A|TmgkFkRws3=ur{?7O#-Rd%*`5GJH^O1+nvOj#snCS92$~X zC3;wkZI7eZ)ufC%oDdSR2?Lwt+S6021Za&UN+8KZgCqo^AqnKmy?e92U_b7h<%fIE zd7tOK@B6&ZeV*riKA*Gu_Ode4ewK#A;WBpry8LY%4u1eVC~*~#47)aiHxA$MHtTg< z-&o!p4)^q?-Q~=8nyP)%?4G|jt{;B9m{s?}G5ZxteePuv{Z!6D^;79K&d9!4U`_9- z6R^4qvI(B|ZYbYZ(MDt*Jl@v-V`1M=LF>(#!7+35tKs;Cs!=-GP~9SKa4Sn@dk4M4 zdO^(vn8$PXPy?so!NxE@CWHvY%6}rIJa;iQ;DyB!b@2KQy48nW71#^7?$zCw(M8N8 zqP4SSIJuXgr}t3<7j@Rs&^oN(OS@iD&uw{$S~Gb3#&|BJOop)1VqC6KZ;eEKTH~u! z=gD0%93Be)+~1|M4%p`C6HW*EC}`Xqe>btO9zpd;M_7xBxJJpnwMr$J3nTpI3Tzv- z#=JQrn^NZLPeH#{1SQf-o_-Bt$)%i2`^Kbbl(La5umb4};ndcXuj~Z2*`aSeYl$QZ zDV@k)bL?ZV(zl*f$?^Z8Kjx1Zwo+9v%;LGv!s26G1{rHGCqk(*#i4{%<7N%lt%k+I z>G)T6J^dAGjS4L<5lY3~KwcWX9OUdT2I?3g)P8_`h%ae+ z@KdHD__QsqsWmkH{w_aZ)*FzfS69u5&|b^%ent(9bj?(=K;}@ho9fj%DTH*AfdW*A zi#tcE%Yh=0y*$P7PIt98ShNc&G=lzAr`ZS`028M;{J8hgHKO;eEkNS>G$sFNh2a^| z&F+WyQY-tArzC|4xw>lMh`1i=_@%!L^WUl&77B@3 zj#p@-TXe#dFN~Xeil1w`_?4=l%#}k}z(!Un{}zeE;)R^=XdCemA(J>2T{pythp=HI z62x>jSx$eN@(&0SN;*b5# z<%3sN%&}u!#|1cSon{XS>^rG}AS~WhJ08rWt;0idB>zqa*Zq;sy82HG@tO)D_CPOC zDPbGW{nr~NSt_6_zW5Ab^W67z)|ygJXWtqxdS74uIB*qVq=2S+p%DxQ>#q=XWI(Wcj#S=b%Tn0Yr(;X%@-r!`l-MIE$!tR@29fHf{d-CqPnk z$R%%`IE?T3fTO&KJWQkgH~_`|HSsY2F9ijnn^4wLmL}HN^IOJ?<9l88DaPy8Nz5QKXiYyG2yVqYGu7!RFCCY*ajcD;h_L?bUb(V-{$oiZdPbqWpH zgi7=rX3z=j=ba?)$y(Ykz@K;-e`NH9|BzcIKvLy^g!u1CD{R#p%@t3&pM77JU=Mfi M+FRcDdhN-71AgXC }); setState(() {}); - // Navigator.of(context).pushNamed( '/router/eom'); }, ); }, diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 30731e72..6c918b2f 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -17,8 +17,6 @@ import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import '../web/web_view/input_comment_o.dart'; - class CommunityDetails extends StatefulWidget { final Map arguments; @@ -60,7 +58,7 @@ class _CommunityDetails extends State void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { - // isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0; + isKeyBoardShow = MediaQuery.of(context).viewInsets.bottom > 0; if (!mounted) return; if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { @@ -108,7 +106,7 @@ class _CommunityDetails extends State void _focusNodeListener() { /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ setState(() { - smileyPadGone = true; + emojiShowing = false; }); }*/ } @@ -161,9 +159,9 @@ class _CommunityDetails extends State @override Widget build(BuildContext context) { double h = MediaQuery.of(context).viewInsets.bottom; - if(h > 0 && keyboard <= 0) { + if(h > 0 && keyboard < h) { + keyboard = h; setState(() { - keyboard = h; }); } return GestureDetector( @@ -176,6 +174,7 @@ class _CommunityDetails extends State }); }, child: Scaffold( + // resizeToAvoidBottomInset: false, appBar: MyAppBar( title: S.of(context).dongtaixiangqing, titleColor: Colors.black, diff --git a/lib/community/community_page.dart b/lib/community/community_page.dart index d767da25..61a91406 100644 --- a/lib/community/community_page.dart +++ b/lib/community/community_page.dart @@ -79,6 +79,7 @@ class _CommunityPage extends State return Scaffold( appBar: MyAppBar( leading: false, + centerTitle: true, titleChild: PreferredSize( preferredSize: Size( MediaQuery.of(context).size.width - 60.w, diff --git a/lib/community/community_view/class_details_video.dart b/lib/community/community_view/class_details_video.dart index 995b5ff6..e34f7516 100644 --- a/lib/community/community_view/class_details_video.dart +++ b/lib/community/community_view/class_details_video.dart @@ -139,7 +139,7 @@ class ClassDetailsVideoState extends State { color: Colors.black, width: width, height:MediaQuery.of(context).size.width / 1.5, - margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + // margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), child: chewies = Chewie( controller: chewieAudioController, ), @@ -147,7 +147,7 @@ class ClassDetailsVideoState extends State { : Container( width: width, height:MediaQuery.of(context).size.width / 1.5, - margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + // margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), )), if (widget.isShowImg) GestureDetector( @@ -161,7 +161,7 @@ class ClassDetailsVideoState extends State { child: Container( width: width, height: MediaQuery.of(context).size.width / 1.5, - margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + // margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), color: Colors.black, child: Stack( children: [ diff --git a/lib/community/community_view/home_class.dart b/lib/community/community_view/home_class.dart index 2649c8ab..d8f8c2ad 100644 --- a/lib/community/community_view/home_class.dart +++ b/lib/community/community_view/home_class.dart @@ -67,7 +67,7 @@ class _HomeClass extends State { ), ), Container( - height: 195, + height: 195.h, margin: EdgeInsets.only(top: 10.h), child: ListView.builder( scrollDirection: Axis.horizontal, diff --git a/lib/community/new_community_details.dart b/lib/community/new_community_details.dart index f005b3e2..5b904034 100644 --- a/lib/community/new_community_details.dart +++ b/lib/community/new_community_details.dart @@ -175,7 +175,7 @@ class _NewCommunityDetails extends State with WidgetsBindin @override Widget build(BuildContext context) { double h = MediaQuery.of(context).viewInsets.bottom; - if(h > 0 && keyboard <= 0) { + if(h > 0 && keyboard with AutomaticKeepAliveClientMixin { ///活动海报弹窗 posterShowAlertDialog(ActivityPos activityPos) { + var today = DateTime.now().day; SharedPreferences.getInstance().then((value) { - if((value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) + if(value.getInt("today")==today && (value.getString("ActivityPosCode") ?? "").contains("${activityPos.code}_${value.getString("userId")};")) return; value.setString("ActivityPosCode", "${(value.getString("ActivityPosCode")??"")}${activityPos.code}_${value.getString("userId")};"); + value.setInt("today", today); //显示对话框 showDialog( context: context, diff --git a/lib/main.dart b/lib/main.dart index 49f8b9ed..99a6c6eb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -199,7 +199,7 @@ class MyApp extends StatelessWidget { } else if (locales[0].countryCode == "CN"){ locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); } else{ - locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'US'); + locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'CH'); } return appLocale ?? locale; }, diff --git a/lib/mine/vip_pay_code.dart b/lib/mine/vip_pay_code.dart index 63f18fe4..60305ceb 100644 --- a/lib/mine/vip_pay_code.dart +++ b/lib/mine/vip_pay_code.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:convert'; import 'package:barcode_widget/barcode_widget.dart'; @@ -39,7 +40,6 @@ class _VipPayCode extends State { void dispose() { super.dispose(); refreshController.dispose(); - Location.getInstance().stopLocation(); } @override @@ -51,6 +51,8 @@ class _VipPayCode extends State { UserInfo userInfo; final RefreshController refreshController = RefreshController(); bool vipCodeText = false; + Timer _timer; + bool isDispose = false; ///查询用户信息 queryUser() async { @@ -67,185 +69,122 @@ class _VipPayCode extends State { refreshController.refreshFailed();}); if (baseData != null && baseData.isSuccess) { userInfo = baseData.data; + SharedPreferences.getInstance().then((value) => { + value.setString('user', jsonEncode(baseData.data)), + }); setState(() {}); - SharedPreferences.getInstance().then((value) => { - value.setString('user', jsonEncode(baseData.data)), - }); refreshController.refreshCompleted(); }else{ refreshController.refreshFailed(); } }finally{ - setState((){}); + refreshCode(); } } + refreshCode(){ + if (_timer != null) return; + const oneSec = const Duration(minutes: 2); + var callback = ((timer) { + if (isDispose) return; + queryUser(); + }); + _timer = Timer.periodic(oneSec, callback); + } + @override Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( title: "会员码", - background: Colors.white, - titleColor: Colors.black, + background: Color(0xFF32A060), + titleColor: Colors.white, brightness: Brightness.dark, - leadingColor: Colors.black, + leadingColor: Colors.white, ), - body: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader(), - physics: BouncingScrollPhysics(), - onRefresh: () { - queryUser(); - }, - child: SingleChildScrollView( - child: Container( - color: Colors.white, - padding: EdgeInsets.only(top: 45.h), - child: Stack( - alignment: Alignment.topCenter, - children: [ - Container( - padding: EdgeInsets.only(top: 50.h), - child: Container( - width: double.infinity, - margin: EdgeInsets.symmetric(horizontal: 14.w), - padding: EdgeInsets.only(top: 68.h, bottom: 16.h), - decoration: BoxDecoration( - color: Color(0xFF32A060), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.circular(6), + body: Container( + color: Color(0xFF32A060), + height: double.infinity, + padding: EdgeInsets.only(top: 45.h), + child: Stack( + alignment: Alignment.topCenter, + children: [ + Container( + color: Color(0xFF32A060), + // height: 485.h, + padding: EdgeInsets.only(top: 47.h), + child: Container( + height: 438.h, + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 14, + spreadRadius: 0, ), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 2), - blurRadius: 14, - spreadRadius: 0, - ), - ], - borderRadius: BorderRadius.circular(6), - ), - margin: EdgeInsets.symmetric(horizontal: 16.w), - padding: EdgeInsets.only( - top: 46.h, left:16.w, right: 15.w, bottom: 79.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - onTap: (){ - setState(() { - vipCodeText = !vipCodeText; - }); - }, - child: - vipCodeText ? Text( - userInfo != null - ? "${(userInfo?.vipNo ?? "").substring(0, 4)} " - "${(userInfo?.vipNo ?? "").substring(4, 8)} " - "${(userInfo?.vipNo ?? "").substring(8, 12)} " - "${(userInfo?.vipNo ?? "").substring(12, 16)} " - "${(userInfo?.vipNo ?? "").substring(16, (userInfo?.vipNo ?? "").length)}" - : "", - style: TextStyle( - fontSize: 14.sp, - wordSpacing: userInfo == null - ? 10 - : (MediaQuery.of(context).size.width - 64.w) / - ((((userInfo?.vipNo ?? "") - .length) * - 4)), - letterSpacing: userInfo == null - ? 8 - : (MediaQuery.of(context).size.width - 64.w) / - ((((userInfo?.vipNo ?? "") - .length) * - 4)), - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF353535), - ), - ) - :Text( - "轻触可查看会员码数字", - style: TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 13.sp, - color: Color(0xFFCACACA), - ), - ), - ), - SizedBox( - height: 12.h, - ), - BarcodeWidget( - barcode: Barcode.code128(useCode128C: true), - data: - userInfo != null ? userInfo?.vipNo : "", - height: 72.h, - color: Colors.black, - drawText: false, - ), - SizedBox( - height: 16.h, - ), - QrImage( - data: userInfo != null - ? (userInfo?.vipNo ?? "") - : "", - version: QrVersions.auto, - size: 200.w, - gapless: true, - ), - ], - ), - ), - ), + ], + borderRadius: BorderRadius.circular(6), ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(56), - color: Colors.white, - border: Border.all( - color: Colors.white, - width: 8.w, - ), - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(56), - color: Colors.white, - border: Border.all( - color: Color(0xFF32A060), - width: 2.w, + margin: EdgeInsets.symmetric(horizontal: 16.w,), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 46.h,), + Text( + "请保持屏幕常亮,并对准扫码盒或枪口", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + color: Color(0xFF4D4D4D), ), ), - child: MImage( - userInfo?.headimg ?? "", - width: 80, - height: 80, - radius: BorderRadius.circular(56), - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", + SizedBox(height: 30.h,), + QrImage( + data: userInfo != null + ? (userInfo?.vipScanNo ?? "") + : "", + version: QrVersions.auto, + size: 200.w, + gapless: true, ), + ], + ), + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(56), + color: Color(0xFF32A060), + border: Border.all( + color: Color(0xFF32A060), + width: 8.w, + ), + ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(56), + color: Colors.white, + border: Border.all( + color: Colors.white, + width: 2.w, ), ), - ], + child: MImage( + userInfo?.headimg ?? "", + width: 80, + height: 80, + radius: BorderRadius.circular(56), + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + ), ), - ), + ], ), ), ); diff --git a/lib/order/write_off_page.dart b/lib/order/write_off_page.dart index 26ec1c5e..9eba17ea 100644 --- a/lib/order/write_off_page.dart +++ b/lib/order/write_off_page.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:barcode_widget/barcode_widget.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -13,9 +14,13 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/separator.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:qr_flutter/qr_flutter.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import '../view_widget/classic_header.dart'; +import '../view_widget/my_footer.dart'; + class WriteOffPage extends StatefulWidget { final arguments; @@ -31,6 +36,7 @@ class _WriteOffPage extends State { dynamic coupon; ApiService apiService; CouponDetail queryCoupon; + final RefreshController refreshController = RefreshController(); @override void initState() { @@ -79,248 +85,495 @@ class _WriteOffPage extends State { background: Color(0xFF32A060), leadingColor: Colors.white, ), - body: Container( - alignment: Alignment.topCenter, - child: Stack( - alignment: Alignment.topCenter, - children: [ - Image.asset( - "assets/image/icon_write_off_bg.webp", - width: MediaQuery.of(context).size.width * 0.912, - fit: BoxFit.fill, - ), - LayoutBuilder(builder: (context, constraints) { - return Container( - width: constraints.constrainWidth() * 0.912, - child: Column( - children: [ - Expanded( - child: Container( - child: Column( - children: [ - Text( - coupon != null ? coupon["couponName"] : "", - style: TextStyle( - fontSize: 16.sp, - fontWeight: FontWeight.bold, - color: Color(0xFF353535)), - ), - SizedBox( - height: 8.h, - ), - Text( - (coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi( - "${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"), - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF353535), - ), - ), - ], - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - ), - alignment: Alignment.center, - ), - flex: 6, - ), - Container( - margin: EdgeInsets.only(left: 20.w, right: 20.w), - child: MySeparator( - width: 5.w, - height: 1.h, - color: Color(0xFFA29E9E), + body: SmartRefresher( + controller: refreshController, + enablePullDown: false, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + Container( + alignment: Alignment.topCenter, + height: 530.h, + child: Stack( + alignment: Alignment.topCenter, + children: [ + Image.asset( + "assets/image/write_off_bg.webp", + width: MediaQuery.of(context).size.width * 0.912, + height: 540.h, + fit: BoxFit.fill, ), - ), - Expanded( - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - coupon != null - ? "${coupon["memberCouponId"].substring(0, 4)} " - "${coupon["memberCouponId"].substring(4, 8)} " - "${coupon["memberCouponId"].substring(8, 12)} " - "${coupon["memberCouponId"].substring(12, 16)} " - "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}" - : "", - style: TextStyle( - fontSize: 14.sp, - wordSpacing: coupon == null - ? 10 - : (MediaQuery.of(context).size.width - - 64.w) / - (((coupon["memberCouponId"].length) * 4)), - letterSpacing: coupon == null - ? 8 - : (MediaQuery.of(context).size.width - - 64.w) / - (((coupon["memberCouponId"].length) * 4)), - fontWeight: MyFontWeight.semi_bold, - color: Color(0xFF353535), + LayoutBuilder(builder: (context, constraints) { + return Container( + alignment: Alignment.center, + width: constraints.constrainWidth() * 0.912, + padding:EdgeInsets.only(top: 24.h), + child: Column( + children: [ + Container( + child: Column( + children: [ + Text( + coupon != null ? coupon["couponName"] : "", + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.bold, + color: Color(0xFF353535)), + ), + SizedBox( + height:11.h, + ), + Text( + (coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi( + "${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"), + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF353535), + ), + ), + ], + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + ), + alignment: Alignment.center, ), - ), - SizedBox( - height: 12.h, - ), - BarcodeWidget( - barcode: Barcode.code128(useCode128C: true), - data: coupon != null ? coupon["memberCouponId"] : "", - height: 72.h, - color: Colors.black, - drawText: false, - ), - SizedBox( - height: 16.h, - ), - Expanded(child: QrImage( - data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}", - version: QrVersions.auto, - size: 200.w, - gapless: true, - ),), - SizedBox( - height: 35.h, - ), - ], - ), - margin: EdgeInsets.symmetric(horizontal: 20.w), - ), - flex: 27, - ), - Container( - child: MySeparator( - width: 5.w, - height: 1.h, - color: Color(0xFFA29E9E), - ), - margin: EdgeInsets.only(left: 20.w, right: 20.w), - ), - Expanded( - child: Container( - padding: EdgeInsets.fromLTRB(20.w, 15.h, 20.w, 15.h), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 3.w, - height: 15.h, - margin: - EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(3), - color: Color(0xFF20662A), - ), + Container( + margin: EdgeInsets.only(left: 20.w, right: 20.w,top:16.h,bottom:30.h), + child: MySeparator( + width: 5.w, + height: 1.h, + color: Color(0xFFA29E9E), ), - Text( - S.of(context).shiyongtiaojian, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535), + ), + Expanded( + child: Container( + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + coupon != null + ? "${coupon["memberCouponId"].substring(0, 4)} " + "${coupon["memberCouponId"].substring(4, 8)} " + "${coupon["memberCouponId"].substring(8, 12)} " + "${coupon["memberCouponId"].substring(12, 16)} " + "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}" + : "", + style: TextStyle( + fontSize: 14.sp, + wordSpacing: coupon == null + ? 10 + : (MediaQuery.of(context).size.width - + 64.w) / + (((coupon["memberCouponId"].length) * 4)), + letterSpacing: coupon == null + ? 8 + : (MediaQuery.of(context).size.width - + 64.w) / + (((coupon["memberCouponId"].length) * 4)), + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 15.h, + ), + BarcodeWidget( + barcode: Barcode.code128(useCode128C: true), + data: coupon != null ? coupon["memberCouponId"] : "", + height: 72.h, + color: Colors.black, + drawText: false, + ), + SizedBox( + height: 16.h, + ), + Expanded(child: QrImage( + data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}", + version: QrVersions.auto, + size: 200.w, + gapless: true, + ),), + SizedBox( + height: 35.h, + ), + ], ), + margin: EdgeInsets.symmetric(horizontal: 20.w), ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 11.w, - ), - Expanded( - child: Text( - S - .of(context) - .qianwanghuixiangmendianduihuanhexiao, - style: TextStyle( - textBaseline: TextBaseline.alphabetic, - fontSize: 14.sp, - color: Color(0xFF353535)), - ), - flex: 1, + flex: 27, + ), + Container( + child: MySeparator( + width: 5.w, + height: 1.h, + color: Color(0xFFA29E9E), ), - ], + margin: EdgeInsets.only(left: 20.w, right: 20.w,bottom:20.h), + ), + ], + ), + ); + }), + //原版本样式 + // LayoutBuilder(builder: (context, constraints) { + // return Container( + // width: constraints.constrainWidth() * 0.912, + // child: Column( + // children: [ + // Expanded( + // child: Container( + // child: Column( + // children: [ + // Text( + // coupon != null ? coupon["couponName"] : "", + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight: FontWeight.bold, + // color: Color(0xFF353535)), + // ), + // SizedBox( + // height: 8.h, + // ), + // Text( + // (coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi( + // "${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"), + // style: TextStyle( + // fontSize: 12.sp, + // color: Color(0xFF353535), + // ), + // ), + // ], + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // ), + // alignment: Alignment.center, + // ), + // flex: 6, + // ), + // Container( + // margin: EdgeInsets.only(left: 20.w, right: 20.w), + // child: MySeparator( + // width: 5.w, + // height: 1.h, + // color: Color(0xFFA29E9E), + // ), + // ), + // Expanded( + // child: Container( + // alignment: Alignment.center, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // SizedBox(height: 5.h,), + // Text( + // coupon != null + // ? "${coupon["memberCouponId"].substring(0, 4)} " + // "${coupon["memberCouponId"].substring(4, 8)} " + // "${coupon["memberCouponId"].substring(8, 12)} " + // "${coupon["memberCouponId"].substring(12, 16)} " + // "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}" + // : "", + // style: TextStyle( + // fontSize: 14.sp, + // wordSpacing: coupon == null + // ? 10 + // : (MediaQuery.of(context).size.width - + // 64.w) / + // (((coupon["memberCouponId"].length) * 4)), + // letterSpacing: coupon == null + // ? 8 + // : (MediaQuery.of(context).size.width - + // 64.w) / + // (((coupon["memberCouponId"].length) * 4)), + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFF353535), + // ), + // ), + // SizedBox( + // height: 12.h, + // ), + // BarcodeWidget( + // barcode: Barcode.code128(useCode128C: true), + // data: coupon != null ? coupon["memberCouponId"] : "", + // height: 72.h, + // color: Colors.black, + // drawText: false, + // ), + // SizedBox( + // height: 16.h, + // ), + // Expanded(child: QrImage( + // data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}", + // version: QrVersions.auto, + // size: 200.w, + // gapless: true, + // ),), + // SizedBox( + // height: 35.h, + // ), + // ], + // ), + // margin: EdgeInsets.symmetric(horizontal: 20.w), + // ), + // flex: 27, + // ), + // Container( + // child: MySeparator( + // width: 5.w, + // height: 1.h, + // color: Color(0xFFA29E9E), + // ), + // margin: EdgeInsets.only(left: 20.w, right: 20.w), + // ), + // Expanded( + // child: Container( + // padding: EdgeInsets.fromLTRB(20.w, 15.h, 20.w, 15.h), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Container( + // width: 3.w, + // height: 15.h, + // margin: + // EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(3), + // color: Color(0xFF20662A), + // ), + // ), + // Text( + // S.of(context).shiyongtiaojian, + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // ], + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // SizedBox( + // width: 11.w, + // ), + // Expanded( + // child: Text( + // S + // .of(context) + // .qianwanghuixiangmendianduihuanhexiao, + // style: TextStyle( + // textBaseline: TextBaseline.alphabetic, + // fontSize: 14.sp, + // color: Color(0xFF353535)), + // ), + // flex: 1, + // ), + // ], + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Container( + // width: 3.w, + // height: 15.h, + // margin: EdgeInsets.fromLTRB(4, 7, 4, 7), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(3), + // color: Color(0xFF20662A), + // ), + // ), + // Text( + // S.of(context).shiyongshuoming, + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 14.sp, + // color: Color(0xFF353535)), + // ), + // ], + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // SizedBox( + // width: 11.w, + // ), + // Text( + // S.of(context).zitiduihuanquan, + // style: TextStyle( + // textBaseline: TextBaseline.alphabetic, + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // ], + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // SizedBox( + // width: 11.w, + // ), + // Text( + // S.of(context).huixiangrenyimendian, + // style: TextStyle( + // textBaseline: TextBaseline.alphabetic, + // fontSize: 14.sp, + // color: Color(0xFF353535), + // ), + // ), + // ], + // ), + // ], + // ), + // ), + // flex: 13, + // ), + // Expanded( + // child: Container(), + // flex: 3, + // ), + // ], + // ), + // ); + // }) + ], + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.912, + padding: EdgeInsets.only(left:18.w, bottom:15.h, right:18.w), + margin:EdgeInsets.only(bottom: 21.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(6), + bottomRight: Radius.circular(6),), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0x08213303).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 3, + spreadRadius: 0, + ), + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 3.w, + height: 15.h, + margin: + EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(3), + color: Color(0xFF20662A), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: 3.w, - height: 15.h, - margin: EdgeInsets.fromLTRB(4, 7, 4, 7), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(3), - color: Color(0xFF20662A), - ), - ), - Text( - S.of(context).shiyongshuoming, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14.sp, - color: Color(0xFF353535)), - ), - ], + ), + Text( + S.of(context).shiyongtiaojian, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Color(0xFF353535), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 11.w, - ), - Text( - S.of(context).zitiduihuanquan, - style: TextStyle( - textBaseline: TextBaseline.alphabetic, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - ], + ), + ], + ), + SizedBox(height:12.h,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 11.w, + ), + Expanded( + child: Text( + S + .of(context) + .qianwanghuixiangmendianduihuanhexiao, + style: TextStyle( + textBaseline: TextBaseline.alphabetic, + fontSize: 14.sp, + height: 1.5.h, + color: Color(0xFF353535)), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - width: 11.w, - ), - Text( - S.of(context).huixiangrenyimendian, - style: TextStyle( - textBaseline: TextBaseline.alphabetic, - fontSize: 14.sp, - color: Color(0xFF353535), - ), - ), - ], + flex: 1, + ), + ], + ), + SizedBox(height:16.h,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: 3.w, + height: 15.h, + margin: EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(3), + color: Color(0xFF20662A), ), - ], - ), + ), + Text( + S.of(context).shiyongshuoming, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14.sp, + color: Color(0xFF353535)), + ), + ], ), - flex: 13, - ), - Expanded( - child: Container(), - flex: 3, - ), - ], - ), - ); - }) - ], + Container( + child: Html( + data: + coupon != null ? coupon["remark"] : "", + customImageRenders: { + networkSourceMatcher(): networkImageRender( + loadingWidget: () { + return Container(); + }, + ), + }, + ), + ) + ], + ), + ) + ], + ), + ), ), ), ); diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index 4b412eac..b3015f2b 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -20,6 +20,7 @@ class UserInfo { UserInfo(); String vipNo; + String vipScanNo; String nickname; String headimg; bool userType; @@ -54,6 +55,7 @@ class UserInfo { factory UserInfo.fromJson(Map json) => UserInfo() ..vipNo = json['vipNo'] as String + ..vipScanNo =json['vipScanNo'] as String ..nickname = json['nickname'] as String ..headimg = json['headimg'] as String ..userType = json['userType'] as bool @@ -87,6 +89,7 @@ class UserInfo { Map toJson() => { 'vipNo': this.vipNo, + 'vipScanNo':this.vipScanNo, 'nickname': this.nickname, 'headimg': this.headimg, 'userType': this.userType, diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index f7e60731..7e9d7012 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 06429ed5..d0cbdfe8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -64,7 +64,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.129:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 @@ -497,7 +497,7 @@ abstract class ApiService { Future wiped(@Path("memberCouponId") String memberCouponId); ///查询优惠券详情 - @GET("/coupon/detail/") + @GET("/coupon/detail/{memberCouponId}") Future> couponDetail(@Path("") String memberCouponId); ///查询会员信息 diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 9d5c20d7..49509dc2 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -1862,7 +1862,7 @@ class _ApiService implements ApiService { const _extra = {}; final queryParameters = {}; final _data = {}; - final _result = await _dio.request>('coupon/detail/', + final _result = await _dio.request>('coupon/detail/$memberCouponId', queryParameters: queryParameters, options: RequestOptions( method: 'GET', diff --git a/lib/view_widget/mine_vip_entry.dart b/lib/view_widget/mine_vip_entry.dart index 2c6ae5a0..932d2bd1 100644 --- a/lib/view_widget/mine_vip_entry.dart +++ b/lib/view_widget/mine_vip_entry.dart @@ -81,10 +81,13 @@ class MineVipEntry extends StatelessWidget { } Widget widget = Container( + height:20.h, + width: double.infinity, child: Row( children: [ Container( - padding: EdgeInsets.symmetric(horizontal:4.w,vertical: 3.h), + height: double.infinity, + padding: EdgeInsets.symmetric(horizontal:3.w,vertical:4.h), decoration: BoxDecoration( color: logoColor, borderRadius: BorderRadius.only( @@ -102,12 +105,13 @@ class MineVipEntry extends StatelessWidget { child: Image.asset( "assets/image/mine_vip_logo.webp", fit: BoxFit.cover, - width: 13.w, - height: 11.h, + // width: 13.w, + // height: 11.h, ), ), Container( - padding: EdgeInsets.symmetric(horizontal:2.w,vertical:3.h), + height: double.infinity, + padding: EdgeInsets.symmetric(horizontal:3.w,vertical:3.h), decoration: BoxDecoration( color: levelTextBackdrop, borderRadius: BorderRadius.only( @@ -136,8 +140,8 @@ class MineVipEntry extends StatelessWidget { Image.asset( "assets/image/icon_right.webp", fit: BoxFit.cover, - width: 8.w, - height: 8.h, + width: 8, + height: 8, color: levelTextColor, ), ], diff --git a/lib/view_widget/my_appbar.dart b/lib/view_widget/my_appbar.dart index a464ca01..7a3ce7c5 100644 --- a/lib/view_widget/my_appbar.dart +++ b/lib/view_widget/my_appbar.dart @@ -16,6 +16,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { final Size preferredSize; final double toolbarHeight; final bool leading; + final bool centerTitle; final Brightness brightness; final Function exit; @@ -34,6 +35,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { this.titleSize = 18, this.brightness = Brightness.light, this.leading = true, + this.centerTitle = false, this.exit }) : preferredSize = Size.fromHeight(toolbarHeight ?? kToolbarHeight), super(key: key) { @@ -79,7 +81,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { ) : Container(), titleSpacing: 2, - centerTitle: false, + centerTitle: centerTitle, leadingWidth: leading ? 56 : 10.w, title: ((title == null || title == "") && titleChild != null) ? titleChild diff --git a/lib/vip/vip_view/vip_top.dart b/lib/vip/vip_view/vip_top.dart index 74fd97ff..54f11b73 100644 --- a/lib/vip/vip_view/vip_top.dart +++ b/lib/vip/vip_view/vip_top.dart @@ -717,8 +717,7 @@ class _VipTop extends State { topLeft: const Radius.circular(8.0), topRight: const Radius.circular(8.0))), child: Container( - // height: 230.h, - height: 160.h, + height: 230.h, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -800,8 +799,6 @@ class _VipTop extends State { ), ), ), - if (widget?.vipCardHome?.cards[selectIndex]?.autoSubscribe ?? - false) GestureDetector( onTap: () { state(() { diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index aa53cb2a..148e141d 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -265,7 +265,7 @@ class _WebPage extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { double h = MediaQuery.of(context).viewInsets.bottom; - if(h > 0 && keyboard <= 0) { + if(h > 0 && keyboard < h) { setState(() { keyboard = h; }); diff --git a/lib/web/web_view/input_comment.dart b/lib/web/web_view/input_comment.dart index ad9d7513..4a11f1ae 100644 --- a/lib/web/web_view/input_comment.dart +++ b/lib/web/web_view/input_comment.dart @@ -221,13 +221,14 @@ class _InputComment extends State { Offstage( offstage: !widget.emojiShowing, child: SizedBox( - height: 250.h, + height: widget.keyboard == -1 ? 270 : widget.keyboard, + width: MediaQuery.of(context).size.width, child: EmojiPicker( textEditingController: widget.commentTextController, config: Config( columns: 7, - emojiSizeMax: 32 * (Platform.isIOS ? 1.30 : 1.0), + emojiSizeMax: 32 * (Platform.isIOS ? 1.10 : 1.0), verticalSpacing: 0, horizontalSpacing: 0, gridPadding: EdgeInsets.zero, @@ -249,7 +250,7 @@ class _InputComment extends State { textAlign: TextAlign.center, ), loadingIndicator: const SizedBox.shrink(), - tabIndicatorAnimDuration: kTabScrollDuration, + tabIndicatorAnimDuration: Duration(milliseconds: 0), categoryIcons: const CategoryIcons(), buttonMode: ButtonMode.MATERIAL, checkPlatformCompatibility: true, diff --git a/pubspec.lock b/pubspec.lock index 661bac50..fd60a0b3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -113,6 +113,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.10" + emoji_picker_flutter: + dependency: "direct main" + description: + name: emoji_picker_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.1" event_bus: dependency: "direct main" description: From 95343314f44a575ea3dafad6d4b5d50d2b19ab00 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Tue, 28 Feb 2023 18:15:53 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9B=20=E5=85=85=E5=80=BC=E5=A2=9E=E5=8A=A0=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AE=9D=EF=BC=9B=20=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9B=EF=BC=88=E9=80=89=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E5=BC=B9=E7=AA=97/=E8=AF=A6=E6=83=85=E5=8A=A0=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E5=BC=B9=E7=AA=97=E6=95=B0=E9=87=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=89=20=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E4=BF=AE=E6=94=B9=EF=BC=9B=20=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E4=B8=AD=E5=BF=83=E4=BF=AE=E6=94=B9=EF=BC=9B=20?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E5=9C=B0=E5=9D=80=E8=B7=9D?= =?UTF-8?q?=E7=A6=BB=E6=9B=B4=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/base_state.dart | 4 +- lib/community/community_details.dart | 2 +- .../community_view/class_details.dart | 1 + .../community_view/community_dynamic.dart | 2 +- lib/home/welfare_page.dart | 55 +- lib/main.dart | 4 +- lib/main_page.dart | 4 +- lib/mine/recharge_page.dart | 66 +- lib/order/edit_remarks_page.dart | 17 +- lib/order/order_detail_page.dart | 4 +- lib/order/order_history_page.dart | 3 +- lib/order/order_view/order_address.dart | 24 +- lib/settlement/settlement.dart | 5 +- .../settlement_view/distribution.dart | 42 +- .../settlement_view/pay_method.dart | 7 +- lib/store/shop_details_page.dart | 357 +++++----- lib/store/store_order.dart | 66 +- lib/store/store_view/product_sku.dart | 630 ++++++++++-------- lib/store/store_view/shop_goods.dart | 148 ++-- lib/union/union_list.dart | 3 +- lib/view_widget/activity_poster.dart | 6 +- 21 files changed, 777 insertions(+), 673 deletions(-) diff --git a/lib/base_state.dart b/lib/base_state.dart index 8262544f..916e047a 100644 --- a/lib/base_state.dart +++ b/lib/base_state.dart @@ -59,8 +59,10 @@ abstract class BaseState extends State params["activityId"] = pushMap["info"]; break; case 3: - routeName = "/router/union_detail_page"; + routeName = "/router/store_order"; params["id"] = pushMap["info"]; + params["tenant"] = pushMap["tenant"]; + params["storeName"] = pushMap["storeName"]; break; case 4: routeName = "/router/integral_store_page"; diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 6c918b2f..84bce1f9 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -106,7 +106,7 @@ class _CommunityDetails extends State void _focusNodeListener() { /*if (_focusNode.hasFocus || _focusNode.consumeKeyboardToken()){ setState(() { - emojiShowing = false; + smileyPadGone = true; }); }*/ } diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index cc60e937..1a1652fc 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -213,6 +213,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { child: Column( children: [ Container( + height: MediaQuery.of(context).size.width / 1.5, child: Stack( children: [ ClassDetailsVideo( diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index 4b7c66a2..ae5e917b 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -226,7 +226,7 @@ class _CommunityDynamic extends State { }, child: MImage( (widget?.article?.authorHeadImg ?? - "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"), + ""), width: 44, height: 44, isCircle: true, diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart index 94633c35..990cb680 100644 --- a/lib/home/welfare_page.dart +++ b/lib/home/welfare_page.dart @@ -50,8 +50,7 @@ class _WelfarePage extends State { super.initState(); SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), context: context, token: value.getString("token")), - queryGoods(), - queryCoupon(), + _onRefresh(), }); } @@ -108,6 +107,8 @@ class _WelfarePage extends State { "searchKey": "", "state": 0 }).catchError((onError) { + SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type), + alignment: Alignment.center); refreshController.refreshFailed(); refreshController.loadFailed(); }); @@ -134,7 +135,7 @@ class _WelfarePage extends State { _onRefresh(){ queryGoods(); - // queryCoupon(); + queryCoupon(); } @@ -262,7 +263,13 @@ class _WelfarePage extends State { ), ], )), - AspectRatio( + coupon.length == 0? + NoDataView( + src: "assets/image/ka.webp", + isShowBtn: false, + text: S.of(context).haimeiyouyouhuiquankeyilingqu, + fontSize: 16.sp, + ): AspectRatio( aspectRatio: 1.10, child: Swiper( onIndexChanged: (it){ @@ -288,12 +295,11 @@ class _WelfarePage extends State { children: [ Container( child: weekList(coupon[position]), - // weekList(testList2[position]), ), ], ); }, - itemCount:coupon.length, + itemCount:coupon.length ?? 0, ), ) ], @@ -302,27 +308,30 @@ class _WelfarePage extends State { } Widget weekList(List cops){ - return Expanded(child:(cops != null && cops.length > 0)?ListView.builder( - padding: EdgeInsets.zero, - itemCount: cops.length, - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - }, - child: weekCoupon(cops[position]), - ); - }, - ):NoDataView( + return Expanded( + child:(cops == null && cops.length == 0)? + NoDataView( src: "assets/image/ka.webp", isShowBtn: false, text: S.of(context).haimeiyouyouhuiquankeyilingqu, fontSize: 16.sp, - ),); + ):ListView.builder( + padding: EdgeInsets.zero, + itemCount: cops.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: weekCoupon(cops[position]), + ); + }, + ),); } + ///优惠券列表 Widget weekCoupon(Coupon cop) { return Container( height: 95.h, @@ -396,6 +405,7 @@ class _WelfarePage extends State { ); } + ///优惠券样式 Widget weekWidget(Coupon cop) { if (cop.bizType == 1) { return Column( @@ -581,6 +591,7 @@ class _WelfarePage extends State { } } + ///优惠券领取状态 Widget weekBtn(Coupon cop) { if(cop.status == 0) return Align( @@ -645,6 +656,7 @@ class _WelfarePage extends State { ); } + ///领取优惠券 receiveCoupon(couponId) async { couponIndex = swiperIndex; BaseData baseData = await apiService.receiveCoupon(couponId); @@ -881,7 +893,6 @@ class _WelfarePage extends State { ); } - String pointPrice(Goods goodsPrice){ if(goodsPrice == null) return ""; diff --git a/lib/main.dart b/lib/main.dart index 99a6c6eb..236b1317 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -199,7 +199,7 @@ class MyApp extends StatelessWidget { } else if (locales[0].countryCode == "CN"){ locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); } else{ - locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'CH'); + locale = Locale.fromSubtags(languageCode: 'en', countryCode: 'US'); } return appLocale ?? locale; }, @@ -325,7 +325,7 @@ Map routers = { '/router/help_feedback_page': (context, {arguments}) => HelpFeedbackPage(), '/router/founder_story_page': (context, {arguments}) => FounderStoryPage(), '/router/system_msg_page': (context, {arguments}) => SystemMessagePage(), - '/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(), + '/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(arguments: arguments), // '/router/hot_article_page': (context, {arguments}) => HotArticlePage(), '/router/address_map_page': (context, {arguments}) => AddressMapPage(), '/router/roll_center_page': (context, {arguments}) => RollCenterPage(), diff --git a/lib/main_page.dart b/lib/main_page.dart index 3390b4f0..331f2662 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -297,8 +297,10 @@ class _MainPage extends State with WidgetsBindingObserver { params["activityId"] = pushMap["info"]; break; case 3: - routeName = "/router/union_detail_page"; + routeName = "/router/store_order"; params["id"] = pushMap["info"]; + params["tenant"] = pushMap["tenant"]; + params["storeName"] = pushMap["storeName"]; break; case 4: routeName = "/router/integral_store_page"; diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index b511fea3..50219753 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -296,6 +296,7 @@ class _RechargePage extends State { ), ), GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { checkIndex = 2; @@ -327,37 +328,38 @@ class _RechargePage extends State { ), ), SizedBox(height:10.h), - // GestureDetector( - // onTap: () { - // setState(() { - // checkIndex = 3; - // }); - // }, - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Image.asset( - // "assets/image/icon_alipay.webp"), - // Expanded( - // flex: 1, - // child: Padding( - // padding: EdgeInsets.only(left: 8.w), - // child: Text( - // S.of(context).zhifubao, - // style: TextStyle( - // fontSize: 14.sp, - // color: Color(0xff353535), - // ), - // ), - // ), - // ), - // checkView(3), - // ], - // ), - // ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + checkIndex = 3; + }); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Image.asset( + "assets/image/icon_alipay.webp"), + Expanded( + flex: 1, + child: Padding( + padding: EdgeInsets.only(left: 8.w), + child: Text( + S.of(context).zhifubao, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + ), + ), + ), + ), + checkView(3), + ], + ), + ), ], ), ), @@ -632,7 +634,7 @@ class _RechargePage extends State { Widget checkView(var index) { return Container( - padding: EdgeInsets.only(right: 16.w), + padding: EdgeInsets.only(right: 16.w,left: 46.w), alignment: Alignment.center, child: Image.asset( checkIndex != index diff --git a/lib/order/edit_remarks_page.dart b/lib/order/edit_remarks_page.dart index f30a4f72..638e2dba 100644 --- a/lib/order/edit_remarks_page.dart +++ b/lib/order/edit_remarks_page.dart @@ -5,6 +5,9 @@ import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class EditRemarksPage extends StatefulWidget { + final Map arguments; + + EditRemarksPage({this.arguments}); @override State createState() { return _EditRemarksPage(); @@ -14,6 +17,14 @@ class EditRemarksPage extends StatefulWidget { class _EditRemarksPage extends State { TextEditingController commentTextController = TextEditingController(); + + @override + void initState() { + super.initState(); + if((widget.arguments["remake"]??"") != "") + commentTextController.text = widget.arguments["remake"]; + } + @override Widget build(BuildContext context) { return Scaffold( @@ -75,7 +86,8 @@ class _EditRemarksPage extends State { controller: commentTextController, keyboardType: TextInputType.multiline, maxLines: 10, - decoration: InputDecoration( + decoration: + InputDecoration( isDense: true, hintText: '请填写备注信息,例如:面包切一刀', hintStyle: TextStyle( @@ -97,7 +109,8 @@ class _EditRemarksPage extends State { ), GestureDetector( onTap: (){ - Navigator.pop(context,commentTextController.text); + String notes = commentTextController.text; + Navigator.pop(context,notes); }, child: Container( padding: EdgeInsets.all(16.h), diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index eb37b90a..db277842 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -34,11 +34,11 @@ class OrderDetailPage extends StatefulWidget { class _OrderDetailPage extends State { ApiService apiService; MinApiService minService; + int jumpState; @override void initState() { super.initState(); - SharedPreferences.getInstance().then((value) { apiService = ApiService( Dio(), @@ -48,6 +48,7 @@ class _OrderDetailPage extends State { ); queryDetails(); }); + jumpState = widget.arguments["jumpState"]; } /// 小程序登录 @@ -183,6 +184,7 @@ class _OrderDetailPage extends State { paySelected, _orderCancel, orderInfo, + jumpState ), ///订单商品 diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 682f1c57..84d4ac59 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -155,7 +155,7 @@ class _OrderHistoryList extends State return InkWell( onTap: () { Navigator.of(context).pushNamed('/router/order_details', - arguments: {"id": orderInfos[position].id}); + arguments: {"id": orderInfos[position].id,"jumpState":2}); }, child: orderItem(orderInfos[position]), ); @@ -469,6 +469,7 @@ class _OrderHistoryList extends State text: orderInfo.finalPayPrice, style: TextStyle( fontSize: 12.sp, + fontWeight: FontWeight.bold, color: Colors.black, ), diff --git a/lib/order/order_view/order_address.dart b/lib/order/order_view/order_address.dart index 7ff137ff..30303357 100644 --- a/lib/order/order_view/order_address.dart +++ b/lib/order/order_view/order_address.dart @@ -22,6 +22,7 @@ class OrderAddress extends StatefulWidget { final Function orderCancel; final Function() carryOnPay; final OrderInfo orderInfo; + final int jumpState; OrderAddress( this.orderStatus, @@ -33,7 +34,8 @@ class OrderAddress extends StatefulWidget { this.center, this.carryOnPay, this.orderCancel, - this.orderInfo,); + this.orderInfo, + this.jumpState); @override State createState() { @@ -271,14 +273,18 @@ class _OrderAddress extends State { widget.orderInfo.storeVO.storeName, ); } else { - Navigator.of(context).pushNamed( - '/router/store_order', - arguments: { - "id": widget.orderInfo.storeVO.id, - "tenant": widget.orderInfo.tenantCode, - "storeName": widget.orderInfo.storeVO.storeName - }, - ); + if(widget.jumpState == 1){ + Navigator.of(context).pop(); + }else if(widget.jumpState == 2){ + Navigator.of(context).popAndPushNamed( + '/router/store_order', + arguments: { + "id": widget.orderInfo.storeVO.id, + "tenant": widget.orderInfo.tenantCode, + "storeName": widget.orderInfo.storeVO.storeName + }, + ); + } } } diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 830c108f..c6f656fd 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -698,6 +698,7 @@ class _Settlement extends State { '/router/order_details', arguments: { "id": orderId, + "jumpState":1, }, ); // Navigator.of(context).pop(); @@ -771,7 +772,7 @@ class _Settlement extends State { payChannel, tableId ?? 0); }, queryAddress, storeInfo, address, - selectedAddress, pageType), + selectedAddress, pageType,widget.arguments["distance"]), SizedBox( height: 16, @@ -810,7 +811,7 @@ class _Settlement extends State { () { Navigator.of(context).pushNamed( '/router/edit_remarks_page', - arguments: {}, + arguments: {"remake":remakers} ).then((value) => { setState(() { if (value != null) remakers = value; diff --git a/lib/settlement/settlement_view/distribution.dart b/lib/settlement/settlement_view/distribution.dart index 2abd5a15..e9c2179a 100644 --- a/lib/settlement/settlement_view/distribution.dart +++ b/lib/settlement/settlement_view/distribution.dart @@ -26,9 +26,10 @@ class DistributionMode extends StatefulWidget { final StoreInfo storeInfo; final Address address; final String pageType; + final double distance; DistributionMode(this.queryOrderInfo, this.queryAddress, this.storeInfo, - this.address, this.selectedNewAddress, this.pageType); + this.address, this.selectedNewAddress, this.pageType, this.distance); @override State createState() { @@ -56,7 +57,7 @@ class _DistributionMode extends State { ///定位获取当前的位置 void startLocation() async { - Location.getInstance().startLocation(context, (BaiduLocation result){ + Location.getInstance().startLocation(context, (BaiduLocation result) { if (result != null && result.latitude != null && result.longitude != null) { @@ -261,11 +262,21 @@ class _DistributionMode extends State { Column( children: [ RoundButton( - // width: 41.w, height: 13, text: distance.length > 3 - ? "${distance}km" - : "距离您${distance}km", + ? ((widget.distance ?? 0) > 1000 + ? "${((widget.distance ?? 0) / 1000 * 100).toInt() / 100.0}km" + : S.of(context).mi( + ((widget.distance ?? 0) * + 100) + .toInt() / + 100.0)) + : "距离您${(widget.distance ?? 0) > 1000 ? + "${((widget.distance ?? 0) / 1000 * 100).toInt() / 100.0}km" + : S.of(context).mi(((widget.distance ?? 0) * 100).toInt() / 100.0)}", + // distance.length > 3 + // ? "${distance}km" + // : "距离您${distance}km", textColor: Color(0xFF34A262), fontWeight: MyFontWeight.semi_bold, radius: 7.5, @@ -310,16 +321,17 @@ class _DistributionMode extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - (widget.storeInfo.storeName == "一心回乡商城") ? - Icon( - Icons.local_shipping, - color: Color(0xFF727272), - size: 24, - ):Image.asset( - "assets/image/icon_permission_location.webp", - height: 24.h, - width: 24.w, - ), + (widget.storeInfo.storeName == "一心回乡商城") + ? Icon( + Icons.local_shipping, + color: Color(0xFF727272), + size: 24, + ) + : Image.asset( + "assets/image/icon_permission_location.webp", + height: 24.h, + width: 24.w, + ), SizedBox(width: 5), Text( widget?.address?.username ?? "", diff --git a/lib/settlement/settlement_view/pay_method.dart b/lib/settlement/settlement_view/pay_method.dart index 65a11ec1..d947eef9 100644 --- a/lib/settlement/settlement_view/pay_method.dart +++ b/lib/settlement/settlement_view/pay_method.dart @@ -90,6 +90,7 @@ class _PayMethod extends State { ), if(!(widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { checkIndex = 1; @@ -134,6 +135,7 @@ class _PayMethod extends State { ), if(!(widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { checkIndex = 2; @@ -178,6 +180,7 @@ class _PayMethod extends State { ), if(mGreenMoney!="0.00" && !(widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { checkIndex = 3; @@ -231,6 +234,7 @@ class _PayMethod extends State { ), if(mRaiseMoney!="0" && (widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { checkIndex = 4; @@ -284,6 +288,7 @@ class _PayMethod extends State { ), if(!(widget.settleOrderInfo?.isRaise ?? false)) GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { checkIndex = 5; @@ -320,7 +325,7 @@ class _PayMethod extends State { Widget checkView(var index) { return Container( - padding: EdgeInsets.only(right: 16.w), + padding: EdgeInsets.only(right:36.w), alignment: Alignment.center, child: Image.asset( checkIndex != index diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index d857f643..305216f7 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -65,6 +65,7 @@ class _ShopDetailsPage extends State { String storeId; String parentId; int numberOfPeople = 0; + int index; @override void initState() { @@ -91,7 +92,6 @@ class _ShopDetailsPage extends State { buildCount(); } - /// 查询店铺信息 queryStoreInfo() async { SharedPreferences value = await SharedPreferences.getInstance(); @@ -152,7 +152,6 @@ class _ShopDetailsPage extends State { }); } - ///商品详情 queryMiNiDetail(id) async { BaseData baseData = @@ -938,10 +937,8 @@ class _ShopDetailsPage extends State { child: Container( margin: EdgeInsets.only(left: 16, top: 52), padding: EdgeInsets.all(5), - child: Icon( - Icons.arrow_back_ios, - size: 24, - color: Color(0xFF353535), + child: Image.asset( + "assets/image/integral_return.webp", ), ), ), @@ -959,205 +956,199 @@ class _ShopDetailsPage extends State { context, state, ) { - return WillPopScope( - onWillPop: () async => false, - child:Container( - alignment: Alignment.topCenter, - padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16), - height: MediaQuery.of(context).size.height / 3 * 2, - width: double.infinity, - decoration: BoxDecoration( - color: Color(0xFFFAFAFA), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), - ), - ), - child: Column( + return Container( + alignment: Alignment.topCenter, + padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16), + height: MediaQuery.of(context).size.height / 3 * 2, + width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFFFAFAFA), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ClipRRect( - child: MImage( - miNiDetail.imgs[0], - fit: BoxFit.cover, - width: 70, - height: 70, - errorSrc: "assets/image/default_2_1.webp", - fadeSrc: "assets/image/default_2_1.webp", - ), - borderRadius: BorderRadius.circular(4), - ), - SizedBox( - width: 10.w, - ), - Expanded( - child: Container( - height: 70, - child: Column( + ClipRRect( + child: MImage( + miNiDetail.imgs[0], + fit: BoxFit.cover, + width: 70, + height: 70, + errorSrc: "assets/image/default_2_1.webp", + fadeSrc: "assets/image/default_2_1.webp", + ), + borderRadius: BorderRadius.circular(4), + ), + SizedBox( + width: 10.w, + ), + Expanded( + child: Container( + height: 70, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - miNiDetail?.productName ?? "", - style: TextStyle( - fontSize: 13.sp, - fontWeight: FontWeight.bold, - color: Color(0xFF000000), - ), - ), - GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, - child: Image.asset( - "assets/image/cancel.webp", - fit: BoxFit.cover, - height: 24, - width: 24, - ), - ), - ], - ), Text( - "¥${miNiDetail?.price ?? ""}", + miNiDetail?.productName ?? "", style: TextStyle( - fontSize: 12.sp, + fontSize: 13.sp, fontWeight: FontWeight.bold, - color: Color(0xFFF65720), + color: Color(0xFF000000), + ), + ), + GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Image.asset( + "assets/image/cancel.webp", + fit: BoxFit.cover, + height: 24, + width: 24, ), ), ], ), - )), - ], - ), - if (miNiDetail.attrList != null && - miNiDetail.attrList.length > 0) - SizedBox( - height: 10, - ), - if (miNiDetail.attrList != null && - miNiDetail.attrList.length > 0) - Expanded( - child: ListView.builder( - itemCount: miNiDetail.attrList.length, - scrollDirection: Axis.vertical, - physics: BouncingScrollPhysics(), - padding: EdgeInsets.zero, - itemBuilder: (context, position) { - return attrItem( - (attrValue) { - state(() { - // if(selectSkus.length > position) - selectSkus[position] = attrValue; - buildCount(); - }); - }, - miNiDetail.attrList[position], - position, - ); + Text( + "¥${miNiDetail?.price ?? ""}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.bold, + color: Color(0xFFF65720), + ), + ), + ], + ), + )), + ], + ), + if (miNiDetail.attrList != null && + miNiDetail.attrList.length > 0) + SizedBox( + height: 10, + ), + if (miNiDetail.attrList != null && + miNiDetail.attrList.length > 0) + Expanded( + child: ListView.builder( + itemCount: miNiDetail.attrList.length, + scrollDirection: Axis.vertical, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.zero, + itemBuilder: (context, position) { + return attrItem( + (attrValue) { + state(() { + // if(selectSkus.length > position) + selectSkus[position] = attrValue; + buildCount(); + }); }, - ), + miNiDetail.attrList[position], + position, + ); + }, + ), + ), + SizedBox( + height: 24, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "数量", + style: TextStyle( + color: Color(0xFFB3B3B3), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, ), + ), SizedBox( - height: 24, + height: 10, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, + Row( children: [ - Text( - "数量", - style: TextStyle( - color: Color(0xFFB3B3B3), - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - ), - ), - SizedBox( - height: 10, - ), - Row( - children: [ - InkWell( - onTap: () { - state(() { - if (counts > 1) - setState(() { - counts -= 1; - }); - reduce(miNiDetail, selectSkus); + InkWell( + onTap: () { + state(() { + if (counts > 1) + setState(() { + counts -= 1; }); - }, - child: Icon( - Icons.remove, - color: Color(0xFF32A060), - size: 24, - ) - // Image.asset( - // "assets/image/reduce.webp", - // width: 22, - // height: 22, - // ), - ), - Padding( - padding: EdgeInsets.only(left: 8, right: 8), - child: Text( - "$counts", - style: TextStyle( - color: Colors.black, - fontSize: 14.sp, - fontWeight: MyFontWeight.medium, - ), - ), + // reduce(miNiDetail, selectSkus); + }); + }, + child: Icon( + Icons.remove, + color: Color(0xFF32A060), + size: 24, + ) + ), + Padding( + padding: EdgeInsets.only(left: 8, right: 8), + child: Text( + "$counts", + style: TextStyle( + color: Colors.black, + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, ), - InkWell( - onTap: () { - state(() { - counts += 1; - add(miNiDetail, selectSkus); - }); - }, - child: Icon( - Icons.add, - color: Color(0xFF32A060), - size: 24, - )), - ], - ) + ), + ), + InkWell( + onTap: () { + state(() { + counts += 1; + // add(miNiDetail, selectSkus); + }); + }, + child: Icon( + Icons.add, + color: Color(0xFF32A060), + size: 24, + )), ], - ), - SizedBox( - height: 24, - ), - RoundButton( - width: double.infinity, - height: 54.h, - text: "加入购物车", - textColor: Colors.white, - fontWeight: MyFontWeight.semi_bold, - radius: 27, - backgroup: Color(0xFF32A060), - fontSize: 16.sp, - callback: () { - state(() { - _addShopCar(miNiDetail, selectSkus, counts); - Navigator.of(context).pop(); - }); - }, - ), + ) ], ), - )); + SizedBox( + height: 24, + ), + RoundButton( + width: double.infinity, + height: 54.h, + text: "加入购物车", + textColor: Colors.white, + fontWeight: MyFontWeight.semi_bold, + radius: 27, + backgroup: Color(0xFF32A060), + fontSize: 16.sp, + callback: () { + state(() { + _addShopCar(miNiDetail, selectSkus, counts); + counts = 1; + Navigator.of(context).pop(); + }); + }, + ), + ], + ), + ); }); }, backgroundColor: Colors.transparent, diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index eb9d9849..5491a73b 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -515,12 +515,12 @@ class _StoreOrderPage extends State Spacer(), GestureDetector( onTap: () { - // if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now())) - // &&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){ + if(AppUtils.compareTime(storeInfo.openStartTime,DateFormat('HH:mm:ss').format(DateTime.now())) + &&(!AppUtils.compareTime(storeInfo.openEndTime,DateFormat('HH:mm:ss').format(DateTime.now())))){ toDownOrder(); - // } - // else - // SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center); + } + else + SmartDialog.showToast("营业时间:${storeInfo.openStartTime}-${storeInfo.openEndTime}", alignment: Alignment.center); }, child: RoundButton( width: 103.w, @@ -649,6 +649,7 @@ class _StoreOrderPage extends State "cid": cid, "shoppingCart": shopCarGoods, "numberOfPeople": numberOfPeople, + "distance":widget.arguments["distance"], }, ); if (tableId > 0) { @@ -737,15 +738,16 @@ class _StoreOrderPage extends State _queryMiNiDetail(String id, int count) async { EasyLoading.show(status: S.current.zhengzaijiazai); if (count < 0) { - shopCarGoods.shoppingCartSkuItemList.forEach((element) { + shopCarGoods.shoppingCartSkuItemList.forEach((element) async{ if (element.productId == id) { - shopCartReduce(element); + await shopCartReduce(element); setState(() {}); } }); return; } BaseData baseData = await minService.miNiDetail(id); + EasyLoading.dismiss(); if (baseData != null && baseData.isSuccess) { showStoreSelector(baseData.data, id, count); } @@ -758,20 +760,19 @@ class _StoreOrderPage extends State } else { EasyLoading.dismiss(); dialogShowing = true; - SmartDialog.show( - widget: ProductSku( - miNiDetail, - shopCarGoods, - id, - _addShopCar, - add, - reduce, - ), - onDismiss: () { - dialogShowing = false; - }, - alignmentTemp: Alignment.bottomCenter, - ); + showModalBottomSheet( + backgroundColor: Colors.transparent, + context: context, + builder: (_) { + return ProductSku( + miNiDetail, + shopCarGoods, + id, + _addShopCar, + add, + reduce, + ); + }); } } @@ -822,12 +823,10 @@ class _StoreOrderPage extends State }, ], }); - EasyLoading.dismiss(); + // EasyLoading.dismiss(); if (baseDate != null && baseDate.isSuccess) { - queryShopCar().then((value) { - this.shopCarGoods = value; - setState(() {}); - }); + this.shopCarGoods = await queryShopCar(); + setState(() {}); } else { SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center); } @@ -917,7 +916,7 @@ class _StoreOrderPage extends State if (productSku == null) return; String skuId = productSku.id; if (shopCarGoods == null) { - await _addShopCar(miNiDetail, selectSkus, 2); + await _addShopCar(miNiDetail, selectSkus, 1); return; } int shopSkuIndex = shopCarGoods.shoppingCartSkuItemList @@ -932,17 +931,16 @@ class _StoreOrderPage extends State .firstWhere((element) => skuId == element.id); shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; } else { - await _addShopCar(miNiDetail, selectSkus, 2); + await _addShopCar(miNiDetail, selectSkus, 1); return; } BaseData> baseDate = await minService.shoppingCartSingle(shopCarTemp); if (baseDate.isSuccess) { - queryShopCar().then((value) { - this.shopCarGoods = value; - setState(() {}); - }); + this.shopCarGoods = await queryShopCar(); + debugPrint("count.toString()"); + setState(() {}); } } @@ -956,7 +954,7 @@ class _StoreOrderPage extends State if (productSku == null) return; String skuId = productSku.id; if (shopCarGoods == null) { - await _addShopCar(miNiDetail, selectSkus, 2); + await _addShopCar(miNiDetail, selectSkus, 1); return; } ShoppingCartSkuItemListBean shopSkuItem = shopCarGoods @@ -970,7 +968,7 @@ class _StoreOrderPage extends State shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum -= 1; } } else { - await _addShopCar(miNiDetail, selectSkus, 2); + await _addShopCar(miNiDetail, selectSkus, 1); return; } shopCarGoods.tableId = "$tableId"; diff --git a/lib/store/store_view/product_sku.dart b/lib/store/store_view/product_sku.dart index 72d8ee88..525be6ce 100644 --- a/lib/store/store_view/product_sku.dart +++ b/lib/store/store_view/product_sku.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -9,24 +10,18 @@ import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/round_button.dart'; class ProductSku extends StatefulWidget { - final MiNiDetail miNiDetail; final String productId; - final Function(MiNiDetail miNiDetail, List selectSkus, int count) addShopCar; + final Function(MiNiDetail miNiDetail, List selectSkus, int count) + addShopCar; final Function(MiNiDetail miNiDetail, List selectSkus) add; final Function(MiNiDetail miNiDetail, List selectSkus) reduce; final ShoppingCart shopCarGoods; - final int buttonType; + final int buttonType; - ProductSku( - this.miNiDetail, - this.shopCarGoods, - this.productId, - this.addShopCar, - this.add, - this.reduce, - { this.buttonType} - ); + ProductSku(this.miNiDetail, this.shopCarGoods, this.productId, + this.addShopCar, this.add, this.reduce, + {this.buttonType}); @override State createState() { @@ -36,8 +31,9 @@ class ProductSku extends StatefulWidget { class _ProductSku extends State { List selectSkus = []; - int count = 1; + int count = 1, realCount = 0; String selectedPrice = ""; + bool _isTapEd = false; @override void initState() { @@ -57,16 +53,19 @@ class _ProductSku extends State { productSku = widget.miNiDetail.productSkuVOList.firstWhere((element) { return skuY(element, selectSkus); }); - }catch(ex){ + } catch (ex) { return; } if (productSku == null) return; selectedPrice = productSku.skuPrice; String skuId = productSku.id; - if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return; - int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id); + if (widget.shopCarGoods == null || + widget.shopCarGoods.shoppingCartSkuItemList == null) return; + int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList + .indexWhere((element) => skuId == element.id); if (shopSkuIndex >= 0) { count = widget.shopCarGoods.shoppingCartSkuItemList[shopSkuIndex].buyNum; + realCount = count; } } @@ -81,19 +80,19 @@ class _ProductSku extends State { return gg; } - @override Widget build(BuildContext context) { return WillPopScope( onWillPop: () async { - debugPrint("ssssasdadsasdadasd"); - SmartDialog.dismiss(); + // debugPrint("ssssasdadsasdadasd"); + // SmartDialog.dismiss(); + Navigator.of(context).pop(); return true; }, child: StatefulBuilder(builder: (context1, state) { return Container( alignment: Alignment.topCenter, - padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 16), height: MediaQuery.of(context).size.height / 3 * 2, width: double.infinity, decoration: BoxDecoration( @@ -124,7 +123,8 @@ class _ProductSku extends State { SizedBox( width: 10, ), - Expanded(child:Column( + Expanded( + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -136,12 +136,15 @@ class _ProductSku extends State { fontWeight: MyFontWeight.medium, ), ), - if(widget.miNiDetail.attrList[0].attrName!="") + if (widget.miNiDetail.attrList[0].attrName != "") Padding( padding: EdgeInsets.only(top: 4, bottom: 7), child: Text( "已选: " + - (selectSkus.map((e) => "$e").toList().toString()), + (selectSkus + .map((e) => "$e") + .toList() + .toString()), maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -175,8 +178,8 @@ class _ProductSku extends State { )), InkWell( onTap: () { - // Navigator.of(context).pop(); - SmartDialog.dismiss(); + Navigator.of(context).pop(); + // SmartDialog.dismiss(); }, child: Image.asset( "assets/image/cancel.webp", @@ -187,11 +190,14 @@ class _ProductSku extends State { ), ], ), - if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0) + if (widget.miNiDetail.attrList != null && + widget.miNiDetail.attrList.length > 0) SizedBox( - height:10, + height: 10, ), - if (widget.miNiDetail.attrList != null && widget.miNiDetail.attrList.length > 0 && widget.miNiDetail.attrList[0].attrName!="") + if (widget.miNiDetail.attrList != null && + widget.miNiDetail.attrList.length > 0 && + widget.miNiDetail.attrList[0].attrName != "") Expanded( child: ListView.builder( itemCount: widget.miNiDetail.attrList.length, @@ -200,7 +206,7 @@ class _ProductSku extends State { padding: EdgeInsets.zero, itemBuilder: (context, position) { return attrItem( - (attrValue) { + (attrValue) { state(() { selectSkus[position] = attrValue; buildCount(); @@ -212,8 +218,8 @@ class _ProductSku extends State { }, ), ), - if (widget.miNiDetail.attrList[0].attrName=="") - Expanded(child: Container()), + if (widget.miNiDetail.attrList[0].attrName == "") + Expanded(child: Container()), SizedBox( height: 24, ), @@ -231,12 +237,15 @@ class _ProductSku extends State { ), ), InkWell( - onTap: () { - if (count > 1) - setState(() { - count -= 1; - }); - widget.reduce(widget.miNiDetail, selectSkus); + onTap: () async { + if(count == 1) + return; + _isTapEd = true; + EasyLoading.show(status: S.current.zhengzaijiazai); + await widget.reduce(widget.miNiDetail, selectSkus); + count -= 1; + setState(() {}); + EasyLoading.dismiss(); }, child: Image.asset( "assets/image/reduce.webp", @@ -256,11 +265,17 @@ class _ProductSku extends State { ), ), InkWell( - onTap: () { - setState(() { - count += 1; - }); - widget.add(widget.miNiDetail, selectSkus); + onTap: () async { + _isTapEd = true; + EasyLoading.show(status: S.current.zhengzaijiazai); + if (count == 1 && realCount == 0) + await widget.addShopCar( + widget.miNiDetail, selectSkus, 2); + else + await widget.add(widget.miNiDetail, selectSkus); + count += 1; + setState(() {}); + EasyLoading.dismiss(); }, child: Image.asset( "assets/image/add.webp", @@ -273,7 +288,7 @@ class _ProductSku extends State { SizedBox( height: 24, ), - if(widget.buttonType != 1) + if (widget.buttonType != 1) RoundButton( width: double.infinity, height: 54.h, @@ -284,12 +299,13 @@ class _ProductSku extends State { backgroup: Color(0xFF32A060), fontSize: 16.sp, callback: () { - // Navigator.of(context).pop(); - SmartDialog.dismiss(); - widget.addShopCar(widget.miNiDetail, selectSkus, 1); + Navigator.of(context).pop(); + // SmartDialog.dismiss(); + if (!_isTapEd) + widget.addShopCar(widget.miNiDetail, selectSkus, 1); }, ), - if(widget.buttonType == 1) + if (widget.buttonType == 1) RoundButton( width: double.infinity, height: 54.h, @@ -300,72 +316,21 @@ class _ProductSku extends State { backgroup: Color(0xFF32A060), fontSize: 16.sp, callback: () { - // Navigator.of(context).pop(); - SmartDialog.dismiss(); - widget.addShopCar(widget.miNiDetail, selectSkus,count); + Navigator.of(context).pop(); + // SmartDialog.dismiss(); + widget.addShopCar(widget.miNiDetail, selectSkus, count); }, ), + ///秒杀按钮 - if(widget.buttonType == 2) + if (widget.buttonType == 2) Row( children: [ - Expanded(child: GestureDetector( - onTap: (){ - Navigator.of(context).pushReplacementNamed('/router/group_details'); - }, - child: Container( - alignment: Alignment.center, - width: 120.w, - height:40.h, - margin: EdgeInsets.only(left: 6.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - border: Border.all( - width: 1, - color: Color(0xFF32A060), - style: BorderStyle.solid, - ), - ), - child: Column( - children: [ - Text.rich( - TextSpan( - children: [ - TextSpan( - text: "¥", - style: TextStyle( - fontSize: 7.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), - ), - TextSpan( - text: "284.00", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), - ), - ], - ), - ), - Expanded(child: - Text( - "原价购买", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), - )), - ], - ), - ), - ),), - Expanded(child: GestureDetector( - onTap: (){ - Navigator.of(context).popAndPushNamed('/router/bargain_details'); + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context) + .pushReplacementNamed('/router/group_details'); }, child: Container( alignment: Alignment.center, @@ -373,16 +338,12 @@ class _ProductSku extends State { height: 40.h, margin: EdgeInsets.only(left: 6.w), decoration: BoxDecoration( - color: Color(0xFF32A060), borderRadius: BorderRadius.circular(16), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ), - ], + border: Border.all( + width: 1, + color: Color(0xFF32A060), + style: BorderStyle.solid, + ), ), child: Column( children: [ @@ -394,7 +355,7 @@ class _ProductSku extends State { style: TextStyle( fontSize: 7.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), ), TextSpan( @@ -402,89 +363,99 @@ class _ProductSku extends State { style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), ), ], ), ), - Expanded(child: - Text( - "我要砍价", + Expanded( + child: Text( + "原价购买", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), - ),), + )), ], ), - )),), - - - ], - ), - ///砍价 - if(widget.buttonType == 3) - Row( - children: [ - Expanded(child:GestureDetector( - onTap: (){ - Navigator.of(context).popAndPushNamed('/router/group_details'); - }, - child: Container( - alignment: Alignment.center, - width: 120.w, - height:40.h, - margin: EdgeInsets.only(left: 6.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - border: Border.all( - width: 1, - color: Color(0xFF32A060), - style: BorderStyle.solid, - ), ), - child: Column( - children: [ - Text.rich( - TextSpan( - children: [ + ), + ), + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context) + .popAndPushNamed('/router/bargain_details'); + }, + child: Container( + alignment: Alignment.center, + width: 120.w, + height: 40.h, + margin: EdgeInsets.only(left: 6.w), + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + children: [ + Text.rich( TextSpan( - text: "¥", - style: TextStyle( - fontSize: 7.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 7.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ], ), - TextSpan( - text: "284.00", + ), + Expanded( + child: Text( + "我要砍价", style: TextStyle( - fontSize: 10.sp, + fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), + color: Colors.white, ), ), - ], - ), + ), + ], ), - Expanded(child: - Text( - "原价购买", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), - )), - ], - ), - ), - ),), - Expanded(child:GestureDetector( - onTap: (){ - Navigator.of(context).popAndPushNamed('/router/bargain_details'); + )), + ), + ], + ), + + ///砍价 + if (widget.buttonType == 3) + Row( + children: [ + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context) + .popAndPushNamed('/router/group_details'); }, child: Container( alignment: Alignment.center, @@ -492,16 +463,12 @@ class _ProductSku extends State { height: 40.h, margin: EdgeInsets.only(left: 6.w), decoration: BoxDecoration( - color: Color(0xFF32A060), borderRadius: BorderRadius.circular(16), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ), - ], + border: Border.all( + width: 1, + color: Color(0xFF32A060), + style: BorderStyle.solid, + ), ), child: Column( children: [ @@ -513,7 +480,7 @@ class _ProductSku extends State { style: TextStyle( fontSize: 7.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), ), TextSpan( @@ -521,87 +488,99 @@ class _ProductSku extends State { style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), ), ], ), ), - Expanded(child: - Text( - "我要秒杀", + Expanded( + child: Text( + "原价购买", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), - ),), + )), ], ), - )),), - ], - ), - ///拼团按钮 - if(widget.buttonType == 4) - Row( - children: [ - Expanded(child: GestureDetector( - onTap: (){ - Navigator.of(context).popAndPushNamed('/router/group_details'); - }, - child: Container( - alignment: Alignment.center, - width: 120.w, - height:40.h, - margin: EdgeInsets.only(left: 6.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - border: Border.all( - width: 1, - color: Color(0xFF32A060), - style: BorderStyle.solid, ), ), - child: Column( - children: [ - Text.rich( - TextSpan( + ), + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context) + .popAndPushNamed('/router/bargain_details'); + }, + child: Container( + alignment: Alignment.center, + width: 120.w, + height: 40.h, + margin: EdgeInsets.only(left: 6.w), + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( children: [ - TextSpan( - text: "¥", - style: TextStyle( - fontSize: 7.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 7.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ], ), ), - TextSpan( - text: "284.00", - style: TextStyle( - fontSize: 10.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), + Expanded( + child: Text( + "我要秒杀", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), ), ), ], ), - ), - Expanded(child: - Text( - "单人购买", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.medium, - color: Color(0xFF32A060), - ), )), - ], - ), ), - )), - Expanded(child:GestureDetector( - onTap: (){ - Navigator.of(context).popAndPushNamed('/router/bargain_details'); + ], + ), + + ///拼团按钮 + if (widget.buttonType == 4) + Row( + children: [ + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context) + .popAndPushNamed('/router/group_details'); }, child: Container( alignment: Alignment.center, @@ -609,16 +588,12 @@ class _ProductSku extends State { height: 40.h, margin: EdgeInsets.only(left: 6.w), decoration: BoxDecoration( - color: Color(0xFF32A060), borderRadius: BorderRadius.circular(16), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0, - ), - ], + border: Border.all( + width: 1, + color: Color(0xFF32A060), + style: BorderStyle.solid, + ), ), child: Column( children: [ @@ -630,7 +605,7 @@ class _ProductSku extends State { style: TextStyle( fontSize: 7.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), ), TextSpan( @@ -638,26 +613,88 @@ class _ProductSku extends State { style: TextStyle( fontSize: 10.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), ), ], ), ), - Expanded(child: - Text( - "我要开团", + Expanded( + child: Text( + "单人购买", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.medium, - color: Colors.white, + color: Color(0xFF32A060), ), - ),), + )), ], ), - )),), - ], - ), + ), + )), + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context) + .popAndPushNamed('/router/bargain_details'); + }, + child: Container( + alignment: Alignment.center, + width: 120.w, + height: 40.h, + margin: EdgeInsets.only(left: 6.w), + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 7.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + TextSpan( + text: "284.00", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ], + ), + ), + Expanded( + child: Text( + "我要开团", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ), + ], + ), + )), + ), + ], + ), SizedBox( height: 21.h, ), @@ -669,7 +706,8 @@ class _ProductSku extends State { } Widget attrItem(Function fc, AttrListBean attrListBean, position) { - if (attrListBean.attrValueList != null && attrListBean.attrValueList.length > 0) + if (attrListBean.attrValueList != null && + attrListBean.attrValueList.length > 0) return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -684,7 +722,7 @@ class _ProductSku extends State { ), ), ), - sweetnessStore(fc,attrListBean.attrValueList, position), + sweetnessStore(fc, attrListBean.attrValueList, position), // sweetnessStore(fc, attrListBean.attrValueList, position), ], ); @@ -723,16 +761,17 @@ class _ProductSku extends State { // ); // } - Widget sweetnessStore(Function fc,List arrays, position){ + Widget sweetnessStore(Function fc, List arrays, position) { return Wrap( runSpacing: 10.0, spacing: 10.0, - children: arrays.take(arrays.length).map((AttrValueListBean tag) { + children: + arrays.take(arrays.length).map((AttrValueListBean tag) { return GestureDetector( onTap: () { fc(tag.attrValue); }, - child:sweetnessItem( + child: sweetnessItem( tag.attrValue, (tag.attrValue == selectSkus[position]) ?? false, )); @@ -741,27 +780,26 @@ class _ProductSku extends State { Widget sweetnessItem(String name, bool isCheck) { return Container( - padding: const EdgeInsets.symmetric(vertical:5.0,horizontal: 12.0), - decoration: BoxDecoration( - color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFFF0FAF4), - border: Border.all( - width: !isCheck ? 0:1, - color: !isCheck ? Color(0xFFF2F2F2):Color(0xFF32A060), - style: BorderStyle.solid, - ), - borderRadius: const BorderRadius.all( - Radius.circular(4.0), - ), - ), - child: Text( - name, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color:!isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060), - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, + padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 12.0), + decoration: BoxDecoration( + color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFFF0FAF4), + border: Border.all( + width: !isCheck ? 0 : 1, + color: !isCheck ? Color(0xFFF2F2F2) : Color(0xFF32A060), + style: BorderStyle.solid, + ), + borderRadius: const BorderRadius.all( + Radius.circular(4.0), + ), ), - )); + child: Text( + name, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: !isCheck ? Color(0xFF4D4D4D) : Color(0xFF32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + ), + )); } - } diff --git a/lib/store/store_view/shop_goods.dart b/lib/store/store_view/shop_goods.dart index c433a4bc..976dfa9b 100644 --- a/lib/store/store_view/shop_goods.dart +++ b/lib/store/store_view/shop_goods.dart @@ -94,10 +94,10 @@ class _ShopGoods extends State { Widget build(BuildContext context) { return Container( color: Colors.white, - padding: EdgeInsets.only( - right: 16.w, - // bottom: 20.h, - ), + // padding: EdgeInsets.only( + // right: 16.w, + // // bottom: 20.h, + // ), height: 123.h, child: Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -125,7 +125,8 @@ class _ShopGoods extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( + Padding(padding: EdgeInsets.only(right: 16.w), + child: Row( children: [ Expanded( child: Text( @@ -156,11 +157,12 @@ class _ShopGoods extends State { // ), // ), ], - ), + ),), SizedBox( height: 2.h, ), - Row( + Padding(padding: EdgeInsets.only(right: 16.w), + child: Row( children: [ Expanded( child: Text( @@ -180,11 +182,12 @@ class _ShopGoods extends State { width: 10, ), ], - ), + )), SizedBox( height: 7.h, ), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ @@ -219,35 +222,38 @@ class _ShopGoods extends State { // ), ], ), - Spacer(), if (!widget.isShopCart && (widget.productListBean?.attrStyle ?? 0) == 1) - Stack( + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () async{ + if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){ + showDeleteDialog(); + }else{ + widget.queryMiNiDetail( + widget.productListBean != null + ? widget.productListBean.id + : widget.shoppingCartSkuItemListBean + .productId, + 0); + } + }, + child:Container( + padding: EdgeInsets.only(right: 16.w), + child: Stack( children: [ - Container( - margin: EdgeInsets.only(right: 8, top: 4), - child: RoundButton( - // width: 49.w, - text: S.of(context).xuanguige, - textColor: Colors.white, - fontWeight: MyFontWeight.medium, - radius: 3, - backgroup: Color(0xFF32A060), - fontSize: 11.sp, - padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 3.w), - callback: () { - if(widget.storeInfo.posType.code == "NORMALSTORE"&& widget.tableId == 0){ - showDeleteDialog(); - }else{ - widget.queryMiNiDetail( - widget.productListBean != null - ? widget.productListBean.id - : widget.shoppingCartSkuItemListBean - .productId, - 0); - } - }, - ), + Container( + padding: EdgeInsets.only(left:35.w,top: 4.h,bottom: 4.h,), + margin: EdgeInsets.only(right: 8, top: 4), + child: RoundButton( + text: S.of(context).xuanguige, + textColor: Colors.white, + fontWeight: MyFontWeight.medium, + radius: 3, + backgroup: Color(0xFF32A060), + fontSize: 11.sp, + padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 3.w), + ), ), Positioned( right: 0, @@ -266,26 +272,32 @@ class _ShopGoods extends State { ), ), ], - ), + ),)), if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0) - InkWell( - onTap: () { - if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ - showDeleteDialog(); - }else{ - widget.reduce(widget.shoppingCartSkuItemListBean);} - }, - child: Image.asset( - "assets/image/reduce.webp", - width: 22, - height: 22.h, + Spacer(), + if (widget.isShopCart || + (widget.productListBean?.attrStyle ?? 0) == 0) + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () async{ + if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ + showDeleteDialog(); + }else{ + widget.reduce(widget.shoppingCartSkuItemListBean);} + }, + child: Container( + padding: EdgeInsets.only(left: 15.w,right: 6.w), + child: Image.asset( + "assets/image/reduce.webp", + width: 22, + height: 22.h, + ), ), ), if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0) Container( - width: 30, alignment: Alignment.center, child: Text( "${widget.count}", @@ -298,31 +310,35 @@ class _ShopGoods extends State { ), if (widget.isShopCart || (widget.productListBean?.attrStyle ?? 0) == 0) - GestureDetector( - onTap: () async{ - if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ - showDeleteDialog(); - }else{ - if(_jumpType == -1) - queryMiNiDetail(widget.productListBean.id); - else if(_jumpType == 0) - widget.add(widget.shoppingCartSkuItemListBean); - else if(_jumpType == 1) - await Navigator.of(context) - .pushNamed('/router/product_meals_sku', arguments: { - "id":widget.productListBean.id, - "storeId":widget.productListBean.storeId, - "tableId":widget.tableId - }); - widget.queryShoppingCart(); + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () async{ + if(widget.storeInfo.posType.code == "NORMALSTORE" && widget.tableId == 0){ + showDeleteDialog(); + }else{ + if(_jumpType == -1) + queryMiNiDetail(widget.productListBean.id); + else if(_jumpType == 0) + widget.add(widget.shoppingCartSkuItemListBean); + else if(_jumpType == 1) + await Navigator.of(context) + .pushNamed('/router/product_meals_sku', arguments: { + "id":widget.productListBean.id, + "storeId":widget.productListBean.storeId, + "tableId":widget.tableId + }); + widget.queryShoppingCart(); } - }, - child: Image.asset( + }, + child: Container( + padding: EdgeInsets.only(left: 6.w,right:16.w), + child: Image.asset( "assets/image/add.webp", width: 22, height: 22.h, ), ), + ), ], ), SizedBox( diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index 0260d7de..ee005ff7 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -87,7 +87,8 @@ class _UnionList extends State { arguments: { "id": widget.storeList[position].id, "tenant": widget.storeList[position].tenantCode, - "storeName": widget.storeList[position].storeName + "storeName": widget.storeList[position].storeName, + "distance":widget.storeList[position].distance }, ); } diff --git a/lib/view_widget/activity_poster.dart b/lib/view_widget/activity_poster.dart index 66141e50..45b0b334 100644 --- a/lib/view_widget/activity_poster.dart +++ b/lib/view_widget/activity_poster.dart @@ -22,7 +22,9 @@ class ActivityPoster extends StatefulWidget { class _ActivityPoster extends State { @override Widget build(BuildContext context) { - return Container( + return WillPopScope( + onWillPop: () async => false, + child:Container( width: double.infinity, alignment: Alignment.center, margin: EdgeInsets.only( @@ -69,7 +71,7 @@ class _ActivityPoster extends State { ) ) ], ), - ); + )); } /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) From 772113ed15bcb4d73cdf7964aa0800b3801cc74a Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 1 Mar 2023 13:57:51 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E6=B6=88=E6=81=AFui=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/message/system_message.dart | 702 +++++++++++++++++--------------- 1 file changed, 380 insertions(+), 322 deletions(-) diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index d4325106..b8631255 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -28,13 +28,13 @@ class _SystemMessagePage extends State { ApiService apiService; int pageNum = 1; List messages = []; - Map msgNumber = { - "1":0, - "2":0, - "3":0, - "4":0, - "5":0, - "6":0, + Map msgNumber = { + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, }; int state = 0; @@ -75,7 +75,7 @@ class _SystemMessagePage extends State { List message = []; message.addAll(baseData.data.list); message.forEach((element) { - if(element.typed==2 || element.typed==3){ + if (element.typed == 2 || element.typed == 3) { messages.add(element); } }); @@ -102,14 +102,15 @@ class _SystemMessagePage extends State { token: value.getString("token"), ); } - BaseData> baseData = await apiService.stats().catchError((onError) {}); + BaseData> baseData = + await apiService.stats().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { msgNumber.forEach((key, value) { msgNumber[key] = 0; }); baseData.data.forEach((element) { - if(msgNumber.containsKey(element.name)){ + if (msgNumber.containsKey(element.name)) { msgNumber[element.name] = element.number; } }); @@ -125,34 +126,34 @@ class _SystemMessagePage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: MyAppBar( - background: Colors.white, - leadingColor: Colors.black, - title: S.of(context).xiaoxi, - titleSize: 18.sp, - titleColor: Colors.black, - actions: [ - Container( - margin: EdgeInsets.only(right: 16.w), - alignment: Alignment.centerRight, - child: GestureDetector( - onTap: () { - setState(() { - queryMsgStats(); - }); - }, - child: Text( - S.of(context).biaoweiyidu, - style: TextStyle( - fontSize: 16.sp, - fontWeight:MyFontWeight.semi_bold, - color: Color(0xFF353535), - ), - ), - ), - ), - ], - ), + // appBar: MyAppBar( + // background: Colors.white, + // leadingColor: Colors.black, + // title: S.of(context).xiaoxi, + // titleSize: 18.sp, + // titleColor: Colors.black, + // actions: [ + // Container( + // margin: EdgeInsets.only(right: 16.w), + // alignment: Alignment.centerRight, + // child: GestureDetector( + // onTap: () { + // setState(() { + // queryMsgStats(); + // }); + // }, + // child: Text( + // S.of(context).biaoweiyidu, + // style: TextStyle( + // fontSize: 16.sp, + // fontWeight:MyFontWeight.semi_bold, + // color: Color(0xFF353535), + // ), + // ), + // ), + // ), + // ], + // ), body: SmartRefresher( enablePullDown: true, enablePullUp: true, @@ -161,7 +162,7 @@ class _SystemMessagePage extends State { footer: CustomFooter( loadStyle: LoadStyle.ShowWhenLoading, builder: (BuildContext context, LoadStatus mode) { - return (messages.length == 0)?Container():MyFooter(mode); + return (messages.length == 0) ? Container() : MyFooter(mode); }, ), controller: _refreshController, @@ -177,262 +178,314 @@ class _SystemMessagePage extends State { child: Container( child: Column( children: [ + Container( + color: Colors.white, + padding: EdgeInsets.only( + top: MediaQuery.of(context).padding.top + 10.h, + bottom: 15.h,right: 16.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pop(); + }, + child: Container( + alignment: Alignment.centerRight, + margin: EdgeInsets.only(left: 12,), + padding: EdgeInsets.all(6), + child: Icon( + Icons.arrow_back_ios, + color: Colors.black, + size: 24, + ), + ), + ), + Spacer(), + Expanded( + child: Text( + S.of(context).xiaoxi, + style: TextStyle( + color: Colors.black, + fontSize: 16.sp, + fontWeight: MyFontWeight.regular, + ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + queryMsgStats(); + }); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 10.w), + child: Text( + S.of(context).biaoweiyidu, + style: TextStyle( + color: Colors.black, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ), newsSurvey(), - SizedBox(height: 16.h,), + SizedBox( + height: 16.h, + ), buildMessage(), ], ), ), ), ), - ), ); } - Widget newsSurvey(){ + Widget newsSurvey() { return Container( color: Colors.white, - padding: EdgeInsets.only(top: 16.h,bottom: 16.h), + padding: EdgeInsets.only(top: 16.h, bottom: 16.h), child: Row( children: [ - Expanded(child: GestureDetector( - onTap: (){ - Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":5}).then((value) { - setState(() { - msgNumber["5"] = 0; + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/system_details', + arguments: {"msgType": 5}).then((value) { + setState(() { + msgNumber["5"] = 0; + }); }); - }); - }, - child:Column( - children: [ - Stack( - children: [ - Image.asset( - "assets/image/icon_z.webp", - width: 40, - height: 40, - ), - if(msgNumber["5"].toString() != "0") - Container( - width:48, - alignment: Alignment.topRight, - child:Container( - width:20, - height:17, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - border: Border.all( - width: 1, - color: Colors.white, - style: BorderStyle.solid, - ), - color:Color(0xFFFF441A), + }, + child: Column( + children: [ + Stack( + children: [ + Image.asset( + "assets/image/icon_z.webp", + width: 40, + height: 40, ), - child:RoundButton( - text:msgNumber["5"].toString(), - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFFF441A), - fontSize:8.sp, - radius: 100, - ) + if (msgNumber["5"].toString() != "0") + Container( + width: 48, + alignment: Alignment.topRight, + child: Container( + width: 20, + height: 17, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1, + color: Colors.white, + style: BorderStyle.solid, + ), + color: Color(0xFFFF441A), + ), + child: RoundButton( + text: msgNumber["5"].toString(), + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 8.sp, + radius: 100, + )), + ) + ], ), - ) - ], - ), - SizedBox(height: 6.h), - Text( - S.of(context).dianzan, - style: TextStyle( - fontSize: 14.sp, - fontWeight:MyFontWeight.medium, - color: Color(0xFF060606), - ), - ) - ], - ) - ) - ), - Expanded(child: - GestureDetector( - onTap: (){ - Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":6}).then((value) { - setState(() { - msgNumber["6"] = 0; - }); - }); - }, - child: Column( - children: [ - Stack( - children: [ - Image.asset( - "assets/image/icon_pl.webp", - width: 40, - height: 40, + SizedBox(height: 6.h), + Text( + S.of(context).dianzan, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF060606), ), - if(msgNumber["6"].toString() != "0") - Container( - width:48, - alignment: Alignment.topRight, - child:Container( - width:16, - height:16, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - border: Border.all( - width: 1, - color: Colors.white, - style: BorderStyle.solid, - ), - color:Color(0xFFFF441A), - ), - child:RoundButton( - text: msgNumber["6"].toString(), - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFFF441A), - fontSize:8.sp, - radius: 100, - ) + ) + ], + ))), + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/system_details', + arguments: {"msgType": 6}).then((value) { + setState(() { + msgNumber["6"] = 0; + }); + }); + }, + child: Column( + children: [ + Stack( + children: [ + Image.asset( + "assets/image/icon_pl.webp", + width: 40, + height: 40, ), - ) - ], - ), - SizedBox(height: 6.h), - Text( - S.of(context).pinglun, - style: TextStyle( - fontSize: 14.sp, - fontWeight:MyFontWeight.medium, - color: Color(0xFF060606), + if (msgNumber["6"].toString() != "0") + Container( + width: 48, + alignment: Alignment.topRight, + child: Container( + width: 16, + height: 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1, + color: Colors.white, + style: BorderStyle.solid, + ), + color: Color(0xFFFF441A), + ), + child: RoundButton( + text: msgNumber["6"].toString(), + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 8.sp, + radius: 100, + )), + ) + ], ), - ), - ], - ) - )), - Expanded(child: - GestureDetector( - onTap: (){ - Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":4}).then((value) { - setState(() { - msgNumber["4"] = 0; - }); - }); - }, - child:Column( - children: [ - Stack( - children: [ - Image.asset( - "assets/image/icon_gz.webp", - width: 40, - height: 40, + SizedBox(height: 6.h), + Text( + S.of(context).pinglun, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF060606), ), - if(msgNumber["4"].toString() != "0") - Container( - width:48, - alignment: Alignment.topRight, - child:Container( - width:16, - height:16, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100), - border: Border.all( - width: 1, - color: Colors.white, - style: BorderStyle.solid, - ), - color:Color(0xFFFF441A), - ), - child:RoundButton( - text: msgNumber["4"].toString(), - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFFF441A), - fontSize:8.sp, - radius: 100, - ) + ), + ], + ))), + Expanded( + child: GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/system_details', + arguments: {"msgType": 4}).then((value) { + setState(() { + msgNumber["4"] = 0; + }); + }); + }, + child: Column( + children: [ + Stack( + children: [ + Image.asset( + "assets/image/icon_gz.webp", + width: 40, + height: 40, ), - ) - ], - ), - SizedBox(height: 6.h), - Text( - S.of(context).guanzhu, - style: TextStyle( - fontSize: 14.sp, - fontWeight:MyFontWeight.medium, - color: Color(0xFF060606), + if (msgNumber["4"].toString() != "0") + Container( + width: 48, + alignment: Alignment.topRight, + child: Container( + width: 16, + height: 16, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all( + width: 1, + color: Colors.white, + style: BorderStyle.solid, + ), + color: Color(0xFFFF441A), + ), + child: RoundButton( + text: msgNumber["4"].toString(), + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 8.sp, + radius: 100, + )), + ) + ], ), - ), - ], - ) - ) - ), + SizedBox(height: 6.h), + Text( + S.of(context).guanzhu, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF060606), + ), + ), + ], + ))), ], ), ); } - Widget buildMessage(){ + Widget buildMessage() { return Container( - color: Colors.white, - width: double.infinity, + color: Colors.white, + width: double.infinity, padding: EdgeInsets.all(20.w), - child:Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - S.of(context).xitongxiaoxi, - style: TextStyle( - fontSize: 16.sp, - fontWeight:MyFontWeight.semi_bold, - color: Colors.black, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context).xitongxiaoxi, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), ), - ), - (messages == null || messages.length == 0) - ? NoDataView( - src: "assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) - :ListView.builder( - padding: EdgeInsets.only(top: 16), - itemCount: messages.length, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - if(messages[position].typed == 2) - Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":2}).then((value) { - setState(() { - msgNumber["2"] = 0; - }); - }); - else if(messages[position].typed == 3) - Navigator.of(context) - .pushNamed('/router/system_details',arguments: {"msgType":3}).then((value) { - setState(() { - msgNumber["3"] = 0; - }); - }); - }, - child: buildMessageItem(messages[position]), - ); - }), - ], - ) - ); + (messages == null || messages.length == 0) + ? NoDataView( + src: "assets/image/icon_empty.webp", + isShowBtn: false, + text: S.of(context).haimeiyouxiaoxi, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) + : ListView.builder( + padding: EdgeInsets.only(top: 16), + itemCount: messages.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + if (messages[position].typed == 2) + Navigator.of(context).pushNamed( + '/router/system_details', + arguments: {"msgType": 2}).then((value) { + setState(() { + msgNumber["2"] = 0; + }); + }); + else if (messages[position].typed == 3) + Navigator.of(context).pushNamed( + '/router/system_details', + arguments: {"msgType": 3}).then((value) { + setState(() { + msgNumber["3"] = 0; + }); + }); + }, + child: buildMessageItem(messages[position]), + ); + }), + ], + )); } Widget buildMessageItem(Message message) { @@ -464,26 +517,28 @@ class _SystemMessagePage extends State { (message.typed == 1) ? "assets/image/icon_system_message.webp" : (message.typed == 2) - ? "assets/image/icon_system_message.webp" - : "assets/image/c_z.webp", + ? "assets/image/icon_system_message.webp" + : "assets/image/c_z.webp", width: 40.w, height: 40.h, ), SizedBox( - width:12.w, + width: 12.w, ), - Expanded(child:Column( + Expanded( + child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - Expanded(child:Text( + Expanded( + child: Text( (message.typed == 1) ? S.of(context).xitongtongzhi : (message.typed == 2) - ? S.of(context).dingdanxiaoxi - : S.of(context).chongzhixiaoxi, + ? S.of(context).dingdanxiaoxi + : S.of(context).chongzhixiaoxi, style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.semi_bold, @@ -499,64 +554,67 @@ class _SystemMessagePage extends State { ), ], ), - SizedBox(height:4.h,), - (message.typed != 3) ? - Row( - mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded(child: - Text( - S.of(context).ninyouyigexindedingdan, - style: TextStyle( - fontSize: 10.sp, - color: Color(0xFF353535), - ), - ),), - if(msgNumber["2"].toString() != "0") - RoundButton( - width: 16, - height: 16, - text:msgNumber["2"].toString(), - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFFF441A), - fontSize:10.sp, - radius: 100, - ), - ], - ): - Row( - mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded(child: - Text( - message.content, - style: TextStyle( - fontSize: 10.sp, - color: Color(0xFF353535), - ), - )), - if(msgNumber["3"].toString() != "0") - RoundButton( - width: 16, - height: 16, - text:msgNumber["3"].toString(), - textColor: Colors.white, - fontWeight: MyFontWeight.regular, - backgroup: Color(0xFFFF441A), - fontSize:10.sp, - radius: 100, - ), - ], + SizedBox( + height: 4.h, ), + (message.typed != 3) + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + S.of(context).ninyouyigexindedingdan, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF353535), + ), + ), + ), + if (msgNumber["2"].toString() != "0") + RoundButton( + width: 16, + height: 16, + text: msgNumber["2"].toString(), + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 10.sp, + radius: 100, + ), + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + message.content, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF353535), + ), + )), + if (msgNumber["3"].toString() != "0") + RoundButton( + width: 16, + height: 16, + text: msgNumber["3"].toString(), + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFFFF441A), + fontSize: 10.sp, + radius: 100, + ), + ], + ), ], )), ], ), Container( - margin: EdgeInsets.only(top: 16.h,bottom:8.h), + margin: EdgeInsets.only(top: 16.h, bottom: 8.h), height: 1.h, width: double.infinity, color: Color(0xFFF7F7F7), From ba718c6ecd733ac65295368e8cf9cd0e1857d316 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Thu, 2 Mar 2023 11:53:10 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 2 +- lib/message/system_details.dart | 1034 ++++++++++++++++--------------- lib/message/system_message.dart | 1 + pubspec.lock | 300 ++++----- pubspec.yaml | 4 +- 5 files changed, 698 insertions(+), 643 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index aa38b250..f35fed4c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -184,7 +184,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' +// implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' implementation fileTree(include: ['*.aar'], dir: 'libs') implementation 'androidx.legacy:legacy-support-v4:1.0.0' diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index 79f27255..8e4742e4 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -23,6 +23,7 @@ class SystemDetails extends StatefulWidget { final Map arguments; SystemDetails({this.arguments}); + @override State createState() { return _SystemDetails(); @@ -34,6 +35,7 @@ class _SystemDetails extends State { int pageNum = 1; List messages = []; int msgType = 0; + // String parenId = "0"; var commentFocus = FocusNode(); String hintText = S.current.liuxianinjingcaidepinglunba; @@ -43,7 +45,6 @@ class _SystemDetails extends State { final TextEditingController commentTextController = TextEditingController(); int indexMsg = 0; - @override void initState() { super.initState(); @@ -56,7 +57,6 @@ class _SystemDetails extends State { }); } - _refresh() { pageNum = 1; queryMessage(); @@ -92,13 +92,14 @@ class _SystemDetails extends State { } } - ///关注/取关会员 - _vipFollow(followId,isFollow) async { + ///关注/取关会员 + _vipFollow(followId, isFollow) async { BaseData baseData = await apiService.follow(followId); if (baseData != null && baseData.isSuccess) { // widget.refresh(); queryMessage(); - SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center); + SmartDialog.showToast(isFollow ? "取关成功" : "关注成功", + alignment: Alignment.center); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } @@ -117,16 +118,15 @@ class _SystemDetails extends State { BaseData baseData = await apiService.memberComment({ "content": content, "parentId": messageRelational["additionId"].toString(), - "relationalId":messageRelational["businessId"].toString(), - "relationalType":4 + "relationalId": messageRelational["businessId"].toString(), + "relationalType": 4 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { commentTextController.text = ""; FocusScope.of(context).unfocus(); Navigator.of(context).pop(); SmartDialog.showToast("发布成功", alignment: Alignment.center); - } - else{ + } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } @@ -139,11 +139,19 @@ class _SystemDetails extends State { appBar: MyAppBar( background: Colors.white, leadingColor: Colors.black, - title: (msgType == 2) ? S.of(context).dingdantongzhi:(msgType == 3) ? S.of(context).chongzhixiaoxi:(msgType == 4) ?"关注":(msgType == 5) ?"点赞":"评论", + title: (msgType == 2) + ? S.of(context).dingdantongzhi + : (msgType == 3) + ? S.of(context).chongzhixiaoxi + : (msgType == 4) + ? S.of(context).guanzhu + : (msgType == 5) + ? S.of(context).dianzan + : S.of(context).pinglun, titleSize: 18.sp, titleColor: Colors.black, ), - body:SmartRefresher( + body: SmartRefresher( enablePullDown: true, enablePullUp: true, header: MyHeader(), @@ -151,7 +159,7 @@ class _SystemDetails extends State { footer: CustomFooter( loadStyle: LoadStyle.ShowWhenLoading, builder: (BuildContext context, LoadStatus mode) { - return (messages.length == 0)?Container():MyFooter(mode); + return (messages.length == 0) ? Container() : MyFooter(mode); }, ), controller: _refreshController, @@ -159,76 +167,69 @@ class _SystemDetails extends State { onLoading: () { queryMessage(); }, - child: - Container( - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: - Container( - child: Column( - children: [ - if(msgType == 2) - orderMessage(), - if(msgType == 3) - rechargeMessage(), - if(msgType == 5) - fabulousMessage(), - if(msgType == 6) - commentMessage(), - if(msgType == 4) - followMessage(), - ], - ), - ), + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + child: Column( + children: [ + if (msgType == 2) orderMessage(), + if (msgType == 3) rechargeMessage(), + if (msgType == 5) fabulousMessage(), + if (msgType == 6) commentMessage(), + if (msgType == 4) followMessage(), + ], ), ), + ), + ), ), ); } ///订单通知 - Widget orderMessage(){ + Widget orderMessage() { return Container( - color: Colors.white, - width: double.infinity, - padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w), - child:Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - (messages == null || messages.length == 0) - ? NoDataView( - src: "assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) - : ListView.builder( - padding: EdgeInsets.only(top: 16), - itemCount: messages.length, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - // if (messages[position].typed == 2) { - // Navigator.of(context) - // .pushNamed('/router/exchange_order_details'); - // } - }, - child: orderMessageItem(messages[position]), - ); - }), - ], - ) - ); + color: Colors.white, + width: double.infinity, + padding: + EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + (messages == null || messages.length == 0) + ? NoDataView( + src: "assets/image/icon_empty.webp", + isShowBtn: false, + text: S.of(context).haimeiyouxiaoxi, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) + : ListView.builder( + padding: EdgeInsets.only(top: 16), + itemCount: messages.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + // if (messages[position].typed == 2) { + // Navigator.of(context) + // .pushNamed('/router/exchange_order_details'); + // } + }, + child: orderMessageItem(messages[position]), + ); + }), + ], + )); } + Widget orderMessageItem(Message message) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), - child: - Column( + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -242,13 +243,13 @@ class _SystemDetails extends State { (message.typed == 1) ? "assets/image/icon_system_message.webp" : (message.typed == 2) - ? "assets/image/icon_system_message.webp" - : "assets/image/c_z.webp", + ? "assets/image/icon_system_message.webp" + : "assets/image/c_z.webp", width: 24.w, height: 24.h, ), SizedBox( - width:8.w, + width: 8.w, ), Text( (message.typed == 1) @@ -273,87 +274,89 @@ class _SystemDetails extends State { ), ], ), - Container( - width: double.infinity, - margin: EdgeInsets.only(left:30.w, top:20.h), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded(child: Text( + Container( + width: double.infinity, + margin: EdgeInsets.only(left: 30.w, top: 20.h), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( message.content, maxLines: 2, - overflow:TextOverflow.ellipsis, + overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 12.sp, color: Color(0xFF353535), ), - ),), - Icon( - Icons.keyboard_arrow_right, - color: Colors.black, - ) - ], - ), - Container( - margin: EdgeInsets.only(top: 14.h), - height: 1, - width: double.infinity, - color: Color(0XFFF7F7F7), - ) - ], - ), - ) + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: Colors.black, + ) + ], + ), + Container( + margin: EdgeInsets.only(top: 14.h), + height: 1, + width: double.infinity, + color: Color(0XFFF7F7F7), + ) + ], + ), + ) ], ), ); } ///充值消息通知 - Widget rechargeMessage(){ + Widget rechargeMessage() { return Container( color: Colors.white, width: double.infinity, - padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w), - child:Column( + padding: + EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w), + child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ (messages == null || messages.length == 0) ? NoDataView( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) + src: "assets/image/icon_empty.webp", + isShowBtn: false, + text: S.of(context).haimeiyouxiaoxi, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) : ListView.builder( - padding: EdgeInsets.only(top: 16), - itemCount: messages.length, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - // if (messages[position].typed == 2) { - // Navigator.of(context) - // .pushNamed('/router/exchange_order_details'); - // } - }, - child: rechargeMessageItem(messages[position]), - ); - }), + padding: EdgeInsets.only(top: 16), + itemCount: messages.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + // if (messages[position].typed == 2) { + // Navigator.of(context) + // .pushNamed('/router/exchange_order_details'); + // } + }, + child: rechargeMessageItem(messages[position]), + ); + }), ], - ) - ); + )); } + Widget rechargeMessageItem(Message message) { return Container( margin: EdgeInsets.only(top: 8.h, bottom: 8.h), - child: - Column( + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -367,20 +370,20 @@ class _SystemDetails extends State { (message.typed == 1) ? "assets/image/icon_system_message.webp" : (message.typed == 2) - ? "assets/image/icon_system_message.webp" - : "assets/image/c_z.webp", + ? "assets/image/icon_system_message.webp" + : "assets/image/c_z.webp", width: 24.w, height: 24.h, ), SizedBox( - width:8.w, + width: 8.w, ), Text( (message.typed == 1) ? S.of(context).xitongtongzhi : (message.typed == 2) - ? S.of(context).dingdanxiaoxi - : "充值通知", + ? S.of(context).dingdanxiaoxi + : "充值通知", style: TextStyle( fontSize: 14.sp, fontWeight: FontWeight.bold, @@ -400,7 +403,7 @@ class _SystemDetails extends State { ), Container( width: double.infinity, - margin: EdgeInsets.only(left:30.w, top:20.h), + margin: EdgeInsets.only(left: 30.w, top: 20.h), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -413,20 +416,24 @@ class _SystemDetails extends State { color: Color(0xFF353535), ), ), - SizedBox(height:8.h,), + SizedBox( + height: 8.h, + ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Expanded(child: Text( - message.content, - maxLines: 2, - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF353535), + Expanded( + child: Text( + message.content, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF353535), + ), ), - ),), + ), Icon( Icons.keyboard_arrow_right, color: Colors.black, @@ -448,171 +455,182 @@ class _SystemDetails extends State { } ///点赞通知 - Widget fabulousMessage(){ + Widget fabulousMessage() { return Container( color: Colors.white, width: double.infinity, - padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), - child:Column( + padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w), + child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ (messages == null || messages.length == 0) ? NoDataView( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) + src: "assets/image/icon_empty.webp", + isShowBtn: false, + text: S.of(context).haimeiyouxiaoxi, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) : ListView.builder( - padding: EdgeInsets.only(top: 16), - itemCount: messages.length, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - Navigator.of(context).pushNamed( - '/router/community_details', - arguments: { - "businessId":jsonDecode(messages[position].relational)["businessId"].toString(), - "mid":messages[position].mid + padding: EdgeInsets.only(top: 16), + itemCount: messages.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/community_details', + arguments: { + "businessId": + jsonDecode(messages[position].relational)[ + "businessId"] + .toString(), + "mid": messages[position].mid + }, + ); }, + child: fabulousMessageItem(messages[position]), ); - }, - child: fabulousMessageItem(messages[position]), - ); - }), + }), ], - ) - ); + )); } + Widget fabulousMessageItem(Message message) { var messageRelational = jsonDecode(message.relational); return Container( - child: - Row( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + messageRelational["avatar"] ?? "", + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox( + width: 8, + ), + Expanded( + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - MImage( - messageRelational["avatar"] ?? "", - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox(width: 8,), - Expanded(child:Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + Row( children: [ - Row( - children: [ - Text( - messageRelational["nickname"] ?? "", - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 14.sp, - color: Color(0xFF1A1A1A)) - ), - SizedBox(width:8.w,), - Text( - "点赞了", - style:TextStyle( - fontWeight: MyFontWeight.medium, + Text(messageRelational["nickname"] ?? "", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp, - color: Color(0xFF32A060), - ), - ), - ], + color: Color(0xFF1A1A1A))), + SizedBox( + width: 8.w, ), - SizedBox(height: 8,), Text( - message.updateTime, + "点赞了", style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFA29E9E), - ), - ), - SizedBox(height:12.h,), - Container( - width: double.infinity, - color:Color(0xFFF2F2F2), - padding:EdgeInsets.all(5), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // Text( - // "我的评论:", - // style: TextStyle( - // fontSize: 12.sp, - // height: 1.3, - // fontWeight: MyFontWeight.regular, - // color: Color(0xFF1A1A1A), - // ), - // ), - MImage( - messageRelational["nickname"] , - width: 38, - height: 38, - isCircle: true, - fit: BoxFit.cover, - radius: BorderRadius.circular(2), - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox(width:2.w), - Expanded(child:Text( - messageRelational["content"] ?? "", - maxLines: 2, - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - height: 1.3, - fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), - ), - ),) - ], + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFF32A060), ), ), - Container( - margin: EdgeInsets.only(top: 16.h,bottom:16.h), - height: 1.h, - width: double.infinity, - color: Color(0xFFF7F7F7), - ), ], - )), + ), + SizedBox( + height: 8, + ), + Text( + message.updateTime, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFFA29E9E), + ), + ), + SizedBox( + height: 12.h, + ), + Container( + width: double.infinity, + color: Color(0xFFF2F2F2), + padding: EdgeInsets.all(5), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Text( + // "我的评论:", + // style: TextStyle( + // fontSize: 12.sp, + // height: 1.3, + // fontWeight: MyFontWeight.regular, + // color: Color(0xFF1A1A1A), + // ), + // ), + MImage( + messageRelational["nickname"], + width: 38, + height: 38, + isCircle: true, + fit: BoxFit.cover, + radius: BorderRadius.circular(2), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox(width: 2.w), + Expanded( + child: Text( + messageRelational["content"] ?? "", + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + height: 1.3, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + ), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 16.h, bottom: 16.h), + height: 1.h, + width: double.infinity, + color: Color(0xFFF7F7F7), + ), ], - ), + )), + ], + ), ); } ///评论通知 - Widget commentMessage(){ + Widget commentMessage() { return Container( - color: Colors.white, - width: double.infinity, - padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), - child:Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - (messages == null || messages.length == 0) - ? NoDataView( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) - : ListView.builder( + color: Colors.white, + width: double.infinity, + padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + (messages == null || messages.length == 0) + ? NoDataView( + src: "assets/image/icon_empty.webp", + isShowBtn: false, + text: S.of(context).haimeiyouxiaoxi, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) + : ListView.builder( padding: EdgeInsets.only(top: 16), itemCount: messages.length, shrinkWrap: true, @@ -623,28 +641,30 @@ class _SystemDetails extends State { Navigator.of(context).pushNamed( '/router/community_details', arguments: { - "businessId":jsonDecode(messages[position].relational)["businessId"].toString(), - "mid":messages[position].mid + "businessId": + jsonDecode(messages[position].relational)[ + "businessId"] + .toString(), + "mid": messages[position].mid }, ); }, - child: commentMessageItem(messages[position],position), + child: commentMessageItem(messages[position], position), ); }), - ], - ) - ); + ], + )); } - Widget commentMessageItem(Message message,index) { + + Widget commentMessageItem(Message message, index) { var messageRelational = jsonDecode(message.relational); return Container( - child: - Row( + child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ MImage( - messageRelational["avatar"], + messageRelational["avatar"], width: 44, height: 44, isCircle: true, @@ -652,8 +672,11 @@ class _SystemDetails extends State { errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), - SizedBox(width: 8,), - Expanded(child:Column( + SizedBox( + width: 8, + ), + Expanded( + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -661,42 +684,46 @@ class _SystemDetails extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Text( - messageRelational["nickname"], + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text(messageRelational["nickname"], + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + color: Color(0xFF1A1A1A))), + SizedBox( + width: 8.w, + ), + Text( + "评论了", style: TextStyle( - fontWeight: MyFontWeight.semi_bold, - fontSize: 14.sp, - color: Color(0xFF1A1A1A)) - ), - SizedBox(width:8.w,), - Text( - "评论了", - style:TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Color(0xFF32A060), + fontWeight: MyFontWeight.medium, + fontSize: 14.sp, + color: Color(0xFF32A060), + ), ), + ], + ), + SizedBox( + height: 8, + ), + Text( + message.updateTime, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFFA29E9E), ), - ], - ), - SizedBox(height: 8,), - Text( - message.updateTime, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFA29E9E), ), - ), - ], - ),), + ], + ), + ), GestureDetector( - onTap: (){ + onTap: () { setState(() { indexMsg = index; showDeleteDialog(); @@ -704,9 +731,9 @@ class _SystemDetails extends State { }); }, child: Container( - height:22.h, + height: 22.h, width: 40.w, - padding:EdgeInsets.only(left:2,right:2), + padding: EdgeInsets.only(left: 2, right: 2), alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(11), @@ -728,7 +755,9 @@ class _SystemDetails extends State { ) ], ), - SizedBox(height:8.h,), + SizedBox( + height: 8.h, + ), // Text( // messageRelational["content"], // maxLines: 2, @@ -785,8 +814,8 @@ class _SystemDetails extends State { // ), Container( width: double.infinity, - color:Color(0xFFF2F2F2), - padding:EdgeInsets.all(5), + color: Color(0xFFF2F2F2), + padding: EdgeInsets.all(5), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -810,23 +839,25 @@ class _SystemDetails extends State { errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), - SizedBox(width:2.w), - Expanded(child:Text( - messageRelational["content"], - maxLines: 2, - overflow:TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12.sp, - height: 1.3, - fontWeight: MyFontWeight.regular, - color: Color(0xFF808080), + SizedBox(width: 2.w), + Expanded( + child: Text( + messageRelational["content"], + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + height: 1.3, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), ), - ),) + ) ], ), ), Container( - margin: EdgeInsets.only(top: 16.h,bottom:16.h), + margin: EdgeInsets.only(top: 16.h, bottom: 16.h), height: 1.h, width: double.infinity, color: Color(0xFFF7F7F7), @@ -839,188 +870,195 @@ class _SystemDetails extends State { } ///关注通知 - Widget followMessage(){ + Widget followMessage() { return Container( color: Colors.white, width: double.infinity, - padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), - child:Column( + padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w), + child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ (messages == null || messages.length == 0) ? NoDataView( - src:"assets/image/icon_empty.webp", - isShowBtn: false, - text: S.of(context).haimeiyouxiaoxi, - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ) + src: "assets/image/icon_empty.webp", + isShowBtn: false, + text: S.of(context).haimeiyouxiaoxi, + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h), + ) : ListView.builder( - padding: EdgeInsets.only(top: 16), - itemCount: messages.length, - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return GestureDetector( - onTap: () { - // if (messages[position].typed == 2) { - // Navigator.of(context) - // .pushNamed('/router/exchange_order_details'); - // } - }, - child: followMessageItem(messages[position]), - ); - }), + padding: EdgeInsets.only(top: 16), + itemCount: messages.length, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + // if (messages[position].typed == 2) { + // Navigator.of(context) + // .pushNamed('/router/exchange_order_details'); + // } + }, + child: followMessageItem(messages[position]), + ); + }), ], - ) - ); + )); } + Widget followMessageItem(Message message) { var messageRelational = jsonDecode(message.relational); - if(message.relational.startsWith("{")) - return Container( - child: - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - MImage( - messageRelational["avatar"], - width: 44, - height: 44, - isCircle: true, - fit: BoxFit.cover, - errorSrc: "assets/image/default_1.webp", - fadeSrc: "assets/image/default_1.webp", - ), - SizedBox(width: 8,), - Expanded(child:Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded(child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + if (message.relational.startsWith("{")) + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MImage( + messageRelational["avatar"], + width: 44, + height: 44, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + SizedBox( + width: 8, + ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - messageRelational["nickname"], - style: TextStyle( - fontWeight: MyFontWeight.semi_bold, + Row( + children: [ + Text(messageRelational["nickname"], + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 14.sp, + color: Color(0xFF1A1A1A))), + SizedBox( + width: 8.w, + ), + Text( + "关注了你", + style: TextStyle( + fontWeight: MyFontWeight.medium, fontSize: 14.sp, - color: Color(0xFF1A1A1A)) + color: Color(0xFF32A060), + ), + ), + ], + ), + SizedBox( + height: 8, ), - SizedBox(width:8.w,), Text( - "关注了你", - style:TextStyle( - fontWeight: MyFontWeight.medium, - fontSize: 14.sp, - color: Color(0xFF32A060), + message.updateTime, + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFFA29E9E), ), ), ], ), - SizedBox(height: 8,), - Text( - message.updateTime, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFFA29E9E), + ), + GestureDetector( + onTap: () { + setState(() { + _vipFollow(messageRelational["mid"].toString(), + message?.followed ?? false); + }); + }, + child: RoundButton( + height: 21.h, + width: 56.w, + padding: EdgeInsets.all(2), + backgroup: (message?.followed ?? false) + ? Color(0xFFE6E6E6) + : Color(0xFF32A060), + textColor: (message?.followed ?? false) + ? Color(0xFF808080) + : Colors.white, + text: (message?.followed ?? false) ? "已关注" : "回关", + radius: 20, + icons: Icon( + (message?.followed ?? false) + ? Icons.check + : Icons.add, + color: (message?.followed ?? false) + ? Color(0xFF808080) + : Colors.white, + size: 12, + ), + ) + // Container( + // height: 21.h, + // width:56.w, + // padding:EdgeInsets.only(left:5,right:5), + // alignment: Alignment.center, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(11), + // border: Border.all( + // width: 1, + // color: Color(0xFF00A359), + // style: BorderStyle.solid, + // ), + // color: (message?.followed ?? false) + // ? Color(0xFFE6E6E6) + // : Color(0xFF32A060), + // ), + // child: Row( + // children: [ + // Icon((message?.followed ?? false) + // ? Icons.check + // : Icons.add, + // color:(message?.followed?? false) + // ? Color(0xFF808080) + // : Colors.white, + // size: 16, + // ), + // Text( + // (message?.followed ?? false) ? "已关注" : "回关", + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color:(message?.followed ?? false) + // ? Color(0xFF808080) + // : Colors.white, + // ), + // ), + // ], + // ), + // ) ), - ), - ], - ),), - GestureDetector( - onTap: (){ - setState(() { - _vipFollow(messageRelational["mid"].toString(),message?.followed ?? false); - }); - }, - child: - RoundButton( - height: 21.h, - width:56.w, - padding: EdgeInsets.all(2), - backgroup: (message?.followed ?? false) - ? Color(0xFFE6E6E6) - : Color(0xFF32A060), - textColor: (message?.followed ?? false) - ? Color(0xFF808080) - : Colors.white, - text: (message?.followed ?? false) ? "已关注" : "回关", - radius:20, - icons: Icon( - (message?.followed ?? false) - ? Icons.check - : Icons.add, - color: (message?.followed?? false) - ? Color(0xFF808080) - : Colors.white, - size: 12, - ), - ) - // Container( - // height: 21.h, - // width:56.w, - // padding:EdgeInsets.only(left:5,right:5), - // alignment: Alignment.center, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(11), - // border: Border.all( - // width: 1, - // color: Color(0xFF00A359), - // style: BorderStyle.solid, - // ), - // color: (message?.followed ?? false) - // ? Color(0xFFE6E6E6) - // : Color(0xFF32A060), - // ), - // child: Row( - // children: [ - // Icon((message?.followed ?? false) - // ? Icons.check - // : Icons.add, - // color:(message?.followed?? false) - // ? Color(0xFF808080) - // : Colors.white, - // size: 16, - // ), - // Text( - // (message?.followed ?? false) ? "已关注" : "回关", - // style: TextStyle( - // fontSize: 12.sp, - // fontWeight: MyFontWeight.medium, - // color:(message?.followed ?? false) - // ? Color(0xFF808080) - // : Colors.white, - // ), - // ), - // ], - // ), - // ) - ), - ], - ), - SizedBox(height:8.h,), - Container( - margin: EdgeInsets.only(top: 16.h,bottom:16.h), - height: 1.h, - width: double.infinity, - color: Color(0xFFF7F7F7), - ), - ], - )), - ], - ), - ); + ], + ), + SizedBox( + height: 8.h, + ), + Container( + margin: EdgeInsets.only(top: 16.h, bottom: 16.h), + height: 1.h, + width: double.infinity, + color: Color(0xFFF7F7F7), + ), + ], + )), + ], + ), + ); } ///动态弹窗 @@ -1061,11 +1099,11 @@ class _SystemDetails extends State { child: TextField( maxLines: 8, minLines: 1, - focusNode:commentFocus, - controller:commentTextController, + focusNode: commentFocus, + controller: commentTextController, decoration: InputDecoration( border: InputBorder.none, - hintText:hintText, + hintText: hintText, hintStyle: TextStyle( fontSize: 14.sp, color: Color(0xFF868686), diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index b8631255..48eeff31 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -176,6 +176,7 @@ class _SystemMessagePage extends State { child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( + padding: EdgeInsets.only(bottom: 30.h), child: Column( children: [ Container( diff --git a/pubspec.lock b/pubspec.lock index fd60a0b3..caa771cd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,154 +5,161 @@ packages: dependency: "direct main" description: name: ai_decimal_accuracy - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" android_intent_plus: dependency: "direct main" description: name: android_intent_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.8.2" barcode: dependency: transitive description: name: barcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" barcode_widget: dependency: "direct main" description: name: barcode_widget - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" bubble_tab_indicator: dependency: "direct main" description: name: bubble_tab_indicator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" chewie: dependency: transitive description: name: chewie - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.3" chewie_audio: dependency: "direct main" description: name: chewie_audio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.16.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.2" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" dio: dependency: "direct main" description: name: dio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.10" emoji_picker_flutter: dependency: "direct main" description: name: emoji_picker_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" event_bus: dependency: "direct main" description: name: event_bus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.4" flare_flutter: dependency: "direct main" description: name: flare_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" flutter: @@ -164,56 +171,56 @@ packages: dependency: "direct main" description: name: flutter_baidu_mapapi_base - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.3.0" flutter_baidu_mapapi_map: dependency: "direct main" description: name: flutter_baidu_mapapi_map - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" flutter_baidu_mapapi_search: dependency: "direct main" description: name: flutter_baidu_mapapi_search - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.3.0" flutter_baidu_mapapi_utils: dependency: "direct main" description: name: flutter_baidu_mapapi_utils - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.3.0" flutter_bmflocation: dependency: "direct main" description: name: flutter_bmflocation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.1" + version: "3.3.0" flutter_easyloading: dependency: "direct main" description: name: flutter_easyloading - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.5" flutter_html: dependency: "direct main" description: name: flutter_html - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.6" flutter_localizations: @@ -225,70 +232,70 @@ packages: dependency: transitive description: name: flutter_math_fork - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.2+2" flutter_page_indicator: dependency: transitive description: name: flutter_page_indicator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.7" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0+1" flutter_slidable: dependency: "direct main" description: name: flutter_slidable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.2" flutter_smart_dialog: dependency: "direct main" description: name: flutter_smart_dialog - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.8" + version: "2.1.6" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.0" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.1" flutter_svg: dependency: "direct main" description: name: flutter_svg - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.22.0" flutter_swiper: dependency: "direct main" description: name: flutter_swiper - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.6" flutter_test: @@ -305,385 +312,392 @@ packages: dependency: "direct main" description: name: fluwx - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.9.0+2" + version: "3.12.2" font_awesome_flutter: dependency: "direct main" description: name: font_awesome_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "9.2.0" gradient_widgets: dependency: "direct main" description: name: gradient_widgets - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" image_pickers: dependency: "direct main" description: name: image_pickers - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0+2" + version: "2.0.0+6" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.4" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" keframe: dependency: "direct main" description: name: keframe - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" like_button: dependency: "direct main" description: name: like_button - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" logger: dependency: "direct main" description: name: logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.4" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.7.0" + mqtt_client: + dependency: "direct main" + description: + name: mqtt_client + url: "https://pub.flutter-io.cn" + source: hosted + version: "9.6.8" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" network_to_file_image: dependency: "direct main" description: name: network_to_file_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" number_precision: dependency: "direct main" description: name: number_precision - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2+1" numerus: dependency: transitive description: name: numerus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.1" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.1+1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.7" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.3" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" photo_view: dependency: "direct main" description: name: photo_view - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.0" pin_input_text_field: dependency: "direct main" description: name: pin_input_text_field - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.4" provider: dependency: transitive description: name: provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.4" + version: "6.0.5" pull_to_refresh: dependency: "direct main" description: name: pull_to_refresh - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" qr: dependency: transitive description: name: qr - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" qr_flutter: dependency: "direct main" description: name: qr_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" quiver: dependency: transitive description: name: quiver - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.0" + version: "3.2.1" retrofit: dependency: "direct main" description: name: retrofit - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.4+1" rive: dependency: "direct main" description: name: rive - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.8" rxdart: dependency: "direct main" description: name: rxdart - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.26.0" scan: dependency: "direct main" description: name: scan - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.6.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.15" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.14" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.1.2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "2.1.2" sharesdk_plugin: dependency: "direct main" description: name: sharesdk_plugin - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.5" + version: "1.3.6" simple_gesture_detector: dependency: transitive description: name: simple_gesture_detector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" sky_engine: @@ -695,63 +709,63 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.2" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" table_calendar: dependency: "direct main" description: name: table_calendar - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.3" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.9" thumbnails: dependency: "direct main" description: name: thumbnails - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" tobias: dependency: "direct main" description: name: tobias - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" tpns_flutter_plugin: @@ -767,168 +781,168 @@ packages: dependency: transitive description: name: transformer_page_view - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" tuple: dependency: transitive description: name: tuple - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.7.10" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+4" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+9" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.9" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.5+3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.1+3" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" video_player: dependency: "direct main" description: name: video_player - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.19" video_player_android: dependency: transitive description: name: video_player_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.4" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.7" + version: "2.3.8" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.0" video_player_web: dependency: transitive description: name: video_player_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.12" + version: "2.0.13" wakelock: dependency: transitive description: name: wakelock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.2" wakelock_macos: dependency: transitive description: name: wakelock_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" wakelock_platform_interface: dependency: transitive description: name: wakelock_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" wakelock_web: dependency: transitive description: name: wakelock_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" wakelock_windows: dependency: transitive description: name: wakelock_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" webview_flutter: dependency: transitive description: name: webview_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.14" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.1" + version: "3.1.3" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0+2" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.4.1" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 95525547..23a4247f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: 一心回乡. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 3.2.0+41 +version: 3.2.3+44 environment: sdk: ">=2.7.0 <3.0.0" @@ -103,6 +103,8 @@ dependencies: emoji_picker_flutter: ^1.4.1 + mqtt_client: ^9.6.8 + dev_dependencies: flutter_test: sdk: flutter