修复不能支付的bug
This commit is contained in:
@@ -38,6 +38,7 @@ import androidx.annotation.StringDef
|
||||
MMKVKey.MapType,
|
||||
MMKVKey.ShowFence,
|
||||
MMKVKey.ShowDashedLine,
|
||||
MMKVKey.PaymentMethodID,
|
||||
MMKVKey.ShowAllPet,
|
||||
MMKVKey.isCrash,
|
||||
MMKVKey.AvailableOrder,
|
||||
@@ -59,6 +60,7 @@ annotation class MMKVKey {
|
||||
const val Phone = "phone"
|
||||
const val ActivityGoal = "activityGoal"
|
||||
const val Location = "location"
|
||||
const val PaymentMethodID = "paymentMethodID"
|
||||
const val Gender = "gender"
|
||||
const val BirthdayDate = "birthdayDate"
|
||||
const val CountryCode = "countryCode"
|
||||
@@ -84,6 +86,7 @@ annotation class MMKVKey {
|
||||
|
||||
//只使用谷歌地图
|
||||
const val OnlyGoogleMap = "onlyGoogleMap"
|
||||
|
||||
//是否gps坐标转换火星坐标
|
||||
const val isGpsToGCJ02 = "gpsToGCJ02"
|
||||
const val MapShowDefaultLat = "mapDefaultLat"
|
||||
|
||||
@@ -93,7 +93,7 @@ class AppUtils {
|
||||
* 是否是国内
|
||||
*/
|
||||
fun isChina(type: String = SWITCH_PAGE_TYPE): Boolean {
|
||||
// return false
|
||||
return false
|
||||
if (isDebug()) {
|
||||
if (type == SWITCH_MAP_TYPE && MMKVUtil.getBoolean(MMKVKey.OnlyGoogleMap, false)) {
|
||||
//只启用谷歌地图
|
||||
|
||||
@@ -78,6 +78,27 @@ class Utils {
|
||||
return sdf.format(date)
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断毫秒时间戳是否是昨天
|
||||
* @param timeMs 毫秒时间戳
|
||||
*/
|
||||
fun isYesterday(timeMs: Long): Boolean {
|
||||
// 1. 获取今天零点
|
||||
val todayCal = Calendar.getInstance()
|
||||
todayCal.set(Calendar.HOUR_OF_DAY, 0)
|
||||
todayCal.set(Calendar.MINUTE, 0)
|
||||
todayCal.set(Calendar.SECOND, 0)
|
||||
todayCal.set(Calendar.MILLISECOND, 0)
|
||||
val todayZero = todayCal.timeInMillis
|
||||
|
||||
// 2. 昨天零点 = 今天零点 - 1天
|
||||
val yesterdayCal = todayCal.apply { add(Calendar.DAY_OF_YEAR, -1) }
|
||||
val yesterdayZero = yesterdayCal.timeInMillis
|
||||
|
||||
// 时间落在昨天0点 ~ 今天0点之间 = 昨天
|
||||
return timeMs in yesterdayZero..<todayZero
|
||||
}
|
||||
|
||||
/**
|
||||
* 把字符串转成日期
|
||||
* @param parseFormat 字符串是什么格式的日期就传什么格式
|
||||
|
||||
Reference in New Issue
Block a user