This commit is contained in:
2023-10-27 14:26:51 +08:00
parent 8ed8cca8d7
commit 5d5dbdbdac
2 changed files with 11 additions and 4 deletions

View File

@ -100,7 +100,6 @@
},
onShow() {
this.address = uni.getStorageSync('location')
console.log(this.address, '000')
if (this.address == '德州市') {
uni.setStorageSync("region", 1)
} else if (this.address == '东营市') {

View File

@ -32,7 +32,8 @@
},
onShow() {
let location = uni.getStorageSync('location')
if (!location) {
let region = uni.getStorageSync('region')
if (!location || !region) {
this.getAddress()
}
this.phonecode = undefined
@ -57,6 +58,14 @@
method: "GET",
success(res) {
uni.setStorageSync('location', res.data.result.address_component.city)
var address = uni.getStorageSync('location')
if (address == '德州市') {
uni.setStorageSync("region", 1)
} else if (address == '东营市') {
uni.setStorageSync("region", 2)
} else if (address == '济南市') {
uni.setStorageSync("region", 3)
}
},
fail: res => {
console.log(res.errMsg, '解析失败返回的错误信息');
@ -115,7 +124,6 @@
delta: 1
})
}, 500)
console.log("9999")
} else {
that.$refs.uToast.show({
title: '登录失败',
@ -162,4 +170,4 @@
<style lang="scss">
@import "./login.scss";
</style>
</style>