|
|
@@ -70,6 +70,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
|
|
|
super.onResume()
|
|
|
viewModel.getUserAccount()
|
|
|
viewModel.resetAccountData()
|
|
|
+ viewModel.queryContractTradePosition("2")
|
|
|
}
|
|
|
|
|
|
override fun onDestroy() {
|
|
|
@@ -86,6 +87,8 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
|
|
|
} else if (messageEvent.messageType == EventConstent.FID_MoneyChangedNtf) {//资金账号变化通知
|
|
|
viewModel.getUserAccount()
|
|
|
viewModel.resetAccountData()
|
|
|
+ } else if (messageEvent.messageType == EventConstent.FID_OrderDealedNtf){
|
|
|
+ viewModel.queryContractTradePosition("2")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -100,11 +103,16 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
|
|
|
if (goodsInfo?.goodsid.isNullOrEmpty().not()) {
|
|
|
viewModel.getUserAccount()
|
|
|
// resolve bug #3429
|
|
|
- viewModel.resetAccountData()
|
|
|
+ // 减少频率
|
|
|
+ if(TimeUtils.getNowMills() - requestTime > 3500){
|
|
|
+ viewModel.resetAccountData()
|
|
|
+ requestTime = TimeUtils.getNowMills()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ private var requestTime = TimeUtils.getNowMills()
|
|
|
@SuppressLint("MissingPermission", "RtlHardcoded", "SetTextI18n")
|
|
|
override fun onCreateView(
|
|
|
inflater: LayoutInflater,
|