From b13afc751dbbce24753d008f1f87d2c5e133a4ad Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期二, 09 七月 2024 15:19:26 +0800
Subject: [PATCH] fix bug

---
 app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt b/app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt
index 8572fda..be18eb6 100644
--- a/app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt
+++ b/app/src/main/java/com/dollearn/student/ui/shop/ShopFragment.kt
@@ -1,5 +1,8 @@
 package com.dollearn.student.ui.shop
 
+import android.content.Context
+import android.view.inputmethod.InputMethodManager
+import androidx.core.content.ContextCompat.getSystemService
 import androidx.recyclerview.widget.GridLayoutManager
 import androidx.recyclerview.widget.LinearLayoutManager
 import cn.sinata.xldutils.fragment.BaseFragment
@@ -56,6 +59,8 @@
         }
 
         tv_search.setOnClickListener {
+            (requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager)
+                .hideSoftInputFromWindow(requireActivity().currentFocus!!.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
             if (refreshLayout.isRefreshing)
                 return@setOnClickListener
             search = et_search.text.toString()
@@ -78,7 +83,7 @@
     }
 
     private fun getGoods(){
-        HttpManager.goodListStudy(page,search,goodsTypes.filter { it.checked }.map { it.name }).requestByF(this,success = {_,data->
+        HttpManager.goodListStudy(page,search,goodsTypes.filter { it.checked }.map { it.id.toString() }).requestByF(this,success = {_,data->
             if (page == 1)
                 goods.clear()
             goods.addAll(data ?.records?: arrayListOf())

--
Gitblit v1.7.1