Commit b6e1c4cb authored by shiyl's avatar shiyl

Merge branch 'feature/dev_fight_order' of...

Merge branch 'feature/dev_fight_order' of https://git.yidian-inc.com:8021/bp/ShenghuoquanBusiness into feature/dev_fight_order
parents e5b38cac 6b65a00f
...@@ -52,7 +52,6 @@ class ClientInfoService : ZapService() { ...@@ -52,7 +52,6 @@ class ClientInfoService : ZapService() {
JSONObject() JSONObject()
.put("longitude", 116.4955500) .put("longitude", 116.4955500)
.put("latitude", 39.9885500) .put("latitude", 39.9885500)
.put("address", "北京市朝阳区酒仙桥")
) )
} }
} }
......
...@@ -109,20 +109,18 @@ class SelectPickupPointActivity : BaseMvvmActivity<BorderActivitySelectPickupPoi ...@@ -109,20 +109,18 @@ class SelectPickupPointActivity : BaseMvvmActivity<BorderActivitySelectPickupPoi
* 请求自提点列表 先调用C端客户端信息服务获取经纬度 * 请求自提点列表 先调用C端客户端信息服务获取经纬度
*/ */
private fun requestPickupPoint(type: SelectPickupPointViewModel.LoadType) { private fun requestPickupPoint(type: SelectPickupPointViewModel.LoadType) {
var longitude: Double? = null
var latitude: Double? = null
// 获取C端经纬度信息 // 获取C端经纬度信息
ZapTicket(ZapServiceNameConstants.ClientInfoService) ZapTicket(ZapServiceNameConstants.ClientInfoService)
.withAction(ZapServiceActionConstants.ActionGetCurrentLocation) .withAction(ZapServiceActionConstants.ActionGetCurrentLocation)
.onResult { xResult -> .onResult { xResult ->
val result = xResult.result as JSONObject val result = xResult.result as JSONObject
longitude = result.opt("longitude")?.let { it as Double } val longitude = result.optDouble("longitude")
latitude = result.opt("latitude")?.let { it as Double } 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() }.ship()
location = longitude != null && latitude != null
// 是否有位置信息 控制附近自提点显示
binding.location = location
vm.requestPickupPointList(params?.get(IntentConstants.KEY_EXTRA_MARKETING_ID) as String, longitude, latitude, keyWords, type)
} }
@Subscribe(sticky = false, threadMode = ThreadMode.MAIN) @Subscribe(sticky = false, threadMode = ThreadMode.MAIN)
......
...@@ -25,15 +25,15 @@ class SelectPickupPointViewModel : BaseViewModel() { ...@@ -25,15 +25,15 @@ class SelectPickupPointViewModel : BaseViewModel() {
*/ */
fun requestPickupPointList( fun requestPickupPointList(
marketingId: String, marketingId: String,
longitude: Double?, longitude: Double,
latitude: Double?, latitude: Double,
keyWords: String?, keyWords: String?,
type: LoadType, type: LoadType,
) { ) {
val requestParams = HashMap<String, String?>(6) val requestParams = HashMap<String, String?>(6)
requestParams["marketing_id"] = marketingId requestParams["marketing_id"] = marketingId
longitude?.let { requestParams["longitude"] = it.toString() } if (longitude != 0.0) requestParams["longitude"] = longitude.toString()
latitude?.let { requestParams["latitude"] = it.toString() } if (latitude != 0.0) requestParams["latitude"] = latitude.toString()
if (keyWords?.isNotEmpty() == true) requestParams["keywords"] = keyWords if (keyWords?.isNotEmpty() == true) requestParams["keywords"] = keyWords
OrderRemoteDataSource.getPickupPointList( OrderRemoteDataSource.getPickupPointList(
object : IGetPickupPointListCallback { object : IGetPickupPointListCallback {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment