问题修改

This commit is contained in:
2026-01-30 16:02:35 +08:00
parent bc99ffd691
commit 55eade54b6
6 changed files with 92 additions and 74 deletions

View File

@@ -126,12 +126,14 @@
/* 初始状态:避开底部的定位按钮或留出安全间距 */
bottom: 80px !important;
left: 10px !important;
transition: bottom 0.3s ease; /* 增加平滑动画 */
transition: bottom 0.3s ease;
/* 增加平滑动画 */
}
/* --- 当路径规划面板显示时,比例尺自动上移 --- */
body.panel-active .amap-scalecontrol {
bottom: 38% !important; /* 移动到面板上方 (面板高度35% + 3%间距) */
bottom: 38% !important;
/* 移动到面板上方 (面板高度35% + 3%间距) */
}
/* --- 关键:当 body 有 panel-active 类时,按钮上移 --- */
@@ -371,7 +373,6 @@ body.panel-active .amap-scalecontrol {
})
})
.then(response => {
console.log("JS->: 网络状态码:", response.status);
if (!response.ok) {
throw new Error('网络响应错误: ' + response.status);
}
@@ -388,7 +389,9 @@ body.panel-active .amap-scalecontrol {
var destAddress = res.data.address;
document.getElementById('endInput').value = destAddress;
// 标记终点
markDestination(destAddress, res.data.name || "目的地");
markDestination(destAddress, res.data.name || "目的地",
res.data.longitude, res.data.latitude
);
} else {
console.log("JS->: 接口请求成功,但该区域暂无站点地址");
}
@@ -402,10 +405,8 @@ body.panel-active .amap-scalecontrol {
/**
* 地理编码并在地图标记终点
*/
function markDestination(address, name) {
geocoder.getLocation(address, function (status, result) {
if (status === 'complete' && result.info === 'OK') {
var loc = result.geocodes[0].location;
function markDestination(address, name, longitude, latitude) {
// 1. 清除旧的终点标记
if (destMarker) destMarker.setMap(null);
@@ -421,7 +422,7 @@ body.panel-active .amap-scalecontrol {
// 3. 创建标记
destMarker = new AMap.Marker({
map: map,
position: loc,
position: [longitude, latitude],
icon: destIcon, // 使用自定义图标
// 偏移量如果图标底部中心是尖角offset 设为宽的一半的负数,高度的负数
// 这样能确保图片的底部尖端指向地图上的精确位置
@@ -445,10 +446,6 @@ body.panel-active .amap-scalecontrol {
// // 如果没有起点,直接跳到终点
// map.setCenter(loc);
// }
} else {
console.error("JS->: 终点地址地理编码失败", address);
}
});
}
/**

View File

@@ -70,5 +70,11 @@
<string>fetch</string>
</array>
<key>CFBundleLocalizations</key>
<array>
<string>zh-Hans</string>
<string>en</string>
</array>
</dict>
</plist>

View File

@@ -344,7 +344,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
return;
}*/
final reservationEndDateTime = DateTime(
DateTime reservationEndDateTime = DateTime(
selectedDate.value.year,
selectedDate.value.month,
selectedDate.value.day,
@@ -352,7 +352,13 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
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(
DateTime.now().subtract(const Duration(minutes: 1)),
)) {

View File

@@ -152,7 +152,6 @@ class ReservationPage extends GetView<C_ReservationController> {
if (scanResult == null) {
controller.msgNotice();
}
},
icon: Badge(
smallSize: 8,
@@ -567,20 +566,24 @@ class ReservationPage extends GetView<C_ReservationController> {
borderRadius: BorderRadius.circular(12),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: () => _updateAmount(-1),
icon: Icon(Icons.remove, size: 14.sp, color: Colors.grey),
),
Text(
Expanded(
child: Text(
"${controller.amountController.text}Kg",
textAlign: TextAlign.center,
softWrap: false,
overflow: TextOverflow.fade,
style: TextStyle(
fontSize: 11.sp,
color: Colors.black87,
fontWeight: FontWeight.w500,
),
),
),
IconButton(
onPressed: () => _updateAmount(1),
icon: Icon(Icons.add, size: 14.sp, color: Colors.grey),

View File

@@ -444,11 +444,18 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
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) {
await StorageService.to.saveStationCredentials(account, password);
} else {
await StorageService.to.clearStationCredentials();
}
}
}
_processLoginResponse(responseData, "station", account);
} catch (e) {
@@ -476,7 +483,6 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
) async {
if (responseData == null || responseData.data == null) {
dismissLoading();
showToast('登录失败');
return;
}
var result = BaseModel.fromJson(responseData.data);

View File

@@ -154,7 +154,7 @@ class QrCodeController extends GetxController with BaseControllerMixin {
showErrorToast(result.error);
}
} catch (e) {
showErrorToast("绑定失败,请检查网络");
} finally {
dismissLoading();
}