|
|
@@ -24,6 +24,7 @@ import cn.muchinfo.rma.view.eventbus.MessageEvent
|
|
|
import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
|
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
|
import com.blankj.utilcode.util.SPUtils
|
|
|
+import com.blankj.utilcode.util.TimeUtils
|
|
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
|
|
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
|
|
@@ -74,14 +75,22 @@ class RydzAccountActivity : BaseActivity<RydzAccountViewModel>() {
|
|
|
/** 行情推送过来的goodsid **/
|
|
|
quoteMessageEvent.goodsid.forEach { goodid ->
|
|
|
//找到相应商品信息
|
|
|
+// println("goodsid="+goodid)
|
|
|
val goodsInfo =
|
|
|
GlobalDataCollection.instance?.contractTradePositionDataArrayList?.find { it.goodsid?.toInt() == goodid }
|
|
|
if (goodsInfo?.goodsid.isNullOrEmpty().not()) {
|
|
|
- viewModel.getTaAccounts()
|
|
|
+
|
|
|
+ if(TimeUtils.getNowMills() - requestTime > 1000){
|
|
|
+ viewModel.resetAccountData()
|
|
|
+ viewModel.getTaAccounts()
|
|
|
+ requestTime = TimeUtils.getNowMills()
|
|
|
+ }
|
|
|
+
|
|
|
+ // resolve bug #3429
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ private var requestTime = TimeUtils.getNowMills()
|
|
|
override fun onDestroy() {
|
|
|
super.onDestroy()
|
|
|
EventBus.getDefault().unregister(this)
|
|
|
@@ -560,16 +569,35 @@ class MoneyInfoUI(
|
|
|
* 浮动盈亏-usedmargin
|
|
|
*/
|
|
|
viewModel.usedAccountData.bindOptional(context) {
|
|
|
- text = NumberUtils.roundNum(
|
|
|
- NumberUtils.doubleDistortion(it?.valueOfposition_keep_watch_profit_and_loss?.toString()),
|
|
|
- 2
|
|
|
- )
|
|
|
- textColorInt = if (it?.valueOfposition_keep_watch_profit_and_loss ?: 0.0 > 0.0){
|
|
|
- R.color.rma_red_color
|
|
|
- }else if (it?.valueOfposition_keep_watch_profit_and_loss ?: 0.0 < 0.0){
|
|
|
- R.color.rma_green_color
|
|
|
- }else{
|
|
|
- R.color.rma_black_33
|
|
|
+// println("@@@@ = " + it?.valueOfposition_keep_watch_profit_and_loss)
|
|
|
+// text = NumberUtils.roundNum(
|
|
|
+// NumberUtils.doubleDistortion(it?.valueOfposition_keep_watch_profit_and_loss?.toString()),
|
|
|
+// 2
|
|
|
+// )
|
|
|
+// textColorInt = if (it?.valueOfposition_keep_watch_profit_and_loss ?: 0.0 > 0.0){
|
|
|
+// R.color.rma_red_color
|
|
|
+// }else if (it?.valueOfposition_keep_watch_profit_and_loss ?: 0.0 < 0.0){
|
|
|
+// R.color.rma_green_color
|
|
|
+// }else{
|
|
|
+// R.color.rma_black_33
|
|
|
+// }
|
|
|
+ it!!.postValueOfPosition.bindOptional(context){
|
|
|
+ text = NumberUtils.roundNum(
|
|
|
+ NumberUtils.doubleDistortion(it?.toString()),
|
|
|
+ 2
|
|
|
+ )
|
|
|
+
|
|
|
+ textColorInt = when {
|
|
|
+ it ?: 0.0 > 0.0 -> {
|
|
|
+ R.color.rma_red_color
|
|
|
+ }
|
|
|
+ it ?: 0.0 < 0.0 -> {
|
|
|
+ R.color.rma_green_color
|
|
|
+ }
|
|
|
+ else -> {
|
|
|
+ R.color.rma_black_33
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
textSizeAuto = 36
|