|
|
@@ -8,11 +8,15 @@ import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
import androidx.annotation.RequiresApi
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
+import androidx.lifecycle.MutableLiveData
|
|
|
import androidx.viewpager.widget.PagerAdapter
|
|
|
import androidx.viewpager.widget.ViewPager
|
|
|
import cn.muchinfo.rma.R
|
|
|
import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.global.data.AmountLogData
|
|
|
+import cn.muchinfo.rma.global.data.futureOrders.DealOrderData
|
|
|
+import cn.muchinfo.rma.global.data.futureOrders.FutureEntrustData
|
|
|
+import cn.muchinfo.rma.global.isBlankString
|
|
|
import cn.muchinfo.rma.lifecycle.bindOptional
|
|
|
import cn.muchinfo.rma.view.autoWidget.*
|
|
|
import cn.muchinfo.rma.view.base.BaseActivity
|
|
|
@@ -163,11 +167,27 @@ class HistoryCommissionedUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
- private val historyCommissionedAdapter: BaseAdapter<String, TradingHistoryViewHolder> =
|
|
|
- BaseAdapter { _, _ -> TradingHistoryViewHolder(activity, viewModel) }
|
|
|
+ val startTime : MutableLiveData<String> = MutableLiveData()//历史委托查询起始日期
|
|
|
+ val endTime : MutableLiveData<String> = MutableLiveData()//历史委托查询结束日期
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初始化查询起始和结束日期
|
|
|
+ */
|
|
|
+ fun initTime(){
|
|
|
+ startTime.postValue(GlobalDataCollection.instance?.oneMonth() ?: "")
|
|
|
+ endTime.postValue(TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd")))
|
|
|
+ }
|
|
|
+
|
|
|
+ init {
|
|
|
+ initTime()
|
|
|
+ }
|
|
|
+
|
|
|
+ private val historyCommissionedAdapter: BaseAdapter<FutureEntrustData, EntrustHistoryViewHolder> =
|
|
|
+ BaseAdapter { _, _ -> EntrustHistoryViewHolder(activity, viewModel) }
|
|
|
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
+ viewModel.queryErmcpHisEntrustDetails(startDate = startTime.value ?: "",endDate = endTime.value ?: "")
|
|
|
linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
//起始日期选择
|
|
|
@@ -175,6 +195,9 @@ class HistoryCommissionedUI(
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
+ startTime.bindOptional(context){
|
|
|
+ text = it
|
|
|
+ }
|
|
|
text = "起始日期"
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
@@ -197,6 +220,9 @@ class HistoryCommissionedUI(
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
+ endTime.bindOptional(context){
|
|
|
+ text = it
|
|
|
+ }
|
|
|
text = "结束日期"
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
@@ -233,12 +259,17 @@ class HistoryCommissionedUI(
|
|
|
text = "名称"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
textView {
|
|
|
text = "类型"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
}.lparams(autoSize(300), autoSize(97))
|
|
|
|
|
|
verticalLayout {
|
|
|
@@ -261,12 +292,17 @@ class HistoryCommissionedUI(
|
|
|
text = "状态"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
textView {
|
|
|
text = "时间"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ }
|
|
|
}.lparams(autoSize(300), autoSize(97))
|
|
|
}.lparams(matchParent, autoSize(97))
|
|
|
|
|
|
@@ -278,7 +314,7 @@ class HistoryCommissionedUI(
|
|
|
setEnableRefresh(true)
|
|
|
setEnableLoadMore(false)
|
|
|
setOnRefreshListener {
|
|
|
-
|
|
|
+ viewModel.queryErmcpHisEntrustDetails(startDate = startTime.value ?: "",endDate = endTime.value ?: "")
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
|
@@ -290,6 +326,18 @@ class HistoryCommissionedUI(
|
|
|
}, emptyBlock = {
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ viewModel.entrustOrderHistoryList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
+ statusLayout.showEmpty()
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
+ swipeToLayout.finishRefresh()
|
|
|
+ }
|
|
|
+ statusLayout.showSuccess()
|
|
|
+ historyCommissionedAdapter.setNewData(it)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -309,18 +357,43 @@ class HistoryDealUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
- private val historyCommissionedAdapter: BaseAdapter<String, TradingHistoryViewHolder> =
|
|
|
+ val startTime : MutableLiveData<String> = MutableLiveData()//历史成交查询起始日期
|
|
|
+ val endTime : MutableLiveData<String> = MutableLiveData()//历史成交查询结束日期
|
|
|
+
|
|
|
+ private val historyCommissionedAdapter: BaseAdapter<DealOrderData, TradingHistoryViewHolder> =
|
|
|
BaseAdapter { _, _ -> TradingHistoryViewHolder(activity, viewModel) }
|
|
|
|
|
|
+ /**
|
|
|
+ * 初始化查询起始和结束日期
|
|
|
+ */
|
|
|
+ fun initTime(){
|
|
|
+ startTime.postValue(GlobalDataCollection.instance?.oneMonth() ?: "")
|
|
|
+ endTime.postValue(TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd")))
|
|
|
+ }
|
|
|
+
|
|
|
+ init {
|
|
|
+ initTime()
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequiresApi(Build.VERSION_CODES.N)
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
+ viewModel.queryErmcpHisTradeDetails(startDate = startTime.value ?: "",endDate = endTime.value ?: "")
|
|
|
linearLayout {
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
//起始日期选择
|
|
|
linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ activity.showDataSelectDialog {
|
|
|
+ startTime.postValue(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
+ startTime.bindOptional(context){
|
|
|
+ text = it
|
|
|
+ }
|
|
|
text = "起始日期"
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
@@ -340,9 +413,17 @@ class HistoryDealUI(
|
|
|
|
|
|
//结束日期选择
|
|
|
linearLayout {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ activity.showDataSelectDialog {
|
|
|
+ endTime.postValue(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
textView {
|
|
|
+ endTime.bindOptional(context){
|
|
|
+ text = it
|
|
|
+ }
|
|
|
text = "结束日期"
|
|
|
textColorInt = R.color.rma_hint_text_color_ccc
|
|
|
textSizeAuto = 31
|
|
|
@@ -379,12 +460,17 @@ class HistoryDealUI(
|
|
|
text = "名称"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ topMargin = autoSize(20)
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
textView {
|
|
|
text = "类型"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginStart = autoSize(36)
|
|
|
+ }
|
|
|
}.lparams(autoSize(300), autoSize(97))
|
|
|
|
|
|
verticalLayout {
|
|
|
@@ -403,16 +489,15 @@ class HistoryDealUI(
|
|
|
|
|
|
verticalLayout {
|
|
|
gravity = Gravity.RIGHT
|
|
|
+
|
|
|
textView {
|
|
|
- text = "状态"
|
|
|
+ text = "成交时间"
|
|
|
textSizeAuto = 24
|
|
|
textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
- textView {
|
|
|
- text = "时间"
|
|
|
- textSizeAuto = 24
|
|
|
- textColorInt = R.color.hint_text_color
|
|
|
- }.lparams(wrapContent, wrapContent)
|
|
|
+ }.lparams(wrapContent, wrapContent){
|
|
|
+ marginEnd = autoSize(36)
|
|
|
+ topMargin = autoSize(30)
|
|
|
+ }
|
|
|
}.lparams(autoSize(300), autoSize(97))
|
|
|
}.lparams(matchParent, autoSize(97))
|
|
|
|
|
|
@@ -424,7 +509,7 @@ class HistoryDealUI(
|
|
|
setEnableRefresh(true)
|
|
|
setEnableLoadMore(false)
|
|
|
setOnRefreshListener {
|
|
|
-
|
|
|
+ viewModel.queryErmcpHisTradeDetails(startDate = startTime.value ?: "",endDate = endTime.value ?: "")
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|
|
|
@@ -436,6 +521,18 @@ class HistoryDealUI(
|
|
|
}, emptyBlock = {
|
|
|
emptyView(hint = resources.getString(R.string.now_no_data))
|
|
|
}).lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+ viewModel.dealOrderHistoryList.bindOptional(context) {
|
|
|
+ if (it?.isEmpty() == true || it?.size == 0) {
|
|
|
+ statusLayout.showEmpty()
|
|
|
+ } else {
|
|
|
+ if (swipeToLayout.getIsRefreshing()) {
|
|
|
+ swipeToLayout.finishRefresh()
|
|
|
+ }
|
|
|
+ statusLayout.showSuccess()
|
|
|
+ historyCommissionedAdapter.setNewData(it)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -454,9 +551,20 @@ class MoneyFlowingUI(
|
|
|
private lateinit var swipeToLayout: SwipeToLoadLayout
|
|
|
private lateinit var statusLayout: StatusLayout
|
|
|
|
|
|
- var startTime: String = GlobalDataCollection.instance?.oneMonth() ?: ""//历史资金流水查询起始日期
|
|
|
- var endTime: String = TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd"))//历史资金流水查询结束日期
|
|
|
+ val startTime : MutableLiveData<String> = MutableLiveData()//历史资金流水查询起始日期
|
|
|
+ val endTime : MutableLiveData<String> = MutableLiveData()//历史资金流水查询结束日期
|
|
|
|
|
|
+ /**
|
|
|
+ * 初始化查询起始和结束日期
|
|
|
+ */
|
|
|
+ fun initTime(){
|
|
|
+ startTime.postValue(GlobalDataCollection.instance?.oneMonth() ?: "")
|
|
|
+ endTime.postValue(TimeUtils.getNowString(SimpleDateFormat("yyyy-MM-dd")))
|
|
|
+ }
|
|
|
+
|
|
|
+ init {
|
|
|
+ initTime()
|
|
|
+ }
|
|
|
|
|
|
private val moneyFlowingdAdapter: BaseAdapter<AmountLogData, MoneyFlowingViewHolder> =
|
|
|
BaseAdapter { _, _ -> MoneyFlowingViewHolder(activity, viewModel) }
|
|
|
@@ -464,14 +572,15 @@ class MoneyFlowingUI(
|
|
|
@RequiresApi(Build.VERSION_CODES.N)
|
|
|
val root = _FrameLayout(activity).apply {
|
|
|
verticalLayout {
|
|
|
+
|
|
|
linearLayout {
|
|
|
- viewModel.queryHisAmountLog(startDate = startTime,endDate = endTime)
|
|
|
+ viewModel.queryHisAmountLog(startDate = startTime.value ?: "",endDate = endTime.value ?: "")
|
|
|
gravity = Gravity.CENTER_VERTICAL
|
|
|
//起始日期选择
|
|
|
linearLayout {
|
|
|
onThrottleFirstClick {
|
|
|
activity.showDataSelectDialog {
|
|
|
- startTime = this
|
|
|
+ startTime.postValue(this)
|
|
|
}
|
|
|
}
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
@@ -498,7 +607,7 @@ class MoneyFlowingUI(
|
|
|
linearLayout {
|
|
|
onThrottleFirstClick {
|
|
|
activity.showDataSelectDialog {
|
|
|
- endTime = this
|
|
|
+ endTime.postValue(this)
|
|
|
}
|
|
|
}
|
|
|
backgroundResource = R.drawable.rma_time_click_bg
|
|
|
@@ -522,7 +631,7 @@ class MoneyFlowingUI(
|
|
|
|
|
|
textView {
|
|
|
onThrottleFirstClick {
|
|
|
- viewModel.queryHisAmountLog(startDate = startTime, endDate = endTime)
|
|
|
+ viewModel.queryHisAmountLog(startDate = startTime.value ?: "", endDate = endTime.value ?: "")
|
|
|
}
|
|
|
gravity = Gravity.CENTER
|
|
|
backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
|
|
|
@@ -581,7 +690,7 @@ class MoneyFlowingUI(
|
|
|
setEnableRefresh(true)
|
|
|
setEnableLoadMore(false)
|
|
|
setOnRefreshListener {
|
|
|
- viewModel.queryHisAmountLog(startDate = startTime, endDate = endTime)
|
|
|
+ viewModel.queryHisAmountLog(startDate = startTime.value ?: "", endDate = endTime.value ?: "")
|
|
|
}
|
|
|
setEnableScrollContentWhenLoaded(false)
|
|
|
setEnableLoadMoreWhenContentNotFull(false)
|