From b1b5be9976d9818c0086450192a3533d6764ac48 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 10 Aug 2022 23:49:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98,shouye=20ytuijian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragment/SearchRecommendFragment.java | 2 +- .../views/SearchRecommendBodyViewHolder.java | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java index 295219ffa..3ac45b11f 100644 --- a/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/SearchRecommendFragment.java @@ -93,7 +93,7 @@ public class SearchRecommendFragment extends BaseFragment { @Subscribe(threadMode = ThreadMode.MAIN) public void onSearchRecommendEvent(SearchRecommendEvent event) { - loadData(); +// loadData(); } } diff --git a/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java b/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java index 03f660b38..e1a5b0953 100644 --- a/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/SearchRecommendBodyViewHolder.java @@ -9,12 +9,20 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.yunbao.common.bean.AnchorRecommendItemModel; +import com.yunbao.common.bean.AnchorRecommendModel; +import com.yunbao.common.bean.SearchRecommendModel; import com.yunbao.common.event.SearchRecommendEvent; +import com.yunbao.common.http.base.HttpCallback; +import com.yunbao.common.http.main.MainNetManager; +import com.yunbao.common.manager.SearchHistoryRecordManager; import com.yunbao.common.utils.Bus; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.main.R; import com.yunbao.main.adapter.SearchRecommendBodyAdapter; +import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * 搜索推荐页头部搜索历史信息 @@ -34,7 +42,20 @@ public class SearchRecommendBodyViewHolder extends RecyclerView.ViewHolder { changeBatch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Bus.get().post(new SearchRecommendEvent()); +// Bus.get().post(new SearchRecommendEvent()); + MainNetManager.get((Activity) itemView.getContext()) + .anchorRecommend("10", new HttpCallback() { + @Override + public void onSuccess(AnchorRecommendModel data) { + showData(data.getList()); + + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); } }); }