新增统一认证
@@ -103,6 +103,11 @@ interface CommonApi {
|
||||
*/
|
||||
@POST("/sys/mLogin")
|
||||
fun mLogin(@Body any: LoginBean): Call<JsonObject>
|
||||
/**
|
||||
* 安眼统一认证
|
||||
*/
|
||||
@POST("/sys/mLoginAnYan")
|
||||
fun mLoginAnYan(@Body any: LoginBean): Call<JsonObject>
|
||||
/**
|
||||
* 首页系统功能介绍弹窗-选择多少天不在提示
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ object UrlConfig {
|
||||
//2025年10月23日 14:37 冯普说改为之前的地址,给油田部署的正式地址还没有启用
|
||||
|
||||
|
||||
val baseUrlType: BaseUrlType = BaseUrlType.TEST
|
||||
val baseUrlType: BaseUrlType = BaseUrlType.PRODUCT
|
||||
|
||||
var testDeviceList = mutableListOf("7e8e7e49a26340b1","bb2d17cc138d109f")//测试设备列表 荣耀 oppo vivo
|
||||
var isTestDevice: Boolean = false
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xjjk.healthyclients.ui.activity
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
@@ -30,7 +31,7 @@ import com.xjjk.healthyclients.base.BaseVMBActivity
|
||||
import com.xjjk.healthyclients.bean.LoginBean
|
||||
import com.xjjk.healthyclients.bean.LoginResponseBean
|
||||
import com.xjjk.healthyclients.data.api.CommonApi
|
||||
import com.xjjk.healthyclients.databinding.ActivityLoginBinding
|
||||
import com.xjjk.healthyclients.databinding.ActivityLoginNewBinding
|
||||
import com.xjjk.healthyclients.retrofit.RetrofitManager
|
||||
import com.xjjk.healthyclients.retrofit.UrlConfig
|
||||
import com.xjjk.healthyclients.superfuntion.loginIm
|
||||
@@ -48,7 +49,7 @@ import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
|
||||
class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.layout.activity_login) {
|
||||
class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R.layout.activity_login_new) {
|
||||
var mApi = RetrofitManager.getRetrofits().create(CommonApi::class.java)
|
||||
|
||||
var isRead=false
|
||||
@@ -59,6 +60,9 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
var mLastTime = 0L
|
||||
var mHits = LongArray(mCount)
|
||||
var isAdminEnable=false
|
||||
var loginType = 1
|
||||
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
CommonUtils.logoutClearData()
|
||||
initAgreement()
|
||||
@@ -135,8 +139,8 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
override fun bindEvent() {
|
||||
mBinding?.apply {
|
||||
addClickViews(
|
||||
loginSubmit,loginIvReadState,loginAgreementRoot,loginRetrievePassword,testBtn,ivIconImg,
|
||||
tvDebug,tvProd,tvTest
|
||||
loginSubmit,loginIvReadState,loginAgreementRoot,loginRetrievePassword,testBtn,
|
||||
tvDebug,tvProd,tvTest,tvLoginHealthy,tvLoginPlatform
|
||||
)
|
||||
}
|
||||
mTextViewDialog?.let {
|
||||
@@ -224,11 +228,11 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
}
|
||||
}
|
||||
}
|
||||
R.id.iv_icon_img->{
|
||||
if (isAdminEnable) {
|
||||
mBinding.testBtn.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
// R.id.iv_icon_img->{
|
||||
// if (isAdminEnable) {
|
||||
// mBinding.testBtn.visibility = View.VISIBLE
|
||||
// }
|
||||
// }
|
||||
|
||||
R.id.tv_debug->{
|
||||
DataStoreManager.saveCurrentConfig(1)
|
||||
@@ -244,6 +248,23 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
DataStoreManager.saveCurrentConfig(3)
|
||||
System.exit(0);
|
||||
}
|
||||
R.id.tv_login_platform -> {
|
||||
loginType = 1
|
||||
mBinding.tvLoginPlatform.setBackgroundResource(R.mipmap.ic_login_platform_bg_green)
|
||||
mBinding.tvLoginPlatform.setTextColor(Color.parseColor("#FFFFFF"))
|
||||
mBinding.tvLoginHealthy.setBackgroundResource(R.mipmap.ic_login_healthy_bg)
|
||||
mBinding.tvLoginHealthy.setTextColor(Color.parseColor("#21BEBD"))
|
||||
|
||||
}
|
||||
|
||||
R.id.tv_login_healthy -> {
|
||||
loginType = 2
|
||||
mBinding.tvLoginPlatform.setBackgroundResource(R.mipmap.ic_login_platform_bg)
|
||||
mBinding.tvLoginPlatform.setTextColor(Color.parseColor("#21BEBD"))
|
||||
mBinding.tvLoginHealthy.setBackgroundResource(R.mipmap.ic_login_healthy_bg_green)
|
||||
mBinding.tvLoginHealthy.setTextColor(Color.parseColor("#FFFFFF"))
|
||||
|
||||
}
|
||||
// R.id.login_iv_eye -> {
|
||||
// mBinding?.let {
|
||||
// var selection=it.loginEtUserPassword.selectionEnd
|
||||
@@ -269,7 +290,7 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
}
|
||||
private fun initAgreement() {
|
||||
// var text="已阅读并同意《用户协议》、《隐私政策》和《相关法律说明》"
|
||||
var text="已阅读并同意《用户协议》、《隐私政策》"
|
||||
var text="已阅读并同意《用户协议》和《隐私政策》"
|
||||
var span= SpannableString(text)
|
||||
span.setSpan(object : ClickableSpan() {
|
||||
|
||||
@@ -285,7 +306,7 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
mContext?.let{
|
||||
span.setSpan(NoUnderlineSpan(),6 , 12, Spanned.SPAN_MARK_MARK)
|
||||
span.setSpan(
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.link_blue_color)),6, 12, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.theme_color)),6, 12, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
}
|
||||
|
||||
span.setSpan(object : ClickableSpan() {
|
||||
@@ -302,7 +323,7 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
mContext?.let{
|
||||
span.setSpan(NoUnderlineSpan(),13 , 19, Spanned.SPAN_MARK_MARK)
|
||||
span.setSpan(
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.link_blue_color)),13, 19, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.theme_color)),13, 19, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
}
|
||||
// span.setSpan(object : ClickableSpan() {
|
||||
//
|
||||
@@ -345,8 +366,13 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginBinding>(R.la
|
||||
bean.username=name
|
||||
bean.password=RSACipherStrategy().encrypt(ConstantUtils.mRSAKey,password)
|
||||
// bean.password=password
|
||||
var login=mApi.mLogin(bean)
|
||||
login.enqueue(object : Callback<JsonObject>{
|
||||
var login: Call<JsonObject>?=null
|
||||
if (loginType == 1) {
|
||||
login = mApi.mLoginAnYan(bean)
|
||||
} else if (loginType == 2) {
|
||||
login = mApi.mLogin(bean)
|
||||
}
|
||||
login!!.enqueue(object : Callback<JsonObject>{
|
||||
override fun onResponse(call: Call<JsonObject>, response: Response<JsonObject>) {
|
||||
dialog?.dismiss()
|
||||
try {
|
||||
|
||||
@@ -8,12 +8,12 @@ import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.xjjk.healthyclients.R
|
||||
import com.xjjk.healthyclients.databinding.CustomPasswordViewBinding
|
||||
import com.xjjk.healthyclients.databinding.CustomPasswordViewNewBinding
|
||||
|
||||
class CustomPasswordView : RelativeLayout {
|
||||
|
||||
var mContext:Context?=null
|
||||
lateinit var mBinding: CustomPasswordViewBinding
|
||||
lateinit var mBinding: CustomPasswordViewNewBinding
|
||||
constructor(context: Context?,attrs : AttributeSet?): super(context, attrs,0){
|
||||
mContext=context
|
||||
// if(isInEditMode){
|
||||
@@ -21,7 +21,7 @@ class CustomPasswordView : RelativeLayout {
|
||||
// }else{
|
||||
mBinding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(context),
|
||||
R.layout.custom_password_view, this,true)
|
||||
R.layout.custom_password_view_new, this,true)
|
||||
// }
|
||||
mBinding.loginEtUserPassword.setTransformationMethod(PasswordTransformationMethod.getInstance())
|
||||
mBinding.loginIvEye.setOnClickListener {
|
||||
|
||||
|
After Width: | Height: | Size: 512 KiB |
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/login_root_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/login_view_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_icon_bg_new" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="24dp"
|
||||
android:layout_marginTop="155dp"
|
||||
android:letterSpacing="0.1"
|
||||
android:lineSpacingMultiplier="1.1"
|
||||
android:text="你好呀,\n欢迎使用 健康油我"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@drawable/bg_white_bottom_right_angle_background_shap20"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="38dp"
|
||||
android:layout_marginTop="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_login_platform"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/ic_login_platform_bg_green"
|
||||
android:gravity="center"
|
||||
android:text="平台统一认证"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_login_healthy"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/ic_login_healthy_bg"
|
||||
android:gravity="center"
|
||||
android:text="健康系统认证"
|
||||
android:textColor="@color/theme_color"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/login_et_user_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:layout_marginRight="@dimen/dp_38"
|
||||
android:background="@drawable/bg_grey_background_shap_radius23"
|
||||
android:hint="请输入员工编号或用户名"
|
||||
android:longClickable="false"
|
||||
android:maxLength="20"
|
||||
android:maxLines="1"
|
||||
android:drawablePadding="6dp"
|
||||
android:paddingLeft="@dimen/dp_18"
|
||||
android:drawableLeft="@mipmap/ic_login_phone"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/text_black_33"
|
||||
android:textColorHint="@color/text_black_99"
|
||||
android:textSize="@dimen/txt14" />
|
||||
|
||||
<com.xjjk.healthyclients.view.CustomPasswordView
|
||||
android:id="@+id/login_et_user_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20" />
|
||||
|
||||
|
||||
<com.allen.library.shape.ShapeTextView
|
||||
android:id="@+id/login_submit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginLeft="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_36"
|
||||
android:gravity="center"
|
||||
android:text="登录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/txt16"
|
||||
app:shapeCornersRadius="24dp"
|
||||
app:shapeSolidColor="@color/theme_color" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_retrieve_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="找回密码"
|
||||
android:textColor="@color/text_black_99"
|
||||
android:textSize="@dimen/txt14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/test_btn"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:textColor="@color/text_black_99"
|
||||
android:textSize="@dimen/txt14" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/test_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_debug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:text="开发"
|
||||
android:textColor="@color/text_black_99"
|
||||
android:textSize="@dimen/txt14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_test"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:text="测试"
|
||||
android:textColor="@color/text_black_99"
|
||||
android:textSize="@dimen/txt14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_prod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginRight="30dp"
|
||||
android:text="正式"
|
||||
android:textColor="@color/text_black_99"
|
||||
android:textSize="@dimen/txt14" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/login_agreement_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_35"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginRight="@dimen/dp_35"
|
||||
android:layout_marginBottom="@dimen/dp_35"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/login_iv_read_state"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:src="@drawable/ic_login_no_select" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_tv_agreement"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_5"
|
||||
android:lineSpacingExtra="@dimen/dp_8"
|
||||
android:textColor="@color/text_black_99"
|
||||
android:textSize="@dimen/txt12" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/login_et_user_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginLeft="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_38"
|
||||
android:background="@drawable/bg_grey_background_shap_radius23"
|
||||
android:drawableLeft="@mipmap/ic_login_password"
|
||||
android:drawablePadding="6dp"
|
||||
android:hint="请输入密码"
|
||||
android:inputType="textPassword"
|
||||
android:longClickable="false"
|
||||
android:maxLength="32"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/dp_18"
|
||||
android:paddingRight="@dimen/dp_25"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/text_black_33"
|
||||
android:textColorHint="@color/text_black_99"
|
||||
android:textSize="@dimen/txt14" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/login_iv_eye"
|
||||
android:layout_width="@dimen/dp_35"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:padding="10dp"
|
||||
android:src="@mipmap/ic_password_hind" />
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
|
After Width: | Height: | Size: 816 B |
|
After Width: | Height: | Size: 672 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
@@ -2,8 +2,8 @@ ext {
|
||||
minSdkVersion = 26
|
||||
targetSdkVersion = 32
|
||||
compileSdkVersion = 33
|
||||
versionCode = 102
|
||||
versionName = "1.0.2"
|
||||
versionCode = 10003
|
||||
versionName = "1.00.03"
|
||||
//Dependencies
|
||||
junitVersion = "4.12"
|
||||
lifecycleVersion = "2.6.0-alpha01"
|
||||
|
||||