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() {
JSONObject()
.put("longitude", 116.4955500)
.put("latitude", 39.9885500)
.put("address", "北京市朝阳区酒仙桥")
)
}
}
......
......@@ -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 }
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()
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)
......
......@@ -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 {
......
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