bug修改 - cash相关数值 Folat 修改 Double

This commit is contained in:
renhaoting 2025-12-29 13:48:09 +08:00
parent cd85982048
commit 88c1520177
13 changed files with 64 additions and 64 deletions

View File

@ -10,7 +10,7 @@ data class Account(
@Volatile
var goldCount: Long = 0L,
@Volatile
var cashCount: Float = 0F,
var cashCount: Double = 0.0,
@Volatile
var diamondCount: Int = 0,
var bankInfo: BankInfo? = null,

View File

@ -95,7 +95,7 @@ data class PayoutCheck(
data class WithdrawRecord (
var id: String = "",
var recordNo: String = "",
var cashNum: Float = 0F,
var cashNum: Double = 0.0,
var operateMs: Long = 0L,
var state: Int = TRANSACTION_STATE_ONGOING, // 提现状态 1:提现中,2:提现成功,3:提现失败
var failReason: Int = 0, // TODO - define various fail reasons

View File

@ -67,38 +67,38 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
mItemViewList.add(withdraw100)
mItemViewList.add(withdraw300)
withdraw01.setNumAndAction(0, 0.1F,
withdraw01.setNumAndAction(0, 0.1,
{ itemIndex->
handleGotoWithdraw(itemIndex)
})
withdraw10.setNumAndAction(1, 10F,
withdraw10.setNumAndAction(1, 10.0,
{ itemIndex->
handleGotoWithdraw(itemIndex)
})
withdraw20.setNumAndAction(2, 20F,
withdraw20.setNumAndAction(2, 20.0,
{ itemIndex->
handleGotoWithdraw(itemIndex)
})
withdraw50.setNumAndAction(3, 50F,
withdraw50.setNumAndAction(3, 50.0,
{ itemIndex->
handleGotoWithdraw(itemIndex)
})
withdraw100.setNumAndAction(4, 100F,
withdraw100.setNumAndAction(4, 100.0,
{ itemIndex->
handleGotoWithdraw(itemIndex)
})
withdraw300.setNumAndAction(5, 300F,
withdraw300.setNumAndAction(5, 300.0,
{ itemIndex->
handleGotoWithdraw(itemIndex)
})
withdrawPix2.setIconAndText(R.mipmap.pix2_big, R.string.pix2, {
WithdrawBindBankDialog(this@WithDrawActivity, null).setWithDrawCashNum(0F).show()
WithdrawBindBankDialog(this@WithDrawActivity, null).setWithDrawCashNum(0.0).show()
})
withdrawPix2.setSelectedState(true)
@ -120,7 +120,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
private fun handleGotoWithdraw(itemIndex: Int) {
if (mItemViewList.get(itemIndex).getCashNum() > 1F) {
if (mItemViewList.get(itemIndex).getCashNum() > 1.0) {
gotoWithdrawSubActivity(itemIndex)
} else {
val hasBindBank = AccountManager.hasValidBankInfo()
@ -207,7 +207,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
}
private fun requestInit(withdrawNum: Float) {
private fun requestInit(withdrawNum: Double) {
lifecycleScope.launch {
viewModel.InitData.collect { result ->
when (result) {
@ -252,7 +252,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
viewModel.withdrawInit()
}
private fun requestPayout(initUUID: String, payItemId: Int, payCashNum: Float) {
private fun requestPayout(initUUID: String, payItemId: Int, payCashNum: Double) {
val currentTimeMs = System.currentTimeMillis()
lifecycleScope.launch {
@ -300,7 +300,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
viewModel.withdrawPayout(initUUID, payItemId, payCashNum)
}
private fun showSuccessDialog(cashNum: Float) {
private fun showSuccessDialog(cashNum: Double) {
WithdrawSuccessDialog(this@WithDrawActivity, cashNum).show()
}
@ -340,7 +340,7 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
}
}
private fun saveNewRecord(payoutReply: PayoutReply, payCashNum: Float, timeMs: Long) {
private fun saveNewRecord(payoutReply: PayoutReply, payCashNum: Double, timeMs: Long) {
val newRecord = WithdrawRecord().apply {
id = payoutReply.id!!
recordNo = payoutReply.record_no

View File

@ -92,7 +92,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
}
private fun saveNewRecord(payoutReply: PayoutReply, payCashNum: Float, timeMs: Long) {
private fun saveNewRecord(payoutReply: PayoutReply, payCashNum: Double, timeMs: Long) {
val newRecord = WithdrawRecord().apply {
id = payoutReply.id!!
recordNo = payoutReply.record_no
@ -107,7 +107,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
WithdrawManager.instance().saveNewRecord(newRecord)
}
private fun requestInit(withdrawNum: Float) {
private fun requestInit(withdrawNum: Double) {
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
viewModel.InitData.collect { result ->
@ -154,7 +154,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
viewModel.withdrawInit()
}
private fun requestPayout(initUUID: String, payItemId: Int, payCashNum: Float) {
private fun requestPayout(initUUID: String, payItemId: Int, payCashNum: Double) {
val currentTimeMs = System.currentTimeMillis()
lifecycleScope.launch {
@ -203,7 +203,7 @@ class WithDrawSubActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
}
private fun showSuccessDialog(cashNum: Float) {
private fun showSuccessDialog(cashNum: Double) {
WithdrawSuccessDialog(this, cashNum).show()
}

View File

@ -45,7 +45,7 @@ class WithdrawViewModel : ViewModel() {
}
fun withdrawPayout(initUUID: String, payItemId: Int, payCashNum: Float) {
fun withdrawPayout(initUUID: String, payItemId: Int, payCashNum: Double) {
viewModelScope.launch {
val requestParam = PayoutReq().applyInitFields().apply {
val bankAccount = "11032341882" //AccountManager.getAccount()?.bankInfo?.bankAccount

View File

@ -15,9 +15,9 @@ import com.gamedog.vididin.features.withdraw.BankUtil
import com.vididin.real.money.game.databinding.DialogWithdrawBindingBankBinding as ViewBinding
class WithdrawBindBankDialog(activity: Activity, private val onConfirmedWithdraw: ((cashNum: Float)->Unit)?) : BindingDialog<ViewBinding>(activity, ViewBinding::inflate) {
class WithdrawBindBankDialog(activity: Activity, private val onConfirmedWithdraw: ((cashNum: Double)->Unit)?) : BindingDialog<ViewBinding>(activity, ViewBinding::inflate) {
private var mWithdrawCashNum: Float = 0F
private var mWithdrawCashNum: Double = 0.0
private var mWithdrawCashNumStr: String = ""
init {
@ -113,10 +113,10 @@ class WithdrawBindBankDialog(activity: Activity, private val onConfirmedWithdraw
}
fun setWithDrawCashNum(withdrawNum: Float): WithdrawBindBankDialog {
fun setWithDrawCashNum(withdrawNum: Double): WithdrawBindBankDialog {
mWithdrawCashNum = withdrawNum
if (mWithdrawCashNum == 0F) {
if (mWithdrawCashNum == 0.0) {
mBinding.tvConfirm.text = ResUtil.getString(R.string.confirm)
}
return this
@ -125,7 +125,7 @@ class WithdrawBindBankDialog(activity: Activity, private val onConfirmedWithdraw
fun setWithDrawCashNumStr(withdrawNumStr: String): WithdrawBindBankDialog {
mWithdrawCashNumStr = withdrawNumStr
if (mWithdrawCashNum == 0F) {
if (mWithdrawCashNum == 0.0) {
mBinding.tvConfirm.text = ResUtil.getString(R.string.confirm)
}
return this

View File

@ -11,9 +11,9 @@ import com.gamedog.vididin.core.login.login.AccountManager
import com.vididin.real.money.game.databinding.DialogWithdrawInfoConfirmBinding as ViewBinding
class WithdrawInfoConfirmDialog(context: Activity, private val onConfirmed: (cashNum: Float)->Unit) : BindingDialog<ViewBinding>(context, ViewBinding::inflate) {
class WithdrawInfoConfirmDialog(context: Activity, private val onConfirmed: (cashNum: Double)->Unit) : BindingDialog<ViewBinding>(context, ViewBinding::inflate) {
private var mWithdrawCashNum: Float = 0F
private var mWithdrawCashNum: Double = 0.0
private var mWithdrawCashNumStr: String = ""
init {
@ -60,7 +60,7 @@ class WithdrawInfoConfirmDialog(context: Activity, private val onConfirmed: (cas
}
fun setWithDrawCashNum(withdrawNum: Float): WithdrawInfoConfirmDialog {
fun setWithDrawCashNum(withdrawNum: Double): WithdrawInfoConfirmDialog {
mWithdrawCashNum = withdrawNum
mBinding.tvCashNum.text = buildString {

View File

@ -9,7 +9,7 @@ import com.vididin.real.money.game.R
import com.vididin.real.money.game.databinding.DialogWithdrawSuccessBinding as ViewBinding
class WithdrawSuccessDialog(context: Activity, private val mCashNum: Float = 0F, private val cashNumStr: String = "") : BindingDialog<ViewBinding>(context, ViewBinding::inflate) {
class WithdrawSuccessDialog(context: Activity, private val mCashNum: Double = 0.0, private val cashNumStr: String = "") : BindingDialog<ViewBinding>(context, ViewBinding::inflate) {
init {
build()

View File

@ -16,7 +16,7 @@ class WithDrawItemView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private var mItemIndex: Int = 0
private var mCashNum: Float = 0F
private var mCashNum: Double = 0.0
private var mBinding: ViewBinding
@ -28,7 +28,7 @@ class WithDrawItemView @JvmOverloads constructor(
/**
* For withdraw number in top area
*/
fun setNumAndAction(itemIndex: Int, cashNum: Float, clickAction: (Int)->Unit) {
fun setNumAndAction(itemIndex: Int, cashNum: Double, clickAction: (Int)->Unit) {
mItemIndex = itemIndex
mCashNum = cashNum
mBinding.tvWithdrawNum.text = ResUtil.getString(R.string.cash) + " " +
@ -41,7 +41,7 @@ class WithDrawItemView @JvmOverloads constructor(
}
fun getCashNum(): Float {
fun getCashNum(): Double {
return mCashNum
}

View File

@ -68,12 +68,12 @@ object AccountManager {
}
fun getCash(): Float {
fun getCash(): Double {
return mAccount.cashCount
}
@Synchronized
fun adjustCash(adjustNum: Float, recordBean: RecordCash?): Boolean {
fun adjustCash(adjustNum: Double, recordBean: RecordCash?): Boolean {
if (adjustNum < 0L && Math.abs(adjustNum) > getCash()) {
return false
}
@ -135,7 +135,7 @@ object AccountManager {
val costGoldNum = couldCovertCashTotal * VidiConst.PER_01CASH_COST_GOLD_NUM
if (getGold() >= costGoldNum) {
adjustGold(-1L * costGoldNum.toInt(), RecordGold(RECORD_GOLD_MINUS_CONVERT_2_CASH, -1L * costGoldNum.toInt()))
val adjustCashNum = couldCovertCashTotal * 0.1F
val adjustCashNum = couldCovertCashTotal * 0.1
adjustCash(adjustCashNum, RecordCash(RECORD_CASH_PLUS_GOLD_CONVERT, adjustCashNum.toDouble(), true))
AndroidUtil.showToast("Has convert $costGoldNum gold to $couldCovertCashTotal cash.")
return true

View File

@ -48,7 +48,7 @@ class WithdrawManager private constructor() {
}
companion object {
const val EACH_SUB_ITEM_CASH_NUM: Float = 1F
const val EACH_SUB_ITEM_CASH_NUM: Double = 1.0
// subBean 状态
@ -88,12 +88,12 @@ class WithdrawManager private constructor() {
private fun generateItemList(): MutableList<WithdrawItemBean> {
val itemList = mutableListOf<WithdrawItemBean>()
itemList.add(WithdrawItemBean(0, 0.1F, isBigWithDraw = false))
itemList.add(WithdrawItemBean(1, 10F, AndroidUtil.randomInt(50, 70), generateSubItemList(10F)))
itemList.add(WithdrawItemBean(2, 20F, AndroidUtil.randomInt(50, 70), generateSubItemList(20F)))
itemList.add(WithdrawItemBean(3, 50F, AndroidUtil.randomInt(50, 70), generateSubItemList(50F)))
itemList.add(WithdrawItemBean(4, 100F, AndroidUtil.randomInt(50, 70), generateSubItemList(100F)))
itemList.add(WithdrawItemBean(5, 300F, AndroidUtil.randomInt(50, 70), generateSubItemList(300F)))
itemList.add(WithdrawItemBean(0, 0.1, isBigWithDraw = false))
itemList.add(WithdrawItemBean(1, 10.0, AndroidUtil.randomInt(50, 70), generateSubItemList(10F)))
itemList.add(WithdrawItemBean(2, 20.0, AndroidUtil.randomInt(50, 70), generateSubItemList(20F)))
itemList.add(WithdrawItemBean(3, 50.0, AndroidUtil.randomInt(50, 70), generateSubItemList(50F)))
itemList.add(WithdrawItemBean(4, 100.0, AndroidUtil.randomInt(50, 70), generateSubItemList(100F)))
itemList.add(WithdrawItemBean(5, 300.0, AndroidUtil.randomInt(50, 70), generateSubItemList(300F)))
return itemList
}
@ -103,7 +103,7 @@ class WithdrawManager private constructor() {
for (i in 0..subItemCount-1) {
val initProgress = AndroidUtil.randomInt(50, 70)
subItemList.add(WithdrawSubItem(i, EACH_SUB_ITEM_CASH_NUM, initProgress, initProgress, 0F))
subItemList.add(WithdrawSubItem(i, EACH_SUB_ITEM_CASH_NUM, initProgress, initProgress, 0.0))
}
return subItemList
}
@ -121,8 +121,8 @@ class WithdrawManager private constructor() {
}
fun getHasWithdrawSuccessCashCount(): Float {
var count = 0F
fun getHasWithdrawSuccessCashCount(): Double {
var count = 0.0
for (record in mRecordList) {
if (record.state == TRANSACTION_STATE_SUCCESS) {
count += record.cashNum
@ -135,8 +135,8 @@ class WithdrawManager private constructor() {
return count
}
fun getHasWithdrawSuccessCashCount(itemIndex: Int): Float {
var count = 0F
fun getHasWithdrawSuccessCashCount(itemIndex: Int): Double {
var count = 0.0
for (record in mRecordList) {
if (record.state == TRANSACTION_STATE_SUCCESS && record.itemIndex == itemIndex) {
count += record.cashNum
@ -197,7 +197,7 @@ class WithdrawManager private constructor() {
fun startItem(curItem: WithdrawItemBean) {
if (curItem.startMs <= 0L) {
curItem.startMs = DateUtil.getCurTimeMs() - (if (curItem.totalCashNum == 50F) 24 * 3600000 * 4 else 0)
curItem.startMs = DateUtil.getCurTimeMs() - (if (curItem.totalCashNum == 50.0) 24 * 3600000 * 4 else 0)
saveInfos2Sp(mItemList)
}
}
@ -288,7 +288,7 @@ class WithdrawManager private constructor() {
subItemList.forEach { subItem ->
subItem.apply {
currentAdProgress = startAdProgress
hasEarnMoneyByAd = 0F
hasEarnMoneyByAd = 0.0
withdrawState = STATE_NEED_WATCH_AD
}
}
@ -353,7 +353,7 @@ class WithdrawManager private constructor() {
}
}
private fun doTransactionCheck(recordNo: String, cashNum: Float) {
private fun doTransactionCheck(recordNo: String, cashNum: Double) {
backgroundScope.launch {
performNetworkRequest(recordNo)
}
@ -427,7 +427,7 @@ class WithdrawManager private constructor() {
}
private fun updateFirstWithdraw01Task(recordBean: WithdrawRecord) {
if (recordBean.cashNum == 0.1F && !TaskManager.instance().newbieFirstWithdrawStatus().getStatusBean().hasClaimReward) {
if (recordBean.cashNum == 0.1 && !TaskManager.instance().newbieFirstWithdrawStatus().getStatusBean().hasClaimReward) {
TaskManager.instance().newbieFirstWithdrawStatus().claimReward()
}
}
@ -472,11 +472,11 @@ class WithdrawManager private constructor() {
return failTextRes
}
private fun getStartedItemRestCashNum(itemIndex: Int): Float {
private fun getStartedItemRestCashNum(itemIndex: Int): Double {
if (itemIndex in 0..mItemList.size-1) {
val curItem = mItemList[itemIndex]
if (curItem.hasStarted) {
var hasWithdrawedCash = 0F
var hasWithdrawedCash = 0.0
curItem.subItemList.forEach { subItem->
if (subItem.withdrawState == STATE_HAS_WITHDRAWED) {
hasWithdrawedCash += subItem.cashTotal
@ -485,11 +485,11 @@ class WithdrawManager private constructor() {
return curItem.totalCashNum - hasWithdrawedCash
}
}
return 0F
return 0.0
}
private fun getStartedItemRestCashCount(): Float {
var allStartedItemRestCashNum = 0F
private fun getStartedItemRestCashCount(): Double {
var allStartedItemRestCashNum = 0.0
mItemList.forEachIndexed { index, item ->
allStartedItemRestCashNum += getStartedItemRestCashNum(index)
}
@ -498,8 +498,8 @@ class WithdrawManager private constructor() {
}
fun getItemProgress(itemIndex: Int): Float {
var itemProgress = 0F
fun getItemProgress(itemIndex: Int): Double {
var itemProgress = 0.0
if (itemIndex in 0..mItemList.size-1) {
val curItem = mItemList[itemIndex]
@ -507,7 +507,7 @@ class WithdrawManager private constructor() {
val restAvailableCashNum = userCashTotal - getStartedItemRestCashCount()
if (curItem.hasStarted || restAvailableCashNum >= curItem.totalCashNum) {
itemProgress = 1F
itemProgress = 1.0
} else {
itemProgress = restAvailableCashNum / curItem.totalCashNum
}
@ -535,7 +535,7 @@ class WithdrawManager private constructor() {
data class WithdrawItemBean(
val index: Int,
val totalCashNum: Float,
val totalCashNum: Double,
var totalProgress: Int = 0,
val subItemList: List<WithdrawSubItem> = emptyList(),
var startMs: Long = 0L,
@ -545,9 +545,9 @@ data class WithdrawItemBean(
data class WithdrawSubItem(
val index: Int,
val cashTotal: Float,
val cashTotal: Double,
val startAdProgress: Int = 0,
var currentAdProgress: Int = 0,
var hasEarnMoneyByAd: Float = 0F,
var hasEarnMoneyByAd: Double = 0.0,
var withdrawState: Int = STATE_NEED_WATCH_AD,
)

View File

@ -274,7 +274,7 @@ class ZeroManager private constructor() {
val zeroWithdrawInfoItem = getZeroWithdrawItem(item)
if (couldStartWithdraw(item)) {
val onConfirmed: (cashNum: Float)->Unit = {
val onConfirmed: (cashNum: Double)->Unit = {
requestZeroWithdrawReward(zeroWithdrawInfoItem)
}

View File

@ -241,8 +241,8 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
return -1
}
fun getCouldClaimCashNum(): Float {
var waitClaimCashNum = 0F
fun getCouldClaimCashNum(): Double {
var waitClaimCashNum = 0.0
mStateBean.boxList.forEachIndexed { index, box ->
if (getBoxStateEnum(index) == STATE_FINISH) {
waitClaimCashNum += box.reward_value