Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
6b65a00f
Commit
6b65a00f
authored
Sep 02, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 选择自提点页获取经纬度逻辑
parent
3af76a23
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
ClientInfoService.kt
...om/yidian/shenghuoquan/bdemo/service/ClientInfoService.kt
+0
-1
SelectPickupPointActivity.kt
...n/shenghuoquan/buserorder/ui/SelectPickupPointActivity.kt
+6
-8
SelectPickupPointViewModel.kt
...uoquan/buserorder/viewmodel/SelectPickupPointViewModel.kt
+4
-4
No files found.
Components/BDemo/src/main/java/com/yidian/shenghuoquan/bdemo/service/ClientInfoService.kt
View file @
6b65a00f
...
...
@@ -52,7 +52,6 @@ class ClientInfoService : ZapService() {
JSONObject
()
.
put
(
"longitude"
,
116.4955500
)
.
put
(
"latitude"
,
39.9885500
)
.
put
(
"address"
,
"北京市朝阳区酒仙桥"
)
)
}
}
...
...
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/ui/SelectPickupPointActivity.kt
View file @
6b65a00f
...
...
@@ -109,20 +109,18 @@ class SelectPickupPointActivity : BaseMvvmActivity<BorderActivitySelectPickupPoi
* 请求自提点列表 先调用C端客户端信息服务获取经纬度
*/
private
fun
requestPickupPoint
(
type
:
SelectPickupPointViewModel
.
LoadType
)
{
var
longitude
:
Double
?
=
null
var
latitude
:
Double
?
=
null
// 获取C端经纬度信息
ZapTicket
(
ZapServiceNameConstants
.
ClientInfoService
)
.
withAction
(
ZapServiceActionConstants
.
ActionGetCurrentLocation
)
.
onResult
{
xResult
->
val
result
=
xResult
.
result
as
JSONObject
longitude
=
result
.
opt
(
"longitude"
)
?.
let
{
it
as
Double
}
latitude
=
result
.
opt
(
"latitude"
)
?.
let
{
it
as
Double
}
}.
ship
()
location
=
longitude
!=
null
&&
latitude
!=
null
val
longitude
=
result
.
optDouble
(
"longitude"
)
val
latitude
=
result
.
optDouble
(
"latitude"
)
location
=
longitude
!=
0.0
&&
latitude
!=
0.0
// 是否有位置信息 控制附近自提点显示
binding
.
location
=
location
vm
.
requestPickupPointList
(
params
?.
get
(
IntentConstants
.
KEY_EXTRA_MARKETING_ID
)
as
String
,
longitude
,
latitude
,
keyWords
,
type
)
}.
ship
()
}
@Subscribe
(
sticky
=
false
,
threadMode
=
ThreadMode
.
MAIN
)
...
...
Components/BUserOrder/src/main/java/com/yidian/shenghuoquan/buserorder/viewmodel/SelectPickupPointViewModel.kt
View file @
6b65a00f
...
...
@@ -25,15 +25,15 @@ class SelectPickupPointViewModel : BaseViewModel() {
*/
fun
requestPickupPointList
(
marketingId
:
String
,
longitude
:
Double
?
,
latitude
:
Double
?
,
longitude
:
Double
,
latitude
:
Double
,
keyWords
:
String
?,
type
:
LoadType
,
)
{
val
requestParams
=
HashMap
<
String
,
String
?>(
6
)
requestParams
[
"marketing_id"
]
=
marketingId
longitude
?.
let
{
requestParams
[
"longitude"
]
=
it
.
toString
()
}
latitude
?.
let
{
requestParams
[
"latitude"
]
=
it
.
toString
()
}
if
(
longitude
!=
0.0
)
requestParams
[
"longitude"
]
=
longitude
.
toString
()
if
(
latitude
!=
0.0
)
requestParams
[
"latitude"
]
=
latitude
.
toString
()
if
(
keyWords
?.
isNotEmpty
()
==
true
)
requestParams
[
"keywords"
]
=
keyWords
OrderRemoteDataSource
.
getPickupPointList
(
object
:
IGetPickupPointListCallback
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment