Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
erosXXX
uni-app
提交
07eb495f
U
uni-app
项目概览
erosXXX
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
07eb495f
编写于
6月 16, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 解决iOS微信内置浏览器打开位置相关页面后无法后退的问题 fixed #1789
上级
4ab48920
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
22 deletion
+20
-22
src/platforms/h5/components/system-routes/choose-location/index.vue
...rms/h5/components/system-routes/choose-location/index.vue
+14
-10
src/platforms/h5/components/system-routes/open-location/index.vue
...forms/h5/components/system-routes/open-location/index.vue
+6
-12
未找到文件。
src/platforms/h5/components/system-routes/choose-location/index.vue
浏览文件 @
07eb495f
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
<system-header
<system-header
:confirm=
"!!data"
:confirm=
"!!data"
@
back=
"_back"
@
back=
"_back"
@
confirm=
"_choose"
@
confirm=
"_choose"
>
>
选择位置
选择位置
</system-header>
</system-header>
<div
class=
"map-content"
>
<div
class=
"map-content"
>
<iframe
<iframe
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
allow=
"geolocation"
allow=
"geolocation"
seamless
seamless
sandbox=
"allow-scripts allow-same-origin allow-forms"
sandbox=
"allow-scripts allow-same-origin allow-forms"
frameborder=
"0"
frameborder=
"0"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -27,15 +27,14 @@ export default {
...
@@ -27,15 +27,14 @@ export default {
SystemHeader
SystemHeader
},
},
data
()
{
data
()
{
const
key
=
__uniConfig
.
qqMapKey
return
{
return
{
src
:
''
,
src
:
`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=
${
key
}
&referer=uniapp`
,
data
:
null
data
:
null
}
}
},
},
mounted
()
{
mounted
()
{
var
key
=
__uniConfig
.
qqMapKey
function
handler
(
event
)
{
this
.
src
=
`https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=
${
key
}
&referer=uniapp`
window
.
addEventListener
(
'
message
'
,
(
event
)
=>
{
var
loc
=
event
.
data
var
loc
=
event
.
data
if
(
loc
&&
loc
.
module
===
'
locationPicker
'
)
{
if
(
loc
&&
loc
.
module
===
'
locationPicker
'
)
{
this
.
data
=
{
this
.
data
=
{
...
@@ -45,12 +44,17 @@ export default {
...
@@ -45,12 +44,17 @@ export default {
longitude
:
loc
.
latlng
.
lng
longitude
:
loc
.
latlng
.
lng
}
}
}
}
},
false
)
}
this
.
__messageHandle
=
handler
.
bind
(
this
)
window
.
addEventListener
(
'
message
'
,
this
.
__messageHandle
,
false
)
},
beforeDestroy
()
{
window
.
removeEventListener
(
'
message
'
,
this
.
__messageHandle
,
false
)
},
},
methods
:
{
methods
:
{
_choose
()
{
_choose
()
{
if
(
this
.
data
)
{
if
(
this
.
data
)
{
UniViewJSBridge
.
publishHandler
(
'
onChooseLocation
'
,
this
.
data
)
UniViewJSBridge
.
publishHandler
(
'
onChooseLocation
'
,
Object
.
assign
({},
this
.
data
)
)
getApp
().
$router
.
back
()
getApp
().
$router
.
back
()
}
}
},
},
...
...
src/platforms/h5/components/system-routes/open-location/index.vue
浏览文件 @
07eb495f
<
template
>
<
template
>
<div
class=
"uni-system-open-location"
>
<div
class=
"uni-system-open-location"
>
<system-header
@
back=
"_back"
>
<system-header
@
back=
"_back"
>
位置
位置
</system-header>
</system-header>
<div
class=
"map-content"
>
<div
class=
"map-content"
>
<iframe
<iframe
...
@@ -10,13 +10,13 @@
...
@@ -10,13 +10,13 @@
allow=
"geolocation"
allow=
"geolocation"
sandbox=
"allow-scripts allow-same-origin allow-forms allow-top-navigation allow-modals allow-popups"
sandbox=
"allow-scripts allow-same-origin allow-forms allow-top-navigation allow-modals allow-popups"
frameborder=
"0"
frameborder=
"0"
@
load=
"_load"
@
load=
"_load"
/>
/>
<!-- 去这里 -->
<!-- 去这里 -->
<div
<div
v-if=
"isPoimarkerSrc"
v-if=
"isPoimarkerSrc"
class=
"actTonav"
class=
"actTonav"
@
click=
"_nav"
@
click=
"_nav"
/>
/>
</div>
</div>
</div>
</div>
...
@@ -47,16 +47,10 @@ export default {
...
@@ -47,16 +47,10 @@ export default {
scale
,
scale
,
name
,
name
,
address
,
address
,
src
:
''
,
src
:
latitude
&&
longitude
?
`
${
poimarkerSrc
}
?type=0&marker=coord:
${
latitude
}
,
${
longitude
}
;title:
${
name
}
;addr:
${
address
}
;&key=
${
key
}
&referer=
${
referer
}
`
:
''
,
isPoimarkerSrc
:
false
isPoimarkerSrc
:
false
}
}
},
},
mounted
()
{
if
(
this
.
latitude
&&
this
.
longitude
)
{
this
.
src
=
`
${
poimarkerSrc
}
?type=0&marker=coord:
${
this
.
latitude
}
,
${
this
.
longitude
}
;title:
${
this
.
name
}
;addr:
${
this
.
address
}
;&key=
${
key
}
&referer=
${
referer
}
`
}
},
methods
:
{
methods
:
{
_back
()
{
_back
()
{
if
(
this
.
$refs
.
map
.
src
.
indexOf
(
poimarkerSrc
)
!==
0
)
{
if
(
this
.
$refs
.
map
.
src
.
indexOf
(
poimarkerSrc
)
!==
0
)
{
...
@@ -73,7 +67,7 @@ export default {
...
@@ -73,7 +67,7 @@ export default {
}
}
},
},
_nav
()
{
_nav
()
{
var
url
=
var
url
=
`https://map.qq.com/nav/drive#routes/page?transport=2&epointy=
${
this
.
latitude
}
&epointx=
${
this
.
longitude
}
&eword=
${
encodeURIComponent
(
this
.
name
||
'
目的地
'
)}
&referer=
${
referer
}
`
`https://map.qq.com/nav/drive#routes/page?transport=2&epointy=
${
this
.
latitude
}
&epointx=
${
this
.
longitude
}
&eword=
${
encodeURIComponent
(
this
.
name
||
'
目的地
'
)}
&referer=
${
referer
}
`
this
.
$refs
.
map
.
src
=
url
this
.
$refs
.
map
.
src
=
url
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录