|
@@ -4,6 +4,7 @@ import android.content.DialogInterface
|
|
|
import android.graphics.Color
|
|
|
import android.os.Bundle
|
|
|
import android.text.InputType
|
|
|
+import android.text.TextUtils
|
|
|
import android.view.*
|
|
|
import android.widget.*
|
|
|
import androidx.fragment.app.Fragment
|
|
@@ -16,8 +17,10 @@ import cn.yyxx.columbus.core.impl.login.LoginActivity
|
|
|
import cn.yyxx.columbus.core.ui.EventEditText
|
|
|
import cn.yyxx.columbus.core.ui.dialog.AgreementDialog
|
|
|
import cn.yyxx.columbus.core.ui.dialog.ForgetPwdDialog
|
|
|
+import cn.yyxx.columbus.core.utils.EditTextUtils
|
|
|
import cn.yyxx.columbus.core.utils.SessionUtils
|
|
|
import cn.yyxx.support.ResUtils
|
|
|
+import cn.yyxx.support.hawkeye.ToastUtils
|
|
|
|
|
|
/**
|
|
|
* @author #Suyghur.
|
|
@@ -120,7 +123,7 @@ class LauncherFragment : Fragment(), View.OnClickListener {
|
|
|
|
|
|
ivCheck = view.findViewById(ResUtils.getResId(requireActivity(), "yyxx_iv_check", "id"))
|
|
|
tvAgreement = view.findViewById(ResUtils.getResId(requireActivity(), "yyxx_tv_agreement", "id"))
|
|
|
- if (SdkBridgeImpl.initBean.privacyCfg.switch == 0) {
|
|
|
+ if (SdkBridgeImpl.initBean.privacyCfg.switch == 0 || TextUtils.isEmpty(SdkBridgeImpl.initBean.privacyCfg.url)) {
|
|
|
ivCheck.visibility = View.GONE
|
|
|
tvAgreement.visibility = View.GONE
|
|
|
} else {
|
|
@@ -308,6 +311,24 @@ class LauncherFragment : Fragment(), View.OnClickListener {
|
|
|
}
|
|
|
|
|
|
})
|
|
|
+ btnConfirm.setOnClickListener {
|
|
|
+ val userName = eetAccount.editText.text.trim().toString()
|
|
|
+ val phoneNum = eetPhone.editText.text.trim().toString()
|
|
|
+
|
|
|
+ if (!EditTextUtils.filterAccount(userName)) {
|
|
|
+ ToastUtils.toastInfo(requireActivity(), ResUtils.getResString(requireActivity(), "yyxx_tips_account_format_error"))
|
|
|
+ return@setOnClickListener
|
|
|
+ }
|
|
|
+ if (!EditTextUtils.filterPhone(phoneNum)) {
|
|
|
+ ToastUtils.toastInfo(requireActivity(), ResUtils.getResString(requireActivity(), "yyxx_tips_phone_format_error"))
|
|
|
+ return@setOnClickListener
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(code)) {
|
|
|
+ ToastUtils.toastInfo(requireActivity(), ResUtils.getResString(requireActivity(), "yyxx_tips_area_code_format_error"))
|
|
|
+ return@setOnClickListener
|
|
|
+ }
|
|
|
+ invokeForgetPwd()
|
|
|
+ }
|
|
|
show()
|
|
|
}
|
|
|
}
|
|
@@ -338,17 +359,25 @@ class LauncherFragment : Fragment(), View.OnClickListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private fun invokeForgetPwd() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
override fun onClick(v: View?) {
|
|
|
v?.apply {
|
|
|
when (tag as Int) {
|
|
|
ClickType.ACTION_FORGET -> showForgetPwdDialog()
|
|
|
ClickType.ACTION_LAUNCHER -> {
|
|
|
-// val jsonObject = JSONObject()
|
|
|
-// jsonObject.put("login_type", LoginType.TYPE_ACCOUNT_LOGIN)
|
|
|
-// jsonObject.put("uname", eetAccount.editText.text)
|
|
|
-// jsonObject.put("pwd", eetPwd.editText.text)
|
|
|
val userName = eetAccount.editText.text.trim().toString()
|
|
|
val pwd = eetPwd.editText.text.trim().toString()
|
|
|
+ if (!EditTextUtils.filterAccount(userName)) {
|
|
|
+ ToastUtils.toastInfo(requireActivity(), ResUtils.getResString(requireActivity(), "yyxx_tips_account_format_error"))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!EditTextUtils.filterPwd(pwd)) {
|
|
|
+ ToastUtils.toastInfo(requireActivity(), ResUtils.getResString(requireActivity(), "yyxx_tips_pwd_format_error"))
|
|
|
+ return
|
|
|
+ }
|
|
|
loginImpl.userSignInImpl.accountLogin(requireActivity(), userName, pwd)
|
|
|
}
|
|
|
ClickType.ACTION_CLICK_CHECK -> changeCheck()
|