package com.fangxinxing.xxfxx.ui.mine.money_bag
|
|
import com.fangxinxing.xxfxx.R
|
import com.fangxinxing.xxfxx.base.MyBaseActivity
|
import com.fangxinxing.xxfxx.bean.UserBean
|
import com.fangxinxing.xxfxx.netUtls.Api
|
import com.fangxinxing.xxfxx.netUtls.callNet
|
import com.fangxinxing.xxfxx.netUtls.getMapByAny
|
import com.fangxinxing.xxfxx.utils.Cache.CacheKey
|
import com.fangxinxing.xxfxx.utils.getFormatTwo
|
import kotlinx.android.synthetic.main.activity_income_detail.tv_left_title_income
|
import kotlinx.android.synthetic.main.activity_income_detail.tv_money
|
|
class IncomeDetailActivity : MyBaseActivity() {
|
override fun setContentView() {
|
setContentView(R.layout.activity_income_detail)
|
}
|
|
override fun initView() {
|
showTitle(false)
|
showHeader(false)
|
addFragment(InconeDetailFragment(), R.id.fl_container)
|
}
|
|
override fun onResume() {
|
super.onResume()
|
callMine()
|
}
|
|
private fun callMine() {
|
val map = getMapByAny()
|
callNet(Api.queryInfo, map) {
|
val user = gson.fromJson<UserBean>(it, UserBean::class.java)
|
CacheKey.saveUserInfo(user.data)
|
showUI()
|
}
|
}
|
|
private fun showUI() {
|
tv_money.text =
|
"¥" + getFormatTwo(CacheKey.getUserInfo().activityMoney?.toDoubleOrNull() ?: 0.0)
|
}
|
|
override fun setOnclick() {
|
tv_left_title_income.setOnClickListener {
|
onBackPressed()
|
}
|
}
|
}
|