init
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package com.sw.inbound
|
||||
|
||||
import android.net.Uri
|
||||
import com.sw.inbound.model.response.DictType
|
||||
import com.sw.inbound.model.response.User
|
||||
|
||||
object GlobalData {
|
||||
/**
|
||||
* 登录后的用户信息
|
||||
*/
|
||||
var user: User? = null
|
||||
|
||||
/**
|
||||
* 采集图片uri
|
||||
*/
|
||||
var imageUri: Uri? = null
|
||||
|
||||
var storageTypeList: List<DictType> = arrayListOf()
|
||||
var goodsTypeList: List<DictType> = arrayListOf()
|
||||
var warehouseTypeList: List<DictType> = arrayListOf()
|
||||
var supplierTypeList: List<DictType> = arrayListOf()
|
||||
var unitTypeList: List<DictType> = arrayListOf()
|
||||
|
||||
fun getStorageType(id: Int): String {
|
||||
return storageTypeList.find { it.id == id }?.value ?: "默认"
|
||||
}
|
||||
|
||||
fun getGoodsType(id: Int): String {
|
||||
return goodsTypeList.find { it.id == id }?.value ?: "-"
|
||||
}
|
||||
|
||||
fun getWarehouseType(id: Int): String {
|
||||
return warehouseTypeList.find { it.id == id }?.value ?: "-"
|
||||
}
|
||||
|
||||
fun getSupplierType(id: Int): String {
|
||||
return supplierTypeList.find { it.id == id }?.value ?: "-"
|
||||
}
|
||||
|
||||
fun getUnitType(id: Int): String {
|
||||
return unitTypeList.find { it.id == id }?.value ?: "-"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
object GlobalKey {
|
||||
const val KEY_TOKEN = "tokenKey"
|
||||
const val KEY_USER_INFO = "userInfoKey"
|
||||
}
|
||||
Reference in New Issue
Block a user