Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 93311fcb
authored
Apr 13, 2022
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改省市展示
1 parent
160089b4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
21 deletions
src/components/province-city/index.vue
src/views/account/components/baseInfo.vue
src/views/baseInfo/editInfo.vue
src/components/province-city/index.vue
View file @
93311fc
...
@@ -42,15 +42,12 @@ export default {
...
@@ -42,15 +42,12 @@ export default {
methods
:
{
methods
:
{
init
(
provinceName
,
cityName
)
{
init
(
provinceName
,
cityName
)
{
console
.
log
(
provinceName
,
cityName
)
console
.
log
(
provinceName
,
cityName
)
console
.
log
(
111111
)
console
.
log
(
this
.
AllData
)
this
.
provinceForm
=
{
this
.
provinceForm
=
{
provinceName
:
provinceName
,
provinceName
:
provinceName
,
cityName
:
cityName
cityName
:
cityName
}
}
this
.
AllData
.
map
(
item
=>
{
this
.
AllData
.
map
(
item
=>
{
if
(
provinceName
==
item
.
provinceName
)
{
if
(
item
.
provinceName
.
indexOf
(
provinceName
)
!=
-
1
)
{
console
.
log
(
111111
)
this
.
cityList
=
item
.
cityInfoList
this
.
cityList
=
item
.
cityInfoList
this
.
provinceForm
.
provinceCode
=
item
.
provinceCode
this
.
provinceForm
.
provinceCode
=
item
.
provinceCode
this
.
cityList
.
map
(
itm
=>
{
this
.
cityList
.
map
(
itm
=>
{
...
...
src/views/account/components/baseInfo.vue
View file @
93311fc
...
@@ -261,6 +261,7 @@ export default {
...
@@ -261,6 +261,7 @@ export default {
return
data
.
label
.
indexOf
(
value
)
!==
-
1
return
data
.
label
.
indexOf
(
value
)
!==
-
1
},
},
getAddress
()
{
getAddress
()
{
console
.
log
(
this
.
$refs
.
mapForm
.
geocoderAddress
)
if
(
!
this
.
$refs
.
mapForm
.
address
)
{
if
(
!
this
.
$refs
.
mapForm
.
address
)
{
this
.
$message
.
error
(
'请选择地址'
)
this
.
$message
.
error
(
'请选择地址'
)
return
return
...
@@ -270,20 +271,16 @@ export default {
...
@@ -270,20 +271,16 @@ export default {
let
lnglat
=
this
.
$refs
.
mapForm
.
lnglat
let
lnglat
=
this
.
$refs
.
mapForm
.
lnglat
this
.
accountAddForm
.
lat
=
lnglat
.
lat
this
.
accountAddForm
.
lat
=
lnglat
.
lat
this
.
accountAddForm
.
lng
=
lnglat
.
lng
this
.
accountAddForm
.
lng
=
lnglat
.
lng
// 截取省市
var
fullAddress
=
this
.
$refs
.
mapForm
.
geocoderAddress
.
addressComponent
var
provinceIdx
=
address
.
indexOf
(
'省'
)
// 获取省市
var
cityIdx
=
address
.
indexOf
(
'市'
)
var
provinceIdx
=
fullAddress
.
province
// provinceIdx == -1 ? (provinceIdx = 0) : provinceIdx
var
cityIdx
=
fullAddress
.
city
var
province
=
address
.
slice
(
0
,
provinceIdx
)
var
province
=
provinceIdx
.
slice
(
0
,
2
)
var
city
=
address
.
slice
(
provinceIdx
+
1
,
cityIdx
)
var
city
=
cityIdx
.
slice
(
0
,
2
)
// 如果没有省
if
(
provinceIdx
==
-
1
)
{
provinceIdx
=
0
city
=
address
.
slice
(
provinceIdx
,
cityIdx
)
province
=
city
}
// 判断省市是否匹配
// 判断省市是否匹配
if
(
this
.
accountAddForm
.
provinceName
)
{
if
(
this
.
accountAddForm
.
provinceName
)
{
this
.
accountAddForm
.
provinceName
=
this
.
accountAddForm
.
provinceName
.
slice
(
0
,
2
)
this
.
accountAddForm
.
cityName
=
this
.
accountAddForm
.
cityName
.
slice
(
0
,
2
)
if
(
this
.
accountAddForm
.
provinceName
!==
province
||
this
.
accountAddForm
.
cityName
!==
city
)
{
if
(
this
.
accountAddForm
.
provinceName
!==
province
||
this
.
accountAddForm
.
cityName
!==
city
)
{
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
accountAddForm
.
merchantAddress
=
''
this
.
accountAddForm
.
merchantAddress
=
''
...
...
src/views/baseInfo/editInfo.vue
View file @
93311fc
...
@@ -151,13 +151,16 @@ export default {
...
@@ -151,13 +151,16 @@ export default {
let
lnglat
=
this
.
$refs
.
mapForm
.
lnglat
let
lnglat
=
this
.
$refs
.
mapForm
.
lnglat
this
.
infoForm
.
lat
=
lnglat
.
lat
this
.
infoForm
.
lat
=
lnglat
.
lat
this
.
infoForm
.
lng
=
lnglat
.
lng
this
.
infoForm
.
lng
=
lnglat
.
lng
// 截取省市
var
fullAddress
=
this
.
$refs
.
mapForm
.
geocoderAddress
.
addressComponent
var
provinceIdx
=
address
.
indexOf
(
'省'
)
// 获取省市
var
cityIdx
=
address
.
indexOf
(
'市'
)
var
provinceIdx
=
fullAddress
.
province
var
province
=
address
.
slice
(
0
,
provinceIdx
)
var
cityIdx
=
fullAddress
.
city
var
city
=
address
.
slice
(
provinceIdx
+
1
,
cityIdx
)
var
province
=
provinceIdx
.
slice
(
0
,
2
)
var
city
=
cityIdx
.
slice
(
0
,
2
)
// 判断省市是否匹配
// 判断省市是否匹配
if
(
this
.
infoForm
.
provinceName
)
{
if
(
this
.
infoForm
.
provinceName
)
{
this
.
infoForm
.
provinceName
=
this
.
infoForm
.
provinceName
.
slice
(
0
,
2
)
this
.
infoForm
.
cityName
=
this
.
infoForm
.
cityName
.
slice
(
0
,
2
)
if
(
this
.
infoForm
.
provinceName
!==
province
||
this
.
infoForm
.
cityName
!==
city
)
{
if
(
this
.
infoForm
.
provinceName
!==
province
||
this
.
infoForm
.
cityName
!==
city
)
{
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
infoForm
.
merchantAddress
=
''
this
.
infoForm
.
merchantAddress
=
''
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment