- 将应用名称从 SmartPlateCabinet 更改为 SmartTakePlate - 更新初始化页面背景图片为 bg_collect_page3 - 替换 View 组件为 Space 组件以优化布局权重分配 - 调整取盘按钮尺寸和文字大小提升用户体验 - 简化人脸识别登录页面布局结构 - 更新应用图标资源为 logo_launcher - 移除未使用的权限声明和活动注册 - 优化人脸识别相关 API 接口调用 - 调整时间显示逻辑仅保留时间部分 - 移除扫描枪事件监听相关功能代码 - 重构人脸识别数据更新逻辑 - 移除余额不足对话框相关代码
62 lines
1.8 KiB
Kotlin
62 lines
1.8 KiB
Kotlin
//package com.sw.platecabinet.viewmodel
|
|
//
|
|
//import com.sw.platecabinet.model.response.UserFaceModel
|
|
//import kotlinx.coroutines.Dispatchers
|
|
//import kotlinx.coroutines.withContext
|
|
//import java.io.File
|
|
//
|
|
///**
|
|
// * 管理员操作viewmodel
|
|
// */
|
|
//class SettingViewModel : BaseViewModel() {
|
|
//
|
|
// companion object {
|
|
// const val PAGE_SIZE = 100
|
|
// }
|
|
//
|
|
// /**
|
|
// * 获取人脸数据
|
|
// */
|
|
// fun getFaceIncrementList(
|
|
// pageNo: Int = 1,
|
|
// pageSize: Int = PAGE_SIZE,
|
|
// timestamp: Long,
|
|
// block: (List<UserFaceModel>) -> Unit
|
|
// ) {
|
|
// launch {
|
|
// val response = repository.getFaceIncrementList(
|
|
// pageNum = pageNo.toLong(),
|
|
// pageSize = pageSize.toLong(),
|
|
// timestamp = timestamp
|
|
// )
|
|
// if (parseResponse(response)) {
|
|
// withContext(Dispatchers.Default) {
|
|
// val list: List<UserFaceModel> = response.data ?: emptyList()
|
|
// block(list)
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// /**
|
|
// * 添加人脸数据
|
|
// */
|
|
// fun addUserFace(faceData: String, imageFile: File, block: (Boolean, UserFaceModel?) -> Unit) {
|
|
// launch {
|
|
// val imageResp = repository.uploadImage(imageFile)
|
|
// val imageUrl = imageResp.data ?: ""
|
|
// if (imageUrl.isBlank()) {
|
|
// block(false, null)
|
|
// return@launch
|
|
// }
|
|
// val faceResp = repository.addUserFace(faceData, imageUrl)
|
|
// val status = parseResponse(faceResp)
|
|
// if (status.not()) {
|
|
// block(false, null)
|
|
// return@launch
|
|
// }
|
|
// block(true, faceResp.data)
|
|
// }
|
|
// }
|
|
//
|
|
//} |