问题修改
This commit is contained in:
@@ -122,17 +122,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* --- 调整比例尺位置 --- */
|
/* --- 调整比例尺位置 --- */
|
||||||
.amap-scalecontrol {
|
.amap-scalecontrol {
|
||||||
/* 初始状态:避开底部的定位按钮或留出安全间距 */
|
/* 初始状态:避开底部的定位按钮或留出安全间距 */
|
||||||
bottom: 80px !important;
|
bottom: 80px !important;
|
||||||
left: 10px !important;
|
left: 10px !important;
|
||||||
transition: bottom 0.3s ease; /* 增加平滑动画 */
|
transition: bottom 0.3s ease;
|
||||||
}
|
/* 增加平滑动画 */
|
||||||
|
}
|
||||||
|
|
||||||
/* --- 当路径规划面板显示时,比例尺自动上移 --- */
|
/* --- 当路径规划面板显示时,比例尺自动上移 --- */
|
||||||
body.panel-active .amap-scalecontrol {
|
body.panel-active .amap-scalecontrol {
|
||||||
bottom: 38% !important; /* 移动到面板上方 (面板高度35% + 3%间距) */
|
bottom: 38% !important;
|
||||||
}
|
/* 移动到面板上方 (面板高度35% + 3%间距) */
|
||||||
|
}
|
||||||
|
|
||||||
/* --- 关键:当 body 有 panel-active 类时,按钮上移 --- */
|
/* --- 关键:当 body 有 panel-active 类时,按钮上移 --- */
|
||||||
body.panel-active #location-btn {
|
body.panel-active #location-btn {
|
||||||
@@ -180,7 +182,7 @@ body.panel-active .amap-scalecontrol {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var map, marker, destMarker,driving, truckDriving, geocoder;
|
var map, marker, destMarker, driving, truckDriving, geocoder;
|
||||||
var currentLat, currentLng;
|
var currentLat, currentLng;
|
||||||
var isTruckMode = false;
|
var isTruckMode = false;
|
||||||
var isInitialLocationSet = false;
|
var isInitialLocationSet = false;
|
||||||
@@ -297,7 +299,7 @@ body.panel-active .amap-scalecontrol {
|
|||||||
|
|
||||||
console.log("地理:" + JSON.stringify(result));
|
console.log("地理:" + JSON.stringify(result));
|
||||||
fetchStationInfo(addressComponent.province, addressComponent.city,
|
fetchStationInfo(addressComponent.province, addressComponent.city,
|
||||||
addressComponent.district,lat,lng);
|
addressComponent.district, lat, lng);
|
||||||
|
|
||||||
// 策略1: 优先使用最近的、类型合适的POI的名称
|
// 策略1: 优先使用最近的、类型合适的POI的名称
|
||||||
if (pois && pois.length > 0) {
|
if (pois && pois.length > 0) {
|
||||||
@@ -351,7 +353,7 @@ body.panel-active .amap-scalecontrol {
|
|||||||
/**
|
/**
|
||||||
* 调用后端接口获取站点
|
* 调用后端接口获取站点
|
||||||
*/
|
*/
|
||||||
function fetchStationInfo(province, city, district,lat,lng) {
|
function fetchStationInfo(province, city, district, lat, lng) {
|
||||||
// 注意:某些直辖市在高德中 city 字段可能为空,需做兼容处理
|
// 注意:某些直辖市在高德中 city 字段可能为空,需做兼容处理
|
||||||
console.log("JS->: 开始请求." + province + city + district);
|
console.log("JS->: 开始请求." + province + city + district);
|
||||||
var cityName = (typeof city === 'string' && city.length > 0) ? city : province;
|
var cityName = (typeof city === 'string' && city.length > 0) ? city : province;
|
||||||
@@ -371,7 +373,6 @@ body.panel-active .amap-scalecontrol {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log("JS->: 网络状态码:", response.status);
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('网络响应错误: ' + response.status);
|
throw new Error('网络响应错误: ' + response.status);
|
||||||
}
|
}
|
||||||
@@ -388,7 +389,9 @@ body.panel-active .amap-scalecontrol {
|
|||||||
var destAddress = res.data.address;
|
var destAddress = res.data.address;
|
||||||
document.getElementById('endInput').value = destAddress;
|
document.getElementById('endInput').value = destAddress;
|
||||||
// 标记终点
|
// 标记终点
|
||||||
markDestination(destAddress, res.data.name || "目的地");
|
markDestination(destAddress, res.data.name || "目的地",
|
||||||
|
res.data.longitude, res.data.latitude
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log("JS->: 接口请求成功,但该区域暂无站点地址");
|
console.log("JS->: 接口请求成功,但该区域暂无站点地址");
|
||||||
}
|
}
|
||||||
@@ -402,10 +405,8 @@ body.panel-active .amap-scalecontrol {
|
|||||||
/**
|
/**
|
||||||
* 地理编码并在地图标记终点
|
* 地理编码并在地图标记终点
|
||||||
*/
|
*/
|
||||||
function markDestination(address, name) {
|
function markDestination(address, name, longitude, latitude) {
|
||||||
geocoder.getLocation(address, function (status, result) {
|
|
||||||
if (status === 'complete' && result.info === 'OK') {
|
|
||||||
var loc = result.geocodes[0].location;
|
|
||||||
|
|
||||||
// 1. 清除旧的终点标记
|
// 1. 清除旧的终点标记
|
||||||
if (destMarker) destMarker.setMap(null);
|
if (destMarker) destMarker.setMap(null);
|
||||||
@@ -421,7 +422,7 @@ body.panel-active .amap-scalecontrol {
|
|||||||
// 3. 创建标记
|
// 3. 创建标记
|
||||||
destMarker = new AMap.Marker({
|
destMarker = new AMap.Marker({
|
||||||
map: map,
|
map: map,
|
||||||
position: loc,
|
position: [longitude, latitude],
|
||||||
icon: destIcon, // 使用自定义图标
|
icon: destIcon, // 使用自定义图标
|
||||||
// 偏移量:如果图标底部中心是尖角,offset 设为宽的一半的负数,高度的负数
|
// 偏移量:如果图标底部中心是尖角,offset 设为宽的一半的负数,高度的负数
|
||||||
// 这样能确保图片的底部尖端指向地图上的精确位置
|
// 这样能确保图片的底部尖端指向地图上的精确位置
|
||||||
@@ -445,10 +446,6 @@ body.panel-active .amap-scalecontrol {
|
|||||||
// // 如果没有起点,直接跳到终点
|
// // 如果没有起点,直接跳到终点
|
||||||
// map.setCenter(loc);
|
// map.setCenter(loc);
|
||||||
// }
|
// }
|
||||||
} else {
|
|
||||||
console.error("JS->: 终点地址地理编码失败", address);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -70,5 +70,11 @@
|
|||||||
<string>fetch</string>
|
<string>fetch</string>
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
|
<key>CFBundleLocalizations</key>
|
||||||
|
<array>
|
||||||
|
<string>zh-Hans</string>
|
||||||
|
<string>en</string>
|
||||||
|
</array>
|
||||||
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
final reservationEndDateTime = DateTime(
|
DateTime reservationEndDateTime = DateTime(
|
||||||
selectedDate.value.year,
|
selectedDate.value.year,
|
||||||
selectedDate.value.month,
|
selectedDate.value.month,
|
||||||
selectedDate.value.day,
|
selectedDate.value.day,
|
||||||
@@ -352,7 +352,13 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
endTime.value.minute,
|
endTime.value.minute,
|
||||||
);
|
);
|
||||||
|
|
||||||
//判断预约区间的结束时间是否早于当前时间(留出1分钟缓冲)
|
// 如果结束的小时数小于开始的小时数,或者结束时间是 00:00,说明是次日
|
||||||
|
if (endTime.value.hour < startTime.value.hour ||
|
||||||
|
(endTime.value.hour == 0 && endTime.value.minute == 0)) {
|
||||||
|
reservationEndDateTime = reservationEndDateTime.add(const Duration(days: 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 执行时间检查
|
||||||
if (reservationEndDateTime.isBefore(
|
if (reservationEndDateTime.isBefore(
|
||||||
DateTime.now().subtract(const Duration(minutes: 1)),
|
DateTime.now().subtract(const Duration(minutes: 1)),
|
||||||
)) {
|
)) {
|
||||||
|
|||||||
@@ -147,12 +147,11 @@ class ReservationPage extends GetView<C_ReservationController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () async{
|
onPressed: () async {
|
||||||
var scanResult = await Get.to(() => const MessagePage());
|
var scanResult = await Get.to(() => const MessagePage());
|
||||||
if (scanResult == null) {
|
if (scanResult == null) {
|
||||||
controller.msgNotice();
|
controller.msgNotice();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
icon: Badge(
|
icon: Badge(
|
||||||
smallSize: 8,
|
smallSize: 8,
|
||||||
@@ -567,20 +566,24 @@ class ReservationPage extends GetView<C_ReservationController> {
|
|||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => _updateAmount(-1),
|
onPressed: () => _updateAmount(-1),
|
||||||
icon: Icon(Icons.remove, size: 14.sp, color: Colors.grey),
|
icon: Icon(Icons.remove, size: 14.sp, color: Colors.grey),
|
||||||
),
|
),
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Text(
|
||||||
"${controller.amountController.text}Kg",
|
"${controller.amountController.text}Kg",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
softWrap: false,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 11.sp,
|
fontSize: 11.sp,
|
||||||
color: Colors.black87,
|
color: Colors.black87,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => _updateAmount(1),
|
onPressed: () => _updateAmount(1),
|
||||||
icon: Icon(Icons.add, size: 14.sp, color: Colors.grey),
|
icon: Icon(Icons.add, size: 14.sp, color: Colors.grey),
|
||||||
|
|||||||
@@ -444,11 +444,18 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
data: {'account': account, 'password': encryptedPassword, 'loginType': "station"},
|
data: {'account': account, 'password': encryptedPassword, 'loginType': "station"},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (responseData != null && responseData.data != null) {
|
||||||
|
var result = BaseModel.fromJson(responseData.data);
|
||||||
|
if (result.code == 0) {
|
||||||
|
// 登录成功,处理记住密码逻辑
|
||||||
if (_rememberPassword) {
|
if (_rememberPassword) {
|
||||||
await StorageService.to.saveStationCredentials(account, password);
|
await StorageService.to.saveStationCredentials(account, password);
|
||||||
} else {
|
} else {
|
||||||
await StorageService.to.clearStationCredentials();
|
await StorageService.to.clearStationCredentials();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
_processLoginResponse(responseData, "station", account);
|
_processLoginResponse(responseData, "station", account);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -476,7 +483,6 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
|
|||||||
) async {
|
) async {
|
||||||
if (responseData == null || responseData.data == null) {
|
if (responseData == null || responseData.data == null) {
|
||||||
dismissLoading();
|
dismissLoading();
|
||||||
showToast('登录失败');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var result = BaseModel.fromJson(responseData.data);
|
var result = BaseModel.fromJson(responseData.data);
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class QrCodeController extends GetxController with BaseControllerMixin {
|
|||||||
showErrorToast(result.error);
|
showErrorToast(result.error);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showErrorToast("绑定失败,请检查网络");
|
|
||||||
} finally {
|
} finally {
|
||||||
dismissLoading();
|
dismissLoading();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user