调整了部分问题
This commit is contained in:
@@ -7,6 +7,7 @@ import com.sw.plate.utils.ToastUtils
|
||||
import com.sw.platecabinet.databinding.ActivityLoginByPwdBinding
|
||||
import com.sw.platecabinet.databinding.ItemTitleTimeBinding
|
||||
import com.sw.platecabinet.viewmodel.UserViewModel
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
|
||||
@@ -34,28 +35,23 @@ class LoginByPwdActivity : BaseActivity<ActivityLoginByPwdBinding>() {
|
||||
binding.tvFaceRec.setOnClickListener {
|
||||
val intent = Intent(this, LoginByFaceActivity::class.java)
|
||||
startActivity(intent)
|
||||
// handleScanKeyInfo(binding.etPwd.text.toString())
|
||||
}
|
||||
}
|
||||
|
||||
override fun registerDataChange() {
|
||||
super.registerDataChange()
|
||||
lifecycleScope.launch {
|
||||
viewModel.currentUserInfo.collect {
|
||||
Timber.d("currentUserInfo it = $it")
|
||||
if (it != null) {
|
||||
ToastUtils.showToast("登录成功")
|
||||
MainActivity.start(context, pageType = PageType.PLATE_CABINET_FULL)
|
||||
finish()
|
||||
viewModel.currentUserInfo
|
||||
.drop(1)
|
||||
.collect {
|
||||
Timber.d("currentUserInfo it = $it")
|
||||
if (it != null) {
|
||||
// ToastUtils.showToast("登录成功")
|
||||
MainActivity.start(context, pageType = PageType.PLATE_OPEN)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lifecycleScope.launch {
|
||||
viewModel.showLoading.collect {
|
||||
if (it) {
|
||||
showWaitingDialog("")
|
||||
} else {
|
||||
hideWaitingDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user