|
|
@@ -3,7 +3,11 @@ package cn.muchinfo.rma.view.base.platinumtreasure.trade
|
|
|
import android.os.Bundle
|
|
|
import android.view.Gravity
|
|
|
import cn.muchinfo.rma.R
|
|
|
+import cn.muchinfo.rma.global.data.ContractLogData
|
|
|
+import cn.muchinfo.rma.global.data.QhjContractDetailsData
|
|
|
+import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
|
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
|
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
import cn.muchinfo.rma.view.base.future.trade.itemView
|
|
|
import mtp.polymer.com.autowidget.adapter.BaseAdapter
|
|
|
@@ -14,6 +18,8 @@ import org.jetbrains.anko.*
|
|
|
*/
|
|
|
class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
|
|
|
+ //列表传过来的参数
|
|
|
+ private val data by lazy { intent.getParcelableExtra<QhjContractDetailsData>("data") as QhjContractDetailsData }
|
|
|
|
|
|
// 下拉刷新
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
@@ -22,7 +28,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
/**
|
|
|
* 明细
|
|
|
*/
|
|
|
- private val financingDetailsAdapter: BaseAdapter<String, FinancingDetailsViewHolder> =
|
|
|
+ private val financingDetailsAdapter: BaseAdapter<ContractLogData, FinancingDetailsViewHolder> =
|
|
|
BaseAdapter { _, _ ->
|
|
|
FinancingDetailsViewHolder(
|
|
|
this,
|
|
|
@@ -34,6 +40,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
super.onCreate(savedInstanceState)
|
|
|
verticalLayout {
|
|
|
+ viewModel.queryContractLog(scfcontractid = data.scfcontractid ?: "")
|
|
|
topBar {
|
|
|
// 返回
|
|
|
commonLeftButton()
|
|
|
@@ -54,7 +61,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "黄金"
|
|
|
+ text = data.goodsname
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -75,7 +82,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "2021-12-03 12:21:33"
|
|
|
+ text = data.contractconfirmtime
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -96,7 +103,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "2g"
|
|
|
+ text = data.wrqty
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -117,7 +124,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "231.09"
|
|
|
+ text = NumberUtils.roundNum(data.tradeprice,2)
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -138,7 +145,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "231.09"
|
|
|
+ text = NumberUtils.roundNum(data.lenderamount,2)
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -159,7 +166,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "30%"
|
|
|
+ text = data.marginratio
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -180,7 +187,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "150"
|
|
|
+ text = NumberUtils.roundNum(data.payamount,2)
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -201,7 +208,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "150"
|
|
|
+ text = NumberUtils.roundNum(data.remainamount,2)
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -222,7 +229,7 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
}
|
|
|
|
|
|
textView {
|
|
|
- text = "150"
|
|
|
+ text = NumberUtils.roundNum(data.totalinterest,2)
|
|
|
textSizeAuto = 36
|
|
|
textColorInt = R.color.rma_black_33
|
|
|
}.lparams(wrapContent, wrapContent)
|
|
|
@@ -268,14 +275,14 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
statusLayout = this
|
|
|
// bindTaskStatus(viewModule.status)
|
|
|
setRetryAction {
|
|
|
-
|
|
|
+ viewModel.queryContractLog(scfcontractid = data.scfcontractid ?: "")
|
|
|
}
|
|
|
swipeToLoadLayout {
|
|
|
swipeToLayout = this
|
|
|
setEnableRefresh(true)
|
|
|
setEnableLoadMore(false)
|
|
|
setOnRefreshListener {
|
|
|
-
|
|
|
+ viewModel.queryContractLog(scfcontractid = data.scfcontractid ?: "")
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
|
@@ -290,7 +297,17 @@ class FinancingDetailsActivity : BaseActivity<PlatinumTradeViewModel>(){
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
|
|
|
|
- financingDetailsAdapter.setNewData(arrayListOf("1", "2", "3", "4"))
|
|
|
+ viewModel.contractLogDataList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
+ statusLayout.showEmpty()
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
+ swipeToLayout.finishRefresh()
|
|
|
+ }
|
|
|
+ statusLayout.showSuccess()
|
|
|
+ financingDetailsAdapter.setNewData(it)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|