提交 de2754a0 作者: 方治民

fix: 修复引导页没有正常关闭的问题

上级 0621e144
......@@ -12,24 +12,8 @@
})
onLoad(() => {
uni.getLocation({
type: 'wgs84',
success(res) {
pageData.weather.lon = res.longitude
pageData.weather.lat = res.latitude
uni.setStorageSync('location', {
// 缓存地址
lon: res.longitude,
lat: res.latitude,
})
},
fail() {
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none',
})
},
})
// 关闭启动页并检查更新
closeSplashscreenAndChechUpgrade()
})
onShow(() => {
......@@ -42,16 +26,24 @@
if (res.longitude === 0 || res.latitude === 0) {
return
}
pageData.weather.lon = res.longitude
pageData.weather.lat = res.latitude
uni.setStorageSync('location', {
// 缓存地址
lon: res.longitude,
lat: res.latitude,
})
model.location = `${res.longitude},${res.latitude}`
reloadWeather()
},
fail(res) {
console.log('获取位置失败:', res)
reloadWeather()
},
complete() {
// 关闭启动页并检查更新
closeSplashscreenAndChechUpgrade()
uni.showToast({
title: '获取地址失败,将导致部分功能不可用',
icon: 'none',
})
},
})
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论