|
@@ -9,9 +9,7 @@ import android.os.Bundle
|
|
|
import android.os.Message
|
|
|
import android.view.View
|
|
|
import androidx.core.content.ContextCompat
|
|
|
-import androidx.recyclerview.widget.DividerItemDecoration
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
-import androidx.recyclerview.widget.RecyclerView
|
|
|
import com.blankj.utilcode.util.ActivityUtils
|
|
|
import com.blankj.utilcode.util.AppUtils
|
|
|
import com.bumptech.glide.Glide
|
|
@@ -19,13 +17,11 @@ import com.bumptech.glide.load.DataSource
|
|
|
import com.bumptech.glide.load.engine.GlideException
|
|
|
import com.bumptech.glide.request.RequestListener
|
|
|
import com.bumptech.glide.request.target.Target
|
|
|
-import xn.xxp.main.msds.InstructionActivity
|
|
|
import com.kongzue.dialogx.dialogs.InputDialog
|
|
|
import com.kongzue.dialogx.dialogs.MessageDialog
|
|
|
import core.ui.activity.BaseSignActivity
|
|
|
import core.ui.widget.SwipeAction
|
|
|
import core.ui.widget.SwipeTouchListener
|
|
|
-import core.ui.widget.decoration.NoLastLineItemDecoration
|
|
|
import core.util.FastClickDelegate
|
|
|
import core.util.OnWeakListener
|
|
|
import core.util.WeakHandler
|
|
@@ -44,13 +40,14 @@ import org.greenrobot.eventbus.Subscribe
|
|
|
import org.greenrobot.eventbus.ThreadMode
|
|
|
import xn.xxp.R
|
|
|
import xn.xxp.app.LabApp
|
|
|
-import xn.xxp.home.setting.SettingActivity
|
|
|
import xn.xxp.databinding.ActivityMainBinding
|
|
|
+import xn.xxp.home.auth.AuthType
|
|
|
+import xn.xxp.home.setting.SettingActivity
|
|
|
import xn.xxp.main.monitor.MonitorActivity
|
|
|
+import xn.xxp.main.msds.InstructionActivity
|
|
|
import xn.xxp.main.person.LaboratoryPersonActivity
|
|
|
import xn.xxp.main.risk.RiskListActivity
|
|
|
import xn.xxp.main.rule.RuleActivity
|
|
|
-import xn.xxp.main.things.ThingsActivity
|
|
|
import xn.xxp.main.things.ThingsListActivity
|
|
|
import xn.xxp.mqtt.event.BannerEvent
|
|
|
import xn.xxp.mqtt.event.BulletinBoardEvent
|
|
@@ -112,7 +109,7 @@ class MainActivity :
|
|
|
|
|
|
private var mNoticeList: List<NoticeSummary>? = null
|
|
|
|
|
|
-// private val mSerialPortHelper by lazy {
|
|
|
+ // private val mSerialPortHelper by lazy {
|
|
|
// SerialPortHelper(this, object : OnSerialScanListener {
|
|
|
// override fun onServiceConnected() {
|
|
|
// RcLog.info("MainActivity# isRelationGuard=${LabApp.sLabConfig?.isRelationGuard}")
|
|
@@ -124,11 +121,11 @@ class MainActivity :
|
|
|
// }
|
|
|
// })
|
|
|
// }
|
|
|
-
|
|
|
+ private var authType: AuthType = AuthType.FACE
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
// mSerialPortHelper.bindService()
|
|
|
-
|
|
|
+ authType = (intent.getSerializableExtra("authType") as AuthType?)!!
|
|
|
// 实验室文化图 > 文化图
|
|
|
val message = mBannerHandler.obtainMessage(WHAT_WORKBENCH)
|
|
|
mBannerHandler.sendMessageDelayed(message, BANNER_TIME_WORKBENCH)
|
|
@@ -373,7 +370,7 @@ class MainActivity :
|
|
|
})
|
|
|
// 签到
|
|
|
binding.signIn.setOnClickListener(FastClickDelegate {
|
|
|
- dispatchSignIn()
|
|
|
+ dispatchSignIn(authType)
|
|
|
})
|
|
|
// 离开
|
|
|
binding.leave.setOnClickListener(FastClickDelegate {
|
|
@@ -381,7 +378,7 @@ class MainActivity :
|
|
|
})
|
|
|
// 开门
|
|
|
binding.openDoor.setOnClickListener(FastClickDelegate {
|
|
|
- Tool.INSTANCE.openDoor()
|
|
|
+ Tool.INSTANCE.openDoor(LabApp.userVo.userId,authType)
|
|
|
})
|
|
|
// 返回
|
|
|
binding.back.setOnClickListener(FastClickDelegate {
|
|
@@ -427,7 +424,7 @@ class MainActivity :
|
|
|
|
|
|
lateinit var labConfig: LabConfig
|
|
|
override fun initData() {
|
|
|
- Tool.INSTANCE.openDoor()
|
|
|
+ Tool.INSTANCE.openDoor(LabApp.userVo.userId,authType)
|
|
|
labConfig = RoomTool.getInstance().labConfigDao().labConfig
|
|
|
val laboratoryVo = LabApp.laboratory
|
|
|
if (null == laboratoryVo || null == labConfig) {
|