Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-shop
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-shop
Commits
cd99c127
提交
cd99c127
authored
6月 03, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
对接高德地图
上级
0a6d469d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
41 行增加
和
14 行删除
+41
-14
contact.vue
src/pages/setting/contact.vue
+41
-14
没有找到文件。
src/pages/setting/contact.vue
浏览文件 @
cd99c127
<
template
>
<app-card>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"
100px
"
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"
70px"
:hide-required-asterisk=
"true
"
>
<el-form-item
label=
"客户电话"
prop=
"shop_tel"
>
<el-radio-group
v-model=
"telRadio"
@
change=
"radioChange"
>
<el-radio
:label=
"1"
>
普通座机号
</el-radio>
...
...
@@ -14,18 +14,20 @@
</el-form-item>
<el-form-item
label=
"详细地址"
prop=
"shop_address"
>
<el-input
v-model=
"ruleForm.shop_address"
>
<
!--
<
template
#
append
>
<template
#
append
>
<el-button
@
click=
"mapSearch"
>
搜索地图
</el-button>
</
template
>
-->
</
template
>
</el-input>
</el-form-item>
<
!-- <
div class="map">
<div
class=
"map"
>
<div
id=
"map-container"
></div>
<div
id=
"map-panel"
></div>
</div> -->
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
保存
</el-button>
</el-form-item>
</div>
<div
class=
"form-footer"
>
<div
class=
"inner"
>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
保存
</el-button>
</div>
</div>
</el-form>
</app-card>
</template>
...
...
@@ -79,6 +81,7 @@ export default {
}
else
{
this
.
telRadio
=
2
}
this
.
$nextTick
(
this
.
initMap
)
}
}
},
...
...
@@ -102,11 +105,24 @@ export default {
})
},
initMap
()
{
if
(
this
.
map
)
{
return
}
const
position
=
JSON
.
parse
(
this
.
ruleForm
.
shop_pos
)
this
.
map
=
new
window
.
AMap
.
Map
(
'map-container'
,
{
resizeEnable
:
true
,
zoom
:
18
,
center
:
[
116.24582
,
40.222615
]
zoom
:
16
,
center
:
position
})
new
window
.
AMap
.
Marker
({
map
:
this
.
map
,
position
})
const
infoWindow
=
new
window
.
AMap
.
InfoWindow
({
content
:
this
.
ruleForm
.
shop_address
,
offset
:
new
window
.
AMap
.
Pixel
(
0
,
-
30
)
})
infoWindow
.
open
(
this
.
map
,
position
)
window
.
AMap
.
plugin
([
'AMap.PlaceSearch'
],
()
=>
{
// 构造地点查询类
this
.
placeSearch
=
new
window
.
AMap
.
PlaceSearch
({
...
...
@@ -119,7 +135,7 @@ export default {
this
.
placeSearch
.
on
(
'selectChanged'
,
e
=>
{
const
data
=
e
.
selected
.
data
this
.
ruleForm
.
shop_address
=
data
.
cityname
+
data
.
adname
+
data
.
name
this
.
ruleForm
.
shop_pos
=
JSON
.
stringify
(
data
.
location
.
pos
)
this
.
ruleForm
.
shop_pos
=
JSON
.
stringify
(
[
data
.
location
.
lng
,
data
.
location
.
lat
]
)
console
.
log
(
data
)
})
})
...
...
@@ -129,11 +145,9 @@ export default {
this
.
placeSearch
.
search
(
this
.
ruleForm
.
shop_address
)
}
},
mounted
()
{
// this.initMap()
},
destroyed
()
{
this
.
map
&&
this
.
map
.
destroy
()
this
.
map
=
null
}
}
</
script
>
...
...
@@ -158,4 +172,17 @@ export default {
right
:
10px
;
width
:
280px
;
}
.form-footer
{
position
:
sticky
;
bottom
:
0
;
z-index
:
118
;
border-top
:
0
.5px
solid
rgba
(
0
,
0
,
0
,
0
.05
);
background-color
:
rgba
(
255
,
255
,
255
,
0
.95
);
.inner
{
height
:
80px
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论