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
Hide 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 {
methods
:
{
init
(
provinceName
,
cityName
)
{
console
.
log
(
provinceName
,
cityName
)
console
.
log
(
111111
)
console
.
log
(
this
.
AllData
)
this
.
provinceForm
=
{
provinceName
:
provinceName
,
cityName
:
cityName
}
this
.
AllData
.
map
(
item
=>
{
if
(
provinceName
==
item
.
provinceName
)
{
console
.
log
(
111111
)
if
(
item
.
provinceName
.
indexOf
(
provinceName
)
!=
-
1
)
{
this
.
cityList
=
item
.
cityInfoList
this
.
provinceForm
.
provinceCode
=
item
.
provinceCode
this
.
cityList
.
map
(
itm
=>
{
...
...
src/views/account/components/baseInfo.vue
View file @
93311fc
...
...
@@ -261,6 +261,7 @@ export default {
return
data
.
label
.
indexOf
(
value
)
!==
-
1
},
getAddress
()
{
console
.
log
(
this
.
$refs
.
mapForm
.
geocoderAddress
)
if
(
!
this
.
$refs
.
mapForm
.
address
)
{
this
.
$message
.
error
(
'请选择地址'
)
return
...
...
@@ -270,20 +271,16 @@ export default {
let
lnglat
=
this
.
$refs
.
mapForm
.
lnglat
this
.
accountAddForm
.
lat
=
lnglat
.
lat
this
.
accountAddForm
.
lng
=
lnglat
.
lng
// 截取省市
var
provinceIdx
=
address
.
indexOf
(
'省'
)
var
cityIdx
=
address
.
indexOf
(
'市'
)
// provinceIdx == -1 ? (provinceIdx = 0) : provinceIdx
var
province
=
address
.
slice
(
0
,
provinceIdx
)
var
city
=
address
.
slice
(
provinceIdx
+
1
,
cityIdx
)
// 如果没有省
if
(
provinceIdx
==
-
1
)
{
provinceIdx
=
0
city
=
address
.
slice
(
provinceIdx
,
cityIdx
)
province
=
city
}
var
fullAddress
=
this
.
$refs
.
mapForm
.
geocoderAddress
.
addressComponent
// 获取省市
var
provinceIdx
=
fullAddress
.
province
var
cityIdx
=
fullAddress
.
city
var
province
=
provinceIdx
.
slice
(
0
,
2
)
var
city
=
cityIdx
.
slice
(
0
,
2
)
// 判断省市是否匹配
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
)
{
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
this
.
accountAddForm
.
merchantAddress
=
''
...
...
src/views/baseInfo/editInfo.vue
View file @
93311fc
...
...
@@ -151,13 +151,16 @@ export default {
let
lnglat
=
this
.
$refs
.
mapForm
.
lnglat
this
.
infoForm
.
lat
=
lnglat
.
lat
this
.
infoForm
.
lng
=
lnglat
.
lng
// 截取省市
var
provinceIdx
=
address
.
indexOf
(
'省'
)
var
cityIdx
=
address
.
indexOf
(
'市'
)
var
province
=
address
.
slice
(
0
,
provinceIdx
)
var
city
=
address
.
slice
(
provinceIdx
+
1
,
cityIdx
)
var
fullAddress
=
this
.
$refs
.
mapForm
.
geocoderAddress
.
addressComponent
// 获取省市
var
provinceIdx
=
fullAddress
.
province
var
cityIdx
=
fullAddress
.
city
var
province
=
provinceIdx
.
slice
(
0
,
2
)
var
city
=
cityIdx
.
slice
(
0
,
2
)
// 判断省市是否匹配
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
)
{
this
.
$message
.
error
(
'您选择的地址错误,请重新选择'
)
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