|
@@ -422,6 +422,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
422
|
422
|
updateAppRv()
|
423
|
423
|
if (it.fromNetWorkType==1){
|
424
|
424
|
quitAccount(it)
|
|
425
|
+ }else if (it.fromNetWorkType==2){
|
|
426
|
+ changeCode(it)
|
425
|
427
|
}
|
426
|
428
|
}
|
427
|
429
|
}
|
|
@@ -643,14 +645,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
643
|
645
|
private fun getChangeCodeListener(): AppAdapter.ChangePwdListener {
|
644
|
646
|
return object : AppAdapter.ChangePwdListener {
|
645
|
647
|
override fun changeCode() {
|
646
|
|
- val deviceSetBean = StrategyUtils.getSchoolDeviceSetBean(this@MainActivity)
|
647
|
|
- var showFlag = true
|
648
|
|
- if (deviceSetBean != null && deviceSetBean.changePwd == 0) {
|
649
|
|
- //学校设置是否禁止修改密码
|
650
|
|
- showFlag = false
|
651
|
|
- }
|
652
|
|
- if (showFlag) {
|
653
|
|
- showChangeCodeDialog()
|
|
648
|
+ userBean?.let {
|
|
649
|
+ viewModel.getSchoolSetData(it.schoolid,2)
|
654
|
650
|
}
|
655
|
651
|
}
|
656
|
652
|
|
|
@@ -678,6 +674,18 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
678
|
674
|
}
|
679
|
675
|
}
|
680
|
676
|
|
|
677
|
+ private fun changeCode(deviceSetBean:SchoolDeviceSetBean?){
|
|
678
|
+ //val deviceSetBean = StrategyUtils.getSchoolDeviceSetBean(this@MainActivity)
|
|
679
|
+ var showFlag = true
|
|
680
|
+ if (deviceSetBean != null && deviceSetBean.changePwd == 0) {
|
|
681
|
+ //学校设置是否禁止修改密码
|
|
682
|
+ showFlag = false
|
|
683
|
+ }
|
|
684
|
+ if (showFlag) {
|
|
685
|
+ showChangeCodeDialog()
|
|
686
|
+ }
|
|
687
|
+ }
|
|
688
|
+
|
681
|
689
|
private fun showChangeCodeDialog() {
|
682
|
690
|
CustomDialog.build()
|
683
|
691
|
.setCustomView(object : OnBindView<CustomDialog>(R.layout.layout_changecode_dialog) {
|
|
@@ -694,16 +702,16 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
694
|
702
|
val oldCode = oldCodeEt.text.toString()
|
695
|
703
|
val newCode = newCodeEt.text.toString()
|
696
|
704
|
if (!getTextFlag(enterCode) || !getTextFlag(oldCode) || !getTextFlag(newCode)) {
|
697
|
|
- Toast("密码不符合规则")
|
|
705
|
+ Toast(getString(R.string.codetips))
|
698
|
706
|
return@setOnClickListener
|
699
|
707
|
}
|
700
|
708
|
if (oldCode.equals(newCode)) {
|
701
|
|
- Toast("新密码不能和旧密码一致")
|
|
709
|
+ Toast(getString(R.string.codetipsold))
|
702
|
710
|
return@setOnClickListener
|
703
|
711
|
}
|
704
|
712
|
|
705
|
713
|
if (!newCode.equals(enterCode)) {
|
706
|
|
- Toast("两次输入的新密码不一致")
|
|
714
|
+ Toast(getString(R.string.codetipsnew))
|
707
|
715
|
return@setOnClickListener
|
708
|
716
|
}
|
709
|
717
|
|
|
@@ -1642,7 +1650,11 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
1642
|
1650
|
|
1643
|
1651
|
}
|
1644
|
1652
|
}else{
|
1645
|
|
- Toast("密码错误!")
|
|
1653
|
+ if (code.isNullOrBlank()){
|
|
1654
|
+ Toast(getString(R.string.codenoempty))
|
|
1655
|
+ }else{
|
|
1656
|
+ Toast(getString(R.string.codetips))
|
|
1657
|
+ }
|
1646
|
1658
|
}
|
1647
|
1659
|
}
|
1648
|
1660
|
cancelTv.setOnClickListener {
|
|
@@ -1687,7 +1699,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),Download
|
1687
|
1699
|
val titleTv = v.findViewById<TextView>(R.id.dialog_title_tv)
|
1688
|
1700
|
val contentTv = v.findViewById<TextView>(R.id.dialog_content_tv)
|
1689
|
1701
|
contentTv.text=msg
|
1690
|
|
- titleTv.text="通知"
|
|
1702
|
+ titleTv.text=getString(R.string.notice)
|
1691
|
1703
|
closeBtn.setOnClickListener {
|
1692
|
1704
|
dialog.dismiss()
|
1693
|
1705
|
}
|