main
lion 3 months ago
parent 6e1b40193c
commit 85f1123221

@ -7,13 +7,13 @@
<view class="info-item">
<text class="info-label">太湖</text>
<view class="info-value-group">
<text class="info-value"
<!-- <text class="info-value"
>水位深度{{
statistics.taihu_to_xujiang
? statistics.taihu_to_xujiang.water_level
: "-"
}}m</text
>
> -->
<text class="info-value"
>吃水深度{{
statistics.taihu_to_xujiang
@ -26,13 +26,13 @@
<view class="info-item">
<text class="info-label">胥江</text>
<view class="info-value-group">
<text class="info-value"
<!-- <text class="info-value"
>水位深度{{
statistics.xujiang_to_taihu
? statistics.xujiang_to_taihu.water_level
: "-"
}}m</text
>
> -->
<text class="info-value"
>吃水深度{{
statistics.xujiang_to_taihu

@ -380,7 +380,7 @@ export default {
this.fetchGeofenceByDirection();
}
},
async fetchGeofenceByDirection() {
async fetchGeofenceByDirection(showModal = true) {
const token = uni.getStorageSync('token');
if (!token || !this.direction) return;
try {
@ -403,17 +403,19 @@ export default {
}
//
this.checkLocationInGeofence(geofenceData);
this.checkLocationInGeofence(geofenceData, showModal);
}
} catch (e) {
//
this.isInGeofence = null;
}
},
//
checkLocationInGeofence(geofenceData) {
checkLocationInGeofence(geofenceData, showModal = true) {
//
if (!this.userLocation || !this.userLocation.latitude || !this.userLocation.longitude) {
console.warn('用户位置信息不存在,无法进行范围判断');
this.isInGeofence = null;
return;
}
@ -434,13 +436,16 @@ export default {
}
}
// false
// false
this.isInGeofence = false;
uni.showModal({
title: '提示',
content: '您的当前位置不在闸站可预约范围内',
showCancel: false
});
// showModaltrueshowModalfalseonReserve
if (showModal) {
uni.showModal({
title: '提示',
content: '您的当前位置不在闸站可预约范围内',
showCancel: false
});
}
},
// 使线
isPointInPolygon(lng, lat, coordinates) {
@ -630,7 +635,7 @@ export default {
const found = this.shipTypeEnum.find(item => item.value === type || item.value == type);
return found ? found.label : type;
},
onReserve() {
async onReserve() {
if (!this.agreeNotice) {
uni.showToast({ title: '请先阅读并同意预约须知', icon: 'none' });
return;
@ -639,20 +644,64 @@ export default {
uni.showToast({ title: '请先选择航行方向', icon: 'none' });
return;
}
//
//
if (!this.userLocation || !this.userLocation.latitude || !this.userLocation.longitude) {
uni.showLoading({ title: '正在获取位置...' });
//
await new Promise((resolve) => {
this.getUserLocation();
// 5
let checkCount = 0;
const checkInterval = setInterval(() => {
checkCount++;
if (this.userLocation && this.userLocation.latitude && this.userLocation.longitude) {
clearInterval(checkInterval);
uni.hideLoading();
resolve();
} else if (checkCount >= 50) { // 5
clearInterval(checkInterval);
uni.hideLoading();
uni.showToast({ title: '获取位置失败,请重试', icon: 'none' });
resolve();
}
}, 100);
});
}
//
if (!this.userLocation || !this.userLocation.latitude || !this.userLocation.longitude) {
uni.showToast({ title: '无法获取位置信息,请检查位置权限', icon: 'none' });
return;
}
// modalonReserve
uni.showLoading({ title: '正在验证位置...' });
await this.fetchGeofenceByDirection(false);
uni.hideLoading();
//
if (this.isInGeofence === false) {
uni.showToast({ title: '您的当前位置不在闸站可预约范围内', icon: 'none' });
return;
}
// null
if (this.isInGeofence === null) {
uni.showToast({ title: '位置验证失败,请重试', icon: 'none' });
return;
}
const token = uni.getStorageSync('token');
if (!token) {
uni.showToast({ title: '请先登录', icon: 'none' });
return;
}
if (!this.currentShip || !this.currentShip.ship_number || !this.currentShip.id) {
uni.showToast({ title: '无效的船舶信息', icon: 'none' });
return;
}
// if (!this.currentShip || !this.currentShip.ship_number || !this.currentShip.id) {
// uni.showToast({ title: '', icon: 'none' });
// return;
// }
// direction: north->in, south->out
const directionValue = this.direction || 'in';

@ -1,2 +0,0 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>胥口闸站购票</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/h5/static/index.883130ca.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/h5/static/js/chunk-vendors.f93c9f80.js></script><script src=/h5/static/js/index.5f04b5d5.js></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Loading…
Cancel
Save