Sfoglia il codice sorgente

更新商品分享请求逻辑

tags/0.0.2+8
Weller 4 anni fa
parent
commit
af2353b7ec
9 ha cambiato i file con 544 aggiunte e 394 eliminazioni
  1. +107
    -107
      .dart_tool/package_config.json
  2. +1
    -1
      example/ios/Podfile.lock
  3. +0
    -31
      lib/pages/goods_share_page/goods_share_bloc.dart
  4. +51
    -0
      lib/pages/goods_share_page/goods_share_content_bloc.dart
  5. +165
    -115
      lib/pages/goods_share_page/goods_share_image/goods_share_image.dart
  6. +129
    -86
      lib/pages/goods_share_page/goods_share_link/goods_share_link.dart
  7. +78
    -36
      lib/pages/goods_share_page/goods_share_miniprogram/goods_share_miniprogram.dart
  8. +10
    -15
      lib/pages/goods_share_page/goods_share_page.dart
  9. +3
    -3
      lib/pages/goods_share_page/widgets/goods_share_miniprogram_widget.dart

+ 107
- 107
.dart_tool/package_config.json Vedi File

@@ -3,637 +3,637 @@
"packages": [
{
"name": "archive",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "args",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0",
"packageUri": "lib/",
"languageVersion": "2.3"
},
{
"name": "async",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "bloc",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/bloc-4.0.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/bloc-4.0.0",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "boolean_selector",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "cached_network_image",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-2.2.0+1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-2.2.0+1",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "charcode",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "clock",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/clock-1.0.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/clock-1.0.1",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "collection",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "connectivity",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity-0.4.9+5",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/connectivity-0.4.9+5",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "connectivity_for_web",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_for_web-0.3.1+4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_for_web-0.3.1+4",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "connectivity_macos",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_macos-0.1.0+7",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_macos-0.1.0+7",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "connectivity_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_platform_interface-1.0.6",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_platform_interface-1.0.6",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "convert",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1",
"packageUri": "lib/",
"languageVersion": "1.17"
},
{
"name": "crypto",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "device_info",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/device_info-0.4.2+10",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/device_info-0.4.2+10",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "device_info_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/device_info_platform_interface-1.0.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/device_info_platform_interface-1.0.1",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "dio",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "equatable",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/equatable-1.2.5",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/equatable-1.2.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "event_bus",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/event_bus-1.1.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/event_bus-1.1.1",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "ffi",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "file",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/file-5.2.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/file-5.2.1",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "flutter",
"rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter",
"rootUri": "file:///Users/fnuouser/Documents/code/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "flutter_alibc",
"rootUri": "file:///Users/fnuser/.pub-cache/git/zhiying_flutter_alibc-ba413f84090cd58b8b769ca43ff3ef65a0e53274/",
"rootUri": "file:///Users/fnuouser/.pub-cache/git/zhiying_flutter_alibc-ba413f84090cd58b8b769ca43ff3ef65a0e53274/",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "flutter_bloc",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_bloc-4.0.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_bloc-4.0.1",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "flutter_cache_manager",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_cache_manager-1.4.2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_cache_manager-1.4.2",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "flutter_cupertino_date_picker",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_cupertino_date_picker-1.0.26+2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_cupertino_date_picker-1.0.26+2",
"packageUri": "lib/",
"languageVersion": "1.19"
},
{
"name": "flutter_native_image",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_native_image-0.0.5+3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_native_image-0.0.5+3",
"packageUri": "lib/",
"languageVersion": "1.19"
},
{
"name": "flutter_page_indicator",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_page_indicator-0.0.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_page_indicator-0.0.3",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "flutter_plugin_android_lifecycle",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_plugin_android_lifecycle-1.0.11",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_plugin_android_lifecycle-1.0.11",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "flutter_screenutil",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-1.1.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-1.1.0",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "flutter_slidable",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_slidable-0.5.7",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_slidable-0.5.7",
"packageUri": "lib/",
"languageVersion": "1.19"
},
{
"name": "flutter_swiper",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_swiper-1.1.6",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_swiper-1.1.6",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "flutter_test",
"rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter_test",
"rootUri": "file:///Users/fnuouser/Documents/code/flutter/packages/flutter_test",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "flutter_update_dialog",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_update_dialog-1.0.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/flutter_update_dialog-1.0.0",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "flutter_web_plugins",
"rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter_web_plugins",
"rootUri": "file:///Users/fnuouser/Documents/code/flutter/packages/flutter_web_plugins",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "flutter_xupdate",
"rootUri": "file:///Users/fnuser/.pub-cache/git/flutter_xupdate-d17c695461ee4588dec990533d7467c11884cd0f/",
"rootUri": "file:///Users/fnuouser/.pub-cache/git/flutter_xupdate-d17c695461ee4588dec990533d7467c11884cd0f/",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "fluttertoast",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/fluttertoast-4.0.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/fluttertoast-4.0.1",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "http",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/http-0.12.2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/http-0.12.2",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "http_parser",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/http_parser-3.1.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/http_parser-3.1.4",
"packageUri": "lib/",
"languageVersion": "2.3"
},
{
"name": "image",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "image_cropper",
"rootUri": "file:///Users/fnuser/.pub-cache/git/Image_Cropper-e32f2264f86a27a2f5d7a7a5e26c6154eaf5798e/",
"rootUri": "file:///Users/fnuouser/.pub-cache/git/Image_Cropper-e32f2264f86a27a2f5d7a7a5e26c6154eaf5798e/",
"packageUri": "lib/",
"languageVersion": "1.20"
},
{
"name": "image_picker",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/image_picker-0.6.7+14",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/image_picker-0.6.7+14",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "image_picker_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/image_picker_platform_interface-1.1.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/image_picker_platform_interface-1.1.1",
"packageUri": "lib/",
"languageVersion": "2.5"
},
{
"name": "imei_plugin",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/imei_plugin-1.2.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/imei_plugin-1.2.0",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "intl",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/intl-0.16.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/intl-0.16.1",
"packageUri": "lib/",
"languageVersion": "2.5"
},
{
"name": "jdsdk",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/jdsdk-0.0.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/jdsdk-0.0.1",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "loading_indicator",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/loading_indicator-1.2.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/loading_indicator-1.2.0",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "matcher",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.6",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.6",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "meta",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8",
"packageUri": "lib/",
"languageVersion": "1.12"
},
{
"name": "nested",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/nested-0.0.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/nested-0.0.4",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "package_info",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/package_info-0.4.3+2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/package_info-0.4.3+2",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "path_provider",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.6.24",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.6.24",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_linux",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_linux-0.0.1+2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_linux-0.0.1+2",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_macos",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_macos-0.0.4+6",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_macos-0.0.4+6",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_platform_interface-1.0.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_platform_interface-1.0.4",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_windows",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_windows-0.0.4+3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_windows-0.0.4+3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "pedantic",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.9.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.9.0",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "permission_handler",
"rootUri": "file:///Users/fnuser/.pub-cache/git/permission_handler-b8c45c4c20221ac39fe083113fc360cc632f33a4/",
"rootUri": "file:///Users/fnuouser/.pub-cache/git/permission_handler-b8c45c4c20221ac39fe083113fc360cc632f33a4/",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "permission_handler_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/permission_handler_platform_interface-2.0.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/permission_handler_platform_interface-2.0.1",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "petitparser",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "photo_view",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/photo_view-0.10.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/photo_view-0.10.3",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "platform",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/platform-2.2.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/platform-2.2.1",
"packageUri": "lib/",
"languageVersion": "1.24"
},
{
"name": "plugin_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/plugin_platform_interface-1.0.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/plugin_platform_interface-1.0.3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "process",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/process-3.0.13",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/process-3.0.13",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "provider",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/provider-4.3.2+2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/provider-4.3.2+2",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "pull_to_refresh",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "quiver",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "rxdart",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/rxdart-0.24.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/rxdart-0.24.1",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "save_image",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/save_image-1.0.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/save_image-1.0.1",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "share_extend",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/share_extend-1.1.9",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/share_extend-1.1.9",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "shared_preferences",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.12+4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.12+4",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "shared_preferences_linux",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_linux-0.0.2+4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_linux-0.0.2+4",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "shared_preferences_macos",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_macos-0.0.1+11",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_macos-0.0.1+11",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "shared_preferences_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_platform_interface-1.0.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_platform_interface-1.0.4",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "shared_preferences_web",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_web-0.1.2+7",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_web-0.1.2+7",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "shared_preferences_windows",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_windows-0.0.1+3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_windows-0.0.1+3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "sharesdk_plugin",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/sharesdk_plugin-1.2.8",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/sharesdk_plugin-1.2.8",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "shimmer",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shimmer-1.1.2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/shimmer-1.1.2",
"packageUri": "lib/",
"languageVersion": "1.20"
},
{
"name": "sky_engine",
"rootUri": "file:///Users/fnuser/Documents/flutter-sdk/bin/cache/pkg/sky_engine",
"rootUri": "file:///Users/fnuouser/Documents/code/flutter/bin/cache/pkg/sky_engine",
"packageUri": "lib/",
"languageVersion": "1.11"
},
{
"name": "source_span",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "sqflite",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.3.1+2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.3.1+2",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "sqflite_common",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/sqflite_common-1.0.2+1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/sqflite_common-1.0.2+1",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "stack_trace",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3",
"packageUri": "lib/",
"languageVersion": "1.23"
},
{
"name": "stream_channel",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "string_scanner",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "string_validator",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/string_validator-0.1.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/string_validator-0.1.4",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "synchronized",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/synchronized-2.2.0+2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/synchronized-2.2.0+2",
"packageUri": "lib/",
"languageVersion": "2.8"
},
{
"name": "tab_indicator_styler",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/tab_indicator_styler-1.0.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/tab_indicator_styler-1.0.0",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "term_glyph",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0",
"packageUri": "lib/",
"languageVersion": "1.8"
},
{
"name": "test_api",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "transformer_page_view",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/transformer_page_view-0.1.6",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/transformer_page_view-0.1.6",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "typed_data",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "url_launcher",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher-5.7.6",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher-5.7.6",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_linux",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_linux-0.0.1+4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_linux-0.0.1+4",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_macos",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_macos-0.0.1+9",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_macos-0.0.1+9",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_platform_interface-1.0.8",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_platform_interface-1.0.8",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_web",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_web-0.1.4+1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_web-0.1.4+1",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "url_launcher_windows",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_windows-0.0.1+3",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_windows-0.0.1+3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "uuid",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/uuid-2.2.2",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/uuid-2.2.2",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "vector_math",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "webview_flutter",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "win32",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.4",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "xdg_directories",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/xdg_directories-0.1.0",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/xdg_directories-0.1.0",
"packageUri": "lib/",
"languageVersion": "2.3"
},
{
"name": "xml",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1",
"rootUri": "file:///Users/fnuouser/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1",
"packageUri": "lib/",
"languageVersion": "2.6"
},
@@ -650,7 +650,7 @@
"languageVersion": "2.8"
}
],
"generated": "2020-11-18T06:55:44.422288Z",
"generated": "2020-11-23T01:25:15.507062Z",
"generator": "pub",
"generatorVersion": "2.8.2"
}

+ 1
- 1
example/ios/Podfile.lock Vedi File

@@ -359,4 +359,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: b876ad7c3dca51c928ab9b8b08f46dd6a845c75e

COCOAPODS: 1.9.3
COCOAPODS: 1.10.0

+ 0
- 31
lib/pages/goods_share_page/goods_share_bloc.dart Vedi File

@@ -1,14 +1,10 @@
import 'dart:async';

import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_poster_model.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart';
import 'package:zhiying_comm/util/base_bloc.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class GoodsShareData {
List<Map<String, dynamic>> tabs;
List<GoodsShareTempDataModel> datas;
GoodsSharePosterModel poster;
}

class GoodsShareBloc extends BlocBase {
@@ -26,16 +22,10 @@ class GoodsShareBloc extends BlocBase {
}

void loadData(String shopType, Map<String, dynamic> params) async {
await loadPoster(params);
await loadMod(shopType);
await loadInfo(shopType, params);
_tabController.add(_data);
}

Future loadPoster(Map<String, dynamic> params) async {
_data.poster = await _loadPoster(params);
}

Future loadMod(String shopType) async {
var data = await NetUtil.post(
'/api/v1/tmp/mod/pub.flutter.share?type=${shopType.toString()}',
@@ -59,25 +49,4 @@ class GoodsShareBloc extends BlocBase {
Logger.error(err);
}
}

Future loadInfo(String shopType, Map<String, dynamic> params) async {
_data.datas = List();
for (Map<String, dynamic> item in _data.tabs) {
String url = item['url'];
Logger.debug(url);
var json = await NetUtil.post('/api/v1/share?type=${url.toString()}',
params: params);
Map<String, dynamic> data = json['data'];
_data.datas.add(
GoodsShareTempDataModel.fromJson(Map<String, dynamic>.from(data)));
}
}

// 请求分享海报
Future<GoodsSharePosterModel> _loadPoster(Map<String, dynamic> params) async {
var json = await NetUtil.post('/api/v1/share?type=poster', params: params);
Map<String, dynamic> data = Map<String, dynamic>.from(json['data']);

return GoodsSharePosterModel.fromJson(data);
}
}

+ 51
- 0
lib/pages/goods_share_page/goods_share_content_bloc.dart Vedi File

@@ -0,0 +1,51 @@
import 'dart:async';

import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_poster_model.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart';
import 'package:zhiying_comm/util/base_bloc.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class GoodsShareContentBloc extends BlocBase {
GoodsShareTempDataModel _data = GoodsShareTempDataModel();
GoodsSharePosterModel _poster;

StreamController<GoodsShareTempDataModel> _dataController =
StreamController<GoodsShareTempDataModel>();

StreamController<GoodsSharePosterModel> _posterController =
StreamController<GoodsSharePosterModel>();

Stream<GoodsShareTempDataModel> get outData => _dataController.stream;
Stream<GoodsSharePosterModel> get outPoster => _posterController.stream;

@override
void dispose() {
_dataController.close();
_dataController = null;
_posterController.close();
_posterController = null;
}

Future loadData(String shareType, Map<String, dynamic> params) async {
if (shareType == 'image') {
_loadPoster(params);
}

var json = await NetUtil.post('/api/v1/share?type=${shareType.toString()}',
params: params);
Map<String, dynamic> data = json['data'];

_data = GoodsShareTempDataModel.fromJson(Map<String, dynamic>.from(data));

_dataController.add(_data);
}

// 请求分享海报
void _loadPoster(Map<String, dynamic> params) async {
var json = await NetUtil.post('/api/v1/share?type=poster', params: params);
Map<String, dynamic> data = Map<String, dynamic>.from(json['data']);

_poster = GoodsSharePosterModel.fromJson(data);
_posterController.add(_poster);
}
}

+ 165
- 115
lib/pages/goods_share_page/goods_share_image/goods_share_image.dart Vedi File

@@ -11,6 +11,7 @@ import 'package:fluttertoast/fluttertoast.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:save_image/save_image.dart';
import 'package:zhiying_base_widget/dialog/loading/loading.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_content_bloc.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_editor/goods_share_editor.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_image/goods_share_image_model.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_poster_model.dart';
@@ -25,20 +26,45 @@ import 'package:zhiying_base_widget/widgets/public/custom_button/custom_bottom.d
import 'package:zhiying_base_widget/widgets/public/custom_button/custom_button_model.dart';
import 'package:zhiying_base_widget/widgets/share/models/share_data_model.dart';
import 'package:zhiying_base_widget/widgets/share/share_alert.dart';
import 'package:zhiying_comm/util/base_bloc.dart';

class GoodsShareImage extends StatefulWidget {
final Map<String, dynamic> model;
final GoodsShareTempDataModel datas;
final GoodsSharePosterModel poster;
final Map<String, dynamic> params;
final String shareType;

const GoodsShareImage(this.model, this.datas, {Key key, this.poster})
const GoodsShareImage(this.model, this.params, this.shareType, {Key key})
: super(key: key);

@override
_GoodsShareImageState createState() => _GoodsShareImageState();
}

class _GoodsShareImageState extends State<GoodsShareImage>
class _GoodsShareImageState extends State<GoodsShareImage> {
@override
Widget build(BuildContext context) {
return BlocProvider<GoodsShareContentBloc>(
bloc: GoodsShareContentBloc(),
child: _GoodsShareImageContent(
widget.model, widget.params, widget.shareType),
);
}
}

class _GoodsShareImageContent extends StatefulWidget {
final Map<String, dynamic> model;
final Map<String, dynamic> params;
final String shareType;

const _GoodsShareImageContent(this.model, this.params, this.shareType,
{Key key})
: super(key: key);

@override
_GoodsShareImageContentState createState() => _GoodsShareImageContentState();
}

class _GoodsShareImageContentState extends State<_GoodsShareImageContent>
with AutomaticKeepAliveClientMixin {
GlobalKey _globalKey = GlobalKey();
GoodsShareImageModel _style;
@@ -48,6 +74,8 @@ class _GoodsShareImageState extends State<GoodsShareImage>
bool _isContentSelected = false;
bool _isPosterSelected = false;

GoodsShareContentBloc _bloc;

// 分享数据
final ShareDataModel _shareModel = ShareDataModel();

@@ -60,124 +88,146 @@ class _GoodsShareImageState extends State<GoodsShareImage>
String data = widget.model['data'];
var d = convert.jsonDecode(data);
_style = GoodsShareImageModel.fromJson(Map<String, dynamic>.from(d));
_content = widget.datas.shareContent;
// _content = widget.datas.shareContent;

_bloc = BlocProvider.of<GoodsShareContentBloc>(context);
_bloc.loadData(widget.shareType, widget.params);

super.initState();
}

@override
Widget build(BuildContext context) {
widgets.clear();
widgets.add(GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
child: GoodsShareEdit(
_content,
widget.datas,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
onCopyClick: () {
Clipboard.setData(ClipboardData(text: _content));
Fluttertoast.showToast(msg: '文案已复制');
},
onEditorClick: () {
Fluttertoast.showToast(msg: '正在开发中');
return;
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => GoodsShareEditor(_style)));
},
onTempChange: (temp) {
setState(() {
_content = widget.datas.shareContent + temp;
});
},
),
onSelected: (isSelected) {
_isContentSelected = isSelected;
// _shareModel.content = isSelected ? _content : '';
},
));
for (String message in _style.customContent) {
widgets.add(
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: false,
child: GoodsShareMessage(message),
),
);
}
widgets.add(
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: true,
child: Container(
// color: Colors.redAccent,
width: 100,
height: 140,
padding: EdgeInsets.only(left: 25),
child: Transform.scale(
alignment: Alignment.centerLeft,
scale: 0.2,
child: GoodsShareTemplate(
widget.poster,
contentKey: _globalKey,
),
),
),
onSelected: (isSelected) {
_isPosterSelected = isSelected;
},
),
);
for (int index = 0; index < _style.customImage.length; index++) {
String image = _style.customImage[index];
// 分享图片
widgets.add(
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: true,
child: GoodsShareImageWidget(image),
onSelected: (isSelected) {
if (_images.containsKey(index)) {
_images.remove(index);
} else {
_images[index] = image;
return StreamBuilder<GoodsShareTempDataModel>(
stream: _bloc.outData,
builder: (BuildContext context, AsyncSnapshot snapshot) {
GoodsShareTempDataModel data = snapshot.data;
widgets.clear();
if (data != null) {
if (_content == null || _content == '') {
_content = data.shareContent;
}
},
),
);
}
widgets.add(GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
child: GoodsShareEdit(
_content,
data,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
onCopyClick: () {
Clipboard.setData(ClipboardData(text: _content));
Fluttertoast.showToast(msg: '文案已复制');
},
onEditorClick: () {
Fluttertoast.showToast(msg: '正在开发中');
return;
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => GoodsShareEditor(_style)));
},
onTempChange: (temp) {
setState(() {
_content = data.shareContent + temp;
});
},
),
onSelected: (isSelected) {
_isContentSelected = isSelected;
// _shareModel.content = isSelected ? _content : '';
},
));
for (String message in _style.customContent) {
widgets.add(
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: false,
child: GoodsShareMessage(message),
),
);
}
widgets.add(
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: true,
child: Container(
// color: Colors.redAccent,
width: 100,
height: 140,
padding: EdgeInsets.only(left: 25),
child: Transform.scale(
alignment: Alignment.centerLeft,
scale: 0.2,
child: StreamBuilder<GoodsSharePosterModel>(
stream: _bloc.outPoster,
builder: (BuildContext context, AsyncSnapshot snapshot) {
GoodsSharePosterModel poster = snapshot.data;
return poster == null
? Container()
: GoodsShareTemplate(
poster,
contentKey: _globalKey,
);
},
),
),
),
onSelected: (isSelected) {
_isPosterSelected = isSelected;
},
),
);
for (int index = 0; index < _style.customImage.length; index++) {
String image = _style.customImage[index];
// 分享图片
widgets.add(
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: true,
child: GoodsShareImageWidget(image),
onSelected: (isSelected) {
if (_images.containsKey(index)) {
_images.remove(index);
} else {
_images[index] = image;
}
},
),
);
}
}

return Column(
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(bottom: 4),
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8))),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: widgets),
),
),
),
_createBottom(),
],
);
return Column(
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(bottom: 4),
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8))),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: widgets),
),
),
),
_createBottom(),
],
);
});
}

Widget _createBottom() {


+ 129
- 86
lib/pages/goods_share_page/goods_share_link/goods_share_link.dart Vedi File

@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_content_bloc.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_editor/goods_share_editor.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_image/goods_share_image_model.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart';
@@ -15,25 +16,55 @@ import 'package:zhiying_base_widget/widgets/public/custom_button/custom_bottom.d
import 'package:zhiying_base_widget/widgets/public/custom_button/custom_button_model.dart';
import 'package:zhiying_base_widget/widgets/share/models/share_data_model.dart';
import 'package:zhiying_base_widget/widgets/share/share_alert.dart';
import 'package:zhiying_comm/util/base_bloc.dart';

class GoodsShareLink extends StatefulWidget {
final Map<String, dynamic> model;
final Map<String, dynamic> params;

final GoodsShareTempDataModel datas;
final String shareType;

const GoodsShareLink(this.model, this.datas, {Key key}) : super(key: key);
const GoodsShareLink(this.model, this.params, this.shareType, {Key key})
: super(key: key);

@override
_GoodsShareLinkState createState() => _GoodsShareLinkState();
}

class _GoodsShareLinkState extends State<GoodsShareLink>
class _GoodsShareLinkState extends State<GoodsShareLink> {
@override
Widget build(BuildContext context) {
return BlocProvider<GoodsShareContentBloc>(
bloc: GoodsShareContentBloc(),
child:
_GoodsShareLinkContent(widget.model, widget.params, widget.shareType),
);
}
}

class _GoodsShareLinkContent extends StatefulWidget {
final Map<String, dynamic> model;
final Map<String, dynamic> params;
final String shareType;

// final GoodsShareTempDataModel datas;

const _GoodsShareLinkContent(this.model, this.params, this.shareType,
{Key key})
: super(key: key);

@override
_GoodsShareLinkContentState createState() => _GoodsShareLinkContentState();
}

class _GoodsShareLinkContentState extends State<_GoodsShareLinkContent>
with AutomaticKeepAliveClientMixin {
GoodsShareImageModel _style;
Map<int, String> _images = Map();
List<Widget> widgets = List();
String _content = '';
bool _isContentSelected = false;

GoodsShareContentBloc _bloc;

// 分享数据
final ShareDataModel _shareModel = ShareDataModel();
@@ -47,97 +78,109 @@ class _GoodsShareLinkState extends State<GoodsShareLink>
String data = widget.model['data'];
var d = convert.jsonDecode(data);
_style = GoodsShareImageModel.fromJson(Map<String, dynamic>.from(d));
_content = widget.datas.shareContent;
// _content = widget.datas.shareContent;
_bloc = BlocProvider.of<GoodsShareContentBloc>(context);
_bloc.loadData(widget.shareType, widget.params);
super.initState();
}

@override
Widget build(BuildContext context) {
widgets.clear();
widgets.add(GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: false,
child: GoodsShareLinkWidget(
title: widget.datas?.title ?? '',
desc: widget.datas?.content ?? '',
imgGoods: widget.datas?.imgUrl ?? '',
icon: widget.datas?.appLogo ?? '',
name: widget.datas?.appName ?? '',
),
));
widgets.add(GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: false,
child: GoodsShareEdit(
_content,
widget.datas,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
onCopyClick: () {
Clipboard.setData(ClipboardData(text: _content));
Fluttertoast.showToast(msg: '文案已复制');
},
onEditorClick: () {
Fluttertoast.showToast(msg: '正在开发中');
return;
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => GoodsShareEditor(_style)));
},
onTempChange: (temp) {
setState(() {
_content = widget.datas.shareContent + temp;
});
},
),
onSelected: (isSelected) {
_isContentSelected = isSelected;
// _shareModel.content = isSelected ? _content : '';
},
));
for (String message in _style.customContent) {
widgets.add(
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: false,
child: GoodsShareMessage(message),
),
);
}
return StreamBuilder<GoodsShareTempDataModel>(
stream: _bloc.outData,
builder: (BuildContext context, AsyncSnapshot snapshot) {
GoodsShareTempDataModel data = snapshot.data;
widgets.clear();
if (data != null) {
if (_content == null || _content == '') {
_content = data.shareContent;
}
widgets.add(GoodsShareItem(
imgHeader: _style?.cssList?.headerImage ?? '',
imgCheck: _style?.cssList?.unChooseImage ?? '',
imgCheckSelected: _style?.cssList?.chooseImage ?? '',
enabled: false,
child: GoodsShareLinkWidget(
title: data?.title ?? '',
desc: data?.content ?? '',
imgGoods: data?.imgUrl ?? '',
icon: data?.appLogo ?? '',
name: data?.appName ?? '',
),
));
widgets.add(GoodsShareItem(
imgHeader: _style?.cssList?.headerImage ?? '',
imgCheck: _style?.cssList?.unChooseImage ?? '',
imgCheckSelected: _style?.cssList?.chooseImage ?? '',
enabled: false,
child: GoodsShareEdit(
_content,
data,
imgCheck: _style?.cssList?.unChooseImage ?? '',
imgCheckSelected: _style?.cssList?.chooseImage ?? '',
onCopyClick: () {
Clipboard.setData(ClipboardData(text: _content));
Fluttertoast.showToast(msg: '文案已复制');
},
onEditorClick: () {
Fluttertoast.showToast(msg: '正在开发中');
return;
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => GoodsShareEditor(_style)));
},
onTempChange: (temp) {
setState(() {
_content = data.shareContent + temp;
});
},
),
onSelected: (isSelected) {
// _isContentSelected = isSelected;
// _shareModel.content = isSelected ? _content : '';
},
));
for (String message in _style.customContent) {
widgets.add(
GoodsShareItem(
imgHeader: _style?.cssList?.headerImage ?? '',
imgCheck: _style?.cssList?.unChooseImage ?? '',
imgCheckSelected: _style?.cssList?.chooseImage ?? '',
enabled: false,
child: GoodsShareMessage(message),
),
);
}
}

return Column(
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(bottom: 4),
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8))),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: widgets),
),
),
),
_createBottom(),
],
);
return Column(
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(bottom: 4),
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8))),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: widgets),
),
),
),
_createBottom(),
],
);
});
}

Widget _createBottom() {
Map<String, dynamic> shareImages = _style.cssList.shareImage;
Map<String, dynamic> shareImages = _style?.cssList?.shareImage ?? {};
if (shareImages == null) {
return Container();
}


+ 78
- 36
lib/pages/goods_share_page/goods_share_miniprogram/goods_share_miniprogram.dart Vedi File

@@ -1,30 +1,61 @@
import 'dart:convert' as convert;

import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_content_bloc.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_image/goods_share_image_model.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/widgets/goods_share_item.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/widgets/goods_share_miniprogram_widget.dart';
import 'package:zhiying_base_widget/widgets/public/custom_button/custom_bottom.dart';
import 'package:zhiying_base_widget/widgets/public/custom_button/custom_button_model.dart';
import 'package:zhiying_comm/util/base_bloc.dart';

class GoodsShareMiniprogram extends StatefulWidget {
final Map<String, dynamic> model;
final Map<String, dynamic> params;

final GoodsShareTempDataModel datas;
final String shareType;

const GoodsShareMiniprogram(this.model, this.datas, {Key key})
const GoodsShareMiniprogram(this.model, this.params, this.shareType,
{Key key})
: super(key: key);

@override
_GoodsShareMiniprogramState createState() => _GoodsShareMiniprogramState();
}

class _GoodsShareMiniprogramState extends State<GoodsShareMiniprogram>
class _GoodsShareMiniprogramState extends State<GoodsShareMiniprogram> {
@override
Widget build(BuildContext context) {
return BlocProvider<GoodsShareContentBloc>(
bloc: GoodsShareContentBloc(),
child: _GoodsShareMiniprogramContent(
widget.model, widget.params, widget.shareType),
);
}
}

class _GoodsShareMiniprogramContent extends StatefulWidget {
final Map<String, dynamic> model;
final Map<String, dynamic> params;
final String shareType;

const _GoodsShareMiniprogramContent(this.model, this.params, this.shareType,
{Key key})
: super(key: key);

@override
_GoodsShareMiniprogramContentState createState() =>
_GoodsShareMiniprogramContentState();
}

class _GoodsShareMiniprogramContentState
extends State<_GoodsShareMiniprogramContent>
with AutomaticKeepAliveClientMixin {
GoodsShareImageModel _style;
Map<int, String> _images = Map();
List<Widget> widgets = List();
GoodsShareContentBloc _bloc;

// 切换Tab导航栏保持页面状态
bool get wantKeepAlive => true;
@@ -34,47 +65,58 @@ class _GoodsShareMiniprogramState extends State<GoodsShareMiniprogram>
String data = widget.model['data'];
var d = convert.jsonDecode(data);
_style = GoodsShareImageModel.fromJson(Map<String, dynamic>.from(d));
_bloc = BlocProvider.of<GoodsShareContentBloc>(context);
_bloc.loadData(widget.shareType, widget.params);
super.initState();
}

@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(bottom: 4),
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8))),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GoodsShareItem(
imgHeader: _style.cssList.headerImage,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
enabled: false,
child: GoodsShareMiniprogramWidget(
title: widget.datas?.miniAppTitle ?? '',
imgGoods: widget.datas?.imgUrl ?? '',
icon: widget.datas?.appLogo ?? '',
name: widget.datas?.appName ?? '',
return StreamBuilder<GoodsShareTempDataModel>(
stream: _bloc.outData,
builder: (BuildContext context, AsyncSnapshot snapshot) {
GoodsShareTempDataModel data = snapshot.data;
if (data == null) {
return Container();
}
return Column(
children: <Widget>[
Expanded(
child: Container(
margin: EdgeInsets.only(bottom: 4),
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8))),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GoodsShareItem(
imgHeader: _style?.cssList?.headerImage ?? '',
imgCheck: _style?.cssList?.unChooseImage ?? '',
imgCheckSelected: _style?.cssList?.chooseImage ?? '',
enabled: false,
child: GoodsShareMiniprogramWidget(
title: data?.miniAppTitle ?? '',
imgGoods: data?.imgUrl ?? '',
icon: data?.appLogo ?? '',
name: data?.appName ?? '',
),
),
],
),
),
],
),
),
),
),
),
_createBottom(),
],
);
_createBottom(),
],
);
});
return Material();
}

Widget _createBottom() {


+ 10
- 15
lib/pages/goods_share_page/goods_share_page.dart Vedi File

@@ -1,12 +1,9 @@
import 'dart:convert' as convert;

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_bloc.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_image/goods_share_image.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_link/goods_share_link.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_miniprogram/goods_share_miniprogram.dart';
import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart';
import 'package:zhiying_comm/util/base_bloc.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

@@ -44,6 +41,7 @@ class _GoodsShareContainerState extends State<_GoodsShareContainer>
TabController _tabController;
List<Widget> _tabs = [];
List<Widget> _contents = [];
Map<String, dynamic> _params = {};

@override
void initState() {
@@ -53,7 +51,8 @@ class _GoodsShareContainerState extends State<_GoodsShareContainer>
Map<String, dynamic> data = widget.model;
Logger.debug(data['share_url_args'].toString());
_bloc = BlocProvider.of<GoodsShareBloc>(context);
_bloc.loadData('taobao', data['share_url_args']);
_params = data['share_url_args'];
_bloc.loadData('taobao', _params);
super.initState();
}

@@ -67,32 +66,28 @@ class _GoodsShareContainerState extends State<_GoodsShareContainer>
builder: (BuildContext context, AsyncSnapshot snapshot) {
GoodsShareData data = snapshot.data;
List<Map<String, dynamic>> list = data?.tabs;
List<GoodsShareTempDataModel> datas = data?.datas;
if (list == null ||
list.length == 0 ||
datas == null ||
datas.length == 0) {
if (list == null || list.length == 0) {
return Container();
}

_tabController = TabController(length: list.length, vsync: this);
_tabs.clear();
_contents.clear();
for (int i = 0; i < list.length && i < datas.length; i++) {
for (int i = 0; i < list.length && i < data.tabs.length; i++) {
Map<String, dynamic> item = list[i];
GoodsShareTempDataModel model = datas[i];
// GoodsShareTempDataModel model = datas[i];
_tabs.add(_createTabItem(item['title']));
String type = item['url'];
if (type == 'image') {
_contents.add(GoodsShareImage(
item,
model,
poster: data.poster,
_params,
type,
));
} else if (type == 'link') {
_contents.add(GoodsShareLink(item, model));
_contents.add(GoodsShareLink(item, _params, type));
} else if (type == 'mini') {
_contents.add(GoodsShareMiniprogram(item, model));
_contents.add(GoodsShareMiniprogram(item, _params, type));
} else {
_contents.add(Container());
}


+ 3
- 3
lib/pages/goods_share_page/widgets/goods_share_miniprogram_widget.dart Vedi File

@@ -28,11 +28,11 @@ class GoodsShareMiniprogramWidget extends StatelessWidget {
width: 15,
height: 15,
child: CachedNetworkImage(
imageUrl: icon,
imageUrl: icon ?? '',
),
),
Text(
name,
name ?? '',
style: TextStyle(fontSize: 11, color: Color(0xff999999)),
)
],
@@ -51,7 +51,7 @@ class GoodsShareMiniprogramWidget extends StatelessWidget {
width: double.infinity,
height: 180,
child: CachedNetworkImage(
imageUrl: imgGoods,
imageUrl: imgGoods ?? '',
),
),
Row(


Caricamento…
Annulla
Salva