diff --git a/android/app/build.gradle b/android/app/build.gradle index 5a9f81ab..0d83268c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -141,25 +141,25 @@ android { buildTypes { release { -// debuggable true -// shrinkResources false -// minifyEnabled false + debuggable true + shrinkResources false + minifyEnabled false signingConfig signingConfigs.config -// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { -// debuggable true -// shrinkResources false -// minifyEnabled false + debuggable true + shrinkResources false + minifyEnabled false signingConfig signingConfigs.config -// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } profile { -// debuggable true -// shrinkResources false -// minifyEnabled false + debuggable true + shrinkResources false + minifyEnabled false signingConfig signingConfigs.config -// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } diff --git a/ios/Podfile b/ios/Podfile index 990bc022..bd714496 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -29,6 +29,7 @@ flutter_ios_podfile_setup target 'Runner' do # pod 'AFNetworking', '~> 4.0' + pod 'SSZipArchive', '~> 2.4.2' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 32522f2a..8d00ae52 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -81,6 +81,7 @@ PODS: - sqflite (0.0.2): - Flutter - FMDB (>= 2.7.5) + - SSZipArchive (2.4.2) - TOCropViewController (2.6.0) - TPNS-iOS (1.3.3.0) - tpns_flutter_plugin (1.1.2): @@ -112,6 +113,7 @@ DEPENDENCIES: - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - sharesdk_plugin (from `.symlinks/plugins/sharesdk_plugin/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`) + - SSZipArchive (~> 2.4.2) - tpns_flutter_plugin (from `.symlinks/plugins/tpns_flutter_plugin/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - video_player (from `.symlinks/plugins/video_player/ios`) @@ -125,6 +127,7 @@ SPEC REPOS: - FMDB - mob_sharesdk - MOBFoundation + - SSZipArchive - TOCropViewController - TPNS-iOS - WechatOpenSDK @@ -192,6 +195,7 @@ SPEC CHECKSUMS: shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d sharesdk_plugin: 6d6634bb480174b607030f19fc9d84d68cfbf326 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 + SSZipArchive: e7b4f3d9e780c2acc1764cd88fbf2de28f26e5b2 TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38 TPNS-iOS: 57a146496858ba2fb5d43e5f240feb19243b69cb tpns_flutter_plugin: a366649c8ad71f19dfb864d3c994ed0480b69daa @@ -201,6 +205,6 @@ SPEC CHECKSUMS: webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 -PODFILE CHECKSUM: 3dec887221b0cf3fccf2bbd3f50f36c0ad0bcbeb +PODFILE CHECKSUM: 7092aa3092b9508e0ccea9e76cd5fa33505dbb46 COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d5441654..bd7070d4 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -25,7 +25,6 @@ 6EE8F34E2695816000237A5E /* liblibPDRCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33C2695816000237A5E /* liblibPDRCore.a */; }; 6EE8F34F2695816000237A5E /* liblibNativeUI.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33D2695816000237A5E /* liblibNativeUI.a */; }; 6EE8F3502695816000237A5E /* liblibUI.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33E2695816000237A5E /* liblibUI.a */; }; - 6EE8F3512695816000237A5E /* libcoreSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F33F2695816000237A5E /* libcoreSupport.a */; }; 6EE8F3522695816000237A5E /* liblibStorage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F3402695816000237A5E /* liblibStorage.a */; }; 6EE8F3532695816000237A5E /* liblibPGInvocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F3412695816000237A5E /* liblibPGInvocation.a */; }; 6EE8F3542695816000237A5E /* liblibNavigator.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F3422695816000237A5E /* liblibNavigator.a */; }; @@ -306,7 +305,6 @@ 6EE8F3522695816000237A5E /* liblibStorage.a in Frameworks */, 6EE8F34D2695816000237A5E /* liblibWeex.a in Frameworks */, 6EE8F3552695816000237A5E /* storage.framework in Frameworks */, - 6EE8F3512695816000237A5E /* libcoreSupport.a in Frameworks */, 05C5427426BCE3AC00D26AC2 /* BMKLocationKit.framework in Frameworks */, 89A626A726A7FF910004A8F0 /* libWeChatSDK.a in Frameworks */, 89A626AC26A8002F0004A8F0 /* libWeChatSDK.a in Frameworks */, @@ -884,6 +882,15 @@ "$(PROJECT_DIR)/UniMPSDK/Libs", ); GCC_INPUT_FILETYPE = automatic; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + HAVE_INTTYPES_H, + HAVE_PKCRYPT, + HAVE_STDINT_H, + HAVE_WZAES, + HAVE_ZLIB, + ); HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", @@ -1111,6 +1118,15 @@ "$(PROJECT_DIR)/UniMPSDK/Libs", ); GCC_INPUT_FILETYPE = automatic; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + HAVE_INTTYPES_H, + HAVE_PKCRYPT, + HAVE_STDINT_H, + HAVE_WZAES, + HAVE_ZLIB, + ); HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", @@ -1231,6 +1247,15 @@ "$(PROJECT_DIR)/UniMPSDK/Libs", ); GCC_INPUT_FILETYPE = automatic; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + HAVE_INTTYPES_H, + HAVE_PKCRYPT, + HAVE_STDINT_H, + HAVE_WZAES, + HAVE_ZLIB, + ); HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", diff --git a/lib/main.dart b/lib/main.dart index f263c8f5..a4e8e4d4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -47,6 +47,7 @@ import 'package:huixiang/setting/help_feedback_page.dart'; import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; +import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/union/store_details_page.dart'; import 'package:huixiang/union/union_details_page.dart'; @@ -277,6 +278,9 @@ Map routers = { '/router/edit_name': (context, {arguments}) => EditName( arguments: arguments, ), + '/router/location_map': (context, {arguments}) => LocationMap( + arguments: arguments, + ), // '/router/hot_article_details_page': (context, {arguments}) => HotArticleDetailsPage(), // '/router/ui_test': (context, {arguments}) => UITest(), }; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index cf322a94..a4fe3575 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -14,11 +14,11 @@ import 'package:shared_preferences/shared_preferences.dart'; part 'retrofit_api.g.dart'; -// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const base_url = "http://192.168.10.236:8766/app/"; -const baseUrl = "http://192.168.10.236:8766/app/"; +// const base_url = "http://192.168.10.236:8766/app/"; +// const baseUrl = "http://192.168.10.236:8766/app/"; /// 本地 diff --git a/lib/union/location_map_page.dart b/lib/union/location_map_page.dart new file mode 100644 index 00000000..63419f8f --- /dev/null +++ b/lib/union/location_map_page.dart @@ -0,0 +1,86 @@ + +import 'dart:io'; +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + + +class LocationMap extends StatefulWidget { + + final Map arguments; + + LocationMap({this.arguments}); + + @override + State createState() { + return _LocationMap(); + } + +} + + +class _LocationMap extends State { + + @override + Widget build(BuildContext context) { + latLng = BMFCoordinate(double.tryParse(widget.arguments["lat"]), double.tryParse(widget.arguments["lng"])); + return Scaffold( + appBar: MyAppBar( + background: Color(0xFFF7F7F7), + title: widget.arguments["storeName"], + titleColor: Colors.black87, + titleSize: 18.sp, + leadingColor: Colors.black, + ), + body: Container( + child: BMFMapWidget( + mapOptions: BMFMapOptions( + center: latLng, + zoomLevel: 12, + ), + onBMFMapCreated: onMapCreated, + ), + ), + ); + } + + BMFMapController _mapController; + BMFCoordinate latLng; + BMFMarker bmfMarker; + + onMapCreated(BMFMapController controller) { + _mapController = controller; + setState(() { + _mapController.showUserLocation(true); + _mapController.setCustomMapStyle('assets/map_style/chatian.sty', 0); + if (bmfMarker == null && _mapController != null) { + bmfMarker = BMFMarker( + position: latLng, + centerOffset: BMFPoint(0.5, 0.7), + enabled: false, + icon: "assets/image/icon_map_marker.png", + draggable: false, + ); + _mapController.addMarker(bmfMarker); + } + _mapController.updateMapOptions( + BMFMapOptions( + center: latLng, + zoomLevel: 15, + ), + ); + }); + } + +} + + + + + + diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 913047f2..dc888043 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -220,10 +220,28 @@ class _UnionDetailsPage extends State { SizedBox( width: 16.w, ), - Image.asset( - "assets/image/icon_union_location.png", - width: 24.w, - height: 24.h, + InkWell( + onTap: () { + if (storeInfo == null || + storeInfo.latitude == null || + storeInfo.longitude == null || + storeInfo.latitude == "" || + storeInfo.longitude == "") + return; + Navigator.of(context).pushNamed( + '/router/location_map', + arguments: { + "lat": storeInfo.latitude, + "lng": storeInfo.longitude, + "storeName": + storeInfo.storeName, + }); + }, + child: Image.asset( + "assets/image/icon_union_location.png", + width: 24.w, + height: 24.h, + ), ), SizedBox( width: 16.w, @@ -743,12 +761,15 @@ class _UnionDetailsPage extends State { itemBuilder: (context, position) { return InkWell( onTap: () { - if (widget.arguments["source"] != null - && widget.arguments["source"] == activitys[position].id) { + if (widget.arguments["source"] != null && + widget.arguments["source"] == activitys[position].id) { Navigator.of(context).pop(); } else { Navigator.of(context).pushNamed('/router/store_detail_page', - arguments: {"activityId": activitys[position].id, "source": widget.arguments["id"]}); + arguments: { + "activityId": activitys[position].id, + "source": widget.arguments["id"] + }); } }, child: Container( diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 7d6aea9c..72fb8907 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -164,9 +164,12 @@ class _UnionPage extends State SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setString("latitude", "${latLng.latitude}"); await prefs.setString("longitude", "${latLng.longitude}"); - await prefs.setString("province", province); - await prefs.setString("city", city); - await prefs.setString("district", district); + if (province != null) + await prefs.setString("province", province); + if (city != null) + await prefs.setString("city", city); + if (district != null) + await prefs.setString("district", district); } getLatLng() async {