Compare commits
20 Commits
1278c38b7e
...
dev_map
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5843ef6e87 | ||
| 0123025296 | |||
| 587dd48896 | |||
| 569780ffb4 | |||
| 3aac4e7330 | |||
| b275c66383 | |||
| bf80931f37 | |||
| 67c36f436c | |||
| c10c92afdc | |||
| d3edf95df3 | |||
| 930953780d | |||
| cd14469d79 | |||
| b846d352a2 | |||
|
|
a24f41a8d5 | ||
|
|
65b4a3ac34 | ||
| 35bd3a78a5 | |||
| 032e60d362 | |||
| 45f5035d1b | |||
| f792915429 | |||
| edbacc502b |
8
ln_jq_app/.claude/settings.local.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(flutter build apk --debug 2>&1 | tail -15)",
|
||||||
|
"Bash(flutter build apk --debug 2>&1 | tail -10)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,3 +68,8 @@ android {
|
|||||||
flutter {
|
flutter {
|
||||||
source = "../.."
|
source = "../.."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("com.amap.api:navi-3dmap-location-search:10.0.700_3dmap10.0.700_loc6.4.5_sea9.7.2")
|
||||||
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,7 +14,12 @@
|
|||||||
<!--定位权限-->
|
<!--定位权限-->
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION"/>
|
<!--用于申请调用A-GPS模块-->
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></uses-permission>
|
||||||
|
<!--如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限-->
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
|
<!--如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明-->
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||||
|
|
||||||
|
|
||||||
@@ -22,6 +27,19 @@
|
|||||||
android:label="小羚羚"
|
android:label="小羚羚"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/logo">
|
android:icon="@mipmap/logo">
|
||||||
|
|
||||||
|
<!-- 高德地图Key -->
|
||||||
|
<meta-data
|
||||||
|
android:name="com.amap.api.v2.apikey"
|
||||||
|
android:value="92495660f7bc990cb475426c47c03b65" />
|
||||||
|
|
||||||
|
<!-- 高德地图定位服务 -->
|
||||||
|
<service android:name="com.amap.api.location.APSService" />
|
||||||
|
<!--高德导航-->
|
||||||
|
<activity
|
||||||
|
android:name="com.amap.api.navi.AmapRouteActivity"
|
||||||
|
android:theme="@android:style/Theme.NoTitleBar"
|
||||||
|
android:configChanges="orientation|keyboardHidden|screenSize|navigation" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|||||||
@@ -1,6 +1,195 @@
|
|||||||
package com.lnkj.ln_jq_app;
|
package com.lnkj.ln_jq_app;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import io.flutter.embedding.android.FlutterActivity;
|
import io.flutter.embedding.android.FlutterActivity;
|
||||||
|
import io.flutter.embedding.engine.FlutterEngine;
|
||||||
|
import io.flutter.plugin.common.MethodChannel;
|
||||||
|
|
||||||
public class MainActivity extends FlutterActivity {
|
public class MainActivity extends FlutterActivity {
|
||||||
|
|
||||||
|
private static final String CHANNEL = "com.lnkj.ln_jq_app/map";
|
||||||
|
private static final String TAG = "MainActivity";
|
||||||
|
|
||||||
|
// 权限请求码
|
||||||
|
private static final int PERMISSION_REQUEST_CODE = 1001;
|
||||||
|
|
||||||
|
private NativeMapView mapView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
|
||||||
|
super.configureFlutterEngine(flutterEngine);
|
||||||
|
|
||||||
|
// 注册高德地图导航Platform View
|
||||||
|
flutterEngine
|
||||||
|
.getPlatformViewsController()
|
||||||
|
.getRegistry()
|
||||||
|
.registerViewFactory(
|
||||||
|
"NativeFirstPage",
|
||||||
|
new NativeMapFactory(this)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 注册方法通道用于地图控制
|
||||||
|
new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), CHANNEL)
|
||||||
|
.setMethodCallHandler((call, result) -> {
|
||||||
|
switch (call.method) {
|
||||||
|
case "requestPermissions":
|
||||||
|
requestPermissions();
|
||||||
|
result.success(null);
|
||||||
|
break;
|
||||||
|
case "onResume":
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onResume();
|
||||||
|
}
|
||||||
|
result.success(null);
|
||||||
|
break;
|
||||||
|
case "onPause":
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onPause();
|
||||||
|
}
|
||||||
|
result.success(null);
|
||||||
|
break;
|
||||||
|
case "onDestroy":
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.dispose();
|
||||||
|
mapView = null;
|
||||||
|
}
|
||||||
|
result.success(null);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
result.notImplemented();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前系统版本需要申请的权限列表
|
||||||
|
*/
|
||||||
|
private String[] getRequiredPermissions() {
|
||||||
|
List<String> permissions = new ArrayList<>();
|
||||||
|
// 定位权限是必须的
|
||||||
|
permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);
|
||||||
|
permissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||||
|
|
||||||
|
// 存储权限处理:Android 13 (API 33) 以下才需要申请 legacy 存储权限
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
|
permissions.add(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return permissions.toArray(new String[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查并申请权限
|
||||||
|
*/
|
||||||
|
private void checkAndRequestPermissions() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
String[] requiredPermissions = getRequiredPermissions();
|
||||||
|
List<String> deniedPermissions = new ArrayList<>();
|
||||||
|
|
||||||
|
for (String permission : requiredPermissions) {
|
||||||
|
if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
deniedPermissions.add(permission);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!deniedPermissions.isEmpty()) {
|
||||||
|
ActivityCompat.requestPermissions(
|
||||||
|
this,
|
||||||
|
deniedPermissions.toArray(new String[0]),
|
||||||
|
PERMISSION_REQUEST_CODE
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "所有必要权限已授予");
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.startLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.startLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void requestPermissions() {
|
||||||
|
checkAndRequestPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMapView(NativeMapView mapView) {
|
||||||
|
this.mapView = mapView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
// 注意:高德SDK合规检查通过后再进行定位相关操作
|
||||||
|
// 这里仅保留地图生命周期调用,权限建议在Flutter端或按需触发
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onResume();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onPause();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.dispose();
|
||||||
|
mapView = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
|
||||||
|
if (requestCode == PERMISSION_REQUEST_CODE) {
|
||||||
|
boolean locationGranted = false;
|
||||||
|
for (int i = 0; i < permissions.length; i++) {
|
||||||
|
if (Manifest.permission.ACCESS_FINE_LOCATION.equals(permissions[i])
|
||||||
|
&& grantResults[i] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
locationGranted = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (locationGranted) {
|
||||||
|
if (mapView != null) {
|
||||||
|
mapView.startLocation();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 只有在定位权限确实被拒绝时才弹出提示
|
||||||
|
Toast.makeText(this, "请授予应用定位权限以正常使用地图功能", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.lnkj.ln_jq_app;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import io.flutter.plugin.common.MessageCodec;
|
||||||
|
import io.flutter.plugin.common.StandardMessageCodec;
|
||||||
|
import io.flutter.plugin.platform.PlatformView;
|
||||||
|
import io.flutter.plugin.platform.PlatformViewFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高德地图导航 Platform View Factory
|
||||||
|
* 对应iOS的NativeViewFactory
|
||||||
|
*/
|
||||||
|
public class NativeMapFactory extends PlatformViewFactory {
|
||||||
|
|
||||||
|
private static final String VIEW_TYPE_ID = "NativeFirstPage";
|
||||||
|
private static NativeMapView mapViewInstance = null;
|
||||||
|
private final Context context;
|
||||||
|
|
||||||
|
public NativeMapFactory(Context context) {
|
||||||
|
super(StandardMessageCodec.INSTANCE);
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlatformView create(Context context, int viewId, Object args) {
|
||||||
|
mapViewInstance = new NativeMapView(context, viewId, args);
|
||||||
|
return mapViewInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取地图实例,供MainActivity使用
|
||||||
|
*/
|
||||||
|
public static NativeMapView getMapView() {
|
||||||
|
return mapViewInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
ln_jq_app/android/app/src/main/res/drawable/car.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_close.png
Normal file
|
After Width: | Height: | Size: 880 B |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_fuel.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_location.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_marker.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_mileage.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_tag.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_time.png
Normal file
|
After Width: | Height: | Size: 810 B |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_toll.png
Normal file
|
After Width: | Height: | Size: 924 B |
BIN
ln_jq_app/android/app/src/main/res/drawable/ic_un_marker.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
BIN
ln_jq_app/android/app/src/main/res/mipmap-xhdpi/logo.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
51
ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK.podspec
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#
|
||||||
|
# Be sure to run `pod lib lint AMapNavIOSSDK.podspec' to ensure this is a
|
||||||
|
# valid spec before submitting.
|
||||||
|
#
|
||||||
|
# Any lines starting with a # are optional, but their use is encouraged
|
||||||
|
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
|
||||||
|
#
|
||||||
|
|
||||||
|
Pod::Spec.new do |s|
|
||||||
|
s.name = 'AMapNavIOSSDK'
|
||||||
|
s.version = '0.1.0'
|
||||||
|
s.summary = 'A short description of AMapNavIOSSDK.'
|
||||||
|
|
||||||
|
# This description is used to generate tags and improve search results.
|
||||||
|
# * Think: What does it do? Why did you write it? What is the focus?
|
||||||
|
# * Try to keep it short, snappy and to the point.
|
||||||
|
# * Write the description between the DESC delimiters below.
|
||||||
|
# * Finally, don't worry about the indent, CocoaPods strips it!
|
||||||
|
|
||||||
|
s.description = <<-DESC
|
||||||
|
TODO: Add long description of the pod here.
|
||||||
|
DESC
|
||||||
|
|
||||||
|
s.homepage = 'https://github.com/xiaoshuai/AMapNavIOSSDK'
|
||||||
|
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
|
||||||
|
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||||
|
s.author = { 'xiaoshuai' => 'xiaoshuai@net.cn' }
|
||||||
|
s.source = { :git => 'https://github.com/xiaoshuai/AMapNavIOSSDK.git', :tag => s.version.to_s }
|
||||||
|
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
|
||||||
|
|
||||||
|
s.ios.deployment_target = '12.0'
|
||||||
|
|
||||||
|
s.source_files = 'AMapNavIOSSDK/Classes/**/*'
|
||||||
|
s.resource = 'AMapNavIOSSDK/**/*.bundle'
|
||||||
|
s.resource_bundles = {
|
||||||
|
'AMapNavIOSSDKPrivacyInfo' => ['AMapNavIOSSDK/**/PrivacyInfo.xcprivacy']
|
||||||
|
}
|
||||||
|
|
||||||
|
# s.public_header_files = 'Pod/Classes/**/*.h'
|
||||||
|
# s.frameworks = 'UIKit', 'MapKit'
|
||||||
|
# s.dependency 'AFNetworking', '~> 2.3'
|
||||||
|
|
||||||
|
s.dependency 'Masonry'
|
||||||
|
s.dependency 'MJExtension'
|
||||||
|
|
||||||
|
s.dependency 'AMapNavi-NO-IDFA'
|
||||||
|
s.dependency 'AMapLocation-NO-IDFA'
|
||||||
|
s.dependency 'AMapSearch-NO-IDFA'
|
||||||
|
s.dependency 'MBProgressHUD'
|
||||||
|
|
||||||
|
end
|
||||||
|
After Width: | Height: | Size: 966 B |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 840 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 829 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyTracking</key>
|
||||||
|
<false/>
|
||||||
|
<key>NSPrivacyTrackingDomains</key>
|
||||||
|
<array/>
|
||||||
|
<key>NSPrivacyAccessedAPITypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyAccessedAPIType</key>
|
||||||
|
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||||
|
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||||
|
<array>
|
||||||
|
<string>0A2A.1</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>NSPrivacyAccessedAPIType</key>
|
||||||
|
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
|
||||||
|
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||||
|
<array>
|
||||||
|
<string>85F4.1</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>NSPrivacyCollectedDataTypes</key>
|
||||||
|
<array/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
//
|
||||||
|
// ABaseViewController.h
|
||||||
|
// ANavDemo
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/5.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <Masonry/Masonry.h>
|
||||||
|
#import "AMapNavCommonUtil.h"
|
||||||
|
|
||||||
|
#define kRoutePlanBarHeight (self.navigationController.navigationBar.frame.size.height + UIApplication.sharedApplication.statusBarFrame.size.height + 0)
|
||||||
|
|
||||||
|
#define kRoutePlanStatusBarHeight (UIApplication.sharedApplication.statusBarFrame.size.height + 0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface ABaseViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
//
|
||||||
|
// ABaseViewController.m
|
||||||
|
// ANavDemo
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/5.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ABaseViewController.h"
|
||||||
|
|
||||||
|
@interface ABaseViewController ()
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ABaseViewController
|
||||||
|
|
||||||
|
- (void)viewDidLoad {
|
||||||
|
[super viewDidLoad];
|
||||||
|
// Do any additional setup after loading the view.
|
||||||
|
|
||||||
|
self.view.backgroundColor = [UIColor whiteColor];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
#pragma mark - Navigation
|
||||||
|
|
||||||
|
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||||
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||||
|
// Get the new view controller using [segue destinationViewController].
|
||||||
|
// Pass the selected object to the new view controller.
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// ACustomAnnotationView.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <AMapNaviKit/AMapNaviKit.h>
|
||||||
|
#import "AMapNavCommonUtil.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface ACustomAnnotationView : MAAnnotationView
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
//
|
||||||
|
// ACustomAnnotationView.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/17.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ACustomAnnotationView.h"
|
||||||
|
|
||||||
|
// ─── 布局常量 ─────────────────────────────────────────────────────────────────
|
||||||
|
static const CGFloat kIconSize = 30; // 图标宽高
|
||||||
|
static const CGFloat kIconTextGap = 6.0; // 图标与文字间距
|
||||||
|
static const CGFloat kMaxTextWidth = 100.0; // 文字区域最大宽度
|
||||||
|
static const CGFloat kMaxTextLines = 2; // 最多行数
|
||||||
|
static const CGFloat kVPad = 4.0; // 整体上下内边距(用于 centerOffset 微调)
|
||||||
|
|
||||||
|
@interface ACustomAnnotationView ()
|
||||||
|
|
||||||
|
@property (nonatomic, strong) UIImageView *iconView;
|
||||||
|
@property (nonatomic, strong) UILabel *titleLabel;
|
||||||
|
|
||||||
|
/// 当前是否选中(用于更新图标 & 文字样式)
|
||||||
|
@property (nonatomic, assign) BOOL isAnnotationSelected;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ACustomAnnotationView
|
||||||
|
|
||||||
|
#pragma mark - Init / Reuse
|
||||||
|
|
||||||
|
- (instancetype)initWithAnnotation:(id<MAAnnotation>)annotation
|
||||||
|
reuseIdentifier:(NSString *)reuseIdentifier {
|
||||||
|
self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
|
||||||
|
if (self) {
|
||||||
|
self.backgroundColor = [UIColor clearColor];
|
||||||
|
// 关闭 MAAnnotationView 自带的 image 渲染,避免干扰
|
||||||
|
self.image = nil;
|
||||||
|
[self _buildSubviews];
|
||||||
|
[self _updateFromAnnotation];
|
||||||
|
[self setNeedsLayout];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setAnnotation:(id<MAAnnotation>)annotation {
|
||||||
|
[super setAnnotation:annotation];
|
||||||
|
[self _updateFromAnnotation];
|
||||||
|
[self setNeedsLayout];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Build
|
||||||
|
|
||||||
|
- (void)_buildSubviews {
|
||||||
|
// ── 图标 ──────────────────────────────────────────────────
|
||||||
|
if (!self.iconView) {
|
||||||
|
UIImageView *iv = [[UIImageView alloc] init];
|
||||||
|
iv.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
[self addSubview:iv];
|
||||||
|
self.iconView = iv;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── 文字 ──────────────────────────────────────────────────
|
||||||
|
if (!self.titleLabel) {
|
||||||
|
UILabel *lbl = [[UILabel alloc] init];
|
||||||
|
lbl.numberOfLines = kMaxTextLines;
|
||||||
|
lbl.lineBreakMode = NSLineBreakByTruncatingTail;
|
||||||
|
lbl.textAlignment = NSTextAlignmentLeft;
|
||||||
|
[self addSubview:lbl];
|
||||||
|
self.titleLabel = lbl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化为默认(未选中)样式
|
||||||
|
[self _applyStyle:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 根据选中状态切换图标 & 文字样式
|
||||||
|
- (void)_applyStyle:(BOOL)selected {
|
||||||
|
if (selected) {
|
||||||
|
self.iconView.image = [AMapNavCommonUtil imageWithName3x:@"station_select_icon"];
|
||||||
|
self.titleLabel.font = [UIFont boldSystemFontOfSize:14];
|
||||||
|
self.titleLabel.textColor = [UIColor colorWithWhite:0.12 alpha:1.0];
|
||||||
|
} else {
|
||||||
|
self.iconView.image = [AMapNavCommonUtil imageWithName3x:@"station_normal_icon"];
|
||||||
|
self.titleLabel.font = [UIFont systemFontOfSize:13];
|
||||||
|
self.titleLabel.textColor = [UIColor colorWithWhite:0.25 alpha:1.0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Data
|
||||||
|
|
||||||
|
- (void)_updateFromAnnotation {
|
||||||
|
NSString *text = nil;
|
||||||
|
id<MAAnnotation> ann = self.annotation;
|
||||||
|
if ([ann respondsToSelector:@selector(title)]) {
|
||||||
|
text = ann.title;
|
||||||
|
}
|
||||||
|
if (text.length == 0) {
|
||||||
|
text = @"加氢站";
|
||||||
|
}
|
||||||
|
self.titleLabel.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Selection(MAAnnotationView 官方选中回调)
|
||||||
|
|
||||||
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||||
|
[super setSelected:selected animated:animated];
|
||||||
|
self.isAnnotationSelected = selected;
|
||||||
|
[self _applyStyle:selected];
|
||||||
|
[self setNeedsLayout];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Layout
|
||||||
|
|
||||||
|
- (void)layoutSubviews {
|
||||||
|
[super layoutSubviews];
|
||||||
|
|
||||||
|
// 文字最大 100pt、最多 2 行
|
||||||
|
CGSize textConstraint = CGSizeMake(kMaxTextWidth,
|
||||||
|
CGFLOAT_MAX);
|
||||||
|
CGSize textFit = [self.titleLabel sizeThatFits:textConstraint];
|
||||||
|
// 高度上限:2 行
|
||||||
|
CGFloat lineH = self.titleLabel.font.lineHeight;
|
||||||
|
CGFloat maxTextH = lineH * kMaxTextLines
|
||||||
|
+ self.titleLabel.font.leading * (kMaxTextLines - 1);
|
||||||
|
CGFloat textW = MIN(textFit.width, kMaxTextWidth);
|
||||||
|
CGFloat textH = MIN(textFit.height, maxTextH);
|
||||||
|
|
||||||
|
CGFloat totalW = kIconSize + kIconTextGap + textW;
|
||||||
|
CGFloat totalH = MAX(kIconSize, textH) + kVPad * 2;
|
||||||
|
|
||||||
|
// 更新自身 bounds
|
||||||
|
self.bounds = CGRectMake(0, 0, totalW, totalH);
|
||||||
|
|
||||||
|
// 图标:垂直居中
|
||||||
|
CGFloat iconY = (totalH - kIconSize) * 0.5;
|
||||||
|
self.iconView.frame = CGRectMake(0, iconY, kIconSize, kIconSize);
|
||||||
|
|
||||||
|
// 文字:垂直居中
|
||||||
|
CGFloat textY = (totalH - textH) * 0.5;
|
||||||
|
self.titleLabel.frame = CGRectMake(kIconSize + 1, textY, textW, textH);
|
||||||
|
|
||||||
|
// 锚点:让图标底部对齐地图坐标点
|
||||||
|
// MAAnnotationView 的 centerOffset 以 (0,0)=中心 为原点
|
||||||
|
// 默认选中图标底部对准坐标:向上偏移 totalH/2
|
||||||
|
self.centerOffset = CGPointMake(totalW / 2.0 - kIconSize / 2.0,
|
||||||
|
-(totalH / 2.0));
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Hit Test
|
||||||
|
|
||||||
|
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
|
||||||
|
UIView *hit = [super hitTest:point withEvent:event];
|
||||||
|
if (hit == self || [hit isDescendantOfView:self]) {
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
return hit;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Touch
|
||||||
|
|
||||||
|
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||||
|
[super touchesBegan:touches withEvent:event];
|
||||||
|
|
||||||
|
id<MAAnnotation> annotation = self.annotation;
|
||||||
|
if (!annotation) return;
|
||||||
|
|
||||||
|
UIView *sv = self.superview;
|
||||||
|
while (sv && ![sv isKindOfClass:[MAMapView class]]) {
|
||||||
|
sv = sv.superview;
|
||||||
|
}
|
||||||
|
MAMapView *mapView = (MAMapView *)sv;
|
||||||
|
if (!mapView) return;
|
||||||
|
|
||||||
|
// [mapView deselectAnnotation:annotation animated:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
//
|
||||||
|
// AMapNavSDKHeader.h
|
||||||
|
// Pods
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/10.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef AMapNavSDKHeader_h
|
||||||
|
#define AMapNavSDKHeader_h
|
||||||
|
|
||||||
|
//#define kAMapSDKDebugFlag
|
||||||
|
// iPhone X
|
||||||
|
#define AMP_iPhoneX (UIApplication.sharedApplication.keyWindow.safeAreaInsets.bottom > 0 ? YES : NO)
|
||||||
|
|
||||||
|
// Status bar height.
|
||||||
|
#define AMP_StatusBarHeight (AMP_iPhoneX ? 44.f : 20.f)
|
||||||
|
|
||||||
|
// Navigation bar height.
|
||||||
|
#define AMP_NavigationBarHeight 44.f
|
||||||
|
|
||||||
|
// Tabbar height.
|
||||||
|
#define AMP_TabbarHeight (AMP_iPhoneX ? (49.f+34.f + 5) : 49.f)
|
||||||
|
|
||||||
|
// Tabbar safe bottom margin.
|
||||||
|
#define AMP_TabbarSafeBottomMargin (AMP_iPhoneX ? 34.f : 0.f)
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark - url
|
||||||
|
///获取站点列表
|
||||||
|
#define kGetStationListUrl @"https://beta-esg.api.lnh2e.com/appointment/station/getNearbyHydrogenStationsByLocation"
|
||||||
|
|
||||||
|
///单个站点详情
|
||||||
|
#define kGetStationDetailtUrl @"https://beta-esg.api.lnh2e.com/appointment/station/getStationInfoByArea"
|
||||||
|
|
||||||
|
|
||||||
|
///获取途经点
|
||||||
|
/**
|
||||||
|
请求方式:post 暂时调不通
|
||||||
|
{
|
||||||
|
"longitude":"121.254139",
|
||||||
|
"latitude":"31.214628",
|
||||||
|
"plateNumber":"浙F32111F",
|
||||||
|
"hydrogenSiteId":""//加氢站DI}
|
||||||
|
|
||||||
|
*/
|
||||||
|
#define kGetRoutePointtUrl @"https://beta-esg.api.lnh2e.com/appointment/truck/truckRouteAlgorithm"
|
||||||
|
|
||||||
|
|
||||||
|
#import "ANavPointModel.h"
|
||||||
|
|
||||||
|
#endif /* AMapNavSDKHeader_h */
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//
|
||||||
|
// AMapNavSDKManager.h
|
||||||
|
// Pods
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/10.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
#import "ARoutePlaneController.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface AMapNavSDKManager : NSObject
|
||||||
|
|
||||||
|
@property (strong, nonatomic) UIWindow *window;
|
||||||
|
|
||||||
|
@property (nonatomic , strong) NSString * localCity;
|
||||||
|
@property (nonatomic, copy) NSString * locationAddressDetail;
|
||||||
|
|
||||||
|
@property (nonatomic , strong , readonly) UIViewController * targetVC;
|
||||||
|
|
||||||
|
+ (instancetype)sharedManager;
|
||||||
|
- (void)configWithKey:(NSString*)key;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
//
|
||||||
|
// AMapNavSDKManager.m
|
||||||
|
// Pods
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/10.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AMapNavSDKManager.h"
|
||||||
|
#import "AMapPrivacyUtility.h"
|
||||||
|
|
||||||
|
#import <AMapFoundationKit/AMapFoundationKit.h>
|
||||||
|
|
||||||
|
@interface AMapNavSDKManager ()
|
||||||
|
@property (nonatomic , strong , readwrite) UIViewController * targetVC;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation AMapNavSDKManager
|
||||||
|
|
||||||
|
+ (instancetype)sharedManager {
|
||||||
|
static AMapNavSDKManager *manager = nil;
|
||||||
|
static dispatch_once_t onceToken;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
|
manager = [[AMapNavSDKManager alloc] init];
|
||||||
|
});
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)init {
|
||||||
|
self = [super init];
|
||||||
|
if (self) {
|
||||||
|
_targetVC = [ARoutePlaneController new];
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- (void)configWithKey:(NSString*)key {
|
||||||
|
if (1) {
|
||||||
|
/*
|
||||||
|
* 调用隐私合规处理方法
|
||||||
|
*/
|
||||||
|
// [AMapPrivacyUtility handlePrivacyAgreeStatusIn:_targetVC];
|
||||||
|
//
|
||||||
|
// 初始化高德导航SDK
|
||||||
|
[self configureAPIKey:key];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIViewController *)targetVC {
|
||||||
|
return _targetVC;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - private
|
||||||
|
- (void)configureAPIKey:(NSString*)key {
|
||||||
|
if ([key length] == 0)
|
||||||
|
{
|
||||||
|
NSString *reason = [NSString stringWithFormat:@"apiKey为空,请检查key是否正确设置。"];
|
||||||
|
|
||||||
|
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:reason delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
|
||||||
|
|
||||||
|
[alert show];
|
||||||
|
}
|
||||||
|
[AMapServices sharedServices].enableHTTPS = YES;
|
||||||
|
[AMapServices sharedServices].apiKey = (NSString *)key;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
//
|
||||||
|
// ARoutePlaneController.h
|
||||||
|
// ANavDemo
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/5.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import "ABaseViewController.h"
|
||||||
|
|
||||||
|
#import "SelectableOverlay.h"
|
||||||
|
#import "NaviPointAnnotation.h"
|
||||||
|
|
||||||
|
#import <AMapNaviKit/AMapNaviKit.h>
|
||||||
|
|
||||||
|
#import "ACustomAnnotationView.h"
|
||||||
|
#import "AMapNavSDKHeader.h"
|
||||||
|
#import "ACustomPointAnnotation.h"
|
||||||
|
#import "ATripCalcResponse.h"
|
||||||
|
#import "AMapNavCommonUtil.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface ARoutePlaneController : ABaseViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
//
|
||||||
|
// ASearchAddressController.h
|
||||||
|
// ANavDemo
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/6.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ABaseViewController.h"
|
||||||
|
|
||||||
|
#import <AMapSearchKit/AMapSearchKit.h>
|
||||||
|
#import <AMapLocationKit/AMapLocationKit.h>
|
||||||
|
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface ASearchAddressController : ABaseViewController
|
||||||
|
|
||||||
|
@property (nonatomic , copy) void(^selectAddressBlk)(AMapPOI * poi);
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
//
|
||||||
|
// ASearchAddressController.m
|
||||||
|
// ANavDemo
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/6.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ASearchAddressController.h"
|
||||||
|
#import "AMapNavSDKManager.h"
|
||||||
|
|
||||||
|
#import <AMapFoundationKit/AMapFoundationKit.h>
|
||||||
|
|
||||||
|
#import "AMapNavCommonUtil.h"
|
||||||
|
|
||||||
|
@interface ASearchAddressController ()<UITextFieldDelegate , AMapSearchDelegate,UITableViewDelegate , UITableViewDataSource>
|
||||||
|
|
||||||
|
@property (nonatomic , strong) UITableView *tableView;
|
||||||
|
@property (nonatomic , strong) UIBarButtonItem *rightItem;
|
||||||
|
@property (nonatomic ,strong)UIButton * backBtn;
|
||||||
|
|
||||||
|
@property (nonatomic , strong) NSArray *dataArr;
|
||||||
|
|
||||||
|
@property (nonatomic, strong) UITextField *inputAddressTf;
|
||||||
|
@property (nonatomic, strong) AMapSearchAPI *search;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ASearchAddressController
|
||||||
|
|
||||||
|
- (void)viewDidLoad {
|
||||||
|
[super viewDidLoad];
|
||||||
|
// Do any additional setup after loading the view.
|
||||||
|
self.title = @"选择地点";
|
||||||
|
|
||||||
|
[self initSubview];
|
||||||
|
|
||||||
|
self.search = [[AMapSearchAPI alloc] init];
|
||||||
|
self.search.delegate = self;
|
||||||
|
|
||||||
|
#ifdef kAMapSDKDebugFlag
|
||||||
|
self.inputAddressTf.text = @"人民广场";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewDidAppear:(BOOL)animated {
|
||||||
|
[super viewDidAppear:animated];
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self.inputAddressTf becomeFirstResponder];
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)initSubview {
|
||||||
|
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:self.backBtn];
|
||||||
|
|
||||||
|
UITextField * inputAddressTf = [[UITextField alloc] init];
|
||||||
|
inputAddressTf.borderStyle = UITextBorderStyleRoundedRect;
|
||||||
|
inputAddressTf.placeholder = @"输入地址";
|
||||||
|
inputAddressTf.returnKeyType = UIReturnKeySearch;
|
||||||
|
inputAddressTf.tag = 100;
|
||||||
|
inputAddressTf.delegate = self;
|
||||||
|
|
||||||
|
[self.view addSubview:inputAddressTf];
|
||||||
|
|
||||||
|
[inputAddressTf mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.mas_equalTo(self.view).offset(10);
|
||||||
|
make.top.mas_equalTo(self.view).offset(kRoutePlanBarHeight + 10);
|
||||||
|
make.height.mas_equalTo(@30);
|
||||||
|
}];
|
||||||
|
|
||||||
|
self.inputAddressTf = inputAddressTf;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
[btn setTitle:@"当前位置" forState:UIControlStateNormal];
|
||||||
|
btn.backgroundColor = [UIColor whiteColor];
|
||||||
|
btn.layer.borderColor = [UIColor blueColor].CGColor;
|
||||||
|
btn.layer.borderWidth = 1;
|
||||||
|
btn.layer.cornerRadius = 5;
|
||||||
|
btn.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||||
|
|
||||||
|
[btn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
|
||||||
|
[btn addTarget:self action:@selector(searchBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[self.view addSubview:btn];
|
||||||
|
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.equalTo(inputAddressTf.mas_right).offset(12);
|
||||||
|
make.top.mas_equalTo(inputAddressTf);
|
||||||
|
make.right.mas_equalTo(self.view).offset(-10);
|
||||||
|
make.height.mas_equalTo(@30);
|
||||||
|
make.width.mas_equalTo(70);
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
[self.view addSubview:self.tableView];
|
||||||
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.mas_equalTo(inputAddressTf.mas_bottom).offset(5);
|
||||||
|
make.left.equalTo(self.view);
|
||||||
|
make.bottom.equalTo(self.view);
|
||||||
|
make.centerX.equalTo(self.view);
|
||||||
|
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self.tableView reloadData];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
|
||||||
|
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
|
||||||
|
if (!cell) {
|
||||||
|
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
|
||||||
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
AMapPOI * m = self.dataArr[indexPath.row];
|
||||||
|
cell.textLabel.text = [NSString stringWithFormat:@"%@" , m.name ];
|
||||||
|
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||||
|
return self.dataArr.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
AMapPOI * m = self.dataArr[indexPath.row];
|
||||||
|
|
||||||
|
if (self.selectAddressBlk) {
|
||||||
|
self.selectAddressBlk(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
[self backBtnAction];
|
||||||
|
// [self.navigationController popViewControllerAnimated:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
- (UITableView *)tableView {
|
||||||
|
if (!_tableView) {
|
||||||
|
_tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
|
||||||
|
_tableView.delegate = self;
|
||||||
|
_tableView.dataSource = self;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _tableView;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(UIButton *)backBtn{
|
||||||
|
if (!_backBtn) {
|
||||||
|
_backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
_backBtn.frame = CGRectMake(0, 0, 40, 30);
|
||||||
|
_backBtn.imageEdgeInsets = UIEdgeInsetsMake(2, -5, 2, 5);
|
||||||
|
|
||||||
|
// _backBtn.backgroundColor = UIColor.redColor;
|
||||||
|
[_backBtn setImage:[AMapNavCommonUtil imageWithName:@"icon_fanhui"] forState:UIControlStateNormal];
|
||||||
|
[_backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
|
return _backBtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)backBtnAction {
|
||||||
|
[self dismissViewControllerAnimated:YES completion:^{
|
||||||
|
|
||||||
|
}];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Action
|
||||||
|
-(void)searchBtnAction {
|
||||||
|
AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager];
|
||||||
|
self.inputAddressTf.text = sdk.locationAddressDetail;
|
||||||
|
|
||||||
|
[self startSearchWithAddress:self.inputAddressTf.text];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)startSearchWithAddress:(NSString *)addr {
|
||||||
|
if (!addr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AMapPOIKeywordsSearchRequest *request = [[AMapPOIKeywordsSearchRequest alloc] init];
|
||||||
|
|
||||||
|
request.keywords = addr;
|
||||||
|
|
||||||
|
AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager];
|
||||||
|
request.city = sdk.localCity;
|
||||||
|
|
||||||
|
|
||||||
|
// request.types = @"高等院校";
|
||||||
|
// request.requireExtension = YES;
|
||||||
|
request.offset =20;
|
||||||
|
|
||||||
|
/* 搜索SDK 3.2.0 中新增加的功能,只搜索本城市的POI。*/
|
||||||
|
request.cityLimit = YES;
|
||||||
|
// request.requireSubPOIs = YES;
|
||||||
|
|
||||||
|
|
||||||
|
[self.search AMapPOIKeywordsSearch:request];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
/* POI 搜索回调. */
|
||||||
|
- (void)onPOISearchDone:(AMapPOISearchBaseRequest *)request response:(AMapPOISearchResponse *)response
|
||||||
|
{
|
||||||
|
NSArray * pois = response.pois;
|
||||||
|
if (pois.count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//解析response获取POI信息,具体解析见 Demo
|
||||||
|
|
||||||
|
self.dataArr = [NSArray arrayWithArray:pois];
|
||||||
|
[self.tableView reloadData];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||||
|
[textField resignFirstResponder];
|
||||||
|
|
||||||
|
[self startSearchWithAddress:textField.text];
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||||
|
[self.inputAddressTf resignFirstResponder];
|
||||||
|
}
|
||||||
|
@end
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
//
|
||||||
|
// AStationDetailPopupController.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/22.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import "ANavPointModel.h"
|
||||||
|
#import "AMapNavSDKHeader.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@class AStationDetailPopupController;
|
||||||
|
|
||||||
|
@protocol AStationDetailPopupDelegate <NSObject>
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/// 点击"开始导航"
|
||||||
|
- (void)stationDetailPopupDidTapStartNavi:(AStationDetailPopupController *)popup;
|
||||||
|
/// 点击关闭
|
||||||
|
- (void)stationDetailPopupDidTapClose:(AStationDetailPopupController *)popup;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface AStationDetailPopupController : UIViewController
|
||||||
|
|
||||||
|
@property (nonatomic, strong, nullable) ANavPointModel *pointModel;
|
||||||
|
|
||||||
|
/// 预计加氢费用(元),可由外部传入;若 nil 则隐藏
|
||||||
|
@property (nonatomic, copy, nullable) NSString *estimatedCost;
|
||||||
|
|
||||||
|
/// 预计时间,如 @"15分钟";若 nil 则隐藏
|
||||||
|
@property (nonatomic, copy, nullable) NSString *estimatedTime;
|
||||||
|
|
||||||
|
/// 行驶里程,如 @"23.5公里";若 nil 则隐藏
|
||||||
|
@property (nonatomic, copy, nullable) NSString *driveDistance;
|
||||||
|
|
||||||
|
/// 过路费,如 @"30元";若 nil 则隐藏
|
||||||
|
@property (nonatomic, copy, nullable) NSString *tollFee;
|
||||||
|
|
||||||
|
@property (nonatomic, weak, nullable) id<AStationDetailPopupDelegate> delegate;
|
||||||
|
|
||||||
|
/// 以半透明蒙层方式弹出在目标控制器上
|
||||||
|
- (void)presentInViewController:(UIViewController *)parentVC;
|
||||||
|
|
||||||
|
/// 关闭弹框
|
||||||
|
- (void)dismiss;
|
||||||
|
|
||||||
|
/// 关闭弹框,动画结束后执行 completion(用于关闭后再 present 其他页面)
|
||||||
|
- (void)dismissWithCompletion:(nullable void(^)(void))completion;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,485 @@
|
|||||||
|
//
|
||||||
|
// AStationDetailPopupController.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/22.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AStationDetailPopupController.h"
|
||||||
|
#import "ABaseViewController.h"
|
||||||
|
#import "AMapNavCommonUtil.h"
|
||||||
|
#import <Masonry/Masonry.h>
|
||||||
|
|
||||||
|
// 主题绿色(开始导航按钮背景)
|
||||||
|
static inline UIColor *AStationThemeGreen(void) {
|
||||||
|
return [UIColor colorWithRed:0x1A/255.0 green:0x7C/255.0 blue:0x43/255.0 alpha:1.0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@interface AStationDetailPopupController ()
|
||||||
|
|
||||||
|
/// 背景蒙层
|
||||||
|
@property (nonatomic, strong) UIControl *maskControl;
|
||||||
|
|
||||||
|
/// 弹框卡片容器
|
||||||
|
@property (nonatomic, strong) UIView *cardView;
|
||||||
|
|
||||||
|
/// 站点名称
|
||||||
|
@property (nonatomic, strong) UILabel *stationNameLabel;
|
||||||
|
|
||||||
|
/// 预计加氢费用(名称右侧)
|
||||||
|
@property (nonatomic, strong) UIImageView *costIconView;
|
||||||
|
@property (nonatomic, strong) UILabel *costLabel;
|
||||||
|
|
||||||
|
/// 地址
|
||||||
|
@property (nonatomic, strong) UILabel *addressLabel;
|
||||||
|
|
||||||
|
/// 分割线
|
||||||
|
@property (nonatomic, strong) UIView *separator;
|
||||||
|
|
||||||
|
/// 预计时间行
|
||||||
|
@property (nonatomic, strong) UIImageView *timeIconView;
|
||||||
|
@property (nonatomic, strong) UILabel *timeLabel;
|
||||||
|
|
||||||
|
/// 行驶里程
|
||||||
|
@property (nonatomic, strong) UIImageView *distanceIconView;
|
||||||
|
@property (nonatomic, strong) UILabel *distanceLabel;
|
||||||
|
|
||||||
|
/// 过路费
|
||||||
|
@property (nonatomic, strong) UIImageView *tollIconView;
|
||||||
|
@property (nonatomic, strong) UILabel *tollLabel;
|
||||||
|
|
||||||
|
/// 关闭按钮
|
||||||
|
@property (nonatomic, strong) UIButton *closeButton;
|
||||||
|
|
||||||
|
/// 开始导航按钮
|
||||||
|
@property (nonatomic, strong) UIButton *startNaviButton;
|
||||||
|
|
||||||
|
/// 卡片 bottom constraint(动画用)
|
||||||
|
@property (nonatomic, strong) MASConstraint *cardBottomConstraint;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation AStationDetailPopupController
|
||||||
|
|
||||||
|
#pragma mark - Life Cycle
|
||||||
|
|
||||||
|
- (void)viewDidLoad {
|
||||||
|
[super viewDidLoad];
|
||||||
|
self.view.backgroundColor = [UIColor clearColor];
|
||||||
|
[self _buildUI];
|
||||||
|
[self _setupMasonryConstraints];
|
||||||
|
[self _updateUI];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewDidAppear:(BOOL)animated {
|
||||||
|
[super viewDidAppear:animated];
|
||||||
|
[self _playShowAnimation];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Public
|
||||||
|
|
||||||
|
- (void)presentInViewController:(UIViewController *)parentVC {
|
||||||
|
self.modalPresentationStyle = UIModalPresentationOverCurrentContext;
|
||||||
|
self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
|
||||||
|
[parentVC presentViewController:self animated:NO completion:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dismiss {
|
||||||
|
[self dismissWithCompletion:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dismissWithCompletion:(void(^)(void))completion {
|
||||||
|
[self _playDismissAnimationWithCompletion:^{
|
||||||
|
[self dismissViewControllerAnimated:NO completion:completion];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Setter Override(弹出前赋值 或 弹出后动态更新)
|
||||||
|
|
||||||
|
- (void)setPointModel:(ANavPointModel *)pointModel {
|
||||||
|
_pointModel = pointModel;
|
||||||
|
if (self.isViewLoaded) [self _updateUI];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setEstimatedCost:(NSString *)estimatedCost {
|
||||||
|
_estimatedCost = [estimatedCost copy];
|
||||||
|
if (self.isViewLoaded) [self _updateUI];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setEstimatedTime:(NSString *)estimatedTime {
|
||||||
|
_estimatedTime = [estimatedTime copy];
|
||||||
|
if (self.isViewLoaded) [self _updateUI];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setDriveDistance:(NSString *)driveDistance {
|
||||||
|
_driveDistance = [driveDistance copy];
|
||||||
|
if (self.isViewLoaded) [self _updateUI];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setTollFee:(NSString *)tollFee {
|
||||||
|
_tollFee = [tollFee copy];
|
||||||
|
if (self.isViewLoaded) [self _updateUI];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Build UI
|
||||||
|
|
||||||
|
/**
|
||||||
|
卡片结构:
|
||||||
|
┌──────────────────────────────────── [✕] ┐
|
||||||
|
│ 站点名称(加粗) 预计加氢费用:--元 │ ← 同行,间距20pt
|
||||||
|
│ 地址(灰色小字,多行) │
|
||||||
|
│ ──────────────────────────────────────── │
|
||||||
|
│ [icon] 预计时间:-- 分钟 │
|
||||||
|
│ [icon] 行驶里程:-- 公里 [icon] 过路费:-- 元 │
|
||||||
|
│ ╔════════════════════════════════════╗ │
|
||||||
|
│ ║ 开始导航 ║ │
|
||||||
|
│ ╚════════════════════════════════════╝ │
|
||||||
|
│ (距底部30pt) │
|
||||||
|
└─────────────────────────────────────────┘
|
||||||
|
*/
|
||||||
|
- (void)_buildUI {
|
||||||
|
// ── 蒙层 ──
|
||||||
|
UIControl *mask = [[UIControl alloc] init];
|
||||||
|
mask.backgroundColor = [UIColor colorWithWhite:0 alpha:0.35];
|
||||||
|
[mask addTarget:self action:@selector(_onMaskTapped) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[self.view addSubview:mask];
|
||||||
|
self.maskControl = mask;
|
||||||
|
|
||||||
|
// ── 卡片 ──
|
||||||
|
UIView *card = [[UIView alloc] init];
|
||||||
|
card.backgroundColor = [UIColor whiteColor];
|
||||||
|
card.layer.cornerRadius = 16;
|
||||||
|
card.layer.masksToBounds = NO;
|
||||||
|
card.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||||
|
card.layer.shadowOpacity = 0.15;
|
||||||
|
card.layer.shadowRadius = 12;
|
||||||
|
card.layer.shadowOffset = CGSizeMake(0, -4);
|
||||||
|
[self.view addSubview:card];
|
||||||
|
self.cardView = card;
|
||||||
|
|
||||||
|
// ── 关闭按钮 ──
|
||||||
|
UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
// [closeBtn setTitle:@"✕" forState:UIControlStateNormal];
|
||||||
|
[closeBtn setImage: [AMapNavCommonUtil imageWithName:@"icon_close"] forState:UIControlStateNormal];
|
||||||
|
|
||||||
|
[closeBtn setTitleColor:[UIColor colorWithWhite:0.5 alpha:1] forState:UIControlStateNormal];
|
||||||
|
closeBtn.titleLabel.font = [UIFont systemFontOfSize:16];
|
||||||
|
[closeBtn addTarget:self action:@selector(_onCloseTapped) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[card addSubview:closeBtn];
|
||||||
|
self.closeButton = closeBtn;
|
||||||
|
|
||||||
|
// ── 站点名称 ──
|
||||||
|
UILabel *nameLabel = [[UILabel alloc] init];
|
||||||
|
nameLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||||
|
nameLabel.textColor = [UIColor colorWithWhite:0.1 alpha:1];
|
||||||
|
nameLabel.numberOfLines = 2;
|
||||||
|
// nameLabel.adjustsFontSizeToFitWidth = YES;
|
||||||
|
nameLabel.minimumScaleFactor = 0.8;
|
||||||
|
[card addSubview:nameLabel];
|
||||||
|
self.stationNameLabel = nameLabel;
|
||||||
|
|
||||||
|
// ── 预计加氢费用(名称右侧,间距20pt) ──
|
||||||
|
UILabel *costLabel = [[UILabel alloc] init];
|
||||||
|
costLabel.font = [UIFont systemFontOfSize:14];
|
||||||
|
costLabel.textColor = [UIColor colorWithWhite:0.2 alpha:1];
|
||||||
|
costLabel.numberOfLines = 1;
|
||||||
|
costLabel.textAlignment = NSTextAlignmentLeft;
|
||||||
|
// [costLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||||
|
// [costLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||||
|
[card addSubview:costLabel];
|
||||||
|
self.costLabel = costLabel;
|
||||||
|
|
||||||
|
// ── 地址 ──
|
||||||
|
UILabel *addrLabel = [[UILabel alloc] init];
|
||||||
|
addrLabel.font = [UIFont systemFontOfSize:13];
|
||||||
|
addrLabel.textColor = [UIColor colorWithWhite:0.5 alpha:1];
|
||||||
|
addrLabel.numberOfLines = 2;
|
||||||
|
[card addSubview:addrLabel];
|
||||||
|
self.addressLabel = addrLabel;
|
||||||
|
|
||||||
|
UIImageView *costIcon = [[UIImageView alloc] init];
|
||||||
|
costIcon.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
costIcon.image = [AMapNavCommonUtil imageWithName3x:@"ic_fuel"];
|
||||||
|
[card addSubview:costIcon];
|
||||||
|
self.costIconView = costIcon;
|
||||||
|
|
||||||
|
// ── 分割线 ──
|
||||||
|
UIView *sep = [[UIView alloc] init];
|
||||||
|
sep.backgroundColor = [UIColor colorWithWhite:0.88 alpha:1];
|
||||||
|
[card addSubview:sep];
|
||||||
|
self.separator = sep;
|
||||||
|
|
||||||
|
// ── 预计时间图标 ──
|
||||||
|
UIImageView *timeIcon = [[UIImageView alloc] init];
|
||||||
|
timeIcon.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
timeIcon.image = [AMapNavCommonUtil imageWithName3x:@"pre_time_icon"];
|
||||||
|
[card addSubview:timeIcon];
|
||||||
|
self.timeIconView = timeIcon;
|
||||||
|
|
||||||
|
// ── 预计时间文字 ──
|
||||||
|
UILabel *timeLabel = [[UILabel alloc] init];
|
||||||
|
timeLabel.font = [UIFont systemFontOfSize:14];
|
||||||
|
timeLabel.textColor = [UIColor colorWithWhite:0.2 alpha:1];
|
||||||
|
[card addSubview:timeLabel];
|
||||||
|
self.timeLabel = timeLabel;
|
||||||
|
|
||||||
|
// ── 行驶里程图标 ──
|
||||||
|
UIImageView *distIcon = [[UIImageView alloc] init];
|
||||||
|
distIcon.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
distIcon.image = [AMapNavCommonUtil imageWithName3x:@"pre_distance_icon"];
|
||||||
|
[card addSubview:distIcon];
|
||||||
|
self.distanceIconView = distIcon;
|
||||||
|
|
||||||
|
// ── 行驶里程文字 ──
|
||||||
|
UILabel *distLabel = [[UILabel alloc] init];
|
||||||
|
distLabel.font = [UIFont systemFontOfSize:14];
|
||||||
|
distLabel.textColor = [UIColor colorWithWhite:0.2 alpha:1];
|
||||||
|
[card addSubview:distLabel];
|
||||||
|
self.distanceLabel = distLabel;
|
||||||
|
|
||||||
|
// ── 过路费图标 ──
|
||||||
|
UIImageView *tollIcon = [[UIImageView alloc] init];
|
||||||
|
tollIcon.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
tollIcon.image = [AMapNavCommonUtil imageWithName3x:@"pre_cost_icon"];
|
||||||
|
[card addSubview:tollIcon];
|
||||||
|
self.tollIconView = tollIcon;
|
||||||
|
|
||||||
|
// ── 过路费文字 ──
|
||||||
|
UILabel *tollLabel = [[UILabel alloc] init];
|
||||||
|
tollLabel.font = [UIFont systemFontOfSize:14];
|
||||||
|
tollLabel.textColor = [UIColor colorWithWhite:0.2 alpha:1];
|
||||||
|
[card addSubview:tollLabel];
|
||||||
|
self.tollLabel = tollLabel;
|
||||||
|
|
||||||
|
// ── 开始导航按钮 ──
|
||||||
|
UIButton *naviBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
[naviBtn setTitle:@"开始导航" forState:UIControlStateNormal];
|
||||||
|
[naviBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
|
naviBtn.titleLabel.font = [UIFont boldSystemFontOfSize:17];
|
||||||
|
naviBtn.backgroundColor = AStationThemeGreen();
|
||||||
|
naviBtn.layer.cornerRadius = 24;
|
||||||
|
[naviBtn addTarget:self action:@selector(_onStartNaviTapped) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[card addSubview:naviBtn];
|
||||||
|
self.startNaviButton = naviBtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Masonry Constraints
|
||||||
|
|
||||||
|
- (void)_setupMasonryConstraints {
|
||||||
|
UIView *card = self.cardView;
|
||||||
|
CGFloat iconSize = 16;
|
||||||
|
|
||||||
|
// ── 蒙层:铺满父视图 ──
|
||||||
|
[self.maskControl mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.equalTo(self.view);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 卡片:左右各16,底部距 safeArea 30pt ──
|
||||||
|
// 初始状态卡片在屏幕下方(动画起点),top 留空,先用 bottom 约束做弹入
|
||||||
|
[card mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.equalTo(self.view).offset(16);
|
||||||
|
make.right.equalTo(self.view).offset(-16);
|
||||||
|
// 动画起点:卡片顶部 = 父视图底部(完全隐藏在屏幕外)
|
||||||
|
make.top.equalTo(self.view.mas_bottom).offset(0);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 关闭按钮:右上角 ──
|
||||||
|
[self.closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(card).offset(8);
|
||||||
|
make.right.equalTo(card).offset(-15);
|
||||||
|
make.width.height.mas_equalTo(40);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 第一行:站点名称(左,内容自适应)+ 预计加氢费用(紧跟nameLabel右侧20pt) ──
|
||||||
|
// nameLabel:内容有多宽占多宽,宽度上限55%,防止过长把费用挤掉
|
||||||
|
[self.stationNameLabel setContentHuggingPriority:UILayoutPriorityDefaultLow
|
||||||
|
forAxis:UILayoutConstraintAxisHorizontal];
|
||||||
|
[self.stationNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(card).offset(25);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
// make.width.lessThanOrEqualTo(card).multipliedBy(0.45);
|
||||||
|
make.right.equalTo(self.closeButton.mas_left).offset(-12);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 地址(名称下方,6pt间距) ──
|
||||||
|
[self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(self.stationNameLabel.mas_bottom).offset(10);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
make.right.equalTo(card).offset(-16);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 分割线(地址下方,12pt间距) ──
|
||||||
|
[self.separator mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(self.addressLabel.mas_bottom).offset(15);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
make.right.equalTo(card).offset(-16);
|
||||||
|
make.height.mas_equalTo(0.5);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 预计时间行(分割线下方,14pt) ──
|
||||||
|
[self.timeIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(self.separator.mas_bottom).offset(15);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
make.width.height.mas_equalTo(iconSize);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(self.timeIconView);
|
||||||
|
make.left.equalTo(self.timeIconView.mas_right).offset(6);
|
||||||
|
// make.right.equalTo(card).offset(-16);
|
||||||
|
make.height.mas_equalTo(24);
|
||||||
|
}];
|
||||||
|
|
||||||
|
///cost
|
||||||
|
[self.costIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(self.timeIconView);
|
||||||
|
make.left.equalTo(self.timeLabel.mas_right).offset(30);
|
||||||
|
make.width.height.mas_equalTo(iconSize);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self.costLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(self.costIconView);
|
||||||
|
make.left.equalTo(self.costIconView.mas_right).offset(6);
|
||||||
|
make.right.lessThanOrEqualTo(card).offset(-10);
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
// ── 行驶里程 + 过路费行(时间行下方,12pt) ──
|
||||||
|
[self.distanceIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(self.timeIconView.mas_bottom).offset(15);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
make.width.height.mas_equalTo(iconSize);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self.distanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(self.distanceIconView);
|
||||||
|
make.left.equalTo(self.distanceIconView.mas_right).offset(6);
|
||||||
|
// 宽度约为可用区域的一半(另一半留给过路费)
|
||||||
|
make.width.mas_lessThanOrEqualTo(130);
|
||||||
|
make.height.mas_equalTo(24);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self.tollIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(self.distanceIconView);
|
||||||
|
make.left.equalTo(self.costIconView.mas_left);
|
||||||
|
make.width.height.mas_equalTo(iconSize);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self.tollLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(self.distanceIconView);
|
||||||
|
make.left.equalTo(self.tollIconView.mas_right).offset(6);
|
||||||
|
// make.right.equalTo(card).offset(-16);
|
||||||
|
make.height.mas_equalTo(24);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 开始导航按钮(里程行下方18pt,距卡片底部30pt) ──
|
||||||
|
[self.startNaviButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(self.distanceIconView.mas_bottom).offset(50);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
make.right.equalTo(card).offset(-16);
|
||||||
|
make.height.mas_equalTo(48);
|
||||||
|
make.bottom.equalTo(card).offset(-AMP_TabbarSafeBottomMargin); // 卡片底部内间距30pt
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Data Update
|
||||||
|
|
||||||
|
- (void)_updateUI {
|
||||||
|
self.stationNameLabel.text = (self.pointModel.name.length > 0)
|
||||||
|
? self.pointModel.name : @"--";
|
||||||
|
|
||||||
|
self.costLabel.text = (self.estimatedCost.length > 0)
|
||||||
|
? [NSString stringWithFormat:@"预计加氢费用:%@元", self.estimatedCost]
|
||||||
|
: @"预计加氢费用:--元";
|
||||||
|
|
||||||
|
self.addressLabel.text = (self.pointModel.address.length > 0)
|
||||||
|
? self.pointModel.address : @"--";
|
||||||
|
|
||||||
|
// ── 预计时间(始终显示,无值显示"-- 分钟") ──
|
||||||
|
self.timeLabel.text = (self.estimatedTime.length > 0)
|
||||||
|
? [NSString stringWithFormat:@"预计时间:%@分钟", self.estimatedTime]
|
||||||
|
: @"预计时间:--分钟";
|
||||||
|
|
||||||
|
// ── 行驶里程(始终显示,无值显示"-- 公里") ──
|
||||||
|
self.distanceLabel.text = (self.driveDistance.length > 0)
|
||||||
|
? [NSString stringWithFormat:@"行驶里程:%@公里", self.driveDistance]
|
||||||
|
: @"行驶里程:--公里";
|
||||||
|
|
||||||
|
// ── 过路费(始终显示,无值显示"-- 元") ──
|
||||||
|
self.tollLabel.text = (self.tollFee.length > 0)
|
||||||
|
? [NSString stringWithFormat:@"过路费:%@元", self.tollFee]
|
||||||
|
: @"过路费:--元";
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Animation
|
||||||
|
|
||||||
|
/**
|
||||||
|
弹入动画:更新 top 约束将卡片滑入至距底部 30pt(含 safeArea)
|
||||||
|
*/
|
||||||
|
- (void)_playShowAnimation {
|
||||||
|
// 目标状态:卡片底部紧贴 safeArea 底部,再往上留 30pt
|
||||||
|
[self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.equalTo(self.view).offset(0);
|
||||||
|
make.right.equalTo(self.view).offset(-0);
|
||||||
|
make.bottom.equalTo(self.view).offset(0);
|
||||||
|
}];
|
||||||
|
|
||||||
|
self.maskControl.alpha = 0;
|
||||||
|
[UIView animateWithDuration:0.36
|
||||||
|
delay:0
|
||||||
|
usingSpringWithDamping:0.82
|
||||||
|
initialSpringVelocity:0.5
|
||||||
|
options:UIViewAnimationOptionCurveEaseOut
|
||||||
|
animations:^{
|
||||||
|
self.maskControl.alpha = 1;
|
||||||
|
[self.view layoutIfNeeded];
|
||||||
|
} completion:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_playDismissAnimationWithCompletion:(void(^)(void))completion {
|
||||||
|
[self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.equalTo(self.view).offset(16);
|
||||||
|
make.right.equalTo(self.view).offset(-16);
|
||||||
|
make.top.equalTo(self.view.mas_bottom).offset(20);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[UIView animateWithDuration:0.25
|
||||||
|
delay:0
|
||||||
|
options:UIViewAnimationOptionCurveEaseIn
|
||||||
|
animations:^{
|
||||||
|
self.maskControl.alpha = 0;
|
||||||
|
[self.view layoutIfNeeded];
|
||||||
|
} completion:^(BOOL finished) {
|
||||||
|
if (completion) completion();
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Actions
|
||||||
|
|
||||||
|
- (void)_onMaskTapped {
|
||||||
|
if ([self.delegate respondsToSelector:@selector(stationDetailPopupDidTapClose:)]) {
|
||||||
|
[self.delegate stationDetailPopupDidTapClose:self];
|
||||||
|
}
|
||||||
|
[self dismiss];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_onCloseTapped {
|
||||||
|
if ([self.delegate respondsToSelector:@selector(stationDetailPopupDidTapClose:)]) {
|
||||||
|
[self.delegate stationDetailPopupDidTapClose:self];
|
||||||
|
}
|
||||||
|
[self dismiss];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_onStartNaviTapped {
|
||||||
|
// 先关闭弹框(等动画完全结束),再通知 delegate 弹出导航页
|
||||||
|
// 避免两个 presentViewController 同时进行导致导航页面无法显示
|
||||||
|
__weak typeof(self) weakSelf = self;
|
||||||
|
[self dismissWithCompletion:^{
|
||||||
|
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||||
|
if ([strongSelf.delegate respondsToSelector:@selector(stationDetailPopupDidTapStartNavi:)]) {
|
||||||
|
[strongSelf.delegate stationDetailPopupDidTapStartNavi:strongSelf];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
//
|
||||||
|
// AAlgorithmPathModel.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface AAlgorithmPathModel : NSObject
|
||||||
|
|
||||||
|
/// 单程
|
||||||
|
@property (nonatomic, copy, nullable) NSString *tripRecommendationId;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *staId;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *tripOneWayPathId;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *tripReturnPathId;
|
||||||
|
|
||||||
|
/// 里程(公里)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *oneWayDis;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *returnDis;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *roundTripDis;
|
||||||
|
|
||||||
|
/// 时长(分钟)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *oneWayTime;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *returnTime;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *roundTripTime;
|
||||||
|
|
||||||
|
/// 总成本(元)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *oneWayCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *returnCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *roundTripCost;
|
||||||
|
|
||||||
|
/// 人工成本(元)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *oneWayLaborCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *returnLaborCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *roundTripLaborCost;
|
||||||
|
|
||||||
|
/// 高速成本(元)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *oneWayChargerouteCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *returnChargerouteCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *roundTripChargerouteCost;
|
||||||
|
|
||||||
|
/// 氢耗(公斤)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *oneWayHydrogenConsumption;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *returnLaborHydrogenConsumption;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *roundTripHydrogenConsumption;
|
||||||
|
|
||||||
|
/// 氢气成本(元)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *oneWayHydrogenCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *returnLaborHydrogenCost;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *roundTripHydrogenCost;
|
||||||
|
|
||||||
|
/// 加氢站相关
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenCost; // 氢气总成本(元)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenStaServiceTime; // 站服务总时长(分钟)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenStaRefuelingTime;// 实际加油时长(分钟)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenStaQueueTime; // 排队时长(分钟)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenStaServiceTimeCost; // 站服务时间成本(元)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenStaRefuelingTimeCost;// 加油时间成本(元)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenStaQueueTimeCost; // 排队时间成本(元)
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// AAlgorithmPathModel.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AAlgorithmPathModel.h"
|
||||||
|
|
||||||
|
@implementation AAlgorithmPathModel
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// ACustomPointAnnotation.h
|
||||||
|
// Pods
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <AMapNaviKit/AMapNaviKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface ACustomPointAnnotation : MAPointAnnotation
|
||||||
|
@property (nonatomic, copy, nullable) NSString *stationID;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// ACustomPointAnnotation.m
|
||||||
|
// Pods
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ACustomPointAnnotation.h"
|
||||||
|
|
||||||
|
@implementation ACustomPointAnnotation
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
//
|
||||||
|
// AMapHyStationModel.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
{
|
||||||
|
"name": "嘉兴经开站",
|
||||||
|
"shortName": null,
|
||||||
|
"siteNo": null,
|
||||||
|
"city": null,
|
||||||
|
"address": "嘉兴市秀洲区岗山路272号",
|
||||||
|
"contact": "龚明伟",
|
||||||
|
"phone": "18888888888",
|
||||||
|
"type": null,
|
||||||
|
"coOpMode": null,
|
||||||
|
"booking": null,
|
||||||
|
"siteStatus": 0,
|
||||||
|
"startBusiness": "06:00:00",
|
||||||
|
"endBusiness": "22:00:00",
|
||||||
|
"billingMethod": null,
|
||||||
|
"term": null,
|
||||||
|
"remark": null,
|
||||||
|
"longitude": "120.75972800",
|
||||||
|
"latitude": "30.79962800"
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@interface AMapHyStationModel : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, copy, nullable) NSString *ID;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *hydrogenId;
|
||||||
|
@property (nonatomic, copy) NSString *name;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *shortName;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *siteNo;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *city;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *address;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *contact;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *phone;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *type;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *coOpMode;
|
||||||
|
@property (nonatomic, strong, nullable) NSString * booking;
|
||||||
|
@property (nonatomic, assign) NSInteger siteStatus;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *startBusiness;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *endBusiness;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *billingMethod;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *term;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *remark;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *longitude;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *latitude;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
/**
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"status": true,
|
||||||
|
"message": "success",
|
||||||
|
"data": [],
|
||||||
|
"time": "1770800256408",
|
||||||
|
"error": null
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@interface AMapHyResponse : NSObject
|
||||||
|
@property (nonatomic, assign) NSInteger code;
|
||||||
|
@property (nonatomic, assign) NSInteger status;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *message;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *time;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *error;
|
||||||
|
|
||||||
|
@property(nonatomic , strong)NSArray <AMapHyStationModel * > * data;
|
||||||
|
|
||||||
|
@end
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// AMapHyStationModel.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AMapHyStationModel.h"
|
||||||
|
|
||||||
|
@implementation AMapHyStationModel
|
||||||
|
+ (NSDictionary *)mj_replacedKeyFromPropertyName
|
||||||
|
{
|
||||||
|
return @{ @"ID" : @"id"};
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation AMapHyResponse
|
||||||
|
|
||||||
|
+ (NSDictionary *)mj_objectClassInArray {
|
||||||
|
return @{@"data" : AMapHyStationModel.class};
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// ANavPointModel.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <CoreLocation/CoreLocation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface ANavPointModel : NSObject
|
||||||
|
@property (nonatomic, copy, nullable) NSString *name;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *address;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *stationID;
|
||||||
|
|
||||||
|
///经纬度
|
||||||
|
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
|
||||||
|
|
||||||
|
///初始化
|
||||||
|
+ (instancetype)instanceWithCoordinate:(CLLocationCoordinate2D)coordinate name:(NSString *)name address:(NSString *)address;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
//
|
||||||
|
// ANavPointModel.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ANavPointModel.h"
|
||||||
|
|
||||||
|
@implementation ANavPointModel
|
||||||
|
///初始化
|
||||||
|
+ (instancetype)instanceWithCoordinate:(CLLocationCoordinate2D)coordinate name:(NSString *)name address:(NSString *)address {
|
||||||
|
ANavPointModel *instance = [[ANavPointModel alloc] init];
|
||||||
|
if (instance) {
|
||||||
|
instance.coordinate = coordinate;
|
||||||
|
instance.name = name;
|
||||||
|
instance.address = address;
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
//
|
||||||
|
// ANaviPathInfoModel.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
{
|
||||||
|
"name": "浙江省嘉兴市平湖市乍浦镇滨海大道中国石化滨海大道加油加气站",
|
||||||
|
"poiId": "",
|
||||||
|
"coordinate": {
|
||||||
|
"longitude": "121.070434",
|
||||||
|
"latitude": "30.596124"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@interface ANaviPathInfoModel : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, copy, nullable) NSString *name;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *poiId;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *longitude;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *latitude;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// ANaviPathInfoModel.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ANaviPathInfoModel.h"
|
||||||
|
|
||||||
|
@implementation ANaviPathInfoModel
|
||||||
|
|
||||||
|
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
|
||||||
|
// JSON 中 coordinate 是嵌套对象,展开为 longitude/latitude
|
||||||
|
return @{
|
||||||
|
@"longitude": @"coordinate.longitude",
|
||||||
|
@"latitude": @"coordinate.latitude"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
//
|
||||||
|
// APathModel.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
#import "ANaviPathInfoModel.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@class ANaviPathInfoModel;
|
||||||
|
|
||||||
|
@interface APathModel : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, assign) CGFloat distance; // 总距离(米)
|
||||||
|
@property (nonatomic, assign) CGFloat duration; // 总时长(秒)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *strategy; // 路线策略,如"避免拥堵"
|
||||||
|
@property (nonatomic, copy, nullable) NSString *tolls; // 高速费(元)
|
||||||
|
@property (nonatomic, assign) CGFloat toll_distance; // 高速里程(米)
|
||||||
|
@property (nonatomic, assign) NSInteger restriction; // 限行标志,-1 无
|
||||||
|
@property (nonatomic, assign) NSInteger traffic_lights; // 红绿灯数量
|
||||||
|
@property (nonatomic, strong) NSArray<ANaviPathInfoModel *> *naviList; // 途经点列表
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//
|
||||||
|
// APathModel.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "APathModel.h"
|
||||||
|
#import "ANaviPathInfoModel.h"
|
||||||
|
|
||||||
|
@implementation APathModel
|
||||||
|
|
||||||
|
+ (NSDictionary *)mj_objectClassInArray {
|
||||||
|
return @{@"naviList": [ANaviPathInfoModel class]};
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
//
|
||||||
|
// ASiteModel.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
{
|
||||||
|
"innerSiteId": "202304241822210001",
|
||||||
|
"name": "滨海大道加油加气站",
|
||||||
|
"shortName": "滨海",
|
||||||
|
"siteNo": "000001",
|
||||||
|
"city": "浙江省-嘉兴市",
|
||||||
|
"address": "嘉兴市平湖市滨海大道1515号",
|
||||||
|
"contact": "陆平",
|
||||||
|
"phone": "18666666666",
|
||||||
|
"type": "",
|
||||||
|
"coOpMode": "签约",
|
||||||
|
"booking": "无需预约",
|
||||||
|
"siteStatus": "0",
|
||||||
|
"siteStatusName": "营运中",
|
||||||
|
"startBusiness": "08:00:00",
|
||||||
|
"endBusiness": "20:00:00",
|
||||||
|
"billingMethod": "月付款",
|
||||||
|
"term": "1703952000000",
|
||||||
|
"remark": "",
|
||||||
|
"longitude": "121.07112700",
|
||||||
|
"latitude": "30.59577700",
|
||||||
|
"distance": ""
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@interface ASiteModel : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, copy, nullable) NSString *innerSiteId;
|
||||||
|
@property (nonatomic, copy) NSString *name;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *shortName;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *siteNo;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *city;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *address;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *contact;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *phone;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *type;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *coOpMode;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *booking;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *siteStatus;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *siteStatusName;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *startBusiness;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *endBusiness;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *billingMethod;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *term;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *remark;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *longitude;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *latitude;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *distance;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// ASiteModel.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ASiteModel.h"
|
||||||
|
|
||||||
|
@implementation ASiteModel
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
//
|
||||||
|
// ATripCalcResponse.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
|
||||||
|
#import "AAlgorithmPathModel.h"
|
||||||
|
#import "APathModel.h"
|
||||||
|
#import "ASiteModel.h"
|
||||||
|
#import "ANaviPathInfoModel.h"
|
||||||
|
#import "ATruckModel.h"
|
||||||
|
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@class ATruckModel;
|
||||||
|
@class ASiteModel;
|
||||||
|
@class APathModel;
|
||||||
|
@class AAlgorithmPathModel;
|
||||||
|
|
||||||
|
#pragma mark - data 节点
|
||||||
|
|
||||||
|
/**
|
||||||
|
{
|
||||||
|
"truckDto": { ... },
|
||||||
|
"truckDtoStr": null,
|
||||||
|
"destinationSite": { ... },
|
||||||
|
"pathDto": { ... },
|
||||||
|
"algorithmPath": { ... },
|
||||||
|
"isInvokeAlgorithm": true
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@interface ATripCalcDataModel : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, strong, nullable) ATruckModel *truckDto;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *truckDtoStr;
|
||||||
|
@property (nonatomic, strong, nullable) ASiteModel *destinationSite;
|
||||||
|
@property (nonatomic, strong, nullable) APathModel *pathDto;
|
||||||
|
@property (nonatomic, strong, nullable) AAlgorithmPathModel *algorithmPath;
|
||||||
|
@property (nonatomic, assign) BOOL isInvokeAlgorithm;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#pragma mark - 根响应
|
||||||
|
|
||||||
|
/**
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"msg": "操作成功!",
|
||||||
|
"data": { ... }
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@interface ATripCalcResponse : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, assign) NSInteger code;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *msg;
|
||||||
|
@property (nonatomic, strong, nullable) ATripCalcDataModel *data;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
//
|
||||||
|
// ATripCalcResponse.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ATripCalcResponse.h"
|
||||||
|
#import "ATruckModel.h"
|
||||||
|
#import "ASiteModel.h"
|
||||||
|
#import "APathModel.h"
|
||||||
|
#import "AAlgorithmPathModel.h"
|
||||||
|
|
||||||
|
@implementation ATripCalcDataModel
|
||||||
|
|
||||||
|
+ (NSDictionary *)mj_objectClassInArray {
|
||||||
|
return @{
|
||||||
|
@"truckDto": [ATruckModel class],
|
||||||
|
@"destinationSite": [ASiteModel class],
|
||||||
|
@"pathDto": [APathModel class],
|
||||||
|
@"algorithmPath": [AAlgorithmPathModel class]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ATripCalcResponse
|
||||||
|
|
||||||
|
+ (NSDictionary *)mj_objectClassInArray {
|
||||||
|
return @{@"data":[ATripCalcDataModel class]};
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
//
|
||||||
|
// ATruckModel.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <MJExtension/MJExtension.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/**
|
||||||
|
{
|
||||||
|
"isRestriction": true,
|
||||||
|
"mvehicleSizeName": "重型货车",
|
||||||
|
"mvehicleAxisUnit": "轴",
|
||||||
|
"mcarNumber": "浙F32111F",
|
||||||
|
"mcarType": 0,
|
||||||
|
"mvehicleHeight": "3.8",
|
||||||
|
"mvehicleHeightUnit": "M",
|
||||||
|
"mvehicleWeight": null,
|
||||||
|
"mvehicleWeightUnit": "T",
|
||||||
|
"mvehicleLoad": "49.0",
|
||||||
|
"mvehicleLoadUnit": "T",
|
||||||
|
"mvehicleLoadSwitch": false,
|
||||||
|
"mvehicleWidth": "0.0",
|
||||||
|
"mvehicleWidthUnit": "M",
|
||||||
|
"mvehicleLength": "7.6",
|
||||||
|
"mvehicleLengthUnit": "M",
|
||||||
|
"mvehicleSize": 4,
|
||||||
|
"mvehicleAxis": 5
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@interface ATruckModel : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, assign) BOOL isRestriction;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleSizeName;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleAxisUnit;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mcarNumber;
|
||||||
|
@property (nonatomic, assign) NSInteger mcarType;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleHeight;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleHeightUnit;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleWeight;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleWeightUnit;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleLoad;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleLoadUnit;
|
||||||
|
@property (nonatomic, assign) BOOL mvehicleLoadSwitch;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleWidth;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleWidthUnit;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleLength;
|
||||||
|
@property (nonatomic, copy, nullable) NSString *mvehicleLengthUnit;
|
||||||
|
@property (nonatomic, assign) NSInteger mvehicleSize;
|
||||||
|
@property (nonatomic, assign) NSInteger mvehicleAxis;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// ATruckModel.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ATruckModel.h"
|
||||||
|
|
||||||
|
@implementation ATruckModel
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
//
|
||||||
|
// AMapNavCommonUtil.h
|
||||||
|
// Pods
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface AMapNavCommonUtil : NSObject
|
||||||
|
|
||||||
|
/// 显示加载转圈(nil 消息时不显示文字)
|
||||||
|
+ (void)showLoadingWithMsg:(nullable NSString *)msg;
|
||||||
|
|
||||||
|
/// 关闭所有 MBProgressHUD
|
||||||
|
+ (void)dismiss;
|
||||||
|
|
||||||
|
/// 显示提示,自动 2.0s 后消失
|
||||||
|
+ (void)showMsg:(NSString *)msg;
|
||||||
|
|
||||||
|
|
||||||
|
/// 获取图片(2x)
|
||||||
|
+ (UIImage *)imageWithName:(NSString *)name;
|
||||||
|
|
||||||
|
/// 获取图片(3x)
|
||||||
|
+ (UIImage *)imageWithName3x:(NSString *)name;
|
||||||
|
|
||||||
|
/// 判断字符串是否为空
|
||||||
|
BOOL stringIsEmpty(NSString *str);
|
||||||
|
|
||||||
|
/// 判断字符串是否非空
|
||||||
|
BOOL stringIsNotEmpty(NSString *str);
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
//
|
||||||
|
// AMapNavCommonUtil.m
|
||||||
|
// Pods
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AMapNavCommonUtil.h"
|
||||||
|
#import <MBProgressHUD/MBProgressHUD.h>
|
||||||
|
|
||||||
|
/// 共享 HUD 实例
|
||||||
|
static MBProgressHUD *_sharedHUD = nil;
|
||||||
|
|
||||||
|
@implementation AMapNavCommonUtil
|
||||||
|
|
||||||
|
#pragma mark - MBProgressHUD
|
||||||
|
|
||||||
|
+ (UIWindow *)_keyWindow {
|
||||||
|
if (@available(iOS 13.0, *)) {
|
||||||
|
for (UIWindowScene *scene in [UIApplication sharedApplication].connectedScenes) {
|
||||||
|
if (scene.activationState == UISceneActivationStateForegroundActive) {
|
||||||
|
for (UIWindow *window in scene.windows) {
|
||||||
|
if (window.isKeyWindow) return window;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [UIApplication sharedApplication].keyWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)showLoadingWithMsg:(NSString *)msg {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
// [self dismiss];
|
||||||
|
|
||||||
|
UIWindow *window = [self _keyWindow];
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:window animated:YES];
|
||||||
|
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
|
||||||
|
hud.bezelView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.75];
|
||||||
|
hud.contentColor = [UIColor whiteColor];
|
||||||
|
|
||||||
|
if (msg.length > 0) {
|
||||||
|
hud.label.text = msg;
|
||||||
|
hud.label.font = [UIFont systemFontOfSize:14];
|
||||||
|
}
|
||||||
|
|
||||||
|
hud.removeFromSuperViewOnHide = YES;
|
||||||
|
_sharedHUD = hud;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)dismiss {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
if (_sharedHUD) {
|
||||||
|
[_sharedHUD hideAnimated:YES];
|
||||||
|
_sharedHUD = nil;
|
||||||
|
} else {
|
||||||
|
//兜底:隐藏所有 HUD(防止有遗漏)
|
||||||
|
UIWindow *window = [self _keyWindow];
|
||||||
|
if (window) {
|
||||||
|
[MBProgressHUD hideHUDForView:window animated:YES];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)showMsg:(NSString *)msg {
|
||||||
|
if (msg.length == 0) return;
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
UIWindow *window = [self _keyWindow];
|
||||||
|
if (!window) return;
|
||||||
|
|
||||||
|
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:window animated:YES];
|
||||||
|
hud.mode = MBProgressHUDModeText;
|
||||||
|
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
|
||||||
|
hud.bezelView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.75];
|
||||||
|
hud.contentColor = [UIColor whiteColor];
|
||||||
|
hud.label.text = msg;
|
||||||
|
hud.label.font = [UIFont systemFontOfSize:14];
|
||||||
|
hud.removeFromSuperViewOnHide = YES;
|
||||||
|
|
||||||
|
// 2.0s 后自动消失
|
||||||
|
[hud hideAnimated:YES afterDelay:2.0];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - 字符串判断
|
||||||
|
|
||||||
|
|
||||||
|
BOOL stringIsEmpty (NSString *str)
|
||||||
|
{
|
||||||
|
if (str == nil || str == NULL)
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
if ([str isKindOfClass:[NSNull class]])
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
if ([str isKindOfClass:[NSString class]])
|
||||||
|
{
|
||||||
|
NSString * newStr = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||||
|
NSSet *emptySet = [NSSet setWithObjects:@"", @"null", @"(null)", @"<null>", @"NULL", @"无",@"kZero", nil];
|
||||||
|
if ([emptySet containsObject:str] || [emptySet containsObject:newStr]) {
|
||||||
|
return YES;
|
||||||
|
} else {
|
||||||
|
return [newStr length] == 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL stringIsNotEmpty (NSString *str)
|
||||||
|
{
|
||||||
|
return ! stringIsEmpty(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark - 获取图片
|
||||||
|
+(UIImage *)imageWithName:(NSString *)name {
|
||||||
|
NSURL * url = [[NSBundle mainBundle] URLForResource:@"AMapNavIOSSDK" withExtension:@"bundle"];
|
||||||
|
NSBundle *containnerBundle = [NSBundle bundleWithURL:url];
|
||||||
|
|
||||||
|
NSString * path = [containnerBundle pathForResource:[NSString stringWithFormat:@"%@@2x.png" , name] ofType:nil];
|
||||||
|
|
||||||
|
UIImage * arrowImage = [[UIImage imageWithContentsOfFile:path] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||||
|
|
||||||
|
return arrowImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
+(UIImage *)imageWithName3x:(NSString *)name {
|
||||||
|
NSURL * url = [[NSBundle mainBundle] URLForResource:@"AMapNavIOSSDK" withExtension:@"bundle"];
|
||||||
|
NSBundle *containnerBundle = [NSBundle bundleWithURL:url];
|
||||||
|
|
||||||
|
NSString * path = [containnerBundle pathForResource:[NSString stringWithFormat:@"%@@3x.png" , name] ofType:nil];
|
||||||
|
|
||||||
|
UIImage * arrowImage = [[UIImage imageWithContentsOfFile:path] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
||||||
|
|
||||||
|
return arrowImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// AMapNavHttpUtil.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface AMapNavHttpUtil : NSObject
|
||||||
|
|
||||||
|
+ (void)postRequestWithURL:(NSString *)urlString parameters:(id)parameters requestHeader:(NSDictionary *)headParam successHandler:(void (^)(NSDictionary *data, NSURLResponse *response))successHandler failureHandler:(void ( ^)(NSError *error))failureHandler;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
//
|
||||||
|
// AMapNavHttpUtil.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/2/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AMapNavHttpUtil.h"
|
||||||
|
|
||||||
|
#define AMapRequestMethod_POST @"POST"
|
||||||
|
|
||||||
|
@interface AMapNavHttpUtil ()
|
||||||
|
@property (nonatomic , copy) NSString * baseURL;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation AMapNavHttpUtil
|
||||||
|
|
||||||
|
+ (instancetype)sharedInstance {
|
||||||
|
static AMapNavHttpUtil *sharedInstance = nil;
|
||||||
|
static dispatch_once_t onceToken;
|
||||||
|
|
||||||
|
// dispatch_once确保下面的代码块只被执行一次
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
|
sharedInstance = [[self alloc] init];
|
||||||
|
// 可以在这里进行一些初始化操作
|
||||||
|
|
||||||
|
});
|
||||||
|
return sharedInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)init {
|
||||||
|
self = [super init];
|
||||||
|
if (self) {
|
||||||
|
|
||||||
|
// if (sdk.config.developmentModel) {
|
||||||
|
// _baseURL = kYTOTPAnalyticsSDKTestHost;
|
||||||
|
// }else {
|
||||||
|
// _baseURL = kYTOTPAnalyticsSDKProductionHost;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+ (void)postRequestWithURL:(NSString *)urlString parameters:(id)parameters requestHeader:(NSDictionary *)headParam successHandler:(void (^)(NSDictionary *data, NSURLResponse *response))successHandler failureHandler:(void ( ^)(NSError *error))failureHandler {
|
||||||
|
[self requestWithMethod:AMapRequestMethod_POST URL:urlString parameters:parameters requestHeader:headParam successHandler:successHandler failureHandler:failureHandler];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 使用NSURLSession发起网络请求
|
||||||
|
+ (void)requestWithMethod:(NSString *)method URL:(NSString *)urlString parameters:(id)parameters requestHeader:(NSDictionary *)headParam successHandler:(void (^)(NSDictionary *data, NSURLResponse *response))successHandler failureHandler:(void (^)(NSError *error))failureHandler {
|
||||||
|
if (!urlString) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建URL
|
||||||
|
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@" , urlString]];
|
||||||
|
|
||||||
|
// 创建请求
|
||||||
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
|
||||||
|
request.HTTPMethod = method;
|
||||||
|
request.timeoutInterval = 30.0;
|
||||||
|
|
||||||
|
// 设置请求头,指定数据通讯格式为json
|
||||||
|
if (headParam) {
|
||||||
|
for (NSString *key in headParam.allKeys) {
|
||||||
|
if (headParam[key]) {
|
||||||
|
[request setValue:[NSString stringWithFormat:@"%@",headParam[key]] forHTTPHeaderField:key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将参数转换为JSON数据
|
||||||
|
NSError *error;
|
||||||
|
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error];
|
||||||
|
if (!jsonData) {}
|
||||||
|
|
||||||
|
if ([method isEqualToString: AMapRequestMethod_POST]) {
|
||||||
|
// 设置请求体
|
||||||
|
request.HTTPBody = jsonData;
|
||||||
|
}
|
||||||
|
|
||||||
|
__block NSURLSession *session = [NSURLSession sharedSession];
|
||||||
|
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||||
|
if (error) {
|
||||||
|
NSLog(@"request error:%@" , error);
|
||||||
|
if (failureHandler) {
|
||||||
|
failureHandler(error);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (successHandler) {
|
||||||
|
NSDictionary * dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
|
||||||
|
if(dic){
|
||||||
|
NSLog(@"url: %@ , response data:%@", url , dic);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
successHandler(dic, response);
|
||||||
|
});
|
||||||
|
// successHandler(dic, response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[session finishTasksAndInvalidate];
|
||||||
|
session = nil;
|
||||||
|
}];
|
||||||
|
|
||||||
|
// 开始任务
|
||||||
|
[task resume];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
//
|
||||||
|
// AMapPrivacyUtility.h
|
||||||
|
// officialDemoNavi
|
||||||
|
//
|
||||||
|
// Created by menglong on 2021/10/29.
|
||||||
|
// Copyright © 2021 AutoNavi. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 隐私合规使用demo 工具类
|
||||||
|
*/
|
||||||
|
@interface AMapPrivacyUtility : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 通过这个方法来判断是否同意隐私合规
|
||||||
|
* 1.如果没有同意隐私合规,则创建的SDK manager 实例返回 为nil, 无法使用SDK提供的功能
|
||||||
|
* 2.如果同意了下次启动不提示 的授权,则不会弹框给用户
|
||||||
|
* 3.如果只同意了,则下次启动还要给用户弹框提示
|
||||||
|
*/
|
||||||
|
|
||||||
|
+ (void)handlePrivacyAgreeStatus;
|
||||||
|
|
||||||
|
+ (void)handlePrivacyAgreeStatusIn:(UIViewController*)targetVC;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
//
|
||||||
|
// AMapPrivacyUtility.m
|
||||||
|
// officialDemoNavi
|
||||||
|
//
|
||||||
|
// Created by menglong on 2021/10/29.
|
||||||
|
// Copyright © 2021 AutoNavi. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AMapPrivacyUtility.h"
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <AMapNavikit/AMapNaviManagerConfig.h>
|
||||||
|
@implementation AMapPrivacyUtility
|
||||||
|
|
||||||
|
+ (void)showPrivacyInfoInWindow:(UIWindow *)window {
|
||||||
|
|
||||||
|
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
||||||
|
|
||||||
|
paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||||
|
|
||||||
|
NSMutableAttributedString *privacyInfo = [[NSMutableAttributedString alloc] initWithString:@"\n亲,感谢您对XXX一直以来的信任!我们依据最新的监管要求更新了XXX《隐私权政策》,特向您说明如下\n1.为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n2.基于您的明示授权,我们可能会获取您的位置(为您提供附近的商品、店铺及优惠资讯等)等信息,您有权拒绝或取消授权;\n3.我们会采取业界先进的安全措施保护您的信息安全;\n4.未经您同意,我们不会从第三方处获取、共享或向提供您的信息;" attributes:@{
|
||||||
|
NSParagraphStyleAttributeName:paragraphStyle,
|
||||||
|
}];
|
||||||
|
|
||||||
|
[privacyInfo addAttribute:NSLinkAttributeName
|
||||||
|
value:@"《隐私权政策》"
|
||||||
|
range:[[privacyInfo string] rangeOfString:@"《隐私权政策》"]];
|
||||||
|
|
||||||
|
UIAlertController *privacyInfoController = [UIAlertController alertControllerWithTitle:@"温馨提示(隐私合规示例)" message:@"" preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
|
[privacyInfoController setValue:privacyInfo forKey:@"attributedMessage"];
|
||||||
|
|
||||||
|
|
||||||
|
UIAlertAction *agreeAllAction = [UIAlertAction actionWithTitle:@"同意(下次不提示)" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"agreeStatus"];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
|
//更新用户授权高德SDK隐私协议状态. since 8.1.0
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree];
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
UIAlertAction *agreeAction = [UIAlertAction actionWithTitle:@"同意" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||||
|
//更新用户授权高德SDK隐私协议状态. since 8.1.0
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree];
|
||||||
|
}];
|
||||||
|
|
||||||
|
UIAlertAction *notAgreeAction = [UIAlertAction actionWithTitle:@"不同意" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"agreeStatus"];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
|
//更新用户授权高德SDK隐私协议状态. since 8.1.0
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusNotAgree];
|
||||||
|
}];
|
||||||
|
|
||||||
|
[privacyInfoController addAction:agreeAllAction];
|
||||||
|
[privacyInfoController addAction:agreeAction];
|
||||||
|
[privacyInfoController addAction:notAgreeAction];
|
||||||
|
|
||||||
|
[window.rootViewController presentViewController:privacyInfoController animated:YES completion:^{
|
||||||
|
//更新App是否显示隐私弹窗的状态,隐私弹窗是否包含高德SDK隐私协议内容的状态. since 8.1.0
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyShow:AMapPrivacyShowStatusDidShow privacyInfo:AMapPrivacyInfoStatusDidContain];
|
||||||
|
}];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)handlePrivacyAgreeStatus {
|
||||||
|
//判断是否同意了隐私协议下次不提示
|
||||||
|
// if(![[NSUserDefaults standardUserDefaults] boolForKey:@"agreeStatus"]){
|
||||||
|
//添加隐私合规弹窗
|
||||||
|
[self showPrivacyInfoInWindow:[UIApplication sharedApplication].delegate.window];
|
||||||
|
|
||||||
|
// [[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree];
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)handlePrivacyAgreeStatusIn:(UIViewController*)targetVC {
|
||||||
|
if(![[NSUserDefaults standardUserDefaults] boolForKey:@"agreeStatus"]){
|
||||||
|
[self showPrivacyInfoInWindowWithVC:targetVC];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)showPrivacyInfoInWindowWithVC:(UIViewController *)window {
|
||||||
|
|
||||||
|
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
||||||
|
|
||||||
|
paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||||
|
|
||||||
|
NSMutableAttributedString *privacyInfo = [[NSMutableAttributedString alloc] initWithString:@"\n感谢您一直以来的信任!我们依据最新的监管要求更新了《隐私权政策》,特向您说明如下\n1.为向您提供交易相关基本功能,我们会收集、使用必要的信息;\n2.基于您的明示授权,我们可能会获取您的位置(为您提供附近的店铺及优惠资讯等)等信息,您有权拒绝或取消授权;\n3.我们会采取业界先进的安全措施保护您的信息安全;\n4.未经您同意,我们不会从第三方处获取、共享或向提供您的信息;" attributes:@{
|
||||||
|
NSParagraphStyleAttributeName:paragraphStyle,
|
||||||
|
}];
|
||||||
|
|
||||||
|
[privacyInfo addAttribute:NSLinkAttributeName
|
||||||
|
value:@"《隐私权政策》"
|
||||||
|
range:[[privacyInfo string] rangeOfString:@"《隐私权政策》"]];
|
||||||
|
|
||||||
|
UIAlertController *privacyInfoController = [UIAlertController alertControllerWithTitle:@"温馨提示(隐私合规示例)" message:@"" preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
|
[privacyInfoController setValue:privacyInfo forKey:@"attributedMessage"];
|
||||||
|
|
||||||
|
|
||||||
|
UIAlertAction *agreeAllAction = [UIAlertAction actionWithTitle:@"同意(下次不提示)" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"agreeStatus"];
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"usragreeStatus"];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
|
//更新用户授权高德SDK隐私协议状态. since 8.1.0
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree];
|
||||||
|
|
||||||
|
[NSNotificationCenter.defaultCenter postNotificationName:@"ksAMapPrivacyDidUpdateNotification" object:nil];
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
UIAlertAction *agreeAction = [UIAlertAction actionWithTitle:@"同意" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||||
|
//更新用户授权高德SDK隐私协议状态. since 8.1.0
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"usragreeStatus"];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
|
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusDidAgree];
|
||||||
|
[NSNotificationCenter.defaultCenter postNotificationName:@"ksAMapPrivacyDidUpdateNotification" object:nil];
|
||||||
|
}];
|
||||||
|
|
||||||
|
UIAlertAction *notAgreeAction = [UIAlertAction actionWithTitle:@"不同意" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"agreeStatus"];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
|
//更新用户授权高德SDK隐私协议状态. since 8.1.0
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyAgree:AMapPrivacyAgreeStatusNotAgree];
|
||||||
|
}];
|
||||||
|
|
||||||
|
[privacyInfoController addAction:agreeAllAction];
|
||||||
|
[privacyInfoController addAction:agreeAction];
|
||||||
|
[privacyInfoController addAction:notAgreeAction];
|
||||||
|
|
||||||
|
[window presentViewController:privacyInfoController animated:YES completion:^{
|
||||||
|
//更新App是否显示隐私弹窗的状态,隐私弹窗是否包含高德SDK隐私协议内容的状态. since 8.1.0
|
||||||
|
[[AMapNaviManagerConfig sharedConfig] updatePrivacyShow:AMapPrivacyShowStatusDidShow privacyInfo:AMapPrivacyInfoStatusDidContain];
|
||||||
|
}];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
//
|
||||||
|
// NaviPointAnnotation.h
|
||||||
|
// AMapNaviKit
|
||||||
|
//
|
||||||
|
// Created by 刘博 on 16/3/8.
|
||||||
|
// Copyright © 2016年 AutoNavi. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <AMapNaviKit/MAMapKit.h>
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, NaviPointAnnotationType)
|
||||||
|
{
|
||||||
|
NaviPointAnnotationStart,
|
||||||
|
NaviPointAnnotationWay,
|
||||||
|
NaviPointAnnotationEnd
|
||||||
|
};
|
||||||
|
|
||||||
|
@interface NaviPointAnnotation : MAPointAnnotation
|
||||||
|
|
||||||
|
@property (nonatomic, assign) NaviPointAnnotationType navPointType;
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
//
|
||||||
|
// NaviPointAnnotation.m
|
||||||
|
// AMapNaviKit
|
||||||
|
//
|
||||||
|
// Created by 刘博 on 16/3/8.
|
||||||
|
// Copyright © 2016年 AutoNavi. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "NaviPointAnnotation.h"
|
||||||
|
|
||||||
|
@implementation NaviPointAnnotation
|
||||||
|
|
||||||
|
@end
|
||||||
24
ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.h
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
//
|
||||||
|
// SelectableOverlay.h
|
||||||
|
// officialDemo2D
|
||||||
|
//
|
||||||
|
// Created by yi chen on 14-5-8.
|
||||||
|
// Copyright (c) 2014年 AutoNavi. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <AMapNaviKit/MAMapKit.h>
|
||||||
|
|
||||||
|
/// 继承 MAPolyline,自身就是 Polyline,renderer 用 self 初始化不会产生 overlay 不匹配警告
|
||||||
|
@interface SelectableOverlay : MAPolyline
|
||||||
|
|
||||||
|
@property (nonatomic, assign) NSInteger routeID;
|
||||||
|
|
||||||
|
@property (nonatomic, assign, getter = isSelected) BOOL selected;
|
||||||
|
@property (nonatomic, strong) UIColor *selectedColor;
|
||||||
|
@property (nonatomic, strong) UIColor *regularColor;
|
||||||
|
|
||||||
|
/// 用坐标数组和数量初始化(对应原来的 MAPolyline polylineWithCoordinates:count:)
|
||||||
|
+ (instancetype)overlayWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
|
||||||
|
|
||||||
|
@end
|
||||||
23
ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Tools/SelectableOverlay.m
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// SelectableOverlay.m
|
||||||
|
// officialDemo2D
|
||||||
|
//
|
||||||
|
// Created by yi chen on 14-5-8.
|
||||||
|
// Copyright (c) 2014年 AutoNavi. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "SelectableOverlay.h"
|
||||||
|
|
||||||
|
@implementation SelectableOverlay
|
||||||
|
|
||||||
|
+ (instancetype)overlayWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count
|
||||||
|
{
|
||||||
|
// MAPolyline 的指定工厂方法,返回 SelectableOverlay 实例
|
||||||
|
SelectableOverlay *overlay = (SelectableOverlay *)[super polylineWithCoordinates:coords count:count];
|
||||||
|
overlay.selected = NO;
|
||||||
|
overlay.selectedColor = [UIColor colorWithRed:0.05 green:0.39 blue:0.9 alpha:0.8];
|
||||||
|
overlay.regularColor = [UIColor colorWithRed:0.5 green:0.6 blue:0.9 alpha:0.8];
|
||||||
|
return overlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
//
|
||||||
|
// ABottomBarView.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import "AMapNavSDKHeader.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@class ABottomBarView;
|
||||||
|
|
||||||
|
@protocol ABottomBarViewDelegate <NSObject>
|
||||||
|
/// 点击「规划路线」按钮
|
||||||
|
- (void)bottomBarViewDidTapCalRoute:(ABottomBarView *)barView;
|
||||||
|
/// 输入框开始编辑(外部弹起搜索页)
|
||||||
|
- (void)bottomBarViewDidTapSearchField:(ABottomBarView *)barView;
|
||||||
|
@end
|
||||||
|
|
||||||
|
/// 底部搜索+规划路线栏
|
||||||
|
@interface ABottomBarView : UIView
|
||||||
|
|
||||||
|
@property (nonatomic, weak) id<ABottomBarViewDelegate> delegate;
|
||||||
|
|
||||||
|
/// 目的地文本(外部赋值后自动更新输入框)
|
||||||
|
@property (nonatomic, copy, nullable) NSString *destinationText;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,204 @@
|
|||||||
|
//
|
||||||
|
// ABottomBarView.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/25.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ABottomBarView.h"
|
||||||
|
#import "AMapNavCommonUtil.h"
|
||||||
|
#import <Masonry/Masonry.h>
|
||||||
|
|
||||||
|
// 主题绿
|
||||||
|
static inline UIColor *ABottomBarThemeGreen(void) {
|
||||||
|
return [UIColor colorWithRed:0x1A/255.0 green:0x6E/255.0 blue:0x45/255.0 alpha:1.0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@interface ABottomBarView () <UITextFieldDelegate>
|
||||||
|
|
||||||
|
/// 白色圆角背景卡片
|
||||||
|
@property (nonatomic, strong) UIView *cardView;
|
||||||
|
|
||||||
|
/// 搜索图标
|
||||||
|
@property (nonatomic, strong) UIImageView *searchIconView;
|
||||||
|
|
||||||
|
/// 目的地输入框
|
||||||
|
@property (nonatomic, strong) UITextField *searchField;
|
||||||
|
|
||||||
|
/// 规划路线按钮
|
||||||
|
@property (nonatomic, strong) UIButton *calRouteButton;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ABottomBarView
|
||||||
|
|
||||||
|
#pragma mark - Init
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
|
self = [super initWithFrame:frame];
|
||||||
|
if (self) {
|
||||||
|
self.backgroundColor = [UIColor clearColor];
|
||||||
|
[self _buildUI];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)init {
|
||||||
|
return [self initWithFrame:CGRectZero];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Build UI
|
||||||
|
|
||||||
|
- (void)_buildUI {
|
||||||
|
// ── 背景卡片 ──────────────────────────────────────────
|
||||||
|
UIView *card = [[UIView alloc] init];
|
||||||
|
// card.backgroundColor = [UIColor colorWithRed:0.96 green:0.97 blue:0.98 alpha:0.96];
|
||||||
|
card.backgroundColor = [UIColor whiteColor];
|
||||||
|
card.layer.cornerRadius = 16;
|
||||||
|
// 顶部阴影
|
||||||
|
card.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||||
|
card.layer.shadowOpacity = 0.10;
|
||||||
|
card.layer.shadowRadius = 10;
|
||||||
|
card.layer.shadowOffset = CGSizeMake(0, -3);
|
||||||
|
card.layer.masksToBounds = NO;
|
||||||
|
[self addSubview:card];
|
||||||
|
self.cardView = card;
|
||||||
|
|
||||||
|
[card mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.equalTo(self);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 搜索框容器(白色圆角行) ──────────────────────────
|
||||||
|
UIView *searchRow = [[UIView alloc] init];
|
||||||
|
searchRow.backgroundColor = [UIColor whiteColor];
|
||||||
|
searchRow.layer.cornerRadius = 5;
|
||||||
|
searchRow.layer.masksToBounds = YES;
|
||||||
|
searchRow.layer.borderColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1].CGColor;
|
||||||
|
searchRow.layer.borderWidth = 1;
|
||||||
|
[card addSubview:searchRow];
|
||||||
|
|
||||||
|
[searchRow mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(card).offset(-18);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
make.right.equalTo(card).offset(-16);
|
||||||
|
make.height.mas_equalTo(50);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 搜索图标 ──────────────────────────────────────────
|
||||||
|
UIImageView *searchIcon = [[UIImageView alloc] init];
|
||||||
|
searchIcon.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
searchIcon.image = [AMapNavCommonUtil imageWithName3x:@"search_icon"];
|
||||||
|
[searchRow addSubview:searchIcon];
|
||||||
|
self.searchIconView = searchIcon;
|
||||||
|
|
||||||
|
[searchIcon mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(searchRow);
|
||||||
|
make.left.equalTo(searchRow).offset(12);
|
||||||
|
make.width.height.mas_equalTo(18);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 目的地输入框 ──────────────────────────────────────
|
||||||
|
UITextField *field = [[UITextField alloc] init];
|
||||||
|
field.placeholder = @"请输入目的地,不输入则自动匹配附近成本最低加氢站";
|
||||||
|
field.font = [UIFont systemFontOfSize:14];
|
||||||
|
field.textColor = [UIColor colorWithWhite:0.1 alpha:1];
|
||||||
|
field.borderStyle = UITextBorderStyleNone;
|
||||||
|
field.backgroundColor = [UIColor clearColor];
|
||||||
|
field.delegate = self;
|
||||||
|
// placeholder 颜色
|
||||||
|
if (field.placeholder) {
|
||||||
|
field.attributedPlaceholder = [[NSAttributedString alloc]
|
||||||
|
initWithString:field.placeholder
|
||||||
|
attributes:@{NSForegroundColorAttributeName:
|
||||||
|
[UIColor colorWithWhite:0.65 alpha:1],
|
||||||
|
NSFontAttributeName:
|
||||||
|
[UIFont systemFontOfSize:13]}];
|
||||||
|
}
|
||||||
|
[searchRow addSubview:field];
|
||||||
|
self.searchField = field;
|
||||||
|
|
||||||
|
[field mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(searchRow);
|
||||||
|
make.left.equalTo(searchIcon.mas_right).offset(8);
|
||||||
|
make.right.equalTo(searchRow).offset(-12);
|
||||||
|
make.top.bottom.equalTo(searchRow);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// ── 规划路线按钮 ──────────────────────────────────────
|
||||||
|
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
btn.backgroundColor = ABottomBarThemeGreen();
|
||||||
|
btn.layer.cornerRadius = 24;
|
||||||
|
btn.layer.masksToBounds = YES;
|
||||||
|
|
||||||
|
// 左侧图标
|
||||||
|
UIImageView *routeIcon = [[UIImageView alloc] init];
|
||||||
|
routeIcon.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
routeIcon.image = [AMapNavCommonUtil imageWithName3x:@"cal_ruoute_icon"];
|
||||||
|
routeIcon.userInteractionEnabled = NO;
|
||||||
|
[btn addSubview:routeIcon];
|
||||||
|
|
||||||
|
// 标题
|
||||||
|
UILabel *titleLbl = [[UILabel alloc] init];
|
||||||
|
titleLbl.text = @"规划路线";
|
||||||
|
titleLbl.textColor = [UIColor whiteColor];
|
||||||
|
titleLbl.font = [UIFont boldSystemFontOfSize:16];
|
||||||
|
titleLbl.userInteractionEnabled = NO;
|
||||||
|
[btn addSubview:titleLbl];
|
||||||
|
|
||||||
|
// 图标和文字水平居中整体
|
||||||
|
[routeIcon mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(btn);
|
||||||
|
make.right.equalTo(titleLbl.mas_left).offset(-8);
|
||||||
|
make.width.height.mas_equalTo(22);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerY.equalTo(btn);
|
||||||
|
// 两者整体水平居中:titleLbl 向右偏移 (22+8)/2 = 15pt
|
||||||
|
make.centerX.equalTo(btn).offset(15);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[btn addTarget:self action:@selector(_onCalRouteTapped) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[card addSubview:btn];
|
||||||
|
self.calRouteButton = btn;
|
||||||
|
|
||||||
|
CGFloat off_y = AMP_TabbarHeight;
|
||||||
|
#ifdef kAMapSDKDebugFlag
|
||||||
|
off_y = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.top.equalTo(searchRow.mas_bottom).offset(20);
|
||||||
|
make.left.equalTo(card).offset(16);
|
||||||
|
make.right.equalTo(card).offset(-16);
|
||||||
|
make.height.mas_equalTo(48);
|
||||||
|
make.bottom.equalTo(card).offset(-40 - off_y);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Public
|
||||||
|
|
||||||
|
- (void)setDestinationText:(NSString *)destinationText {
|
||||||
|
_destinationText = destinationText;
|
||||||
|
self.searchField.text = destinationText;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Actions
|
||||||
|
|
||||||
|
- (void)_onCalRouteTapped {
|
||||||
|
if ([self.delegate respondsToSelector:@selector(bottomBarViewDidTapCalRoute:)]) {
|
||||||
|
[self.delegate bottomBarViewDidTapCalRoute:self];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - UITextFieldDelegate
|
||||||
|
|
||||||
|
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
|
||||||
|
// 不弹起键盘,直接通知外部展示搜索页
|
||||||
|
if ([self.delegate respondsToSelector:@selector(bottomBarViewDidTapSearchField:)]) {
|
||||||
|
[self.delegate bottomBarViewDidTapSearchField:self];
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// ACustomStepView.h
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface ACustomStepView : UIView
|
||||||
|
|
||||||
|
@property (nonatomic, readonly , assign) CGFloat value; // 当前值
|
||||||
|
|
||||||
|
|
||||||
|
- (instancetype)initWithValue:(CGFloat)currentValue maxValue:(CGFloat)maxValue min:(CGFloat)minValue;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
//
|
||||||
|
// ACustomStepView.m
|
||||||
|
// AMapNavIOSSDK
|
||||||
|
//
|
||||||
|
// Created by admin on 2026/3/11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ACustomStepView.h"
|
||||||
|
#import <Masonry/Masonry.h>
|
||||||
|
|
||||||
|
#define kStepValue 0.5
|
||||||
|
|
||||||
|
@interface ACustomStepView ()
|
||||||
|
@property CGFloat value;
|
||||||
|
@property CGFloat maxValue;
|
||||||
|
@property CGFloat minValue;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ACustomStepView
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
|
self = [super initWithFrame:frame];
|
||||||
|
if (self) {
|
||||||
|
self.backgroundColor = [UIColor whiteColor];
|
||||||
|
self.layer.cornerRadius = 4;
|
||||||
|
self.layer.masksToBounds = YES;
|
||||||
|
self.clipsToBounds = YES;
|
||||||
|
self.layer.borderColor = [UIColor colorWithRed:225/255.0 green:225/255.0 blue:225/255.0 alpha:1].CGColor;
|
||||||
|
self.layer.borderWidth = 1;
|
||||||
|
|
||||||
|
[self setupSubviews];
|
||||||
|
|
||||||
|
self.value = 0; // 初始值
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithValue:(CGFloat)currentValue maxValue:(CGFloat)maxValue min:(CGFloat)minValue {
|
||||||
|
// self = [super initWithFrame:CGRectZero];
|
||||||
|
|
||||||
|
if (self) {
|
||||||
|
_value = currentValue;
|
||||||
|
_maxValue = maxValue;
|
||||||
|
_minValue = minValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setupSubviews {
|
||||||
|
// 减按钮
|
||||||
|
UIButton *minusButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||||
|
[minusButton setTitle:@"-" forState:UIControlStateNormal];
|
||||||
|
minusButton.titleLabel.font = [UIFont boldSystemFontOfSize:20];
|
||||||
|
[minusButton addTarget:self action:@selector(decrement:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[minusButton setTintColor:[UIColor colorWithRed:0x35/255.0 green:0x35/255.0 blue:0x35/255.0 alpha:1]];
|
||||||
|
[self addSubview:minusButton];
|
||||||
|
|
||||||
|
// 加按钮
|
||||||
|
UIButton *plusButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||||
|
[plusButton setTitle:@"+" forState:UIControlStateNormal];
|
||||||
|
plusButton.titleLabel.font = [UIFont boldSystemFontOfSize:20];
|
||||||
|
[plusButton setTintColor:[UIColor colorWithRed:0x35/255.0 green:0x35/255.0 blue:0x35/255.0 alpha:1]];
|
||||||
|
|
||||||
|
[plusButton addTarget:self action:@selector(increment:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[self addSubview:plusButton];
|
||||||
|
|
||||||
|
[plusButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.top.right.equalTo(self);
|
||||||
|
make.height.equalTo(@40);
|
||||||
|
}];
|
||||||
|
|
||||||
|
UIView * line = [[UIView alloc] init];
|
||||||
|
line.backgroundColor = [UIColor colorWithRed:230/255.0 green:230/255.0 blue:230/255.0 alpha:1];
|
||||||
|
[self addSubview:line];
|
||||||
|
[line mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.right.equalTo(self);
|
||||||
|
make.top.equalTo(plusButton.mas_bottom);
|
||||||
|
make.height.equalTo(@1);
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
[minusButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.left.right.equalTo(self);
|
||||||
|
make.top.equalTo(plusButton.mas_bottom);
|
||||||
|
make.height.equalTo(plusButton);
|
||||||
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 减1操作
|
||||||
|
- (void)decrement:(UIButton *)sender {
|
||||||
|
if (self.value <= self.minValue) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (self.value - kStepValue < self.minValue) {
|
||||||
|
self.value = self.minValue;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.value = self.value - kStepValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加1操作
|
||||||
|
- (void)increment:(UIButton *)sender {
|
||||||
|
if (self.value >= self.maxValue) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (self.value + kStepValue > self.maxValue) {
|
||||||
|
self.value = self.maxValue;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.value = self.value + kStepValue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
@@ -31,7 +31,13 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
|
|||||||
flutter_ios_podfile_setup
|
flutter_ios_podfile_setup
|
||||||
|
|
||||||
target 'Runner' do
|
target 'Runner' do
|
||||||
use_frameworks!
|
# use_frameworks!
|
||||||
|
use_frameworks! :linkage => :static
|
||||||
|
|
||||||
|
pod 'AMapNavIOSSDK' , :path => './AMapNavIOSSDK'
|
||||||
|
## 本地仓库
|
||||||
|
# pod 'AMapNavIOSSDK' , :path => '../../../../demo/ANavDemo'
|
||||||
|
|
||||||
|
|
||||||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||||
target 'RunnerTests' do
|
target 'RunnerTests' do
|
||||||
|
|||||||
@@ -1,12 +1,26 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- AlicloudELS (1.0.3)
|
- AlicloudELS (1.0.3)
|
||||||
- AlicloudPush (3.2.3):
|
- AlicloudPush (3.2.3):
|
||||||
- AlicloudELS (= 1.0.3)
|
- AlicloudELS (~> 1.0.3)
|
||||||
- AlicloudUTDID (~> 1.0)
|
- AlicloudUTDID (~> 1.0)
|
||||||
- AlicloudUTDID (1.6.1)
|
- AlicloudUTDID (1.6.1)
|
||||||
- aliyun_push_flutter (0.0.1):
|
- aliyun_push_flutter (0.0.1):
|
||||||
- AlicloudPush (< 4.0, >= 3.2.3)
|
- AlicloudPush (< 4.0, >= 3.2.3)
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- AMapFoundation-NO-IDFA (1.8.2)
|
||||||
|
- AMapLocation-NO-IDFA (2.11.0):
|
||||||
|
- AMapFoundation-NO-IDFA (>= 1.8.0)
|
||||||
|
- AMapNavi-NO-IDFA (10.1.600):
|
||||||
|
- AMapFoundation-NO-IDFA (>= 1.8.2)
|
||||||
|
- AMapNavIOSSDK (0.1.0):
|
||||||
|
- AMapLocation-NO-IDFA
|
||||||
|
- AMapNavi-NO-IDFA
|
||||||
|
- AMapSearch-NO-IDFA
|
||||||
|
- Masonry
|
||||||
|
- MBProgressHUD
|
||||||
|
- MJExtension
|
||||||
|
- AMapSearch-NO-IDFA (9.7.4):
|
||||||
|
- AMapFoundation-NO-IDFA (>= 1.8.0)
|
||||||
- connectivity_plus (0.0.1):
|
- connectivity_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- device_info_plus (0.0.1):
|
- device_info_plus (0.0.1):
|
||||||
@@ -28,15 +42,15 @@ PODS:
|
|||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- image_picker_ios (0.0.1):
|
- image_picker_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- Masonry (1.1.0)
|
||||||
|
- MBProgressHUD (1.2.0)
|
||||||
|
- MJExtension (3.4.2)
|
||||||
- mobile_scanner (7.0.0):
|
- mobile_scanner (7.0.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- OrderedSet (6.0.3)
|
- OrderedSet (6.0.3)
|
||||||
- package_info_plus (0.4.5):
|
- package_info_plus (0.4.5):
|
||||||
- Flutter
|
- Flutter
|
||||||
- path_provider_foundation (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- FlutterMacOS
|
|
||||||
- permission_handler_apple (9.3.0):
|
- permission_handler_apple (9.3.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
@@ -47,6 +61,7 @@ PODS:
|
|||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- aliyun_push_flutter (from `.symlinks/plugins/aliyun_push_flutter/ios`)
|
- aliyun_push_flutter (from `.symlinks/plugins/aliyun_push_flutter/ios`)
|
||||||
|
- AMapNavIOSSDK (from `./AMapNavIOSSDK`)
|
||||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
||||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
@@ -57,7 +72,6 @@ DEPENDENCIES:
|
|||||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
|
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/darwin`)
|
||||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
|
||||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
@@ -69,11 +83,20 @@ SPEC REPOS:
|
|||||||
- AlicloudELS
|
- AlicloudELS
|
||||||
- AlicloudPush
|
- AlicloudPush
|
||||||
trunk:
|
trunk:
|
||||||
|
- AMapFoundation-NO-IDFA
|
||||||
|
- AMapLocation-NO-IDFA
|
||||||
|
- AMapNavi-NO-IDFA
|
||||||
|
- AMapSearch-NO-IDFA
|
||||||
|
- Masonry
|
||||||
|
- MBProgressHUD
|
||||||
|
- MJExtension
|
||||||
- OrderedSet
|
- OrderedSet
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
aliyun_push_flutter:
|
aliyun_push_flutter:
|
||||||
:path: ".symlinks/plugins/aliyun_push_flutter/ios"
|
:path: ".symlinks/plugins/aliyun_push_flutter/ios"
|
||||||
|
AMapNavIOSSDK:
|
||||||
|
:path: "./AMapNavIOSSDK"
|
||||||
connectivity_plus:
|
connectivity_plus:
|
||||||
:path: ".symlinks/plugins/connectivity_plus/ios"
|
:path: ".symlinks/plugins/connectivity_plus/ios"
|
||||||
device_info_plus:
|
device_info_plus:
|
||||||
@@ -94,8 +117,6 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/mobile_scanner/darwin"
|
:path: ".symlinks/plugins/mobile_scanner/darwin"
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||||
path_provider_foundation:
|
|
||||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
|
||||||
permission_handler_apple:
|
permission_handler_apple:
|
||||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
@@ -105,25 +126,32 @@ EXTERNAL SOURCES:
|
|||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
AlicloudELS: fbf821383330465a5af84a033f36f263ae46ca41
|
AlicloudELS: fbf821383330465a5af84a033f36f263ae46ca41
|
||||||
AlicloudPush: 95150880af380f64cf1741f5586047c17d36c1d9
|
AlicloudPush: 52cbf38ffc20c07f039cbc72d5738745fd986215
|
||||||
AlicloudUTDID: 5d2f22d50e11eecd38f30bc7a48c71925ea90976
|
AlicloudUTDID: 5d2f22d50e11eecd38f30bc7a48c71925ea90976
|
||||||
aliyun_push_flutter: 0fc2f048a08687ef256c0cfdd72dd7a550ef3347
|
aliyun_push_flutter: ab0bf7112ef3797f506770a7a9f47f004635a9f6
|
||||||
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
|
AMapFoundation-NO-IDFA: 6ce0ef596d4eb8d934ff498e56747b6de1247b05
|
||||||
device_info_plus: 71ffc6ab7634ade6267c7a93088ed7e4f74e5896
|
AMapLocation-NO-IDFA: 590fd42af0c8ea9eac26978348221bbc16be4ef9
|
||||||
|
AMapNavi-NO-IDFA: 22edfa7d6a81d75c91756e31b6c26b7746152233
|
||||||
|
AMapNavIOSSDK: 092382d55290f43b282ffcc522c274996794e2bc
|
||||||
|
AMapSearch-NO-IDFA: 53b2193244be8f07f3be0a4d5161200236960587
|
||||||
|
connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
|
||||||
|
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
|
||||||
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
|
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
|
||||||
flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
|
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
|
||||||
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
|
flutter_native_splash: df59bb2e1421aa0282cb2e95618af4dcb0c56c29
|
||||||
flutter_pdfview: 32bf27bda6fd85b9dd2c09628a824df5081246cf
|
flutter_pdfview: 2e4d13ffb774858562ffbdfdb61b40744b191adc
|
||||||
geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
|
geolocator_apple: 66b711889fd333205763b83c9dcf0a57a28c7afd
|
||||||
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
|
image_picker_ios: 4f2f91b01abdb52842a8e277617df877e40f905b
|
||||||
mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93
|
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
|
||||||
|
MBProgressHUD: 3ee5efcc380f6a79a7cc9b363dd669c5e1ae7406
|
||||||
|
MJExtension: e97d164cb411aa9795cf576093a1fa208b4a8dd8
|
||||||
|
mobile_scanner: 77265f3dc8d580810e91849d4a0811a90467ed5e
|
||||||
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
|
||||||
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
|
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
|
||||||
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
|
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||||
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
|
shared_preferences_foundation: 5086985c1d43c5ba4d5e69a4e8083a389e2909e6
|
||||||
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
|
url_launcher_ios: bb13df5870e8c4234ca12609d04010a21be43dfa
|
||||||
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
|
|
||||||
|
|
||||||
PODFILE CHECKSUM: 357c01ff4e7591871e8c4fd6462220a8c7447220
|
PODFILE CHECKSUM: b4931d4490f04261e0fda802d44e275ab3619244
|
||||||
|
|
||||||
COCOAPODS: 1.16.2
|
COCOAPODS: 1.16.2
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
307490676CE2A16C8D75B103 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 937F9432963895EF63BCCD38 /* Pods_RunnerTests.framework */; };
|
298D3D45379E4332D4A8A627 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95135D36941D5EF2C00065B2 /* Pods_Runner.framework */; };
|
||||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
59E555C098DB12132BCE9F6E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6AF04C5CFFF0B4098EEDA799 /* Pods_Runner.framework */; };
|
3F21125D6B84D3CC58F3C574 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85810788944AB2417549F45E /* Pods_RunnerTests.framework */; };
|
||||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
|
8420D0082F3D9F7E006DB6CC /* NativeFirstPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8420D0072F3D9F7E006DB6CC /* NativeFirstPage.swift */; };
|
||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
@@ -49,13 +50,14 @@
|
|||||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
4B58A54CFC9A912F2BA04FF2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
4B58A54CFC9A912F2BA04FF2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
6AF04C5CFFF0B4098EEDA799 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
6D3F89E22F04C32900A154AD /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
|
6D3F89E22F04C32900A154AD /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
8420D0072F3D9F7E006DB6CC /* NativeFirstPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeFirstPage.swift; sourceTree = "<group>"; };
|
||||||
|
85810788944AB2417549F45E /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
87773E6EB1B2C64DA1B1FA42 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
87773E6EB1B2C64DA1B1FA42 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
937F9432963895EF63BCCD38 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
95135D36941D5EF2C00065B2 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
@@ -73,7 +75,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
59E555C098DB12132BCE9F6E /* Pods_Runner.framework in Frameworks */,
|
298D3D45379E4332D4A8A627 /* Pods_Runner.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -81,7 +83,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
307490676CE2A16C8D75B103 /* Pods_RunnerTests.framework in Frameworks */,
|
3F21125D6B84D3CC58F3C574 /* Pods_RunnerTests.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -152,6 +154,7 @@
|
|||||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||||
|
8420D0072F3D9F7E006DB6CC /* NativeFirstPage.swift */,
|
||||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||||
);
|
);
|
||||||
path = Runner;
|
path = Runner;
|
||||||
@@ -160,8 +163,8 @@
|
|||||||
E621C70ABD0685462494972D /* Frameworks */ = {
|
E621C70ABD0685462494972D /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
6AF04C5CFFF0B4098EEDA799 /* Pods_Runner.framework */,
|
95135D36941D5EF2C00065B2 /* Pods_Runner.framework */,
|
||||||
937F9432963895EF63BCCD38 /* Pods_RunnerTests.framework */,
|
85810788944AB2417549F45E /* Pods_RunnerTests.framework */,
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -199,7 +202,6 @@
|
|||||||
97C146EC1CF9000F007C117D /* Resources */,
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
590CF992B35CC61AF9AA4341 /* [CP] Embed Pods Frameworks */,
|
|
||||||
AF570E8AAEEA12D52BD19B4E /* [CP] Copy Pods Resources */,
|
AF570E8AAEEA12D52BD19B4E /* [CP] Copy Pods Resources */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
@@ -288,23 +290,6 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||||
};
|
};
|
||||||
590CF992B35CC61AF9AA4341 /* [CP] Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
|
||||||
);
|
|
||||||
name = "[CP] Embed Pods Frameworks";
|
|
||||||
outputFileListPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
alwaysOutOfDate = 1;
|
alwaysOutOfDate = 1;
|
||||||
@@ -396,6 +381,7 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
8420D0082F3D9F7E006DB6CC /* NativeFirstPage.swift in Sources */,
|
||||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||||
);
|
);
|
||||||
@@ -526,8 +512,6 @@
|
|||||||
"-framework",
|
"-framework",
|
||||||
"\"package_info_plus\"",
|
"\"package_info_plus\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"path_provider_foundation\"",
|
|
||||||
"-framework",
|
|
||||||
"\"permission_handler_apple\"",
|
"\"permission_handler_apple\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"shared_preferences_foundation\"",
|
"\"shared_preferences_foundation\"",
|
||||||
@@ -565,8 +549,6 @@
|
|||||||
"-framework",
|
"-framework",
|
||||||
"\"package_info_plus\"",
|
"\"package_info_plus\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"path_provider_foundation\"",
|
|
||||||
"-framework",
|
|
||||||
"\"permission_handler_apple\"",
|
"\"permission_handler_apple\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"shared_preferences_foundation\"",
|
"\"shared_preferences_foundation\"",
|
||||||
@@ -794,8 +776,6 @@
|
|||||||
"-framework",
|
"-framework",
|
||||||
"\"package_info_plus\"",
|
"\"package_info_plus\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"path_provider_foundation\"",
|
|
||||||
"-framework",
|
|
||||||
"\"permission_handler_apple\"",
|
"\"permission_handler_apple\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"shared_preferences_foundation\"",
|
"\"shared_preferences_foundation\"",
|
||||||
@@ -833,8 +813,6 @@
|
|||||||
"-framework",
|
"-framework",
|
||||||
"\"package_info_plus\"",
|
"\"package_info_plus\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"path_provider_foundation\"",
|
|
||||||
"-framework",
|
|
||||||
"\"permission_handler_apple\"",
|
"\"permission_handler_apple\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"shared_preferences_foundation\"",
|
"\"shared_preferences_foundation\"",
|
||||||
@@ -899,8 +877,6 @@
|
|||||||
"-framework",
|
"-framework",
|
||||||
"\"package_info_plus\"",
|
"\"package_info_plus\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"path_provider_foundation\"",
|
|
||||||
"-framework",
|
|
||||||
"\"permission_handler_apple\"",
|
"\"permission_handler_apple\"",
|
||||||
"-framework",
|
"-framework",
|
||||||
"\"shared_preferences_foundation\"",
|
"\"shared_preferences_foundation\"",
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES"
|
||||||
debugServiceExtension = "internal"
|
debugServiceExtension = "internal"
|
||||||
|
enableGPUFrameCaptureMode = "3"
|
||||||
enableGPUValidationMode = "1"
|
enableGPUValidationMode = "1"
|
||||||
allowLocationSimulation = "YES">
|
allowLocationSimulation = "YES">
|
||||||
<BuildableProductRunnable
|
<BuildableProductRunnable
|
||||||
|
|||||||
@@ -1,13 +1,86 @@
|
|||||||
import Flutter
|
import Flutter
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
|
///
|
||||||
|
let kAMapKey = "3ac08e5e14df9d7a52e98d40e21a0189";
|
||||||
|
|
||||||
|
|
||||||
@main
|
@main
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
override func application(
|
override func application(
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
|
||||||
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
|
|
||||||
|
AMapNavSDKManager.shared().config(withKey: kAMapKey)
|
||||||
|
|
||||||
|
// 注册平台视图工厂
|
||||||
|
let registrar = self.registrar(forPlugin: "NativeFirstPagePlugin")
|
||||||
|
|
||||||
|
let controller = window?.rootViewController as! FlutterViewController
|
||||||
|
let nativeViewFactory = NativeViewFactory(messenger: controller.binaryMessenger)
|
||||||
|
|
||||||
|
registrar?.register(
|
||||||
|
nativeViewFactory,
|
||||||
|
withId: "NativeFirstPage"
|
||||||
|
)
|
||||||
|
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 创建视图工厂
|
||||||
|
class NativeViewFactory: NSObject, FlutterPlatformViewFactory {
|
||||||
|
private var messenger: FlutterBinaryMessenger
|
||||||
|
|
||||||
|
init(messenger: FlutterBinaryMessenger) {
|
||||||
|
self.messenger = messenger
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
func create(
|
||||||
|
withFrame frame: CGRect,
|
||||||
|
viewIdentifier viewId: Int64,
|
||||||
|
arguments args: Any?
|
||||||
|
) -> FlutterPlatformView {
|
||||||
|
return NativeFlutterView(frame: frame, viewId: viewId, args: args)
|
||||||
|
}
|
||||||
|
|
||||||
|
func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
|
||||||
|
return FlutterStandardMessageCodec.sharedInstance()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NativeFlutterView: NSObject, FlutterPlatformView {
|
||||||
|
private var _view: UIView
|
||||||
|
private var _nativeVC: UIViewController
|
||||||
|
|
||||||
|
init(frame: CGRect, viewId: Int64, args: Any?) {
|
||||||
|
// 创建原生的 ViewController 视图
|
||||||
|
let nativeVC = AMapNavSDKManager.shared().targetVC;
|
||||||
|
// let nativeVC = NativeFirstPage();
|
||||||
|
|
||||||
|
self._nativeVC = nativeVC
|
||||||
|
|
||||||
|
print("---frame: \(frame)");
|
||||||
|
|
||||||
|
_view = nativeVC.view
|
||||||
|
_view.isUserInteractionEnabled = true
|
||||||
|
_view.frame = CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame))
|
||||||
|
super.init()
|
||||||
|
}
|
||||||
|
|
||||||
|
func view() -> UIView {
|
||||||
|
return _view
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"size" : "20x20"
|
"size" : "20x20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-29x29@1x.png",
|
"filename" : "Icon-App-29x29 1.png",
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "29x29"
|
"size" : "29x29"
|
||||||
@@ -31,25 +31,25 @@
|
|||||||
"size" : "29x29"
|
"size" : "29x29"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-80x80.jpg",
|
"filename" : "Icon-App-80x80.png",
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "40x40"
|
"size" : "40x40"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-120x120.jpg",
|
"filename" : "Icon-App-120x120.png",
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"scale" : "3x",
|
"scale" : "3x",
|
||||||
"size" : "40x40"
|
"size" : "40x40"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-120x120 1.jpg",
|
"filename" : "Icon-App-120x120 1.png",
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "60x60"
|
"size" : "60x60"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-180.jpg",
|
"filename" : "Icon-App-180.png",
|
||||||
"idiom" : "iphone",
|
"idiom" : "iphone",
|
||||||
"scale" : "3x",
|
"scale" : "3x",
|
||||||
"size" : "60x60"
|
"size" : "60x60"
|
||||||
@@ -61,19 +61,19 @@
|
|||||||
"size" : "20x20"
|
"size" : "20x20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-20x20@2x.png",
|
"filename" : "Icon-App-20x20@2x 1.png",
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "20x20"
|
"size" : "20x20"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-29x29@1x.png",
|
"filename" : "Icon-App-29x29.png",
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "29x29"
|
"size" : "29x29"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-29x29@2x.png",
|
"filename" : "Icon-App-29x29@2x 1.png",
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"scale" : "2x",
|
"scale" : "2x",
|
||||||
"size" : "29x29"
|
"size" : "29x29"
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
"size" : "40x40"
|
"size" : "40x40"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "Icon-App-76x76@1x.png",
|
"filename" : "Icon-App-76x76.png",
|
||||||
"idiom" : "ipad",
|
"idiom" : "ipad",
|
||||||
"scale" : "1x",
|
"scale" : "1x",
|
||||||
"size" : "76x76"
|
"size" : "76x76"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 509 B After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 849 B |
|
Before Width: | Height: | Size: 848 B After Width: | Height: | Size: 849 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 613 B |