Commit 039be24a authored by fengruiyu's avatar fengruiyu

未登录时打开景点推荐,然后登陆,景点推荐全没了

问题已经解决
parent f4d6a04f
...@@ -266,7 +266,8 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -266,7 +266,8 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
* 第一次加载 * 第一次加载
*/ */
private fun beginInitZsMap(lat: Double? = null, lng: Double? = null, private fun beginInitZsMap(lat: Double? = null, lng: Double? = null,
inner: Int = 0,bean: HotViewBean?=null) { inner: Int = 0,bean: HotViewBean?=null,mapType:String?
,showVrButton:Int?,showScenics:Int?) {
val initMapBean = InitMapBean() val initMapBean = InitMapBean()
initMapBean.lat = lat ?: gps.lat initMapBean.lat = lat ?: gps.lat
initMapBean.lng = lng ?: gps.lng initMapBean.lng = lng ?: gps.lng
...@@ -278,9 +279,9 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -278,9 +279,9 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
initMapBean.vip = 0 initMapBean.vip = 0
} }
initMapBean.inner = inner initMapBean.inner = inner
initMapBean.mapType = "hybrid" initMapBean.mapType = mapType
initMapBean.showVrButton = 1 initMapBean.showVrButton = showVrButton
initMapBean.showScenics = 0 initMapBean.showScenics = showScenics
initMapBean.scenics = bean?.list initMapBean.scenics = bean?.list
binding.webview.callHandler( binding.webview.callHandler(
"beginInitZsMap", Gson().toJson(initMapBean) "beginInitZsMap", Gson().toJson(initMapBean)
...@@ -444,7 +445,18 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel ...@@ -444,7 +445,18 @@ class GoogleMapFragment() : BaseFragment<ActivityGoogleMapBinding, HomeViewModel
}) })
viewModel.viewRecommed.observe(this, Observer { viewModel.viewRecommed.observe(this, Observer {
it?.apply { it?.apply {
beginInitZsMap(gps.lat, gps.lng,bean = this) var mapType:String? = null
viewModel.mapStyleSortBean.value?.mapStyleSort?.get(0)?.list?.forEach outside@{bean->
if(bean.isSelected == true){
mapType = bean.key
return@outside
}
}
beginInitZsMap(gps.lat, gps.lng,bean = this,mapType = mapType?:"hybrid",
showVrButton =if (viewModel.mapStyleSortBean.value
?.isStreetViewMap == true){1}else{0}
,showScenics = if (viewModel.mapStyleSortBean.value
?.isRecommendedPlaces == true){1}else{0})
} }
}) })
} }
......
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