diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 5ea6c35..3eb1970 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -54,7 +54,7 @@ android { ndk { //选择要添加的对应cpu类型的.so库。 abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' - // abiFilters 'armeabi-v7a','x86_64' + //abiFilters 'armeabi-v7a','x86_64' } } @@ -156,6 +156,7 @@ flutter { source '../..' } + dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.2' @@ -184,6 +185,9 @@ dependencies { implementation 'com.alibaba.sdk.android:AlibcTradeBiz:4.0.0.16@aar' implementation 'com.alibaba.sdk.android:nb_trade:4.0.0.16@aar' implementation 'com.alibaba:fastjson:1.2.41@jar' + + implementation fileTree(include: ['*.jar'], dir: 'libs') + } diff --git a/example/android/app/libs/AMap_Location_V5.2.0_20200915.jar b/example/android/app/libs/AMap_Location_V5.2.0_20200915.jar new file mode 100644 index 0000000..28c3dae Binary files /dev/null and b/example/android/app/libs/AMap_Location_V5.2.0_20200915.jar differ diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 4050def..14397e2 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -36,6 +36,7 @@ + @@ -91,7 +92,7 @@ android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/zhiying_file_path" /> - + diff --git a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java index d569792..9e27b1b 100644 --- a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java +++ b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java @@ -155,11 +155,9 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN public Map getSetting() { Map map = new HashMap(); // ///测试 -// map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ -// //map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 -// //map.put("domain", "http://192.168.0.88:5000/"); -// map.put("master_id", "123456"); -// map.put("secret_key", "123456"); + map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ + map.put("master_id", "123456"); + map.put("secret_key", "123456"); ///正式 // map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 @@ -167,9 +165,9 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN // map.put("secret_key", "123456"); //客户测试 - map.put("domain", "http://api.zhiyingos.com/");//45678910,api.zhios.cn84198689 - map.put("master_id", "80685217"); - map.put("secret_key", "123456"); +// map.put("domain", "http://api.zhiyingos.com/");//45678910,api.zhios.cn84198689 +// map.put("master_id", "13376168"); +// map.put("secret_key", "123456"); // map.put("token", "123465"); return map; diff --git a/lib/models/app_config_model.dart b/lib/models/app_config_model.dart index 4ab6574..7c654e3 100644 --- a/lib/models/app_config_model.dart +++ b/lib/models/app_config_model.dart @@ -15,7 +15,7 @@ class AppConfigModel { ///新引导页参数 GuideData guideData; - static String appStartDelay="0.5"; + static String appStartDelay = "0.5"; static AppConfigModel _config; @@ -54,7 +54,7 @@ class AppConfigModel { keys = json['keys'] != null ? new AppConfigKeyModel.fromJson(json['keys']) : null; guideImage = json['guide_image'] != null ? new AppConfigGuideModel.fromJson(json['guide_image']) : null; guideData = json['guide_data'] != null ? GuideData.fromJson(json['guide_data']) : null; - appStartDelay=json['app_start_delay']!=null?json['app_start_delay']:'0.5'; + appStartDelay = json['app_start_delay'] != null ? json['app_start_delay'] : '0.5'; } Map toJson() { @@ -75,6 +75,7 @@ class AppConfigKeyModel { AppConfigKeyItemModel weixin; AppConfigKeyItemModel jdIos; AppConfigKeyItemModel jdAndroid; + GDModel gd; AppConfigKeyModel({this.weibo, this.qq, this.weixin, this.jdIos, this.jdAndroid}); @@ -84,6 +85,7 @@ class AppConfigKeyModel { weixin = json['weixin'] != null ? new AppConfigKeyItemModel.fromJson(json['weixin']) : null; jdIos = json['jd_ios'] != null ? new AppConfigKeyItemModel.fromJson(json['jd_ios']) : null; jdAndroid = json['jd_android'] != null ? new AppConfigKeyItemModel.fromJson(json['jd_android']) : null; + gd = json['gd'] != null ? GDModel.fromJson(json['gd']) : null; } Map toJson() { @@ -103,6 +105,10 @@ class AppConfigKeyModel { if (this.jdAndroid != null) { data['jd_android'] = this.jdAndroid.toJson(); } + if (this.gd != null) { + data['gd'] = this.gd.toJson(); + } + return data; } } @@ -216,3 +222,22 @@ class AppConfigGuideModel { return data; } } + +class GDModel { + String androidKey; + String iosKey; + + GDModel({this.androidKey, this.iosKey}); + + GDModel.fromJson(Map json) { + androidKey = json['android_key']; + iosKey = json['ios_key']; + } + + Map toJson() { + final Map data = new Map(); + data['android_key'] = this.androidKey; + data['ios_key'] = this.iosKey; + return data; + } +} diff --git a/lib/pages/goods_share_page/models/goods_share_style_model.dart b/lib/pages/goods_share_page/models/goods_share_style_model.dart index cd3875f..7c44f26 100644 --- a/lib/pages/goods_share_page/models/goods_share_style_model.dart +++ b/lib/pages/goods_share_page/models/goods_share_style_model.dart @@ -11,6 +11,7 @@ class GoodsShareStyleModel { Map shareImage; GoodsShareTempEditorModel editTemplate; Map shareLink; + Map shareMini; GoodsShareStyleModel( {this.unChooseColor, @@ -33,6 +34,7 @@ class GoodsShareStyleModel { rewardText = json['reward_text']; shareImage = json['share_image']; shareLink=json['share_link']; + shareMini=json['share_mini']; if (json['edit_template'] != null) { editTemplate = GoodsShareTempEditorModel.fromJson( Map.from(json['edit_template'])); diff --git a/lib/register.dart b/lib/register.dart index 3f613f9..f777e6b 100644 --- a/lib/register.dart +++ b/lib/register.dart @@ -70,6 +70,7 @@ import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data.dart' import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail.dart'; import 'package:zhiying_base_widget/widgets/wallet/wallet_income/wallet_income.dart'; import 'package:zhiying_base_widget/widgets/wallet_bil_detail/wallet_bil_detail.dart'; +import 'package:zhiying_base_widget/zhiying_base_widget.dart'; import 'package:zhiying_comm/util/defalut_widget_creater.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; @@ -135,7 +136,10 @@ class BaseWidgetRegister { SharesdkPlugin.regist(register); ///微信支付初始化 - registerWxApi(appId: config?.keys?.weixin?.appId,universalLink: config?.keys?.weixin?.universalLink); + registerWxApi(appId: config?.keys?.weixin?.appId, universalLink: config?.keys?.weixin?.universalLink); + + ///高德定位注册 + AMapFlutterLocation.setApiKey(config?.keys?.gd?.androidKey ?? "", config?.keys?.gd?.iosKey); }); @@ -161,7 +165,7 @@ class BaseWidgetRegister { // NetUtil.post('/api/v1/rec/kaola?page=1', method: NetMethod.GET, cache: true, showToast: false); LoginStyleUtil.fetchNetPageData(); - FlutterUserAgent.init(force: true); + FlutterUserAgent.init(force: true); return null; }); diff --git a/lib/zhiying_base_widget.dart b/lib/zhiying_base_widget.dart index 8a6ebd8..cb7fe3b 100644 --- a/lib/zhiying_base_widget.dart +++ b/lib/zhiying_base_widget.dart @@ -6,4 +6,6 @@ export 'package:zhiying_base_widget/pages/main_page/model/background_model.dart' export 'package:zhiying_base_widget/pages/custom_page/bloc/background_bloc.dart'; export 'package:pull_to_refresh/pull_to_refresh.dart'; export 'package:flutter_user_agent/flutter_user_agent.dart'; -export 'package:zhiying_base_widget/widgets/restart_widget/restart_widget.dart'; \ No newline at end of file +export 'package:zhiying_base_widget/widgets/restart_widget/restart_widget.dart'; +export 'package:amap_flutter_location/amap_flutter_location.dart'; +export 'package:amap_flutter_location/amap_location_option.dart'; \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 5eea53f..a427a60 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,6 +51,9 @@ dependencies: loading_indicator: ^1.2.0 + #高德定位 + amap_flutter_location: ^1.0.1 + mobpush_plugin: plugin_platform_interface: ^1.0.1