统一处理提现流程逻辑+1
This commit is contained in:
parent
e2bdd75db4
commit
82d7f7d9d8
|
|
@ -139,9 +139,6 @@ class WithdrawManager private constructor() {
|
|||
SpUtil.instance().putList(SpUtil.KEY_WITHDRAW_ITEM_LIST, itemList)
|
||||
}
|
||||
|
||||
fun getItemList(): List<WithdrawItem> {
|
||||
return mWithdrawItemList
|
||||
}
|
||||
|
||||
fun getItem(itemIndex: Int): WithdrawItem {
|
||||
return mWithdrawItemList[itemIndex]
|
||||
|
|
@ -152,10 +149,6 @@ class WithdrawManager private constructor() {
|
|||
return RecordsManager.instance().getHasWithdrawSuccessCashCount()
|
||||
}
|
||||
|
||||
fun getHasWithdrawSuccessCashCount(itemIndex: Int): Double {
|
||||
return RecordsManager.instance().getHasWithdrawSuccessCashCount(itemIndex)
|
||||
}
|
||||
|
||||
fun addAdEarnForSubBean(itemIndex: Int, selectedSubIndex: Int, earnMoneyNum: Double) : Boolean {
|
||||
if (itemIndex >= 0 && itemIndex < mWithdrawItemList.size) {
|
||||
try {
|
||||
|
|
@ -221,23 +214,11 @@ class WithdrawManager private constructor() {
|
|||
RecordsManager.instance().updateRecordHasNotifyState(recordNo)
|
||||
}
|
||||
|
||||
fun saveNewRecord(newRecord: RecordCash) {
|
||||
RecordsManager.instance().saveNewWithdrawRecord(newRecord)
|
||||
loopCheckTransactionState()
|
||||
}
|
||||
|
||||
fun saveNewRecord2(newRecord: RecordCash) {
|
||||
fun saveNewWithdrawRecord(newRecord: RecordCash) {
|
||||
RecordsManager.instance().saveNewWithdrawRecord(newRecord)
|
||||
}
|
||||
|
||||
|
||||
fun updateRecord(recordNo: String, newState: Int, failType: Int = 0) {
|
||||
val withdrawItemIndex = RecordsManager.instance().withdrawUpdateRecord(recordNo, newState, failType)
|
||||
if (newState == STATE_HAS_WITHDRAWED && withdrawItemIndex >= 0) {
|
||||
checkIfItemFinishAndReset(withdrawItemIndex)
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkIfItemFinishAndReset(itemIndex: Int) {
|
||||
var needReset = false
|
||||
if (itemIndex == 0) {
|
||||
|
|
@ -254,11 +235,11 @@ class WithdrawManager private constructor() {
|
|||
}
|
||||
|
||||
if (needReset) {
|
||||
resetItem(itemIndex)
|
||||
resetWithdrawItem(itemIndex)
|
||||
}
|
||||
}
|
||||
|
||||
private fun resetItem(itemIndex: Int) {
|
||||
private fun resetWithdrawItem(itemIndex: Int) {
|
||||
val needResetItem = mWithdrawItemList[itemIndex]
|
||||
needResetItem.apply {
|
||||
totalProgress = 0
|
||||
|
|
@ -287,10 +268,6 @@ class WithdrawManager private constructor() {
|
|||
return RecordsManager.instance().getOngoingRecordList()
|
||||
}
|
||||
|
||||
private fun getRecord(recordNo: String): RecordCash? {
|
||||
return RecordsManager.instance().getRecord(recordNo)
|
||||
}
|
||||
|
||||
|
||||
private fun loopCheckTransactionState() {
|
||||
val ongoingList = getOngoingRecordList()
|
||||
|
|
@ -364,14 +341,6 @@ class WithdrawManager private constructor() {
|
|||
}
|
||||
|
||||
|
||||
private fun sendWithdrawResultStatistic(cashNum: Double, isSuccess: Boolean, failType: Int) {
|
||||
StatisticUtil.reportEvents(StatisticUtil.KEY_Withdrawal_Reason,
|
||||
mapOf("Reason_Type" to (if (isSuccess) "Success" else "Fail"),
|
||||
"Fail_Reason" to failType.toString() + ": " + getFailHintStrRes(failType),
|
||||
"Withdrawal_Position" to cashNum,
|
||||
"Withdrawal_Day" to 1))
|
||||
}
|
||||
|
||||
fun getFailHintStrRes(failType: Int) : Int {
|
||||
var failTextRes = R.string.withdraw_normal_fail
|
||||
when (failType) {
|
||||
|
|
@ -506,7 +475,7 @@ class WithdrawManager private constructor() {
|
|||
withdrawItemSubIndex = withdrawSubItemId
|
||||
withdrawItemLoopIndex = payItemLoopIndex
|
||||
}
|
||||
saveNewRecord2(withdrawRecord)
|
||||
saveNewWithdrawRecord(withdrawRecord)
|
||||
|
||||
val initReqParam = applyInitFields( PayInitReq())
|
||||
val initReqResult = NetworkUtil.callApi {
|
||||
|
|
|
|||
Loading…
Reference in New Issue