绑定解绑功能调试;其它优化
This commit is contained in:
@@ -200,10 +200,10 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
private fun disableSystemUICompletely() {
|
||||
Timber.d("disableSystemUICompletely")
|
||||
// 禁用系统手势(Android 10+)
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
// window.insetsController?.systemBarsBehavior =
|
||||
// WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
// }
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
window.insetsController?.systemBarsBehavior =
|
||||
WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
}
|
||||
|
||||
|
||||
// 全屏+隐藏导航栏(所有版本通用)
|
||||
@@ -307,7 +307,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
// }
|
||||
}
|
||||
|
||||
private fun loadEquipmentList(items:List<EquipmentUserInfo>) {
|
||||
private fun loadEquipmentList(items: List<EquipmentUserInfo>) {
|
||||
if (items.isEmpty()) return
|
||||
val unbindList = items.filter { !it.isBound() }
|
||||
if (unbindList.isEmpty()) {
|
||||
@@ -331,7 +331,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
open fun handleLoginSuccess(equipmentUserInfo: EquipmentUserInfo, isAdmin: Boolean) {
|
||||
Timber.d("handleLoginSuccess isAdmin = $isAdmin")
|
||||
equipmentUserInfo.isIntercept = false
|
||||
val cardBalance = equipmentUserInfo.cardBalance?:0.toDouble()
|
||||
val cardBalance = equipmentUserInfo.cardBalance ?: 0.toDouble()
|
||||
val balanceIsNotEnough = cardBalance <= 0.toDouble()
|
||||
if (balanceIsNotEnough && equipmentUserInfo.showBalanceNotEnoughDialog) {
|
||||
//提示余额不足弹窗
|
||||
@@ -340,15 +340,15 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
return
|
||||
}
|
||||
viewModel.resetUserInfo()
|
||||
if (equipmentUserInfo.isOtherEquipment()) {
|
||||
MainActivity.start(
|
||||
context,
|
||||
pageType = PageType.PLATE_TIP,
|
||||
equipmentUserInfo = equipmentUserInfo,
|
||||
isAdmin
|
||||
)
|
||||
return
|
||||
}
|
||||
// if (equipmentUserInfo.isOtherEquipment()) {
|
||||
// MainActivity.start(
|
||||
// context,
|
||||
// pageType = PageType.PLATE_TIP,
|
||||
// equipmentUserInfo = equipmentUserInfo,
|
||||
// isAdmin
|
||||
// )
|
||||
// return
|
||||
// }
|
||||
if (equipmentUserInfo.equipmentBoxCode?.isNotEmpty() == true) {
|
||||
SerialApi.openPlate(
|
||||
equipmentUserInfo.equipmentBoxCode!!.toInt(),
|
||||
@@ -367,7 +367,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
})
|
||||
} else {
|
||||
if (isAdmin) {
|
||||
settingViewModel.getEquipmentList{
|
||||
settingViewModel.getEquipmentList {
|
||||
loadEquipmentList(it)
|
||||
}
|
||||
} else {
|
||||
@@ -394,31 +394,47 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
|
||||
// private val initialDelay = 5 * 60 * 1000L
|
||||
// private val dealyMillis = 10 * 60 * 1000L
|
||||
private val initialDelay = 60 * 1000L
|
||||
private val dealyMillis = 30 * 1000L
|
||||
private val initialDelay = 1 * 60 * 1000L
|
||||
private val dealyMillis = 1 * 60 * 1000L
|
||||
private var taskPageNo = 1
|
||||
fun startFaceTask() {
|
||||
faceTaskJob =
|
||||
intervalExecutor.startIntervalTaskWithInitialDelay(initialDelay, dealyMillis) {
|
||||
val timestamp = SpTool.getLastFaceTimestamp()
|
||||
if (timestamp == 0L) {
|
||||
return@startIntervalTaskWithInitialDelay
|
||||
}
|
||||
settingViewModel.getFaceIncrementList(
|
||||
pageNo = taskPageNo,
|
||||
timestamp = timestamp
|
||||
) { list ->
|
||||
runOnUiThread {
|
||||
if (list.isEmpty()) {
|
||||
return@runOnUiThread
|
||||
}
|
||||
SpTool.setLastFaceTimestamp(System.currentTimeMillis())
|
||||
updateFaceData(list)
|
||||
}
|
||||
}
|
||||
getFaceIncrementList()
|
||||
}
|
||||
}
|
||||
|
||||
private var faceTimestamp = 0L
|
||||
|
||||
private fun getFaceIncrementList() {
|
||||
val timestamp = SpTool.getLastFaceTimestamp()
|
||||
if (timestamp == 0L) {
|
||||
return
|
||||
}
|
||||
settingViewModel.getFaceIncrementList(
|
||||
pageNo = taskPageNo,
|
||||
timestamp = timestamp
|
||||
) { list ->
|
||||
runOnUiThread {
|
||||
if (taskPageNo == 1 && list.isEmpty()) {
|
||||
//未查询到增量数据
|
||||
return@runOnUiThread
|
||||
}
|
||||
updateFaceData(list)
|
||||
if (list.size >= settingViewModel.PAGE_SIZE) {
|
||||
faceTimestamp = list.last().faceUpdateTimestamp?:0
|
||||
taskPageNo++
|
||||
getFaceIncrementList()
|
||||
return@runOnUiThread
|
||||
}
|
||||
if (list.isNotEmpty()) {
|
||||
faceTimestamp = list.last().faceUpdateTimestamp?:0
|
||||
}
|
||||
SpTool.setLastFaceTimestamp(faceTimestamp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val recognizeViewModel by viewModels<RecognizeViewModel>()
|
||||
private fun updateFaceData(list: List<UserFaceModel>) {
|
||||
Thread {
|
||||
|
||||
@@ -51,6 +51,8 @@ class DeviceInitActivity : BaseActivity<ActivityDeviceInitBinding>() {
|
||||
if (deviceConfig == null) {
|
||||
hideWaitingDialog()
|
||||
ToastUtils.showToast("获取设备配置数据失败")
|
||||
hideWaitingDialog()
|
||||
goLoginActivity()
|
||||
return@runOnUiThread
|
||||
}
|
||||
GlobalData.appId = deviceConfig.arcsoftAppId ?: ""
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sw.platecabinet.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextUtils
|
||||
@@ -60,13 +61,18 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun initialize() {
|
||||
arguments?.let {
|
||||
info = it.getParcelable(KEY_ACTION_TYPE)
|
||||
arguments?.let { args ->
|
||||
info = args.getParcelable(KEY_ACTION_TYPE)
|
||||
info?.let {
|
||||
binding.tvNum.text = "${it.equipmentName}-${it.equipmentBoxCode}"
|
||||
if (!TextUtils.isEmpty(it.plateNumber)) {
|
||||
binding.etCode.text = Editable.Factory.getInstance().newEditable(it.plateNumber)
|
||||
// binding.etCode.text = Editable.Factory.getInstance().newEditable(it.plateNumber)
|
||||
binding.etCode.apply {
|
||||
setText(it.plateNumber)
|
||||
setSelection(length())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,13 +110,27 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
}
|
||||
})
|
||||
(activity as MainActivity).registerKeyEventInfo {
|
||||
if (binding.etUserInfo.isFocused) return@registerKeyEventInfo
|
||||
binding.etCode.text.clear()
|
||||
binding.etCode.postDelayed({
|
||||
binding.etCode.text.clear()
|
||||
binding.etCode.text = Editable.Factory.getInstance().newEditable(it)
|
||||
binding.etUserInfo.requestFocus()
|
||||
}, 50)
|
||||
// binding.etCode.text.clear()
|
||||
// binding.etCode.postDelayed({
|
||||
// binding.etCode.text.clear()
|
||||
// binding.etCode.text = Editable.Factory.getInstance().newEditable(it)
|
||||
activity?.runOnUiThread {
|
||||
if (binding.etUserInfo.isFocused) {
|
||||
return@runOnUiThread
|
||||
}
|
||||
binding.etCode.apply {
|
||||
if (it.length > 6) {
|
||||
setText(it.substring(0, 6))
|
||||
} else {
|
||||
setText(it)
|
||||
}
|
||||
if (length() > 0) {
|
||||
setSelection(length())
|
||||
}
|
||||
}
|
||||
binding.etUserInfo.requestFocus()
|
||||
}
|
||||
// }, 50)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,10 +211,10 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
return@setOnClickListener
|
||||
}
|
||||
val bindParam = BindParam(
|
||||
equipmentId = info!!.equipmentId,
|
||||
equipmentCode = info!!.equipmentCode!!,
|
||||
equipmentBoxCode = info!!.equipmentBoxCode!!,
|
||||
memberId = checkedItem!!.id!!,
|
||||
equipmentId = info?.equipmentId,
|
||||
equipmentCode = info?.equipmentCode,
|
||||
equipmentBoxCode = info?.equipmentBoxCode,
|
||||
faceId = checkedItem?.faceId,
|
||||
plateNumber = plateNumber
|
||||
)
|
||||
viewModel.bindPlate(bindParam) { pair ->
|
||||
@@ -242,7 +262,7 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
//TODO 调用接口查询用户是否已绑盘
|
||||
this@BindPlateFragment.equipmentBoxCode = null
|
||||
(activity as? MainActivity)?.showWaitingDialog("查询中,请稍后……")
|
||||
userViewModel.getUserInfoById(memberId = item.id) {
|
||||
userViewModel.getUserInfoById(memberId = item.faceId) {
|
||||
(activity as? MainActivity)?.hideWaitingDialog()
|
||||
this@BindPlateFragment.equipmentBoxCode = it?.equipmentBoxCode
|
||||
}
|
||||
@@ -269,14 +289,14 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
ToastUtils.showToast("数据异常")
|
||||
return
|
||||
}
|
||||
if (errorInfo.equipmentUserInfo.isOtherEquipment()) {
|
||||
MainActivity.start(
|
||||
requireContext(),
|
||||
pageType = PageType.PLATE_TIP,
|
||||
equipmentUserInfo = errorInfo.equipmentUserInfo,
|
||||
isAdmin = true
|
||||
)
|
||||
} else {
|
||||
// if (errorInfo.equipmentUserInfo.isOtherEquipment()) {
|
||||
// MainActivity.start(
|
||||
// requireContext(),
|
||||
// pageType = PageType.PLATE_TIP,
|
||||
// equipmentUserInfo = errorInfo.equipmentUserInfo,
|
||||
// isAdmin = true
|
||||
// )
|
||||
// } else {
|
||||
SerialApi.openPlate(
|
||||
errorInfo.equipmentUserInfo.equipmentBoxCode!!.toInt(),
|
||||
object : SerialPortManager.SendCallback {
|
||||
@@ -289,7 +309,7 @@ class BindPlateFragment : BaseFragment<FragmentBindPlateBinding>(
|
||||
ToastUtils.showToast("绑定失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
ToastUtils.showToast(errorInfo.msg)
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class UnBindPlateFragment private constructor() : BaseFragment<FragmentUnbindPla
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) { result ->
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
viewModel.unbindPlate(info!!.id!!) { pair ->
|
||||
viewModel.unbindPlate(info?.id) { pair ->
|
||||
updateBindState(pair)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.sw.platecabinet.model.response.EquipmentUserInfo
|
||||
* 错误信息 code == 200 成功
|
||||
*/
|
||||
data class ErrorInfo(
|
||||
val code: String = "200",
|
||||
val code: String = "00000",
|
||||
val msg: String = "",
|
||||
val equipmentUserInfo: EquipmentUserInfo? = null
|
||||
) {
|
||||
|
||||
@@ -18,7 +18,7 @@ data class BindParam(
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
var equipmentCode: String = "",
|
||||
var equipmentCode: String? = "",
|
||||
/**
|
||||
*设备盒子编号
|
||||
*/
|
||||
@@ -28,6 +28,7 @@ data class BindParam(
|
||||
* 会员Id
|
||||
*/
|
||||
val memberId: String? = null,
|
||||
val faceId: String? = null,
|
||||
/**
|
||||
*餐盘编号
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,8 @@ data class LoginParam(
|
||||
/**
|
||||
* 会员信息
|
||||
*/
|
||||
val memberId: String? = null,
|
||||
// val memberId: String? = null,
|
||||
val faceId: String? = null,
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
|
||||
@@ -10,25 +10,27 @@ import kotlinx.parcelize.Parcelize
|
||||
*/
|
||||
@Parcelize
|
||||
data class SearchParam(
|
||||
/**
|
||||
* app版本号
|
||||
*/
|
||||
var appVersion: String = "",
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@SerializedName("equipmentCode")
|
||||
var equipmentCode: String = "",
|
||||
@SerializedName("consumptionTime")
|
||||
val consumptionTime: List<String?>? = listOf(),
|
||||
@SerializedName("createTime")
|
||||
val createTime: List<String?>? = listOf(),
|
||||
@SerializedName("memberFrom")
|
||||
val memberFrom: Int? = 0,
|
||||
@SerializedName("pageNum")
|
||||
val pageNum: Int? = 0,
|
||||
@SerializedName("pageSize")
|
||||
val pageSize: Int? = 0,
|
||||
@SerializedName("param")
|
||||
val `param`: String? = ""
|
||||
// /**
|
||||
// * app版本号
|
||||
// */
|
||||
// var appVersion: String = "",
|
||||
// /**
|
||||
// * 设备ID
|
||||
// */
|
||||
// @SerializedName("equipmentCode")
|
||||
// var equipmentCode: String = "",
|
||||
// @SerializedName("consumptionTime")
|
||||
// val consumptionTime: List<String?>? = listOf(),
|
||||
// @SerializedName("createTime")
|
||||
// val createTime: List<String?>? = listOf(),
|
||||
// @SerializedName("memberFrom")
|
||||
// val memberFrom: Int? = 0,
|
||||
// @SerializedName("pageNum")
|
||||
var pageNum: Int? = 0,
|
||||
// @SerializedName("pageSize")
|
||||
var pageSize: Int? = 0,
|
||||
// @SerializedName("param")
|
||||
// val `param`: String? = "",
|
||||
var name:String?=null,
|
||||
var phone:String?=null
|
||||
) : Parcelable
|
||||
@@ -31,7 +31,7 @@ data class EquipmentUserInfo(
|
||||
/**
|
||||
* 会员Id
|
||||
*/
|
||||
val memberId: String? = "",
|
||||
val faceId: String? = "",
|
||||
/**
|
||||
* 餐盘编号
|
||||
*/
|
||||
@@ -70,7 +70,7 @@ data class EquipmentUserInfo(
|
||||
* 是否已绑定
|
||||
*/
|
||||
fun isBound(): Boolean {
|
||||
return memberId != null
|
||||
return faceId != null
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,6 +78,7 @@ data class SearchResult(
|
||||
// @SerializedName("topUpBalance")
|
||||
// val topUpBalance: String? = ""
|
||||
val id: String? = "",
|
||||
val faceId: String? = "",
|
||||
val name: String? = "",
|
||||
val phone: String? = "",
|
||||
) : Parcelable
|
||||
|
||||
@@ -25,6 +25,6 @@ data class UserFaceModel(
|
||||
|
||||
val userId: String? = "",
|
||||
val faceFeatureStr: String? = "",
|
||||
|
||||
val faceUpdateTimestamp:Long?=null,
|
||||
val faceDeleted: Boolean?=false
|
||||
) : Parcelable
|
||||
@@ -13,6 +13,7 @@ import com.sw.platecabinet.model.response.SearchResult
|
||||
import com.sw.platecabinet.model.response.UserFaceModel
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.Field
|
||||
import retrofit2.http.FormUrlEncoded
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.POST
|
||||
@@ -118,9 +119,10 @@ interface ApiService {
|
||||
* 餐盘解绑
|
||||
*/
|
||||
@POST
|
||||
@FormUrlEncoded
|
||||
suspend fun plateUnbind(
|
||||
@Url url: String = "${GlobalData.appBaseUrl}/terminal/neglect/sideboard/app/plateUnbind",
|
||||
@Field("id") id: Long
|
||||
@Field("id") id: Long?
|
||||
): ApiResponse<Any?>
|
||||
|
||||
/**
|
||||
@@ -128,9 +130,10 @@ interface ApiService {
|
||||
*/
|
||||
@POST//("/shuwei-user/swclientUserInfoShop/selectList")
|
||||
suspend fun searchUser(
|
||||
@Url url: String = "${GlobalData.appBaseUrl}/shuwei-user/swclientUserInfoShop/selectList",
|
||||
// @Url url: String = "${GlobalData.appBaseUrl}/shuwei-user/swclientUserInfoShop/selectList",
|
||||
@Url url: String = "${GlobalData.appBaseUrl}/terminal/neglect/common/app/getUserInfoByNameOrPhone",
|
||||
@Body param: SearchParam
|
||||
): ApiResponse<SearchResult>
|
||||
): ApiResponse<List<SearchResult.Member>?>
|
||||
|
||||
// /**
|
||||
// * 通过餐盘号获取信息
|
||||
|
||||
@@ -98,14 +98,14 @@ class RemoteRepository constructor(
|
||||
return safeApiCall { apiService.plateBind(param = param) }
|
||||
}
|
||||
|
||||
suspend fun plateUnbind(id: Long ): ApiResponse<Any?> {
|
||||
suspend fun plateUnbind(id: Long?): ApiResponse<Any?> {
|
||||
return safeApiCall { apiService.plateUnbind(id = id) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户信息模糊搜索
|
||||
*/
|
||||
suspend fun searchUser(param: SearchParam): ApiResponse<SearchResult> {
|
||||
suspend fun searchUser(param: SearchParam): ApiResponse<List<SearchResult.Member>?> {
|
||||
return safeApiCall { apiService.searchUser(param = param) }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sw.platecabinet.viewmodel
|
||||
|
||||
import android.text.TextUtils
|
||||
import com.sw.inbound.utils.DateTimeUtils
|
||||
import com.sw.platecabinet.GlobalData
|
||||
import com.sw.platecabinet.GlobalData.globalEquipmentCode
|
||||
@@ -73,28 +74,36 @@ class SettingViewModel : BaseViewModel() {
|
||||
/**
|
||||
* 搜索会员信息列表
|
||||
*/
|
||||
fun getSearchMemberList(param: String, pageNum: Int = 1, pageSize: Int = 50) {
|
||||
fun getSearchMemberList(param:String, pageNum: Int = 1, pageSize: Int = 50) {
|
||||
if (TextUtils.isEmpty(param)) return
|
||||
currentPage = pageNum
|
||||
var name =""
|
||||
var phone =""
|
||||
val num = param.toIntOrNull()
|
||||
if (num != null) {
|
||||
phone = param
|
||||
} else {
|
||||
name = param
|
||||
}
|
||||
launch {
|
||||
val param = SearchParam(
|
||||
appVersion = GlobalData.appVersion,
|
||||
param = param,
|
||||
val searchParam = SearchParam(
|
||||
// appVersion = GlobalData.appVersion,
|
||||
name = name,
|
||||
phone = phone,
|
||||
pageNum = pageNum,
|
||||
pageSize = pageSize
|
||||
)
|
||||
isLoading = true
|
||||
val response = repository.searchUser(param)
|
||||
val response = repository.searchUser(searchParam)
|
||||
isLoading = false
|
||||
if (parseResponse(response)) {
|
||||
response.data?.let {
|
||||
canLoadMore = it.hasNextPage != false
|
||||
val newList = it.list ?: emptyList()
|
||||
response.data?.let { list ->
|
||||
if (pageNum == 1) {
|
||||
_searchMemberList.value = newList
|
||||
_searchMemberList.value = list
|
||||
} else {
|
||||
_searchMemberList.value = _searchMemberList.value.plus(newList)
|
||||
_searchMemberList.value = _searchMemberList.value.plus(list)
|
||||
}
|
||||
currentPage++
|
||||
if (list.size >= pageSize) currentPage++
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +158,7 @@ class SettingViewModel : BaseViewModel() {
|
||||
// }
|
||||
// }
|
||||
|
||||
fun unbindPlate(id: Long, block:(Pair<Boolean?, ErrorInfo>)-> Unit) {
|
||||
fun unbindPlate(id: Long?, block:(Pair<Boolean?, ErrorInfo>)-> Unit) {
|
||||
block(null to ErrorInfo())
|
||||
launchWithLoading {
|
||||
val response = repository.plateUnbind(id)
|
||||
|
||||
@@ -66,26 +66,32 @@ class UserViewModel : BaseViewModel() {
|
||||
// 获取成功一次后缓存状态
|
||||
SPUtil.getInstance().put(GlobalKey.KEY_FIRST_RUN, true)
|
||||
val list: List<UserFaceModel> = response.data ?: emptyList()
|
||||
if (list.isEmpty()) {
|
||||
if (pageNo==1&&list.isEmpty()) {
|
||||
return@launchWithLoading
|
||||
}
|
||||
|
||||
SpTool.setLastFaceTimestamp(System.currentTimeMillis())
|
||||
val faceEntityList = list.map {
|
||||
FaceEntity(it.userId, null, Base64.decode(it.faceFeatureStr))
|
||||
}
|
||||
withContext(Dispatchers.Default) {
|
||||
faceApi.updateFaceData(pageNo, faceEntityList)
|
||||
if (list.size >= pageSize) {
|
||||
faceTimestamp = list.last().faceUpdateTimestamp?:0
|
||||
currentPageNo++
|
||||
getUserFaceCache(currentPageNo)
|
||||
return@withContext
|
||||
}
|
||||
if (list.isNotEmpty()) {
|
||||
faceTimestamp = list.last().faceUpdateTimestamp?:0
|
||||
}
|
||||
SpTool.setLastFaceTimestamp(faceTimestamp)
|
||||
//activeEngine()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var faceTimestamp = 0L
|
||||
|
||||
/**
|
||||
* 激活人脸识别引擎
|
||||
*/
|
||||
@@ -144,7 +150,7 @@ class UserViewModel : BaseViewModel() {
|
||||
fun getUserInfoById(memberId: String?, action:(EquipmentUserInfo?)->Unit={}) {
|
||||
_currentUserInfo.value = null
|
||||
launchWithLoading {
|
||||
val loginParam = LoginParam(memberId = memberId)
|
||||
val loginParam = LoginParam(faceId = memberId)
|
||||
val response = repository.equipmentBoxLogin(loginParam)
|
||||
if (parseResponse(response)) {
|
||||
_currentUserInfo.value = response.data
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="60dp"
|
||||
tools:context=".fragment.BindPlateFragment">
|
||||
tools:context=".fragment.BindPlateFragment"
|
||||
tools:background="@color/black">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user