Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
r15132706585
uni-app
提交
e2ef8e18
U
uni-app
项目概览
r15132706585
/
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,发现更多精彩内容 >>
提交
e2ef8e18
编写于
3月 24, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(h5): 选择地点支持扩大搜索范围 fixed #2453 #2434
上级
8c2eee57
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
20 deletion
+39
-20
src/platforms/h5/components/system-routes/choose-location/index.vue
...rms/h5/components/system-routes/choose-location/index.vue
+39
-20
未找到文件。
src/platforms/h5/components/system-routes/choose-location/index.vue
浏览文件 @
e2ef8e18
...
...
@@ -9,17 +9,17 @@
@
regionchange=
"_regionchange"
>
<div
class=
"map-location"
/>
<div
class=
"map-move"
@
click=
"_moveToLocation"
<div
class=
"map-move"
@
click=
"_moveToLocation"
>
<i>

</i>
</div>
</v-uni-map>
<div
class=
"nav"
>
<div
class=
"nav-btn back"
@
click=
"_back"
<div
class=
"nav-btn back"
@
click=
"_back"
>
<i
class=
"uni-btn-icon"
>

</i>
</div>
...
...
@@ -51,14 +51,14 @@
取消
</div>
</div>
<v-uni-scroll-view
scroll-y
class=
"list"
@
scrolltolower=
"_scrolltolower"
<v-uni-scroll-view
scroll-y
class=
"list"
@
scrolltolower=
"_scrolltolower"
>
<div
v-if=
"loading"
class=
"list-loading"
<div
v-if=
"loading"
class=
"list-loading"
>
<i
class=
"uni-loading"
/>
</div>
...
...
@@ -77,7 +77,7 @@
{{
item
.
name
}}
</div>
<div
class=
"list-item-detail"
>
{{
item
.
distance
?
item
.
distance
+
"
米 |
"
:
""
}}{{
item
.
address
}}
{{
item
.
distance
|
distance
}}{{
item
.
address
}}
</div>
</div>
</v-uni-scroll-view>
...
...
@@ -95,6 +95,17 @@ const key = __uniConfig.qqMapKey
export
default
{
name
:
'
SystemChooseLocation
'
,
filters
:
{
distance
(
distance
)
{
if
(
distance
>
100
)
{
return
`
${
distance
>
1000
?
(
distance
/
1000
).
toFixed
(
1
)
+
'
k
'
:
distance
.
toFixed
(
0
)}
m | `
}
else
if
(
distance
>
0
)
{
return
'
100m内 |
'
}
else
{
return
''
}
}
},
data
()
{
return
{
latitude
:
0
,
...
...
@@ -105,12 +116,16 @@ export default {
list
:
[],
keyword
:
''
,
searching
:
false
,
loading
:
true
loading
:
true
,
adcode
:
''
}
},
computed
:
{
selected
()
{
return
this
.
list
[
this
.
selectedIndex
]
},
boundary
()
{
return
this
.
adcode
?
`region(
${
this
.
adcode
}
,1,
${
this
.
latitude
}
,
${
this
.
longitude
}
)`
:
`nearby(
${
this
.
latitude
}
,
${
this
.
longitude
}
,5000)`
}
},
created
()
{
...
...
@@ -173,7 +188,7 @@ export default {
},
_getList
()
{
this
.
loading
=
true
const
url
=
this
.
searching
?
`https://apis.map.qq.com/ws/place/v1/search?output=jsonp&key=
${
key
}
&boundary=
nearby(
${
this
.
latitude
}
,
${
this
.
longitude
}
,1000)
&keyword=
${
this
.
keyword
}
&page_size=
${
this
.
pageSize
}
&page_index=
${
this
.
pageIndex
}
`
:
`https://apis.map.qq.com/ws/geocoder/v1/?output=jsonp&key=
${
key
}
&location=
${
this
.
latitude
}
,
${
this
.
longitude
}
&get_poi=1&poi_options=page_size=
${
this
.
pageSize
}
;page_index=
${
this
.
pageIndex
}
`
const
url
=
this
.
searching
?
`https://apis.map.qq.com/ws/place/v1/search?output=jsonp&key=
${
key
}
&boundary=
${
this
.
boundary
}
&keyword=
${
this
.
keyword
}
&page_size=
${
this
.
pageSize
}
&page_index=
${
this
.
pageIndex
}
`
:
`https://apis.map.qq.com/ws/geocoder/v1/?output=jsonp&key=
${
key
}
&location=
${
this
.
latitude
}
,
${
this
.
longitude
}
&get_poi=1&poi_options=page_size=
${
this
.
pageSize
}
;page_index=
${
this
.
pageIndex
}
`
// TODO 列表加载失败提示
getJSONP
(
url
,
{
callback
:
'
callback
'
...
...
@@ -181,8 +196,12 @@ export default {
this
.
loading
=
false
if
(
this
.
searching
&&
'
data
'
in
res
&&
res
.
data
.
length
)
{
this
.
_pushData
(
res
.
data
)
}
else
if
(
'
result
'
in
res
&&
res
.
result
.
pois
)
{
this
.
_pushData
(
res
.
result
.
pois
)
}
else
if
(
'
result
'
in
res
)
{
const
result
=
res
.
result
this
.
adcode
=
result
.
ad_info
?
result
.
ad_info
.
adcode
:
''
if
(
result
.
pois
)
{
this
.
_pushData
(
result
.
pois
)
}
}
},
()
=>
{
this
.
loading
=
false
...
...
@@ -234,10 +253,10 @@ export default {
.uni-system-choose-location
.map
{
position
:
absolute
;
top
:
-40px
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
3
8
0px
;
height
:
3
0
0px
;
}
.uni-system-choose-location
.map-location
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录