package com.zswc.creativity.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import com.zswc.creativity.base.MBActivity
import com.zswc.creativity.config.MIntentAction
import com.zswc.creativity.databinding.ActivityWithdrawalBinding
import com.zswc.creativity.vmodel.WithdrawalVModel

/**
 *Created by shihuiyun
 *on 2020/9/23
 */
class WithdrawalActivity : MBActivity<WithdrawalVModel, ActivityWithdrawalBinding>(){


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        vm.canUseMoney.value=intent?.extras?.getString("money", "")
        vm.getBankInfo()
        vm.reqTips()
    }
    override fun binding(): ActivityWithdrawalBinding {
       return ActivityWithdrawalBinding.inflate(layoutInflater)
    }

    override fun vmClass(): Class<WithdrawalVModel> {
        return WithdrawalVModel::class.java
    }

    override fun title(): String? {
        return "提现"
    }
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if(MIntentAction.REQUEST_CODE_ONE == requestCode && resultCode == Activity.RESULT_OK){
            vm.getBankInfo()//刷新银行卡
        }
    }
}
