Commit c0c3b24c authored by 张释方's avatar 张释方

完成热门景点功能2

parent d3618d3f
......@@ -138,4 +138,10 @@ interface MainApi {
@POST("na/getChooseExperienceData")
fun getChooseExperienceData(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<DetailedBean>>>
/**
* 热门景点
*/
@POST("xx/xxx")
fun getHotView(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<HotViewBean>>>
}
\ No newline at end of file
......@@ -183,5 +183,28 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
}
}
}
/**
* 获取人们景点数据
*/
var hotviewData=MutableLiveData<HotViewBean>()
fun getHotView() {
val vo = java.util.HashMap<String, Any>()
vo["status"] = 1
ApiModel.getHotView(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<HotViewBean>>(
this@HomeViewModel, true) {
override fun onBusinessSuccess(response: BaseResponse<HotViewBean>) {
hotviewData.value = response.result
KLog.e("getmyInfo", response.result.toString())
}
override fun onError(e: Throwable) {
super.onError(e)
KLog.e("getmyInfo", "用户登录信息请求失败")
}
}
)
}
}
\ No newline at end of file
......@@ -146,4 +146,9 @@ object ApiModel {
fun authorizedA():Observable<Response<BaseResponse<AuthorizedBean>>>{
return HttpManager.getInstance().execute(null,MainApi.newInstance().authorizedA())
}
fun getHotView(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, Any>):Observable<Response<BaseResponse<HotViewBean>>>{
return HttpManager.getInstance().execute(lifecycleProvider,MainApi.newInstance().getHotView(map))
}
}
\ No newline at end of file
......@@ -16,12 +16,13 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_click"
android:layout_marginBottom="40dp"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:layout_marginBottom="40dp"
android:src="@mipmap/positioning_icon"
app:layout_constraintBottom_toBottomOf="@id/bmapView"
app:layout_constraintEnd_toEndOf="parent"
......@@ -39,22 +40,31 @@
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:visibility="gone"
android:id="@+id/image_map_history"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginTop="15dp"
android:src="@mipmap/map_history_icon"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_map_change" />
<ImageView
android:id="@+id/ly_hotview"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_margin="20dp"
android:src="@mipmap/icon_hotview"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_map_history" />
<ImageView
android:id="@+id/image_location_icon"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginBottom="220dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="220dp"
android:src="@mipmap/location_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
......@@ -63,8 +73,8 @@
android:id="@+id/map_a_d"
android:layout_width="31dp"
android:layout_height="63dp"
android:layout_marginBottom="10dp"
android:layout_marginEnd="2dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@id/image_location_icon"
......@@ -89,8 +99,8 @@
<View
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:background="@color/color_333" />
</LinearLayout>
......@@ -110,8 +120,8 @@
android:layout_height="wrap_content"
android:background="@drawable/cursor_bg"
android:gravity="center_horizontal"
android:paddingBottom="10dp"
android:orientation="vertical">
android:orientation="vertical"
android:paddingBottom="10dp">
<ImageView
android:id="@+id/image_under"
......@@ -127,53 +137,53 @@
android:id="@+id/stb_bg_search"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_under"
app:stv_corner="20dp"
app:stv_solid="#F5F9FA"
app:stv_stroke_color="#ffe1e1e1"
app:stv_stroke_width="1dp"
/>
app:stv_stroke_width="1dp" />
<ImageView
android:layout_marginStart="16dp"
android:id="@+id/im_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:src="@mipmap/search_icon"
app:layout_constraintBottom_toBottomOf="@id/stb_bg_search"
app:layout_constraintStart_toStartOf="@id/stb_bg_search"
app:layout_constraintTop_toTopOf="@id/stb_bg_search" />
<View
android:background="#A1A3AF"
android:layout_width="0.5dp"
android:layout_height="14dp"
android:layout_marginStart="16dp"
android:background="#A1A3AF"
app:layout_constraintBottom_toBottomOf="@id/stb_bg_search"
app:layout_constraintStart_toEndOf="@id/im_search"
app:layout_constraintTop_toTopOf="@id/stb_bg_search" />
<TextView
android:layout_marginStart="27dp"
app:layout_constraintBottom_toBottomOf="@id/stb_bg_search"
app:layout_constraintStart_toEndOf="@id/im_search"
app:layout_constraintTop_toTopOf="@id/stb_bg_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="27dp"
android:text="搜索境内、境外地址"
android:textColor="#A2A4B1"
android:textSize="14sp" />
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@id/stb_bg_search"
app:layout_constraintStart_toEndOf="@id/im_search"
app:layout_constraintTop_toTopOf="@id/stb_bg_search" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.mints.street.widget.ScrollRecyclerView
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:itemBinding="@{viewModel.addressItemBinding}"
app:items="@{viewModel.addressList}"
tools:listitem="@layout/item_home_button">
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="350dp"
android:orientation="vertical"
android:background="@drawable/shape_dialog_bg">
<ImageView
android:id="@+id/iv_close"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="10dp"
android:src="@mipmap/icon_hot_view_close"
android:layout_gravity="end"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_height="300dp"
android:layout_width="match_parent" />
</LinearLayout>
\ No newline at end of file
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