|
|
@@ -18,6 +18,7 @@ import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.mvvm.BaseTvMVVMActivity
|
|
|
import com.yingyangfly.baselib.player.VoicePlayer
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
+import com.yingyangfly.baselib.utils.GlideImgUtil
|
|
|
import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
import com.yingyangfly.baselib.utils.LiveEventBusUtil
|
|
|
import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
@@ -27,6 +28,7 @@ import com.yingyangfly.evaluation.databinding.ActivityHospitalBinding
|
|
|
import com.yingyangfly.evaluation.entity.SlideshowBean
|
|
|
import com.youth.banner.indicator.RectangleIndicator
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 医院电视端首页
|
|
|
*/
|
|
|
@@ -74,6 +76,14 @@ class HospitalActivity : BaseTvMVVMActivity<ActivityHospitalBinding, HospitalVie
|
|
|
|
|
|
override fun initData() {
|
|
|
initLiveData()
|
|
|
+ PermissionList.readPhoneState.check(this) {
|
|
|
+ binding.tvSnCode.text = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
+ "终端号:" + Build.getSerial()
|
|
|
+ } else {
|
|
|
+ "终端号:" + Build.SERIAL
|
|
|
+ }
|
|
|
+ getSlideShowList()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private fun initLiveData() {
|
|
|
@@ -157,19 +167,27 @@ class HospitalActivity : BaseTvMVVMActivity<ActivityHospitalBinding, HospitalVie
|
|
|
}
|
|
|
|
|
|
R.id.searchLayout -> {
|
|
|
- JumpUtil.jumpActivity(RouterUrlCommon.evaluationHistory)
|
|
|
+ if (loginJudge()) {
|
|
|
+ JumpUtil.jumpActivity(RouterUrlCommon.evaluationHistory)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
R.id.otherEvaluationsLayout -> {
|
|
|
- JumpUtil.jumpActivity(RouterUrlCommon.otherEvaluation)
|
|
|
+ if (loginJudge()) {
|
|
|
+ JumpUtil.jumpActivity(RouterUrlCommon.otherEvaluation)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
R.id.mocaLayout -> {
|
|
|
- getReviewTaskList("MOCA", "0")
|
|
|
+ if (loginJudge()) {
|
|
|
+ getReviewTaskList("MOCA", "0")
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
R.id.mmseLayout -> {
|
|
|
- getReviewTaskList("MMSE", "0")
|
|
|
+ if (loginJudge()) {
|
|
|
+ getReviewTaskList("MMSE", "0")
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -188,19 +206,10 @@ class HospitalActivity : BaseTvMVVMActivity<ActivityHospitalBinding, HospitalVie
|
|
|
if (TextUtils.isEmpty(User.getToken())) {
|
|
|
binding.imageLoginOut.show(false)
|
|
|
binding.tvLoginOut.show(false)
|
|
|
- showBindingPhoneDialog()
|
|
|
} else {
|
|
|
binding.imageLoginOut.show(true)
|
|
|
binding.tvLoginOut.show(true)
|
|
|
}
|
|
|
- PermissionList.readPhoneState.check(this) {
|
|
|
- binding.tvSnCode.text = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
- "终端号:" + Build.getSerial()
|
|
|
- } else {
|
|
|
- "终端号:" + Build.SERIAL
|
|
|
- }
|
|
|
- }
|
|
|
- getSlideShowList()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -218,6 +227,13 @@ class HospitalActivity : BaseTvMVVMActivity<ActivityHospitalBinding, HospitalVie
|
|
|
binding.guide.setLoopTime(data.speed.toLong())
|
|
|
imageList.addAll(it.slideshows)
|
|
|
}
|
|
|
+ if (TextUtils.isEmpty(it.logo)) {
|
|
|
+ GlideImgUtil.loadImg(mContext, it.logo, binding.hospitalImage)
|
|
|
+ } else {
|
|
|
+ GlideImgUtil.loadImgNoPlaceHolder(
|
|
|
+ mContext, R.mipmap.icon_hospital_logo, binding.hospitalImage
|
|
|
+ )
|
|
|
+ }
|
|
|
binding.tvLocation.text = "终端位置:" + if (TextUtils.isEmpty(it.location)) {
|
|
|
""
|
|
|
} else {
|
|
|
@@ -341,4 +357,15 @@ class HospitalActivity : BaseTvMVVMActivity<ActivityHospitalBinding, HospitalVie
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 登陆状态判断
|
|
|
+ */
|
|
|
+ private fun loginJudge(): Boolean {
|
|
|
+ if (TextUtils.isEmpty(User.getToken())) {
|
|
|
+ showBindingPhoneDialog()
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|