| | |
| | | package com.dollearn.student.ui.shop |
| | | |
| | | import android.content.Context |
| | | import android.view.inputmethod.InputMethodManager |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | |
| | | import com.dollearn.student.network.requestByF |
| | | import com.dollearn.student.ui.shop.adapter.GoodsAdapter |
| | | import com.dollearn.student.ui.shop.adapter.GoodsTypeAdapter |
| | | import com.dollearn.student.ui.welfare.GoodsDetailActivity |
| | | import com.dollearn.student.utils.Const |
| | | import com.dollearn.student.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.fragment_shop.* |
| | |
| | | } |
| | | |
| | | 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() |
| | |
| | | } |
| | | |
| | | 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()) |