Commit b6ff8d26 by huyue

修复编辑省编辑不了的问题

1 parent a82ab81a
...@@ -1170,15 +1170,15 @@ ...@@ -1170,15 +1170,15 @@
cityIdx = merchantForm.cityName cityIdx = merchantForm.cityName
provincecode = merchantForm.cityCode provincecode = merchantForm.cityCode
} }
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] // const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provinceIdx) // var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) { // if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区' // // cityIdx = cityIdx.slice(0, 2) + '城区'
if (municipality === '重庆市') { // if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4) // provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县') // provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
} // }
} // }
// 判断省市是否匹配 // 判断省市是否匹配
// if (merchantForm.provinceName) { // if (merchantForm.provinceName) {
// if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) { // if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) {
......
...@@ -1124,15 +1124,15 @@ ...@@ -1124,15 +1124,15 @@
// 获取省市 // 获取省市
var provinceIdx = fullAddress.province var provinceIdx = fullAddress.province
var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district var cityIdx = fullAddress.city ? fullAddress.city : fullAddress.district
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] // const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == provinceIdx) // var municipality = municipalities.find(item => item == provinceIdx)
if (municipality) { // if (municipality) {
cityIdx = cityIdx.slice(0, 2) + '城区' // cityIdx = cityIdx.slice(0, 2) + '城区'
if (municipality === '重庆市') { // if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4) // provincecode = provincecode.slice(0, 4)
provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县') // provincecode == 5001 ? (cityIdx = cityIdx.slice(0, 2) + '城区') : (cityIdx = cityIdx.slice(0, 2) + '郊县')
} // }
} // }
// 判断省市是否匹配 // 判断省市是否匹配
// if (merchantForm.provinceName) { // if (merchantForm.provinceName) {
// if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) { // if (merchantForm.provinceName !== provinceIdx || merchantForm.cityName !== cityIdx) {
......
...@@ -276,8 +276,11 @@ ...@@ -276,8 +276,11 @@
console.log(res) console.log(res)
if (res) { if (res) {
mapData.merchantAddress = res.surroundingPois.length ? res.surroundingPois[0].address : res.address mapData.merchantAddress = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
modelVal('merchantAddress', mapData.merchantAddress) $('#merchantAddress').val(mapData.merchantAddress)
// modelVal('merchantAddress', mapData.merchantAddress)
mapData.geocoderAddress = res mapData.geocoderAddress = res
mapData.lat = res.point.lat
mapData.lng = res.point.lng
} }
}) })
// geocoder.getAddress(marker.getPosition(), function (status, result) { // geocoder.getAddress(marker.getPosition(), function (status, result) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!