master
lion 1 week ago
parent 604b262c3b
commit 2437d21cc4

@ -125,13 +125,17 @@ export default {
this.isWeixinBrowser = /MicroMessenger/i.test(navigator.userAgent)
// #endif
},
onShow() {
this.fetchDirectionEnum().then(() => {
this.fetchShipTypeEnum().then(() => {
this.fetchShipList();
});
});
//
async onShow() {
//
await this.fetchDirectionEnum();
await this.fetchShipTypeEnum();
const hasShip = await this.fetchShipList();
if (!hasShip) {
// fetchShipList
return;
}
//
uni.showModal({
title: '提示',
content: '预约前需要先获取您的位置信息',
@ -150,8 +154,9 @@ export default {
}
}
});
this.fetchDailyReservationDeadline();
//
this.fetchDailyReservationDeadline();
},
methods: {
//
@ -493,7 +498,10 @@ export default {
},
async fetchShipList() {
const token = uni.getStorageSync('token');
if (!token) return;
if (!token) {
uni.showToast({ title: '请先登录', icon: 'none' });
return false;
}
try {
const res = await new Promise((resolve, reject) => {
uni.request({
@ -505,14 +513,12 @@ export default {
});
if (res.data && res.data.errcode === 0) {
if (!res.data.data) {
uni.showToast({ title: '暂无船舶信息', icon: 'none' });
uni.showToast({ title: '暂无船舶信息', icon: 'none', duration: 1500 });
setTimeout(() => {
uni.navigateBack();
uni.navigateTo({ url: '/pages/index/ship_manage' });
uni.redirectTo({ url: '/pages/index/ship_manage' });
}, 1000);
return;
return false;
}
this.currentShip = {
@ -524,9 +530,14 @@ export default {
total_tonnage: res.data.data.total_tonnage,
ship_type: res.data.data.ship_type
};
return true;
} else {
uni.showToast({ title: (res.data && res.data.errmsg) || '获取船舶信息失败', icon: 'none' });
return false;
}
} catch (e) {
//
uni.showToast({ title: '网络错误', icon: 'none' });
return false;
}
},
async fetchDirectionEnum() {

@ -1,2 +1,2 @@
<!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.c970d746.js></script></body></html>
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.14b82f73.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save