package com.yidian.shenghuoquan.bmanagercenter.wallet.ui

import android.content.Intent
import android.os.Bundle
import com.yidian.bcommon.constant.XRouterPathConstants
import com.yidian.bcommon.base.BaseActivity
import com.yidian.bcommon.extensions.initTitleBar
import com.yidian.shenghuoquan.bmanagercenter.databinding.ActivityTransactionDetailsBinding
import com.yidian.shenghuoquan.bmanagercenter.wallet.bean.TransactionListItemDto


/**
 * 钱包 - 交易详情
 */
class TransactionDetailsActivity : BaseActivity<ActivityTransactionDetailsBinding>() {

  override fun createViewBinding(): ActivityTransactionDetailsBinding {
    return ActivityTransactionDetailsBinding.inflate(layoutInflater)
  }

  override fun getXPageName(): String {
    return XRouterPathConstants.TRANSACTION_DETAILS
  }

  override fun init(savedInstanceState: Bundle?) {
    super.init(savedInstanceState)
    initTitle()
    getIntentData(intent)
  }

  private fun initTitle() {
    initTitleBar(viewBind.include.toolbar, viewBind.include.tvTitle, "交易明细")
  }

  private fun getIntentData(intent: Intent?) {
    val paramsMap = intent?.getSerializableExtra(XRouterPathConstants.ParamsKey)
    if (paramsMap != null) {
      paramsMap as HashMap<*, *>
      val itemInfo = paramsMap["TransactionListItemDto"] as TransactionListItemDto
      // 明细赋值
//      viewBind.tvUserName.text = itemInfo.title

    }
  }

}
