From 749a76a09ef2ed9418849a6eea53c43d9bd8b123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=AD=90=E7=BB=B4?= Date: Fri, 16 Jun 2023 13:49:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B8=B8=E6=88=8F=E5=8D=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96-=E6=B8=B8=E6=88=8F=E5=8D=95?= =?UTF-8?q?=E5=B9=BF=E5=9C=BA=E2=80=940606=E6=B5=8B=E8=AF=95=EF=BC=88?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AD=9B=E9=80=89=E6=B8=B8=E6=88=8F=E5=8D=95?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=97=B6=E8=AF=B7=E6=B1=82=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E5=8F=82=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89=20https://jira.shanqu.cc/browse/GHZS-2641?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../square/GameCollectionSquareViewModel.kt | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareViewModel.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareViewModel.kt index aaf3ec61b2..313c32972c 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareViewModel.kt @@ -48,27 +48,23 @@ class GameCollectionSquareViewModel(application: Application) : } override fun provideDataSingle(page: Int): Single> { - val paramsMap = if (view == "recommend") { - if (refreshCount == 0 && page == 1) { - if (selectedTagId.isNotEmpty()) { - mapOf("refresh" to "true", "tag_id" to selectedTagId, "random" to mRandomId) - } else { - mapOf("refresh" to "true", "random" to mRandomId) - } - } else { - mapOf("random" to mRandomId) - } - } else if (selectedTagId.isNotEmpty()) { - mapOf("tag_id" to selectedTagId) + val paramsMap = if (selectedTagId.isNotEmpty()) { + mutableMapOf("tag_id" to selectedTagId) } else { - mapOf() + mutableMapOf() + } + if (view == "recommend") { + paramsMap["random"] = mRandomId + if (refreshCount == 0 && page == 1) { + paramsMap["refresh"] = "true" + } } return RetrofitManager.getInstance() .api.getGameCollectionSquareList( view, page, PAGE_SIZE, - paramsMap + paramsMap.toMap() ) }