10 Commits

Author SHA1 Message Date
0a2c7683b7 更新配置 2026-04-20 09:23:36 +08:00
8e79d8039c fix 2026-04-16 13:43:11 +08:00
2523899ec4 路径更换线上 2026-04-16 11:29:51 +08:00
853a9135c8 线上配置 2026-04-16 11:10:35 +08:00
ec96a96be2 Merge branch 'dev_map' into dev
version 1.2.5
# Conflicts:
#	ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/Class/ASearchAddressController.m
#	ln_jq_app/ios/AMapNavIOSSDK/AMapNavIOSSDK/Classes/View/AStationDetailPopupView.m
2026-04-16 10:50:57 +08:00
xiaogg
0ba9547992 fix:优化完善; 2026-04-15 20:03:37 +08:00
c6e7616be2 fix 2026-04-15 10:06:58 +08:00
eae654c47e fix 2026-04-14 14:04:19 +08:00
f01875abb9 调整 2026-04-14 11:50:33 +08:00
881da166d1 调整 2026-04-13 17:48:37 +08:00
28 changed files with 757 additions and 401 deletions

View File

@@ -37,8 +37,8 @@ android {
// For more information, see: https://flutter.dev/to/review-gradle-config. // For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode = 7 versionCode = 8
versionName = "1.2.4" versionName = "1.2.5"
} }
signingConfigs { signingConfigs {

View File

@@ -61,7 +61,6 @@ import com.amap.api.services.geocoder.RegeocodeAddress;
import com.amap.api.services.geocoder.RegeocodeQuery; import com.amap.api.services.geocoder.RegeocodeQuery;
import com.amap.api.services.geocoder.RegeocodeResult; import com.amap.api.services.geocoder.RegeocodeResult;
import com.amap.api.services.route.BusRouteResult; import com.amap.api.services.route.BusRouteResult;
import com.amap.api.services.route.DrivePath;
import com.amap.api.services.route.DriveRouteResult; import com.amap.api.services.route.DriveRouteResult;
import com.amap.api.services.route.RideRouteResult; import com.amap.api.services.route.RideRouteResult;
import com.amap.api.services.route.RouteSearch; import com.amap.api.services.route.RouteSearch;
@@ -128,8 +127,9 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
private String token; private String token;
private String plateNumber; private String plateNumber;
private String mDebugUrl = "https://beta-esg.api.lnh2e.com/appointment/"; // private String mDebugUrl = "https://beta-esg.api.lnh2e.com/appointment/";
private String mReleaseUrl = ""; //线上环境
private String mDebugUrl = "http://47.101.201.13:8443/api/appointment/";
// 存储货车路线算法接口返回的数据 // 存储货车路线算法接口返回的数据
private TruckRouteData truckRouteData; private TruckRouteData truckRouteData;
@@ -205,7 +205,9 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
endInput = new TextView(context); endInput = new TextView(context);
endInput.setHint("请输入目的地,不输入则自动匹配推荐加氢站"); endInput.setHint("请输入目的地,不输入则自动匹配推荐加氢站");
endInput.setTextSize(13); endInput.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_search, 0, 0, 0);
endInput.setCompoundDrawablePadding(dp2px(8));
endInput.setTextSize(12);
endInput.setTextColor(Color.parseColor("#333333")); endInput.setTextColor(Color.parseColor("#333333"));
endInput.setHintTextColor(Color.GRAY); endInput.setHintTextColor(Color.GRAY);
endInput.setPadding(dp2px(12), dp2px(12), dp2px(12), dp2px(12)); endInput.setPadding(dp2px(12), dp2px(12), dp2px(12), dp2px(12));
@@ -249,13 +251,33 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
View vSpace = new View(context); View vSpace = new View(context);
searchArea.addView(vSpace, new LinearLayout.LayoutParams(1, dp2px(12))); searchArea.addView(vSpace, new LinearLayout.LayoutParams(1, dp2px(12)));
Button planBtn = new Button(context); // 创建自定义按钮布局
planBtn.setText("规划路线"); LinearLayout planBtnContainer = new LinearLayout(context);
planBtn.setTextColor(Color.WHITE); planBtnContainer.setOrientation(LinearLayout.HORIZONTAL);
planBtn.setTypeface(Typeface.DEFAULT_BOLD); planBtnContainer.setGravity(Gravity.CENTER);
planBtn.setBackground(getRoundedDrawable(Color.parseColor("#017143"), 99)); planBtnContainer.setBackground(getRoundedDrawable(Color.parseColor("#017143"), 99));
planBtn.setOnClickListener(v -> calculateRouteBeforeNavi()); planBtnContainer.setPadding(0, 0, 0, 0);
searchArea.addView(planBtn, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dp2px(48)));
// 添加图标
ImageView pathIcon = new ImageView(context);
pathIcon.setImageResource(R.drawable.ic_path);
pathIcon.setColorFilter(Color.WHITE);
LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams(dp2px(20), dp2px(20));
iconParams.rightMargin = dp2px(6); // 图标和文字之间的间距
planBtnContainer.addView(pathIcon, iconParams);
// 添加文字
TextView planText = new TextView(context);
planText.setText("规划路线");
planText.setTextColor(Color.WHITE);
planText.setTextSize(14);
planText.setTypeface(Typeface.DEFAULT_BOLD);
planText.setGravity(Gravity.CENTER);
planBtnContainer.addView(planText);
// 设置点击事件
planBtnContainer.setOnClickListener(v -> calculateRouteBeforeNavi());
searchArea.addView(planBtnContainer, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dp2px(40)));
bottomContainer.addView(searchArea); bottomContainer.addView(searchArea);
@@ -378,8 +400,8 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
row1.setOrientation(LinearLayout.HORIZONTAL); row1.setOrientation(LinearLayout.HORIZONTAL);
row1.setGravity(Gravity.CENTER_VERTICAL); row1.setGravity(Gravity.CENTER_VERTICAL);
row1.setPadding(0, dp2px(8), 0, 0); // 增加行间距 row1.setPadding(0, dp2px(8), 0, 0); // 增加行间距
tvDuration = createInfoItem(row1, R.drawable.ic_time, "预计时间:", "", 1.0f); tvDuration = createInfoItem(row1, R.drawable.ic_time, "预计时间:", "-", 1.0f);
tvTollsFuel = createInfoItem(row1, R.drawable.ic_fuel, "加氢费用:", "", 1.0f); tvTollsFuel = createInfoItem(row1, R.drawable.ic_fuel, "加氢费用:", "-", 1.0f);
routeInfoLayout.addView(row1); routeInfoLayout.addView(row1);
// 第二行:里程 + 过路费 // 第二行:里程 + 过路费
@@ -389,9 +411,9 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
row2.setPadding(0, dp2px(10), 0, 0); // 增加行间距 row2.setPadding(0, dp2px(10), 0, 0); // 增加行间距
// 里程 // 里程
tvDistance = createInfoItem(row2, R.drawable.ic_mileage, "行驶里程:", "", 1.0f); tvDistance = createInfoItem(row2, R.drawable.ic_mileage, "行驶里程:", "-", 1.0f);
// 过路费 // 过路费
tvTolls = createInfoItem(row2, R.drawable.ic_toll, "过路费:", "", 1.0f); tvTolls = createInfoItem(row2, R.drawable.ic_toll, "过路费:", "-", 1.0f);
routeInfoLayout.addView(row2); routeInfoLayout.addView(row2);
//第三行 //第三行
@@ -399,15 +421,15 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
row3.setOrientation(LinearLayout.HORIZONTAL); row3.setOrientation(LinearLayout.HORIZONTAL);
row3.setGravity(Gravity.CENTER_VERTICAL); row3.setGravity(Gravity.CENTER_VERTICAL);
row3.setPadding(0, dp2px(8), 0, 0); // 增加行间距 row3.setPadding(0, dp2px(8), 0, 0); // 增加行间距
tvPerson = createInfoItem(row3, R.drawable.ic_person, "站联系人:", "", 1.0f); tvPerson = createInfoItem(row3, R.drawable.ic_person, "站联系人:", "-", 1.0f);
tvPrice = createInfoItem(row3, R.drawable.ic_price, "加氢价格:", "", 1.0f); tvPrice = createInfoItem(row3, R.drawable.ic_price, "加氢价格:", "-", 1.0f);
routeInfoLayout.addView(row3); routeInfoLayout.addView(row3);
LinearLayout row4 = new LinearLayout(context); LinearLayout row4 = new LinearLayout(context);
row4.setOrientation(LinearLayout.HORIZONTAL); row4.setOrientation(LinearLayout.HORIZONTAL);
row4.setGravity(Gravity.CENTER_VERTICAL); row4.setGravity(Gravity.CENTER_VERTICAL);
row4.setPadding(0, dp2px(8), 0, 0); // 增加行间距 row4.setPadding(0, dp2px(8), 0, 0); // 增加行间距
tvPhone = createInfoItem(row4, R.drawable.ic_phone, "联系方式:", "", 1.0f); tvPhone = createInfoItem(row4, R.drawable.ic_phone, "联系方式:", "-", 1.0f);
routeInfoLayout.addView(row4); routeInfoLayout.addView(row4);
@@ -432,6 +454,7 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
searchArea.setVisibility(View.VISIBLE); searchArea.setVisibility(View.VISIBLE);
planToggleBtn.setVisibility(View.VISIBLE); planToggleBtn.setVisibility(View.VISIBLE);
mLocBtn.setVisibility(View.VISIBLE); mLocBtn.setVisibility(View.VISIBLE);
} }
private boolean isGetInputtips = false; private boolean isGetInputtips = false;
@@ -450,6 +473,8 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
//如果是输入地址提示内容 //如果是输入地址提示内容
if (isGetInputtips) { if (isGetInputtips) {
truckRouteData = null;
RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(new LatLonPoint(startPoint.latitude, startPoint.longitude), new LatLonPoint(endPoint.latitude, endPoint.longitude)); RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(new LatLonPoint(startPoint.latitude, startPoint.longitude), new LatLonPoint(endPoint.latitude, endPoint.longitude));
RouteSearch.DriveRouteQuery query = new RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, null, null, ""); RouteSearch.DriveRouteQuery query = new RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, null, null, "");
routeSearch.calculateDriveRouteAsyn(query); routeSearch.calculateDriveRouteAsyn(query);
@@ -473,9 +498,19 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
@Override @Override
public void run() { public void run() {
String hydrogenCost = "-"; // 默认显示横线
String hydrogenPrice = "-"; // 默认显示横线
String liaisonName = "-";
String liaisonPhone = "-";
String startBusiness = "-";
String endBusiness = "-";
double distanceKm = 0;
String distanceKmStr = "-";
long durationMin = 0;
String durationMinStr = "-";
String tolls = "-";
if (rCode == AMapException.CODE_AMAP_SUCCESS && result != null && !result.getPaths().isEmpty()) { if (rCode == AMapException.CODE_AMAP_SUCCESS && result != null && !result.getPaths().isEmpty()) {
DrivePath path = result.getPaths().get(0);
// 规划成功,显示详情面板,隐藏模式选择 // 规划成功,显示详情面板,隐藏模式选择
if (detailPanel != null) if (detailPanel != null)
@@ -490,52 +525,60 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
tvStationName.setText(endName); tvStationName.setText(endName);
tvStationAddr.setText(endAddress); tvStationAddr.setText(endAddress);
DestinationSite destinationSite = truckRouteData.destinationSite;
double distanceKm = truckRouteData.pathDto.distance / 1000f; if (truckRouteData != null) {
long durationMin = truckRouteData.pathDto.duration / 60; PathDto pathDto = truckRouteData.pathDto;
String tolls = truckRouteData.pathDto.tolls; if (pathDto != null) {
distanceKm = pathDto.distance / 1000f;
durationMin = pathDto.duration / 60;
tolls = pathDto.tolls + "";
String hydrogenCost = "-"; // 默认显示横线 distanceKmStr = String.format("%.1f", distanceKm) + "公里";
String hydrogenPrice = "-"; // 默认显示横线 durationMinStr = durationMin + "分钟";
String liaisonName = "-";
String liaisonPhone = "-";
String startBusiness = "-";
String endBusiness = "-";
try {
// 增加多级非空校验,防止点击搜索条目时崩溃
if (truckRouteData != null &&
truckRouteData.algorithmPath != null &&
truckRouteData.algorithmPath.hydrogenCost != null &&
!truckRouteData.algorithmPath.hydrogenCost.isEmpty()) {
hydrogenCost = truckRouteData.algorithmPath.hydrogenCost;
} }
}
tvDuration.setText("预计时间:" + durationMin + "分钟");
tvDistance.setText("行驶里程:" + String.format("%.1f", distanceKm) + "公里");
tvTolls.setText("过路费:" + tolls + "");
tvTollsFuel.setText("预计加氢费用:" + (isGetInputtips ? "--" : hydrogenCost) + "");
// 增加多级非空校验,防止点击搜索条目时崩溃
if (truckRouteData != null &&
truckRouteData.algorithmPath != null &&
truckRouteData.algorithmPath.hydrogenCost != null &&
!truckRouteData.algorithmPath.hydrogenCost.isEmpty()) {
hydrogenCost = truckRouteData.algorithmPath.hydrogenCost;
hydrogenCost = (isGetInputtips ? "--" : hydrogenCost) + "";
}
tvDuration.setText("预计时间:" + durationMinStr);
tvDistance.setText("行驶里程:" + distanceKmStr);
tvTolls.setText("过路费:" + tolls);
tvTollsFuel.setText("预计加氢费用:" + hydrogenCost);
if (truckRouteData != null) {
DestinationSite destinationSite = truckRouteData.destinationSite;
if (destinationSite != null) { if (destinationSite != null) {
startBusiness = destinationSite.startBusiness; startBusiness = destinationSite.startBusiness;
endBusiness = destinationSite.endBusiness; endBusiness = destinationSite.endBusiness;
hydrogenPrice = destinationSite.hydrogenPrice; hydrogenPrice = destinationSite.hydrogenPrice + "/L";
liaisonName = destinationSite.liaisonName; liaisonName = destinationSite.liaisonName;
liaisonPhone = destinationSite.liaisonPhone; liaisonPhone = destinationSite.liaisonPhone;
//开始结束时间
startBusiness = startBusiness + "-" + endBusiness;
} }
tvBusinessHours.setText("营业时间:" + startBusiness + "-" + endBusiness);
tvPerson.setText("站联系人:" + liaisonName);
tvPrice.setText("加氢价格:" + hydrogenPrice);
tvPhone.setText("联系方式:" + liaisonPhone);
isGetInputtips = false;
aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(endPoint, 13f));
} catch (Exception e) {
Log.e(TAG, "获取加氢费用失败", e);
} }
tvBusinessHours.setText("营业时间:" + startBusiness);
if (liaisonName != null && liaisonName.length() > 5) {
liaisonName = liaisonName.substring(0, 5) + "...";
}
tvPerson.setText("站联系人:" + liaisonName);
tvPrice.setText("加氢价格:" + hydrogenPrice);
tvPhone.setText("联系方式:" + liaisonPhone);
aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(endPoint, 13f));
} else { } else {
// 规划失败回退面板 // 规划失败回退面板
searchArea.setVisibility(View.VISIBLE); searchArea.setVisibility(View.VISIBLE);
@@ -628,6 +671,11 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
// 检查途径点数量,决定使用哪种导航方式 // 检查途径点数量,决定使用哪种导航方式
int wayPointsCount = waysPoiIds.size(); int wayPointsCount = waysPoiIds.size();
Log.d(TAG, "途经点数量: " + wayPointsCount); Log.d(TAG, "途经点数量: " + wayPointsCount);
//如果是输入地址提示内容,不判断途经点
if (isGetInputtips) {
wayPointsCount = 0;
}
if (wayPointsCount > 3) { if (wayPointsCount > 3) {
// 途经点超过3个跳转到 NavigationActivity // 途经点超过3个跳转到 NavigationActivity
Intent intent = new Intent(mContext, NavigationActivity.class); Intent intent = new Intent(mContext, NavigationActivity.class);
@@ -694,13 +742,11 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
* 获取货车路线算法信息 * 获取货车路线算法信息
*/ */
private void fetchTruckRouteAlgorithm(AMapLocation loc) { private void fetchTruckRouteAlgorithm(AMapLocation loc) {
showLoading();
if (plateNumber == null || plateNumber.isEmpty()) { if (plateNumber == null || plateNumber.isEmpty()) {
Toast.makeText(mActivity, "请先绑定车辆后进行导航", Toast.LENGTH_SHORT).show();
return; return;
} }
showLoading();
try { try {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("longitude", String.valueOf(loc.getLongitude())); json.put("longitude", String.valueOf(loc.getLongitude()));
@@ -820,11 +866,13 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
if (detailPanel != null && detailPanel.getVisibility() == View.VISIBLE) { if (detailPanel != null && detailPanel.getVisibility() == View.VISIBLE) {
resetView(); resetView();
} }
modeMenu.setVisibility(View.GONE);
}); });
aMap.setOnPOIClickListener(poi -> { aMap.setOnPOIClickListener(poi -> {
if (detailPanel != null && detailPanel.getVisibility() == View.VISIBLE) { if (detailPanel != null && detailPanel.getVisibility() == View.VISIBLE) {
resetView(); resetView();
} }
modeMenu.setVisibility(View.GONE);
}); });
MyLocationStyle myLocationStyle = new MyLocationStyle(); MyLocationStyle myLocationStyle = new MyLocationStyle();
@@ -882,7 +930,7 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
// 简化逻辑,直接设置文本 // 简化逻辑,直接设置文本
endInput.post(() -> { endInput.post(() -> {
try { try {
endInput.setText(district != null && !district.isEmpty() ? name + " " + district : name); endInput.setText(district != null && !district.isEmpty() ? (name + " " + district) : name);
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "Failed to set text to endInput", e); Log.e(TAG, "Failed to set text to endInput", e);
} }
@@ -1107,6 +1155,9 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
// 更新 UI 和 业务逻辑 // 更新 UI 和 业务逻辑
endName = marker.getTitle(); endName = marker.getTitle();
isUserSelectedDestination = true; // 标识用户手动选择了目的地 isUserSelectedDestination = true; // 标识用户手动选择了目的地
isGetInputtips = false;
endInput.setText("");
// 需要传入当前位置以便接口计算路线 // 需要传入当前位置以便接口计算路线
if (mlocationClient != null && mlocationClient.getLastKnownLocation() != null) { if (mlocationClient != null && mlocationClient.getLastKnownLocation() != null) {
@@ -1251,9 +1302,12 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
// 文本内容 // 文本内容
TextView tv = new TextView(mContext); TextView tv = new TextView(mContext);
tv.setText(label + value); tv.setText(label + value);
tv.setTextSize(14);
tv.setTextColor(Color.parseColor("#333333")); tv.setTextSize(12);
tv.setTextColor(Color.parseColor("#ff1d2129"));
tv.setPadding(dp2px(6), 0, 0, 0); tv.setPadding(dp2px(6), 0, 0, 0);
LinearLayout.LayoutParams tvParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f); LinearLayout.LayoutParams tvParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f);
@@ -1266,23 +1320,6 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
return tv; // 返回TextView以便后续更新内容 return tv; // 返回TextView以便后续更新内容
} }
// 过载一个不需要weight的方法给第一行使用
private TextView createInfoItem(LinearLayout parent, int iconRes, String label, String value) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ImageView iv = new ImageView(mContext);
iv.setImageResource(iconRes);
iv.setColorFilter(Color.parseColor("#017143"));
parent.addView(iv, new LinearLayout.LayoutParams(dp2px(18), dp2px(18)));
TextView tv = new TextView(mContext);
tv.setTextSize(14);
tv.setTextColor(Color.parseColor("#333333"));
tv.setPadding(dp2px(6), 0, 0, 0);
parent.addView(tv, params);
return tv;
}
// 创建模式菜单视图 // 创建模式菜单视图
private View createModeMenu(Context context) { private View createModeMenu(Context context) {
@@ -1305,9 +1342,9 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
TextView item3 = createMenuItem(context, "加氢规划模式", true); TextView item3 = createMenuItem(context, "加氢规划模式", true);
item3.setOnClickListener(v -> switchMode("加氢规划")); item3.setOnClickListener(v -> switchMode("加氢规划"));
menu.addView(item1);
menu.addView(item2);
menu.addView(item3); menu.addView(item3);
menu.addView(item2);
menu.addView(item1);
return menu; return menu;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,40 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M8,14.667C10.946,14.667 13.333,12.496 13.333,9.818C13.333,7.192 11.556,4.364 8,1.333C4.444,4.364 2.667,7.192 2.667,9.818C2.667,12.496 5.054,14.667 8,14.667Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"/>
<path
android:strokeWidth="1"
android:pathData="M6.286,6.333L8,8.123L9.714,6.333"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M6,8.719H10"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M6,10.509H10"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M8,8.719V12"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 781 B

View File

@@ -0,0 +1,41 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M3.667,1.375L2,13.375"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M12.333,1.375L13.988,13.36"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M8,1.375V3.375"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M8,11.042V13.375"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M8,6.042V8.375"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
</vector>

View File

@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group>
<clip-path
android:pathData="M0,0h24v24h-24z"/>
<path
android:pathData="M6.518,10.241C4.181,10.241 2.29,12.135 2.29,14.469C2.29,16.804 6.518,21.684 6.518,21.684C6.518,21.684 10.746,16.806 10.746,14.469C10.746,12.133 8.853,10.241 6.518,10.241ZM6.518,15.616C5.853,15.616 5.313,15.077 5.313,14.411C5.313,13.745 5.853,13.206 6.518,13.206C7.184,13.206 7.723,13.745 7.723,14.411C7.723,15.077 7.181,15.616 6.518,15.616ZM19.676,2.301C18.567,2.301 17.67,3.198 17.67,4.307C17.67,5.416 19.676,7.729 19.676,7.729C19.676,7.729 21.682,5.416 21.682,4.307C21.682,3.198 20.785,2.301 19.676,2.301ZM19.676,4.851C19.36,4.851 19.104,4.595 19.104,4.279C19.104,3.963 19.36,3.707 19.676,3.707C19.992,3.707 20.248,3.963 20.248,4.279C20.246,4.595 19.99,4.851 19.676,4.851ZM18.026,13.185C17.386,12.813 16.629,12.674 15.898,12.538C14.845,12.344 14.196,12.191 14.074,11.72C14.051,11.627 14.037,11.493 14.156,11.291C14.325,11.005 14.855,10.422 16.519,9.735C16.993,9.539 17.449,9.382 17.801,9.27C18.168,9.153 18.393,8.768 18.296,8.395C18.199,8.019 17.812,7.792 17.442,7.909C17.056,8.03 16.543,8.205 15.999,8.43C14.431,9.074 13.404,9.798 12.945,10.579C12.663,11.057 12.584,11.575 12.713,12.077C12.877,12.709 13.303,13.185 13.978,13.485C14.482,13.71 15.073,13.818 15.642,13.923C16.256,14.036 16.889,14.153 17.318,14.402C17.597,14.563 17.888,14.819 17.916,15.487C17.958,16.427 16.88,17.448 14.881,18.367C13.833,18.848 12.764,19.192 12.099,19.385C11.729,19.493 11.5,19.869 11.589,20.244C11.68,20.625 12.064,20.86 12.441,20.752C13.144,20.55 14.295,20.183 15.45,19.654C16.547,19.152 17.424,18.606 18.054,18.032C18.938,17.228 19.364,16.349 19.322,15.426C19.278,14.413 18.842,13.661 18.026,13.185Z"
android:fillColor="#ffffff"/>
</group>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

View File

@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M8,6.042C9.289,6.042 10.333,4.997 10.333,3.708C10.333,2.42 9.289,1.375 8,1.375C6.711,1.375 5.667,2.42 5.667,3.708C5.667,4.997 6.711,6.042 8,6.042Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M2,12.975V13.375H14V12.975C14,11.481 14,10.735 13.709,10.164C13.454,9.663 13.046,9.255 12.544,8.999C11.974,8.708 11.227,8.708 9.733,8.708H6.267C4.773,8.708 4.026,8.708 3.456,8.999C2.954,9.255 2.546,9.663 2.291,10.164C2,10.735 2,11.481 2,12.975Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M5.665,1.937C5.908,1.937 6.131,2.068 6.248,2.28L7.064,3.749C7.171,3.941 7.176,4.174 7.077,4.371L6.292,5.942C6.292,5.942 6.519,7.112 7.472,8.065C8.425,9.018 9.591,9.242 9.591,9.242L11.162,8.456C11.359,8.358 11.592,8.363 11.785,8.47L13.258,9.289C13.469,9.407 13.6,9.63 13.6,9.872V11.563C13.6,12.424 12.8,13.046 11.984,12.771C10.308,12.205 7.707,11.128 6.058,9.479C4.409,7.831 3.332,5.229 2.767,3.553C2.491,2.737 3.113,1.937 3.975,1.937H5.665Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,40 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M8,14.042C11.682,14.042 14.667,11.057 14.667,7.375C14.667,3.693 11.682,0.708 8,0.708C4.318,0.708 1.333,3.693 1.333,7.375C1.333,11.057 4.318,14.042 8,14.042Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"/>
<path
android:strokeWidth="1"
android:pathData="M6,6.708H10"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M6,8.708H10"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M8.003,6.708V10.708"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M10,4.375L8,6.375L6,4.375"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
</vector>

View File

@@ -0,0 +1,26 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:viewportWidth="18"
android:viewportHeight="18">
<path
android:strokeWidth="1"
android:pathData="M7.875,14.5C11.396,14.5 14.25,11.646 14.25,8.125C14.25,4.604 11.396,1.75 7.875,1.75C4.354,1.75 1.5,4.604 1.5,8.125C1.5,11.646 4.354,14.5 7.875,14.5Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#4E5969"/>
<path
android:strokeWidth="1"
android:pathData="M9.997,5.629C9.454,5.086 8.704,4.75 7.875,4.75C7.047,4.75 6.297,5.086 5.754,5.629"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#4E5969"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M12.458,12.707L15.64,15.889"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#4E5969"
android:strokeLineCap="round"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M8,14.042C11.682,14.042 14.667,11.057 14.667,7.375C14.667,3.693 11.682,0.708 8,0.708C4.318,0.708 1.333,3.693 1.333,7.375C1.333,11.057 4.318,14.042 8,14.042Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"/>
<path
android:strokeWidth="1"
android:pathData="M8.003,3.375L8.003,7.378L10.829,10.204"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

View File

@@ -0,0 +1,37 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:strokeWidth="1"
android:pathData="M1.333,2.042H3.667C3.667,2.042 4,3.708 5.667,3.708C7.333,3.708 7.667,2.042 7.667,2.042H14.667V12.708H7.667C7.667,12.708 7.333,11.042 5.667,11.042C4,11.042 3.667,12.708 3.667,12.708H1.333V2.042Z"
android:strokeLineJoin="round"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M5.667,5.708V6.375"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M5.667,8.375V9.042"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M8.333,6.375H12"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
<path
android:strokeWidth="1"
android:pathData="M8.333,8.375H12"
android:fillColor="#00000000"
android:strokeColor="#017137"
android:strokeLineCap="round"/>
</vector>

View File

@@ -27,23 +27,15 @@
#pragma mark - url #pragma mark - url
///获取站点列表 ///获取站点列表
#define kGetStationListUrl @"https://beta-esg.api.lnh2e.com/appointment/station/getNearbyHydrogenStationsByLocation" #define kGetStationListUrl @"http://47.101.201.13:8443/api/appointment/station/getNearbyHydrogenStationsByLocation"
///单个站点详情 ///单个站点详情
#define kGetStationDetailtUrl @"https://beta-esg.api.lnh2e.com/appointment/station/getStationInfoByArea" #define kGetStationDetailtUrl @"http://47.101.201.13:8443/api/appointment/station/getStationInfoByArea"
///获取途经点 ///获取途经点
/**
请求方式post 暂时调不通
{
   "longitude":"121.254139",
    "latitude":"31.214628",
    "plateNumber":"浙F32111F",
"hydrogenSiteId":""//加氢站DI }
*/ #define kGetRoutePointtUrl @"http://47.101.201.13:8443/api/appointment/truck/truckRouteAlgorithm"
#define kGetRoutePointtUrl @"https://beta-esg.api.lnh2e.com/appointment/truck/truckRouteAlgorithm"
#import "ANavPointModel.h" #import "ANavPointModel.h"

View File

@@ -74,6 +74,8 @@
/// ///
@property (nonatomic, weak) UIButton *addHBtn; @property (nonatomic, weak) UIButton *addHBtn;
@property (nonatomic ,strong)MAAnnotationView * currAnnotionView;
@end @end
@implementation ARoutePlaneController @implementation ARoutePlaneController
@@ -179,6 +181,9 @@
dic2[@"plateNumber"] = carNo; dic2[@"plateNumber"] = carNo;
dic2[@"hydrogenSiteId"] = [NSString stringWithFormat:@"%@" , self.pointModel.stationID]; dic2[@"hydrogenSiteId"] = [NSString stringWithFormat:@"%@" , self.pointModel.stationID];
NSLog(@"🔍 Route API Request Params: %@", dic2);
NSLog(@"🔍 Request URL: %@", kGetRoutePointtUrl);
NSDictionary * headDic = @{ NSDictionary * headDic = @{
@"Content-Type":@"application/json; charset=UTF-8", @"Content-Type":@"application/json; charset=UTF-8",
@"asoco-token" : token @"asoco-token" : token
@@ -191,9 +196,16 @@
NSString * url = kGetRoutePointtUrl; NSString * url = kGetRoutePointtUrl;
[AMapNavHttpUtil postRequestWithURL:url parameters:dic2 requestHeader:headDic successHandler:^(NSDictionary * _Nonnull data, NSURLResponse * _Nonnull response) { [AMapNavHttpUtil postRequestWithURL:url parameters:dic2 requestHeader:headDic successHandler:^(NSDictionary * _Nonnull data, NSURLResponse * _Nonnull response) {
NSLog(@"🔍 Route API Response: %@", data);
ATripCalcResponse * resp = [ATripCalcResponse mj_objectWithKeyValues:data]; ATripCalcResponse * resp = [ATripCalcResponse mj_objectWithKeyValues:data];
NSLog(@"🔍 Parsed resp.code: %ld", (long)resp.code);
NSLog(@"🔍 Parsed resp.data: %@", resp.data);
if (resp.code == 200 && resp.data) { if (resp.code == 200 && resp.data) {
self.tjdPathInfoModel = resp.data; self.tjdPathInfoModel = resp.data;
NSLog(@"🔍 Parsed algorithmPath: %@", self.tjdPathInfoModel.algorithmPath);
NSLog(@"🔍 Parsed hydrogenCost: %@", self.tjdPathInfoModel.algorithmPath.hydrogenCost);
if (blk) { if (blk) {
blk(resp.data); blk(resp.data);
@@ -285,7 +297,8 @@
[bottomBar mas_makeConstraints:^(MASConstraintMaker *make) { [bottomBar mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view); make.left.right.equalTo(self.view);
make.bottom.equalTo(self.view).offset(-AMP_TabbarHeight - 10); // make.bottom.equalTo(self.view).offset(-AMP_TabbarHeight - 13);
make.bottom.equalTo(self.view).offset(0);
}]; }];
// startTf / dstTf // startTf / dstTf
@@ -426,7 +439,7 @@
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(self.latitude, self.longitude); CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(self.latitude, self.longitude);
[_mapView setCenterCoordinate:coord animated:YES]; [_mapView setCenterCoordinate:coord animated:YES];
// [_mapView setZoomLevel:10 animated:YES]; [_mapView setZoomLevel:15.0 animated:YES];
} else { } else {
// //
[_mapView setUserTrackingMode:MAUserTrackingModeFollow animated:YES]; [_mapView setUserTrackingMode:MAUserTrackingModeFollow animated:YES];
@@ -1018,6 +1031,7 @@
} }
- (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view { - (void)mapView:(MAMapView *)mapView didSelectAnnotationView:(MAAnnotationView *)view {
self.currAnnotionView = view;
id pointAnnotation = view.annotation; id pointAnnotation = view.annotation;
if ([pointAnnotation isMemberOfClass:ACustomPointAnnotation.class]) { if ([pointAnnotation isMemberOfClass:ACustomPointAnnotation.class]) {
@@ -1041,6 +1055,7 @@
// //
// self.bottomBarView.destinationText = aoi.name; // self.bottomBarView.destinationText = aoi.name;
self.bottomBarView.destinationText = nil;
} }
} }
@@ -1052,6 +1067,7 @@
self.dstPoi = nil; self.dstPoi = nil;
self.dstTf.text = nil; self.dstTf.text = nil;
self.bottomBarView.destinationText = nil; self.bottomBarView.destinationText = nil;
self.currAnnotionView = nil;
} }
} }
@@ -1146,6 +1162,8 @@
self.stationDetailPopup.pointModel = navPoint; self.stationDetailPopup.pointModel = navPoint;
/// ///
NSLog(@"🔍 Debug algorithmPath: %@", self.tjdPathInfoModel.algorithmPath);
NSLog(@"🔍 Debug hydrogenCost: %@", self.tjdPathInfoModel.algorithmPath.hydrogenCost);
self.stationDetailPopup.estimatedCost = self.tjdPathInfoModel.algorithmPath.hydrogenCost; self.stationDetailPopup.estimatedCost = self.tjdPathInfoModel.algorithmPath.hydrogenCost;
/// ///
self.stationDetailPopup.estimatedTime = [NSString stringWithFormat:@"%.f" , self.tjdPathInfoModel.pathDto.duration / 60.0]; self.stationDetailPopup.estimatedTime = [NSString stringWithFormat:@"%.f" , self.tjdPathInfoModel.pathDto.duration / 60.0];
@@ -1199,6 +1217,10 @@
#pragma mark - ABottomBarViewDelegate #pragma mark - ABottomBarViewDelegate
- (void)bottomBarViewDidTapCalRoute:(ABottomBarView *)barView { - (void)bottomBarViewDidTapCalRoute:(ABottomBarView *)barView {
if (self.currAnnotionView) {
[self.mapView deselectAnnotation:self.currAnnotionView.annotation animated:NO];
self.currAnnotionView = nil;
}
// //
[self willRequestTJDInfo]; [self willRequestTJDInfo];
@@ -1209,6 +1231,11 @@
/// ///
self.tjdPathInfoModel = nil; self.tjdPathInfoModel = nil;
if (self.currAnnotionView) {
[self.mapView deselectAnnotation:self.currAnnotionView.annotation animated:NO];
self.currAnnotionView = nil;
}
// //
ASearchAddressController *vc = [[ASearchAddressController alloc] init]; ASearchAddressController *vc = [[ASearchAddressController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];

View File

@@ -70,8 +70,9 @@
[inputAddressTf mas_makeConstraints:^(MASConstraintMaker *make) { [inputAddressTf mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view).offset(10); make.left.mas_equalTo(self.view).offset(10);
make.right.mas_equalTo(self.view).offset(-10);
make.top.mas_equalTo(self.view).offset(kRoutePlanBarHeight + 10); make.top.mas_equalTo(self.view).offset(kRoutePlanBarHeight + 10);
make.height.mas_equalTo(@30); make.height.mas_equalTo(@35);
}]; }];
self.inputAddressTf = inputAddressTf; self.inputAddressTf = inputAddressTf;
@@ -192,25 +193,7 @@
return; return;
} }
AMapPOIKeywordsSearchRequest *request = [[AMapPOIKeywordsSearchRequest alloc] init]; [self requestAddressWithAddress:addr atPage:1];
request.keywords = addr;
AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager];
request.city = sdk.localCity;
// request.types = @"高等院校";
// request.requireExtension = YES;
request.offset =20;
request.page = 1;
/* SDK 3.2.0 POI*/
request.cityLimit = YES;
// request.requireSubPOIs = YES;
[self.search AMapPOIKeywordsSearch:request];
} }
@@ -220,7 +203,7 @@
request.keywords = addr; request.keywords = addr;
AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager]; AMapNavSDKManager * sdk = [AMapNavSDKManager sharedManager];
request.city = sdk.localCity; // request.city = sdk.localCity;
// request.types = @"高等院校"; // request.types = @"高等院校";
@@ -229,7 +212,7 @@
request.page = page; request.page = page;
/* SDK 3.2.0 POI*/ /* SDK 3.2.0 POI*/
request.cityLimit = YES; // request.cityLimit = YES;
// request.requireSubPOIs = YES; // request.requireSubPOIs = YES;

View File

@@ -173,7 +173,7 @@ static inline UIColor *ABottomBarThemeGreen(void) {
make.left.equalTo(card).offset(16); make.left.equalTo(card).offset(16);
make.right.equalTo(card).offset(-16); make.right.equalTo(card).offset(-16);
make.height.mas_equalTo(48); make.height.mas_equalTo(48);
make.bottom.equalTo(card).offset(-40); make.bottom.equalTo(card).offset(-40 + (-AMP_TabbarHeight - 13));
}]; }];
} }

View File

@@ -68,9 +68,6 @@ static inline UIColor *AStationThemeGreen(void) {
@property (nonatomic, strong) UIImageView *phoneIconView; @property (nonatomic, strong) UIImageView *phoneIconView;
@property (nonatomic, strong) UILabel *phoneLabel; @property (nonatomic, strong) UILabel *phoneLabel;
/// bottom constraint
@property (nonatomic, strong) MASConstraint *cardBottomConstraint;
@end @end
@implementation AStationDetailPopupView @implementation AStationDetailPopupView
@@ -81,277 +78,43 @@ static inline UIColor *AStationThemeGreen(void) {
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
self.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor clearColor];
[self _buildUI]; [self setupUI];
[self _setupMasonryConstraints];
[self _updateUI];
} }
return self; return self;
} }
#pragma mark - Public #pragma mark - Setup UI
- (void)showInView:(UIView *)parentView { - (void)setupUI {
self.alpha = 0; [self addSubview:self.maskControl];
self.maskControl.alpha = 0; [self.cardView addSubview:self.closeButton];
[parentView addSubview:self]; [self.cardView addSubview:self.stationNameLabel];
[self mas_remakeConstraints:^(MASConstraintMaker *make) { [self.cardView addSubview:self.costLabel];
// make.edges.equalTo(parentView); [self.cardView addSubview:self.businessHoursLabel];
make.top.left.right.equalTo(parentView); [self.cardView addSubview:self.addressLabel];
make.bottom.equalTo(parentView).offset((-AMP_TabbarSafeBottomMargin - 35)); [self.cardView addSubview:self.costIconView];
}]; [self.cardView addSubview:self.separator];
[self _playShowAnimation]; [self.cardView addSubview:self.timeIconView];
} [self.cardView addSubview:self.timeLabel];
[self.cardView addSubview:self.distanceIconView];
[self.cardView addSubview:self.distanceLabel];
[self.cardView addSubview:self.tollIconView];
[self.cardView addSubview:self.tollLabel];
[self.cardView addSubview:self.contactPersonIconView];
[self.cardView addSubview:self.contactPersonLabel];
[self.cardView addSubview:self.priceIconView];
[self.cardView addSubview:self.priceLabel];
[self.cardView addSubview:self.phoneIconView];
[self.cardView addSubview:self.phoneLabel];
[self.cardView addSubview:self.startNaviButton];
- (void)hide { [self setupConstraints];
[self hideWithCompletion:nil]; [self updateUI];
}
- (void)hideWithCompletion:(void(^)(void))completion {
[self _playDismissAnimationWithCompletion:^{
[self removeFromSuperview];
if (completion) {
completion();
}
}];
}
#pragma mark - Setter Override
- (void)setPointModel:(ANavPointModel *)pointModel {
_pointModel = pointModel;
[self _updateUI];
}
- (void)setEstimatedCost:(NSString *)estimatedCost {
_estimatedCost = [estimatedCost copy];
[self _updateUI];
}
- (void)setEstimatedTime:(NSString *)estimatedTime {
_estimatedTime = [estimatedTime copy];
[self _updateUI];
}
- (void)setDriveDistance:(NSString *)driveDistance {
_driveDistance = [driveDistance copy];
[self _updateUI];
}
- (void)setTollFee:(NSString *)tollFee {
_tollFee = [tollFee copy];
[self _updateUI];
}
- (void)setBusinessHours:(NSString *)businessHours {
_businessHours = [businessHours copy];
[self _updateUI];
}
- (void)setContactName:(NSString *)contactName {
_contactName = [contactName copy];
[self _updateUI];
}
- (void)setContactPhone:(NSString *)contactPhone {
_contactPhone = [contactPhone copy];
[self _updateUI];
}
- (void)setHydrogenPrice:(NSString *)hydrogenPrice {
_hydrogenPrice = [hydrogenPrice copy];
[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 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 addSubview:card];
self.cardView = card;
//
UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[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;
UIColor *headTextColor = [UIColor hp_colorWithRGBHex:0x1D2129];
UIFont *headTextFont = [UIFont hp_pingFangMedium:14];
//
UILabel *nameLabel = [[UILabel alloc] init];
nameLabel.font = [UIFont hp_pingFangMedium:18];
nameLabel.textColor = headTextColor;
nameLabel.numberOfLines = 2;
nameLabel.minimumScaleFactor = 0.8;
[card addSubview:nameLabel];
self.stationNameLabel = nameLabel;
// 20pt
UILabel *costLabel = [[UILabel alloc] init];
costLabel.font = headTextFont;
costLabel.textColor = headTextColor;
costLabel.numberOfLines = 1;
costLabel.textAlignment = NSTextAlignmentLeft;
[card addSubview:costLabel];
self.costLabel = costLabel;
// 4pt
UILabel *bizHoursLabel = [[UILabel alloc] init];
bizHoursLabel.font = [UIFont hp_pingFangRegular:14];
bizHoursLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
bizHoursLabel.numberOfLines = 1;
[card addSubview:bizHoursLabel];
self.businessHoursLabel = bizHoursLabel;
//
UILabel *addrLabel = [[UILabel alloc] init];
addrLabel.font = [UIFont hp_pingFangRegular:14];
addrLabel.textColor = [UIColor hp_colorWithRGBHex:0x86909C];
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:@"ic_time"];
[card addSubview:timeIcon];
self.timeIconView = timeIcon;
//
UILabel *timeLabel = [[UILabel alloc] init];
timeLabel.font = headTextFont;
timeLabel.textColor = headTextColor;
[card addSubview:timeLabel];
self.timeLabel = timeLabel;
//
UIImageView *distIcon = [[UIImageView alloc] init];
distIcon.contentMode = UIViewContentModeScaleAspectFit;
distIcon.image = [AMapNavCommonUtil imageWithName3x:@"ic_mileage"];
[card addSubview:distIcon];
self.distanceIconView = distIcon;
//
UILabel *distLabel = [[UILabel alloc] init];
distLabel.font = headTextFont;
distLabel.textColor = headTextColor;
[card addSubview:distLabel];
self.distanceLabel = distLabel;
//
UIImageView *tollIcon = [[UIImageView alloc] init];
tollIcon.contentMode = UIViewContentModeScaleAspectFit;
tollIcon.image = [AMapNavCommonUtil imageWithName3x:@"ic_toll"];
[card addSubview:tollIcon];
self.tollIconView = tollIcon;
//
UILabel *tollLabel = [[UILabel alloc] init];
tollLabel.font = headTextFont;
tollLabel.textColor = headTextColor;
[card addSubview:tollLabel];
self.tollLabel = tollLabel;
// &
UIImageView *personIcon = [[UIImageView alloc] init];
personIcon.contentMode = UIViewContentModeScaleAspectFit;
personIcon.image = [AMapNavCommonUtil imageWithName3x:@"ic_person"];
[card addSubview:personIcon];
self.contactPersonIconView = personIcon;
UILabel *personLabel = [[UILabel alloc] init];
personLabel.font = headTextFont;
personLabel.textColor = headTextColor;
[card addSubview:personLabel];
self.contactPersonLabel = personLabel;
// &
UIImageView *priceIcon = [[UIImageView alloc] init];
priceIcon.contentMode = UIViewContentModeScaleAspectFit;
priceIcon.image = [AMapNavCommonUtil imageWithName3x:@"ic_price"];
[card addSubview:priceIcon];
self.priceIconView = priceIcon;
UILabel *priceLabel = [[UILabel alloc] init];
priceLabel.font = headTextFont;
priceLabel.textColor = headTextColor;
[card addSubview:priceLabel];
self.priceLabel = priceLabel;
// &
UIImageView *phoneIcon = [[UIImageView alloc] init];
phoneIcon.contentMode = UIViewContentModeScaleAspectFit;
phoneIcon.image = [AMapNavCommonUtil imageWithName3x:@"ic_phone"];
[card addSubview:phoneIcon];
self.phoneIconView = phoneIcon;
UILabel *phoneLabel = [[UILabel alloc] init];
phoneLabel.font = headTextFont;
phoneLabel.textColor = headTextColor;
[card addSubview:phoneLabel];
self.phoneLabel = phoneLabel;
//
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 #pragma mark - Masonry Constraints
- (void)_setupMasonryConstraints { - (void)setupConstraints {
UIView *card = self.cardView; UIView *card = self.cardView;
CGFloat iconSize = 16; CGFloat iconSize = 16;
@@ -507,13 +270,85 @@ static inline UIColor *AStationThemeGreen(void) {
make.left.equalTo(card).offset(16); make.left.equalTo(card).offset(16);
make.right.equalTo(card).offset(-16); make.right.equalTo(card).offset(-16);
make.height.mas_equalTo(48); make.height.mas_equalTo(48);
make.bottom.equalTo(card).offset(-AMP_TabbarSafeBottomMargin); make.bottom.equalTo(card).offset(-AMP_TabbarSafeBottomMargin + (-AMP_TabbarHeight - 13));
}]; }];
} }
#pragma mark - Public
- (void)showInView:(UIView *)parentView {
self.alpha = 0;
self.maskControl.alpha = 0;
[parentView addSubview:self];
[self mas_remakeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(parentView);
}];
[self playShowAnimation];
}
- (void)hide {
[self hideWithCompletion:nil];
}
- (void)hideWithCompletion:(void(^)(void))completion {
[self playDismissAnimationWithCompletion:^{
[self removeFromSuperview];
if (completion) {
completion();
}
}];
}
#pragma mark - Setter Override
- (void)setPointModel:(ANavPointModel *)pointModel {
_pointModel = pointModel;
[self updateUI];
}
- (void)setEstimatedCost:(NSString *)estimatedCost {
_estimatedCost = [estimatedCost copy];
[self updateUI];
}
- (void)setEstimatedTime:(NSString *)estimatedTime {
_estimatedTime = [estimatedTime copy];
[self updateUI];
}
- (void)setDriveDistance:(NSString *)driveDistance {
_driveDistance = [driveDistance copy];
[self updateUI];
}
- (void)setTollFee:(NSString *)tollFee {
_tollFee = [tollFee copy];
[self updateUI];
}
- (void)setBusinessHours:(NSString *)businessHours {
_businessHours = [businessHours copy];
[self updateUI];
}
- (void)setContactName:(NSString *)contactName {
_contactName = [contactName copy];
[self updateUI];
}
- (void)setContactPhone:(NSString *)contactPhone {
_contactPhone = [contactPhone copy];
[self updateUI];
}
- (void)setHydrogenPrice:(NSString *)hydrogenPrice {
_hydrogenPrice = [hydrogenPrice copy];
[self updateUI];
}
#pragma mark - Data Update #pragma mark - Data Update
- (void)_updateUI { - (void)updateUI {
self.stationNameLabel.text = (self.pointModel.name.length > 0) self.stationNameLabel.text = (self.pointModel.name.length > 0)
? self.pointModel.name : @"-"; ? self.pointModel.name : @"-";
@@ -522,7 +357,7 @@ static inline UIColor *AStationThemeGreen(void) {
? [NSString stringWithFormat:@"营业时间:%@", self.businessHours] ? [NSString stringWithFormat:@"营业时间:%@", self.businessHours]
: @"营业时间:-"; : @"营业时间:-";
self.costLabel.text = (self.estimatedCost.length > 0) self.costLabel.text = ((self.estimatedCost.length > 0) && [self.estimatedCost doubleValue])
? [NSString stringWithFormat:@"预计加氢费用:%@元", self.estimatedCost] ? [NSString stringWithFormat:@"预计加氢费用:%@元", self.estimatedCost]
: @"预计加氢费用:-"; : @"预计加氢费用:-";
@@ -530,12 +365,12 @@ static inline UIColor *AStationThemeGreen(void) {
? self.pointModel.address : @"-"; ? self.pointModel.address : @"-";
// "-- 分钟" // "-- 分钟"
self.timeLabel.text = (self.estimatedTime.length > 0) self.timeLabel.text = ((self.estimatedTime.length > 0) && [self.estimatedTime doubleValue] > 0)
? [NSString stringWithFormat:@"预计时间:%@分钟", self.estimatedTime] ? [NSString stringWithFormat:@"预计时间:%@分钟", self.estimatedTime]
: @"预计时间:-"; : @"预计时间:-";
// "-- 公里" // "-- 公里"
self.distanceLabel.text = (self.driveDistance.length > 0) self.distanceLabel.text = ((self.driveDistance.length > 0) && [self.driveDistance doubleValue] > 0)
? [NSString stringWithFormat:@"行驶里程:%@公里", self.driveDistance] ? [NSString stringWithFormat:@"行驶里程:%@公里", self.driveDistance]
: @"行驶里程:-"; : @"行驶里程:-";
@@ -560,7 +395,6 @@ static inline UIColor *AStationThemeGreen(void) {
: @"联系方式:-"; : @"联系方式:-";
} }
// UI
- (void)resetUI { - (void)resetUI {
self.stationNameLabel.text = @"-"; self.stationNameLabel.text = @"-";
self.businessHoursLabel.text = @"营业时间:-"; self.businessHoursLabel.text = @"营业时间:-";
@@ -579,7 +413,7 @@ static inline UIColor *AStationThemeGreen(void) {
/** /**
*/ */
- (void)_playShowAnimation { - (void)playShowAnimation {
// //
[self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) { [self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self).offset(0); make.left.equalTo(self).offset(0);
@@ -593,7 +427,7 @@ static inline UIColor *AStationThemeGreen(void) {
[self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) { [self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self).offset(0); make.left.equalTo(self).offset(0);
make.right.equalTo(self).offset(-0); make.right.equalTo(self).offset(-0);
make.bottom.equalTo(self).offset(-AMP_TabbarSafeBottomMargin); make.bottom.equalTo(self).offset(0);
}]; }];
[UIView animateWithDuration:0.36 [UIView animateWithDuration:0.36
@@ -608,7 +442,7 @@ static inline UIColor *AStationThemeGreen(void) {
} completion:nil]; } completion:nil];
} }
- (void)_playDismissAnimationWithCompletion:(void(^)(void))completion { - (void)playDismissAnimationWithCompletion:(void(^)(void))completion {
[self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) { [self.cardView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self).offset(0); make.left.equalTo(self).offset(0);
make.right.equalTo(self).offset(-0); make.right.equalTo(self).offset(-0);
@@ -628,21 +462,21 @@ static inline UIColor *AStationThemeGreen(void) {
#pragma mark - Actions #pragma mark - Actions
- (void)_onMaskTapped { - (void)onMaskTapped {
if ([self.delegate respondsToSelector:@selector(stationDetailPopupViewDidTapClose:)]) { if ([self.delegate respondsToSelector:@selector(stationDetailPopupViewDidTapClose:)]) {
[self.delegate stationDetailPopupViewDidTapClose:self]; [self.delegate stationDetailPopupViewDidTapClose:self];
} }
[self hide]; [self hide];
} }
- (void)_onCloseTapped { - (void)onCloseTapped {
if ([self.delegate respondsToSelector:@selector(stationDetailPopupViewDidTapClose:)]) { if ([self.delegate respondsToSelector:@selector(stationDetailPopupViewDidTapClose:)]) {
[self.delegate stationDetailPopupViewDidTapClose:self]; [self.delegate stationDetailPopupViewDidTapClose:self];
} }
[self hide]; [self hide];
} }
- (void)_onStartNaviTapped { - (void)onStartNaviTapped {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[self hideWithCompletion:^{ [self hideWithCompletion:^{
__strong typeof(weakSelf) strongSelf = weakSelf; __strong typeof(weakSelf) strongSelf = weakSelf;
@@ -652,4 +486,222 @@ static inline UIColor *AStationThemeGreen(void) {
}]; }];
} }
#pragma mark - Lazy Load
- (UIControl *)maskControl {
if (!_maskControl) {
_maskControl = [[UIControl alloc] init];
_maskControl.backgroundColor = [UIColor colorWithWhite:0 alpha:0];
[_maskControl addTarget:self action:@selector(onMaskTapped) forControlEvents:UIControlEventTouchUpInside];
}
return _maskControl;
}
- (UIView *)cardView {
if (!_cardView) {
_cardView = [[UIView alloc] init];
_cardView.backgroundColor = [UIColor whiteColor];
_cardView.layer.cornerRadius = 16;
_cardView.layer.masksToBounds = NO;
_cardView.layer.shadowColor = [UIColor blackColor].CGColor;
_cardView.layer.shadowOpacity = 0.15;
_cardView.layer.shadowRadius = 12;
_cardView.layer.shadowOffset = CGSizeMake(0, -4);
[self addSubview:_cardView];
}
return _cardView;
}
- (UIButton *)closeButton {
if (!_closeButton) {
_closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_closeButton setImage:[AMapNavCommonUtil imageWithName:@"icon_close"] forState:UIControlStateNormal];
[_closeButton setTitleColor:[UIColor colorWithWhite:0.5 alpha:1] forState:UIControlStateNormal];
_closeButton.titleLabel.font = [UIFont systemFontOfSize:16];
[_closeButton addTarget:self action:@selector(onCloseTapped) forControlEvents:UIControlEventTouchUpInside];
}
return _closeButton;
}
- (UILabel *)stationNameLabel {
if (!_stationNameLabel) {
_stationNameLabel = [[UILabel alloc] init];
_stationNameLabel.font = [UIFont hp_pingFangMedium:18];
_stationNameLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
_stationNameLabel.numberOfLines = 2;
_stationNameLabel.minimumScaleFactor = 0.8;
}
return _stationNameLabel;
}
- (UILabel *)costLabel {
if (!_costLabel) {
_costLabel = [[UILabel alloc] init];
_costLabel.font = [UIFont hp_pingFangMedium:14];
_costLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
_costLabel.numberOfLines = 1;
_costLabel.textAlignment = NSTextAlignmentLeft;
}
return _costLabel;
}
- (UILabel *)businessHoursLabel {
if (!_businessHoursLabel) {
_businessHoursLabel = [[UILabel alloc] init];
_businessHoursLabel.font = [UIFont hp_pingFangRegular:14];
_businessHoursLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
_businessHoursLabel.numberOfLines = 1;
}
return _businessHoursLabel;
}
- (UILabel *)addressLabel {
if (!_addressLabel) {
_addressLabel = [[UILabel alloc] init];
_addressLabel.font = [UIFont hp_pingFangRegular:14];
_addressLabel.textColor = [UIColor hp_colorWithRGBHex:0x86909C];
_addressLabel.numberOfLines = 2;
}
return _addressLabel;
}
- (UIImageView *)costIconView {
if (!_costIconView) {
_costIconView = [[UIImageView alloc] init];
_costIconView.contentMode = UIViewContentModeScaleAspectFit;
_costIconView.image = [AMapNavCommonUtil imageWithName3x:@"ic_fuel"];
}
return _costIconView;
}
- (UIView *)separator {
if (!_separator) {
_separator = [[UIView alloc] init];
_separator.backgroundColor = [UIColor colorWithWhite:0.88 alpha:1];
_separator.hidden = YES;
}
return _separator;
}
- (UIImageView *)timeIconView {
if (!_timeIconView) {
_timeIconView = [[UIImageView alloc] init];
_timeIconView.contentMode = UIViewContentModeScaleAspectFit;
_timeIconView.image = [AMapNavCommonUtil imageWithName3x:@"ic_time"];
}
return _timeIconView;
}
- (UILabel *)timeLabel {
if (!_timeLabel) {
_timeLabel = [[UILabel alloc] init];
_timeLabel.font = [UIFont hp_pingFangMedium:14];
_timeLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
}
return _timeLabel;
}
- (UIImageView *)distanceIconView {
if (!_distanceIconView) {
_distanceIconView = [[UIImageView alloc] init];
_distanceIconView.contentMode = UIViewContentModeScaleAspectFit;
_distanceIconView.image = [AMapNavCommonUtil imageWithName3x:@"ic_mileage"];
}
return _distanceIconView;
}
- (UILabel *)distanceLabel {
if (!_distanceLabel) {
_distanceLabel = [[UILabel alloc] init];
_distanceLabel.font = [UIFont hp_pingFangMedium:14];
_distanceLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
}
return _distanceLabel;
}
- (UIImageView *)tollIconView {
if (!_tollIconView) {
_tollIconView = [[UIImageView alloc] init];
_tollIconView.contentMode = UIViewContentModeScaleAspectFit;
_tollIconView.image = [AMapNavCommonUtil imageWithName3x:@"ic_toll"];
}
return _tollIconView;
}
- (UILabel *)tollLabel {
if (!_tollLabel) {
_tollLabel = [[UILabel alloc] init];
_tollLabel.font = [UIFont hp_pingFangMedium:14];
_tollLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
}
return _tollLabel;
}
- (UIImageView *)contactPersonIconView {
if (!_contactPersonIconView) {
_contactPersonIconView = [[UIImageView alloc] init];
_contactPersonIconView.contentMode = UIViewContentModeScaleAspectFit;
_contactPersonIconView.image = [AMapNavCommonUtil imageWithName3x:@"ic_person"];
}
return _contactPersonIconView;
}
- (UILabel *)contactPersonLabel {
if (!_contactPersonLabel) {
_contactPersonLabel = [[UILabel alloc] init];
_contactPersonLabel.font = [UIFont hp_pingFangMedium:14];
_contactPersonLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
}
return _contactPersonLabel;
}
- (UIImageView *)priceIconView {
if (!_priceIconView) {
_priceIconView = [[UIImageView alloc] init];
_priceIconView.contentMode = UIViewContentModeScaleAspectFit;
_priceIconView.image = [AMapNavCommonUtil imageWithName3x:@"ic_price"];
}
return _priceIconView;
}
- (UILabel *)priceLabel {
if (!_priceLabel) {
_priceLabel = [[UILabel alloc] init];
_priceLabel.font = [UIFont hp_pingFangMedium:14];
_priceLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
}
return _priceLabel;
}
- (UIImageView *)phoneIconView {
if (!_phoneIconView) {
_phoneIconView = [[UIImageView alloc] init];
_phoneIconView.contentMode = UIViewContentModeScaleAspectFit;
_phoneIconView.image = [AMapNavCommonUtil imageWithName3x:@"ic_phone"];
}
return _phoneIconView;
}
- (UILabel *)phoneLabel {
if (!_phoneLabel) {
_phoneLabel = [[UILabel alloc] init];
_phoneLabel.font = [UIFont hp_pingFangMedium:14];
_phoneLabel.textColor = [UIColor hp_colorWithRGBHex:0x1D2129];
}
return _phoneLabel;
}
- (UIButton *)startNaviButton {
if (!_startNaviButton) {
_startNaviButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_startNaviButton setTitle:@"开始导航" forState:UIControlStateNormal];
[_startNaviButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_startNaviButton.titleLabel.font = [UIFont boldSystemFontOfSize:17];
_startNaviButton.backgroundColor = AStationThemeGreen();
_startNaviButton.layer.cornerRadius = 24;
[_startNaviButton addTarget:self action:@selector(onStartNaviTapped) forControlEvents:UIControlEventTouchUpInside];
}
return _startNaviButton;
}
@end @end

View File

@@ -80,5 +80,22 @@
</array> </array>
<key>uses</key> <key>uses</key>
<string></string> <string></string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>47.101.201.13</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
</dict>
</dict>
</dict> </dict>
</plist> </plist>

View File

@@ -8,11 +8,11 @@ class AppTheme {
static const Color themeColor = Color(0xFF017137); static const Color themeColor = Color(0xFF017137);
//是否开放域名切换 //是否开放域名切换
static const bool is_show_host = true; static const bool is_show_host = false;
//http://192.168.110.222:8080/ //http://192.168.110.222:8080/
//http://192.168.110.44:8080/ //http://192.168.110.44:8080/
static String test_service_url = "https://beta-esg.api.lnh2e.com/"; static String test_service_url = "http://47.101.201.13:8443/api/";
static const String release_service_url = ""; static const String release_service_url = "";
//加氢站相关查询 //加氢站相关查询

View File

@@ -17,7 +17,7 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
WidgetsBinding widgetsBinding = await init( WidgetsBinding widgetsBinding = await init(
isDebug: true, isDebug: false,
logTag: '小羚羚', logTag: '小羚羚',
supportedLocales: [const Locale('zh', 'CN')], supportedLocales: [const Locale('zh', 'CN')],
); );
@@ -35,7 +35,7 @@ void main() async {
// 设计稿尺寸 单位dp // 设计稿尺寸 单位dp
designSize: const Size(390, 844), designSize: const Size(390, 844),
// Getx Log // Getx Log
enableLog: true, enableLog: false,
// 默认的跳转动画 // 默认的跳转动画
defaultTransition: Transition.rightToLeft, defaultTransition: Transition.rightToLeft,
// 主题模式 // 主题模式

View File

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.2.4+7 version: 1.2.5+8
environment: environment:
sdk: ^3.9.0 sdk: ^3.9.0