[1.0.8] 1.手表接口替换 2.登录页面UI修改 3.修改密码逻辑
This commit is contained in:
@@ -6,6 +6,7 @@ import com.xjjk.healthyclients.R
|
||||
import com.xjjk.healthyclients.adapter.common.BaseDataBindingAdapter
|
||||
import com.xjjk.healthyclients.bean.CvdMainBean
|
||||
import com.xjjk.healthyclients.databinding.ItemCvdMainBinding
|
||||
import com.xjjk.healthyclients.superfuntion.orEmptyDefault
|
||||
|
||||
class CvdMainAdapter :
|
||||
BaseDataBindingAdapter<CvdMainBean.dataBean, ItemCvdMainBinding>(
|
||||
@@ -46,7 +47,7 @@ class CvdMainAdapter :
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.valueTv.text = item.dataValue
|
||||
mBinding.valueTv.text = item.dataValue.orEmptyDefault()
|
||||
mBinding.nameTv.text = item.wdTypeName
|
||||
mBinding.dateTv.text = item.dataDate
|
||||
}
|
||||
|
||||
@@ -49,6 +49,10 @@ public class CvdMainBean {
|
||||
private String dataValue;
|
||||
private String warnMin;
|
||||
private String warnMax;
|
||||
private String dataMax;
|
||||
private String dataMin;
|
||||
private String dataAvg;
|
||||
|
||||
|
||||
public dataBean(String wdType, String wdTypeName,String dataDate,String dataValue) {
|
||||
this.wdType = wdType;
|
||||
@@ -108,6 +112,30 @@ public class CvdMainBean {
|
||||
public void setWarnMax(String warnMax) {
|
||||
this.warnMax = warnMax;
|
||||
}
|
||||
|
||||
public String getDataMin() {
|
||||
return dataMin;
|
||||
}
|
||||
|
||||
public void setDataMin(String dataMin) {
|
||||
this.dataMin = dataMin;
|
||||
}
|
||||
|
||||
public String getDataAvg() {
|
||||
return dataAvg;
|
||||
}
|
||||
|
||||
public void setDataAvg(String dataAvg) {
|
||||
this.dataAvg = dataAvg;
|
||||
}
|
||||
|
||||
public String getDataMax() {
|
||||
return dataMax;
|
||||
}
|
||||
|
||||
public void setDataMax(String dataMax) {
|
||||
this.dataMax = dataMax;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.xjjk.healthyclients.bean
|
||||
|
||||
class CvdMainBeanNew {
|
||||
var indexItemVos: ArrayList<CvdMainBean.dataBean>? = null
|
||||
var days: String? = null
|
||||
var distance: Long = 0
|
||||
var aveSleep: Double = 0.0
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.xjjk.healthyclients.data.api
|
||||
|
||||
import com.xjjk.healthyclients.bean.CvdMainBean
|
||||
import com.xjjk.healthyclients.bean.CvdRiskInfoBean
|
||||
import com.xjjk.healthyclients.bean.CvdMainBeanNew
|
||||
import com.xjjk.healthyclients.bean.CvdWarningHistoryBean
|
||||
import com.xjjk.healthyclients.retrofit.intervention.CustomInterventionResponseResult
|
||||
import retrofit2.Call
|
||||
@@ -203,8 +202,10 @@ interface HealthCheckNetApi {
|
||||
/**
|
||||
* 查询心血管首页数据
|
||||
*/
|
||||
@GET("health-watch/watchH5Api/indexDataNew")
|
||||
fun getCvdHomeData(@Query("userId") userId: String): Call<CustomInterventionResponseResult<CvdMainBean>>
|
||||
// @GET("health-watch/watchH5Api/indexDataNew")
|
||||
// fun getCvdHomeData(@Query("userId") userId: String): Call<CustomInterventionResponseResult<CvdMainBean>>
|
||||
@GET("health-watch/watchH5Api/indexDataNew/v2")
|
||||
fun getCvdHomeData(@Query("userId") userId: String): Call<CustomInterventionResponseResult<CvdMainBeanNew>>
|
||||
// /**
|
||||
// * 防范心梗 查询是否填写问卷
|
||||
// */
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.xjjk.healthyclients.adapter.CvdMainAdapter
|
||||
import com.xjjk.healthyclients.base.BaseVMBFragment
|
||||
import com.xjjk.healthyclients.base.viewmodel.TestViewModel
|
||||
import com.xjjk.healthyclients.bean.CvdMainBean
|
||||
import com.xjjk.healthyclients.bean.TitleTagBean
|
||||
import com.xjjk.healthyclients.bean.CvdMainBeanNew
|
||||
import com.xjjk.healthyclients.chart.DoubleWheelBPicker
|
||||
import com.xjjk.healthyclients.chart.HeartRateProvider
|
||||
import com.xjjk.healthyclients.chart.TemperatureProvider
|
||||
@@ -108,7 +108,6 @@ class MonitorFragment: BaseVMBFragment<TestViewModel, FragmentMonitorBinding>(R.
|
||||
mBinding.let {
|
||||
addClickViews(it.stepLayout, it.sleepLayout)
|
||||
|
||||
|
||||
}
|
||||
|
||||
// titleTextAdapter.setOnItemClickListener { adapter, view, position ->
|
||||
@@ -117,29 +116,29 @@ class MonitorFragment: BaseVMBFragment<TestViewModel, FragmentMonitorBinding>(R.
|
||||
|
||||
cvdMainAdapter.setOnItemClickListener { adapter, view, position ->
|
||||
var data = adapter.data[position] as CvdMainBean.dataBean
|
||||
when (position) {
|
||||
0 -> {
|
||||
when (data.wdType) {
|
||||
"heart_rate" -> {
|
||||
var bundle = Bundle()
|
||||
bundle.putString("path", "heartRate")
|
||||
bundle.putString("date", data.dataDate)
|
||||
toActivity(InterventionWebActivity::class.java, bundle)
|
||||
}
|
||||
|
||||
1 -> {
|
||||
"spo2" -> {
|
||||
var bundle = Bundle()
|
||||
bundle.putString("path", "oxygenSaturation")
|
||||
bundle.putString("date", data.dataDate)
|
||||
toActivity(InterventionWebActivity::class.java, bundle)
|
||||
}
|
||||
|
||||
2 -> {
|
||||
"stress" -> {
|
||||
var bundle = Bundle()
|
||||
bundle.putString("path", "pressure")
|
||||
bundle.putString("date", data.dataDate)
|
||||
toActivity(InterventionWebActivity::class.java, bundle)
|
||||
}
|
||||
|
||||
3 -> {
|
||||
"temperature" -> {
|
||||
var bundle = Bundle()
|
||||
bundle.putString("path", "temperature")
|
||||
bundle.putString("date", data.dataDate)
|
||||
@@ -198,25 +197,27 @@ class MonitorFragment: BaseVMBFragment<TestViewModel, FragmentMonitorBinding>(R.
|
||||
private fun getHomePageUserInfo() {
|
||||
dialog?.show()
|
||||
var getCvdHomeData = mApi.getCvdHomeData(mUserId)
|
||||
getCvdHomeData.enqueue(object : CallbackInterventionManager<CvdMainBean>() {
|
||||
getCvdHomeData.enqueue(object : CallbackInterventionManager<CvdMainBeanNew>() {
|
||||
|
||||
override fun onSuccess(
|
||||
code: Int,
|
||||
result: CvdMainBean?,
|
||||
result: CvdMainBeanNew?,
|
||||
message: String,
|
||||
ok: Boolean
|
||||
) {
|
||||
dialog?.dismiss()
|
||||
result?.let {
|
||||
|
||||
|
||||
mBinding.sleepValue2Tv.text =
|
||||
"平均睡眠${result.aveSleep.toInt() / 60}小时${result.aveSleep.toInt() % 60}分钟"
|
||||
mBinding.stepValue2Tv.text = "累计约步行${result.distance / 1000}公里"
|
||||
if (result.indexItemVos==null) {
|
||||
return@let
|
||||
}
|
||||
|
||||
var indexItemVos = result.indexItemVos
|
||||
|
||||
val iterator = indexItemVos.iterator()
|
||||
val iterator = indexItemVos!!.iterator()
|
||||
while (iterator.hasNext()) {
|
||||
val dataBean = iterator.next()
|
||||
if (dataBean.wdType.equals("sleep")) {
|
||||
|
||||
@@ -26,6 +26,9 @@ object UrlConfig {
|
||||
//2025年10月23日 14:37 冯普说改为阿里云的地址,给油田部署的正式地址还没有启用
|
||||
// 2025年11月5日 09:27 冯普说改为给油田部署的正式地址并打包加固
|
||||
|
||||
// 安眼修改密码
|
||||
const val ANYAN_CHANGE_PASSWORD_H5 = "https://sso.iosp.ydpt.tech/SSOManageClient/userController/changePassword"
|
||||
|
||||
|
||||
val baseUrlType: BaseUrlType = BaseUrlType.PRODUCT
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ import com.xjjk.healthyclients.ui.viewmodel.LoginViewModel
|
||||
import com.xjjk.healthyclients.utils.CommonUtils
|
||||
import com.xjjk.healthyclients.utils.ConstantUtils
|
||||
import com.xjjk.healthyclients.view.TextViewDialog
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import retrofit2.Call
|
||||
@@ -49,24 +48,27 @@ import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
|
||||
class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R.layout.activity_login_new) {
|
||||
class LoginActivity :
|
||||
BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R.layout.activity_login_new) {
|
||||
var mApi = RetrofitManager.getRetrofits().create(CommonApi::class.java)
|
||||
|
||||
var isRead=false
|
||||
var mTextViewDialog : TextViewDialog?=null
|
||||
var isRead = false
|
||||
var mTextViewDialog: TextViewDialog? = null
|
||||
|
||||
var time: Long = 2000
|
||||
var mCount = 5
|
||||
var mLastTime = 0L
|
||||
var mHits = LongArray(mCount)
|
||||
var isAdminEnable=false
|
||||
var isAdminEnable = false
|
||||
var loginType = 1
|
||||
|
||||
var loginClickTime = 0L
|
||||
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
CommonUtils.logoutClearData()
|
||||
initAgreement()
|
||||
mTextViewDialog= TextViewDialog(this)
|
||||
mTextViewDialog = TextViewDialog(this)
|
||||
mBinding?.let {
|
||||
// it.loginEtUserName.setText("test8")
|
||||
// it.loginEtUserPassword.setText("Aa123456")
|
||||
@@ -80,15 +82,14 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun initData() {
|
||||
var state= DataStoreManager.isAgreePrivacyPolicyStatus()
|
||||
var state = DataStoreManager.isAgreePrivacyPolicyStatus()
|
||||
if (state) {
|
||||
if (state) {
|
||||
isRead=true
|
||||
isRead = true
|
||||
mBinding.loginIvReadState.setImageResource(R.drawable.ic_login_green_select)
|
||||
}else{
|
||||
isRead=false
|
||||
} else {
|
||||
isRead = false
|
||||
mBinding.loginIvReadState.setImageResource(R.drawable.ic_login_no_select)
|
||||
}
|
||||
}
|
||||
@@ -105,24 +106,38 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
mViewModel.list.collectLatest { list ->
|
||||
if (list != null) {
|
||||
list?.let {
|
||||
for (index in 0 until it.size){
|
||||
when(it[index].value){
|
||||
for (index in 0 until it.size) {
|
||||
when (it[index].value) {
|
||||
"1" -> {
|
||||
//用户协议
|
||||
if (it[index].text.isNotEmpty()) {
|
||||
DataStoreManager.saveUserAgreementUrl(UrlConfig.getH5BaseUrl(UrlConfig.baseUrlType)+it[index].text)
|
||||
DataStoreManager.saveUserAgreementUrl(
|
||||
UrlConfig.getH5BaseUrl(
|
||||
UrlConfig.baseUrlType
|
||||
) + it[index].text
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
"2" -> {
|
||||
//隐私政策
|
||||
if (it[index].text.isNotEmpty()) {
|
||||
DataStoreManager.savePrivacyAgreementUrl(UrlConfig.getH5BaseUrl(UrlConfig.baseUrlType)+it[index].text)
|
||||
DataStoreManager.savePrivacyAgreementUrl(
|
||||
UrlConfig.getH5BaseUrl(
|
||||
UrlConfig.baseUrlType
|
||||
) + it[index].text
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
"3" -> {
|
||||
//相关法律说明
|
||||
if (it[index].text.isNotEmpty()) {
|
||||
DataStoreManager.saveLawUrl(UrlConfig.getH5BaseUrl(UrlConfig.baseUrlType)+it[index].text)
|
||||
DataStoreManager.saveLawUrl(
|
||||
UrlConfig.getH5BaseUrl(
|
||||
UrlConfig.baseUrlType
|
||||
) + it[index].text
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,9 +154,9 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
override fun bindEvent() {
|
||||
mBinding?.apply {
|
||||
addClickViews(
|
||||
loginSubmit,loginIvReadState,loginAgreementRoot,loginRetrievePassword,testBtn,
|
||||
tvDebug,tvProd,tvTest,tvLoginHealthy,tvLoginPlatform
|
||||
)
|
||||
loginSubmit, loginIvReadState, loginAgreementRoot, loginRetrievePassword,
|
||||
tvLoginHealthy, tvLoginPlatform
|
||||
)
|
||||
}
|
||||
mTextViewDialog?.let {
|
||||
it.setDialogTitle("温馨提示", 18f)
|
||||
@@ -167,7 +182,7 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
if (mHits[0] >= (SystemClock.uptimeMillis() - time)) {
|
||||
//数组重新初始化
|
||||
mHits = LongArray(mCount)
|
||||
isAdminEnable=true
|
||||
isAdminEnable = true
|
||||
mBinding.loginEtUserName.setText("admin")
|
||||
mBinding.loginEtUserPassword.setInputContext("#fCjW%x2dv@a")
|
||||
showToast("已开启专业模式")
|
||||
@@ -178,7 +193,7 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
}
|
||||
|
||||
override fun processClick(paramView: View?) {
|
||||
when(paramView?.id){
|
||||
when (paramView?.id) {
|
||||
R.id.login_submit -> {
|
||||
// var passWord=mBinding.loginEtUserPassword.text.toString().trim()
|
||||
// if (!passWord.formatCheck()) {
|
||||
@@ -195,64 +210,61 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
// } else if ((passwordLength < 12 || passwordLength > 32)&&loginType==2) {
|
||||
// mTextViewDialog?.show()
|
||||
} else {
|
||||
login(
|
||||
mBinding.loginEtUserName.text.toString().trim(),
|
||||
mBinding.loginEtUserPassword.getInputContext()
|
||||
)
|
||||
if (System.currentTimeMillis() - loginClickTime > 3000) {
|
||||
loginClickTime = System.currentTimeMillis()
|
||||
login(
|
||||
mBinding.loginEtUserName.text.toString().trim(),
|
||||
mBinding.loginEtUserPassword.getInputContext()
|
||||
)
|
||||
} else {
|
||||
showToast("您的操作过于频繁,请稍后再试!")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
R.id.login_iv_read_state,R.id.login_agreement_root -> {
|
||||
|
||||
R.id.login_iv_read_state, R.id.login_agreement_root -> {
|
||||
mBinding?.let {
|
||||
if (isRead) {
|
||||
isRead=false
|
||||
isRead = false
|
||||
it.loginIvReadState.setImageResource(R.drawable.ic_login_no_select)
|
||||
}else{
|
||||
isRead=true
|
||||
} else {
|
||||
isRead = true
|
||||
it.loginIvReadState.setImageResource(R.drawable.ic_login_green_select)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
R.id.login_retrieve_password -> {
|
||||
//找回密码
|
||||
if (loginType == 1) {
|
||||
startWebActivity("https://sso.iosp.ydpt.tech/SSOManageClient/userController/changePassword")
|
||||
startWebActivity(url = UrlConfig.ANYAN_CHANGE_PASSWORD_H5)
|
||||
} else {
|
||||
mContext?.startRetrievePassWordActivity()
|
||||
}
|
||||
}
|
||||
R.id.test_btn->{
|
||||
if (isAdminEnable) {
|
||||
mCount-=1
|
||||
if (mCount==0) {
|
||||
mBinding.testLayout.visibility=View.VISIBLE
|
||||
lifecycleScope.launch {
|
||||
delay(2000)
|
||||
mBinding.testLayout.visibility=View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// R.id.iv_icon_img->{
|
||||
// if (isAdminEnable) {
|
||||
// mBinding.testBtn.visibility = View.VISIBLE
|
||||
// }
|
||||
// }
|
||||
|
||||
R.id.tv_debug->{
|
||||
R.id.tv_debug -> {
|
||||
DataStoreManager.saveCurrentConfig(1)
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
R.id.tv_test->{
|
||||
R.id.tv_test -> {
|
||||
DataStoreManager.saveCurrentConfig(2)
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
R.id.tv_prod->{
|
||||
R.id.tv_prod -> {
|
||||
DataStoreManager.saveCurrentConfig(3)
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
R.id.tv_login_platform -> {
|
||||
loginType = 1
|
||||
mBinding.tvLoginPlatform.setBackgroundResource(R.mipmap.ic_login_platform_bg_green)
|
||||
@@ -290,15 +302,14 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
override fun transparentStatusBar(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
private fun initAgreement() {
|
||||
// var text="已阅读并同意《用户协议》、《隐私政策》和《相关法律说明》"
|
||||
var text="已阅读并同意《用户协议》和《隐私政策》"
|
||||
var span= SpannableString(text)
|
||||
var text = "已阅读并同意用户协议和隐私政策"
|
||||
var span = SpannableString(text)
|
||||
span.setSpan(object : ClickableSpan() {
|
||||
|
||||
override fun onClick(widget: View) {
|
||||
@@ -309,11 +320,15 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
}
|
||||
}
|
||||
// 表示点击整个text的长度都有效触发这个事件
|
||||
}, 6, 12, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
mContext?.let{
|
||||
span.setSpan(NoUnderlineSpan(),6 , 12, Spanned.SPAN_MARK_MARK)
|
||||
}, 6, 10, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
mContext?.let {
|
||||
span.setSpan(NoUnderlineSpan(), 6, 10, Spanned.SPAN_MARK_MARK)
|
||||
span.setSpan(
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.theme_color)),6, 12, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.theme_color)),
|
||||
6,
|
||||
10,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
}
|
||||
|
||||
span.setSpan(object : ClickableSpan() {
|
||||
@@ -326,11 +341,15 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
}
|
||||
}
|
||||
// 表示点击整个text的长度都有效触发这个事件
|
||||
}, 13, 19, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
mContext?.let{
|
||||
span.setSpan(NoUnderlineSpan(),13 , 19, Spanned.SPAN_MARK_MARK)
|
||||
}, 11, 15, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
mContext?.let {
|
||||
span.setSpan(NoUnderlineSpan(), 11, 15, Spanned.SPAN_MARK_MARK)
|
||||
span.setSpan(
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.theme_color)),13, 19, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
ForegroundColorSpan(it.resources.getColor(R.color.theme_color)),
|
||||
11,
|
||||
15,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
}
|
||||
// span.setSpan(object : ClickableSpan() {
|
||||
//
|
||||
@@ -352,41 +371,49 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
mBinding?.loginTvAgreement?.setMovementMethod(LinkMovementMethod.getInstance())
|
||||
}
|
||||
|
||||
fun login(name:String,password:String){
|
||||
fun login(name: String, password: String) {
|
||||
dialog?.show()
|
||||
var bean= LoginBean()
|
||||
var bean = LoginBean()
|
||||
try {
|
||||
bean.deviceType="${DevicesInfoUtils.getDeviceBrand()}"
|
||||
if ("HUAWEI"== DevicesInfoUtils.getDeviceBrand()) {
|
||||
if ("12"== DevicesInfoUtils.getDeviceAndroidVersion()){
|
||||
bean.deviceSystem="${DevicesInfoUtils.getDeviceModel()}(Android:12||Harmony:${DevicesInfoUtils.getDeviceHarmonyOsVersion()})"
|
||||
}else{
|
||||
bean.deviceSystem="${DevicesInfoUtils.getDeviceModel()}(Android${DevicesInfoUtils.getDeviceAndroidVersion()})"
|
||||
bean.deviceType = "${DevicesInfoUtils.getDeviceBrand()}"
|
||||
if ("HUAWEI" == DevicesInfoUtils.getDeviceBrand()) {
|
||||
if ("12" == DevicesInfoUtils.getDeviceAndroidVersion()) {
|
||||
bean.deviceSystem =
|
||||
"${DevicesInfoUtils.getDeviceModel()}(Android:12||Harmony:${DevicesInfoUtils.getDeviceHarmonyOsVersion()})"
|
||||
} else {
|
||||
bean.deviceSystem =
|
||||
"${DevicesInfoUtils.getDeviceModel()}(Android${DevicesInfoUtils.getDeviceAndroidVersion()})"
|
||||
}
|
||||
}else{
|
||||
bean.deviceSystem="${DevicesInfoUtils.getDeviceModel()}(Android${DevicesInfoUtils.getDeviceAndroidVersion()})"
|
||||
} else {
|
||||
bean.deviceSystem =
|
||||
"${DevicesInfoUtils.getDeviceModel()}(Android${DevicesInfoUtils.getDeviceAndroidVersion()})"
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
bean.username=name
|
||||
bean.password=RSACipherStrategy().encrypt(ConstantUtils.mRSAKey,password)
|
||||
bean.username = name
|
||||
bean.password = RSACipherStrategy().encrypt(ConstantUtils.mRSAKey, password)
|
||||
// bean.password=password
|
||||
var login: Call<JsonObject>?=null
|
||||
if (loginType == 1) {
|
||||
login = mApi.mLoginAnYan(bean)
|
||||
} else if (loginType == 2) {
|
||||
var login: Call<JsonObject>? = null
|
||||
|
||||
if (loginType == 2 || isAdminEnable) {
|
||||
login = mApi.mLogin(bean)
|
||||
} else if (loginType == 1) {
|
||||
login = mApi.mLoginAnYan(bean)
|
||||
}
|
||||
login!!.enqueue(object : Callback<JsonObject>{
|
||||
|
||||
login!!.enqueue(object : Callback<JsonObject> {
|
||||
override fun onResponse(call: Call<JsonObject>, response: Response<JsonObject>) {
|
||||
dialog?.dismiss()
|
||||
try {
|
||||
var bean= Gson().fromJson<LoginResponseBean>(response.body().toString(),LoginResponseBean::class.java)
|
||||
if (bean.code==200) {
|
||||
if(bean.result.userInfo.personType!=null&&bean.result.userInfo.personType=="1"||isAdminEnable) {
|
||||
ConstantUtils.mCheckToken=true
|
||||
var bean = Gson().fromJson<LoginResponseBean>(
|
||||
response.body().toString(),
|
||||
LoginResponseBean::class.java
|
||||
)
|
||||
if (bean.code == 200) {
|
||||
if (bean.result.userInfo.personType != null && bean.result.userInfo.personType == "1" || isAdminEnable) {
|
||||
ConstantUtils.mCheckToken = true
|
||||
CustomActivityManager.getInstance()
|
||||
.finishActivity(MainActivity::class.java)
|
||||
if (bean != null && bean.result != null) {
|
||||
@@ -401,10 +428,10 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
showToast("账号或登录密码错误,请重试")
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
showToast(bean.message)
|
||||
}
|
||||
|
||||
@@ -425,7 +452,7 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
})
|
||||
}
|
||||
|
||||
// fun setNoBootomLine(span:SpannableString){
|
||||
// fun setNoBootomLine(span:SpannableString){
|
||||
// span.setSpan(noUnderlineSpan,0 , trim.length(), Spanned.SPAN_MARK_MARK)
|
||||
// }
|
||||
internal class NoUnderlineSpan : UnderlineSpan() {
|
||||
@@ -442,6 +469,7 @@ class LoginActivity : BaseVMBActivity<LoginViewModel, ActivityLoginNewBinding>(R
|
||||
isExit = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun exit() {
|
||||
if (!isExit) {
|
||||
isExit = true
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.xjjk.healthyclients.BuildConfig
|
||||
import com.xjjk.healthyclients.R
|
||||
import com.xjjk.healthyclients.base.BaseVMBActivity
|
||||
import com.xjjk.healthyclients.databinding.ActivitySettingBinding
|
||||
import com.xjjk.healthyclients.superfuntion.startRetrievePassWordActivity
|
||||
import com.xjjk.healthyclients.retrofit.UrlConfig
|
||||
import com.xjjk.healthyclients.superfuntion.startWebActivity
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
@@ -55,7 +55,8 @@ class UserSettingActivity :
|
||||
override fun processClick(paramView: View?) {
|
||||
when (paramView?.id) {
|
||||
R.id.setting_edit_password -> {
|
||||
mContext?.startRetrievePassWordActivity()
|
||||
// mContext?.startRetrievePassWordActivity()
|
||||
startWebActivity(url = UrlConfig.ANYAN_CHANGE_PASSWORD_H5)
|
||||
}
|
||||
R.id.setting_user_agreement -> {
|
||||
DataStoreManager.getUserAgreementUrl()?.let {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?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">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -48,7 +49,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="38dp"
|
||||
android:layout_marginTop="40dp">
|
||||
android:layout_marginTop="40dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_login_platform"
|
||||
@@ -73,22 +75,32 @@
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="center"
|
||||
android:text="平台统一认证"
|
||||
android:textColor="@color/theme_color"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<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_marginTop="@dimen/dp_15"
|
||||
android:layout_marginRight="@dimen/dp_38"
|
||||
android:background="@drawable/bg_grey_background_shap_radius23"
|
||||
android:drawableLeft="@mipmap/ic_login_phone"
|
||||
android:drawablePadding="6dp"
|
||||
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"
|
||||
@@ -115,97 +127,52 @@
|
||||
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"
|
||||
<LinearLayout
|
||||
android:id="@+id/login_agreement_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
android:layout_gravity="center_vertical"
|
||||
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/tv_debug"
|
||||
android:id="@+id/login_tv_agreement"
|
||||
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" />
|
||||
android:layout_marginLeft="@dimen/dp_5"
|
||||
android:lineSpacingExtra="@dimen/dp_8"
|
||||
android:textColor="#B6B6B6"
|
||||
android:textSize="@dimen/txt13"
|
||||
tools:text="已阅读并同意用户协议和隐私政策" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_test"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/login_retrieve_password"
|
||||
android:layout_width="match_parent"
|
||||
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>
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:gravity="end"
|
||||
android:text="找回密码"
|
||||
android:textColor="#B6B6B6"
|
||||
android:textSize="@dimen/txt13" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</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>
|
||||
+2
-2
@@ -2,8 +2,8 @@ ext {
|
||||
minSdkVersion = 26
|
||||
targetSdkVersion = 32
|
||||
compileSdkVersion = 33
|
||||
versionCode = 107
|
||||
versionName = "1.0.7"
|
||||
versionCode = 108
|
||||
versionName = "1.0.8"
|
||||
//Dependencies
|
||||
junitVersion = "4.12"
|
||||
lifecycleVersion = "2.6.0-alpha01"
|
||||
|
||||
Reference in New Issue
Block a user