|
|
|
|
@ -383,9 +383,9 @@
|
|
|
|
|
} else {
|
|
|
|
|
toast("未查询到卡券信息")
|
|
|
|
|
uni.removeStorageSync("vuex_card")
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/change/change'
|
|
|
|
|
})
|
|
|
|
|
// uni.redirectTo({
|
|
|
|
|
// url: '/packages/change/change'
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -421,6 +421,18 @@
|
|
|
|
|
_this.form.city_id = res1.city_id ? res1.city_id.id : ''
|
|
|
|
|
_this.form.district_id = res1.district_id ? res1
|
|
|
|
|
.district_id.id : ''
|
|
|
|
|
if (isNull(_this.form.province_id) || isNull(_this.form
|
|
|
|
|
.city_id) ||
|
|
|
|
|
isNull(_this.form.district_id)) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '未能匹配到所在地区,请手动选择',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
_this.form.area = ""
|
|
|
|
|
_this.form.province_id = ''
|
|
|
|
|
_this.form.city_id = ''
|
|
|
|
|
_this.form.district_id = ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log("_this", _this.form)
|
|
|
|
|
},
|
|
|
|
|
@ -613,7 +625,6 @@
|
|
|
|
|
scope: 'scope.userLocation',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
console.log("authorize", res)
|
|
|
|
|
|
|
|
|
|
uni.chooseLocation({
|
|
|
|
|
success(res) {
|
|
|
|
|
console.log("res", res)
|
|
|
|
|
@ -621,6 +632,7 @@
|
|
|
|
|
_this.form.address = res.name
|
|
|
|
|
// 根据地址匹配 省市区
|
|
|
|
|
let pca = parseAddress(res.address)
|
|
|
|
|
console.log("pca",pca)
|
|
|
|
|
if (pca.length > 0) {
|
|
|
|
|
_this.form.area = pca.join('')
|
|
|
|
|
_this.$u.api.matchRegion({
|
|
|
|
|
@ -633,16 +645,30 @@
|
|
|
|
|
_this.form.city_id = res.city_id ? res.city_id.id : ''
|
|
|
|
|
_this.form.district_id = res.district_id ? res
|
|
|
|
|
.district_id.id : ''
|
|
|
|
|
if (isNull(_this.form.province_id) || isNull(_this.form
|
|
|
|
|
.city_id) ||
|
|
|
|
|
isNull(_this.form.district_id)) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '未能匹配到所在省市区,请手动选择',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
_this.form.area = ""
|
|
|
|
|
_this.form.province_id = ''
|
|
|
|
|
_this.form.city_id = ''
|
|
|
|
|
_this.form.district_id = ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '未获取到地址,重新获取',
|
|
|
|
|
title: '未能匹配到所在省市区,请手动选择',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_this.form.area = ""
|
|
|
|
|
_this.form.province_id = ''
|
|
|
|
|
_this.form.city_id = ''
|
|
|
|
|
_this.form.district_id = ''
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fail(res) {
|
|
|
|
|
console.log("fail", res)
|
|
|
|
|
@ -789,6 +815,8 @@
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
console.log("this.form", this.form)
|
|
|
|
|
// return
|
|
|
|
|
this.$u.api.addUserOrder(this.form).then(res => {
|
|
|
|
|
console.log("res", res)
|
|
|
|
|
uni.removeStorageSync('vuex_card')
|
|
|
|
|
|