修改了配色,添加了解除绑定提示
This commit is contained in:
@@ -26,7 +26,6 @@ import com.sw.platecabinet.model.response.EquipmentUserInfo
|
||||
import com.sw.platecabinet.model.response.SearchResult
|
||||
import com.sw.platecabinet.utils.Debouncer
|
||||
import com.sw.platecabinet.utils.KeyboardUtils
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
|
||||
@@ -150,6 +149,17 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
false // 未处理其他动作
|
||||
}
|
||||
}
|
||||
binding.ivSearch.setOnClickListener {
|
||||
debouncer.debounce {
|
||||
// 执行搜索操作
|
||||
viewModel.getSearchMemberList(
|
||||
param = binding.etUserInfo.text.toString(),
|
||||
pageNum = 1
|
||||
)
|
||||
// 隐藏键盘
|
||||
KeyboardUtils.hideKeyboard(requireActivity())
|
||||
}
|
||||
}
|
||||
binding.llBind.setOnClickListener {
|
||||
if (info == null || info!!.equipmentCode?.isEmpty() == true || info!!.equipmentBoxCode?.isEmpty() == true) {
|
||||
ToastUtils.showToast("传入的设备信息异常")
|
||||
@@ -186,12 +196,12 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
override fun registerDataChange() {
|
||||
super.registerDataChange()
|
||||
lifecycleScope.launch {
|
||||
viewModel.searchMemberList.drop(1).collect {
|
||||
viewModel.searchMemberList.collect {
|
||||
adapter.updateData(it)
|
||||
}
|
||||
}
|
||||
lifecycleScope.launch {
|
||||
viewModel.bindStateChange.drop(1).collect {
|
||||
viewModel.bindStateChange.collect {
|
||||
if (it.first == null) return@collect // 解绑状态过滤
|
||||
val errorInfo = it.second
|
||||
if (errorInfo.isSuccess()) {
|
||||
|
||||
Reference in New Issue
Block a user