Forráskód Böngészése

解决部分bug:一口价问题,以及行情刷新翻倍的问题

yu.jie 3 éve
szülő
commit
f70241810b

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountData.kt

@@ -209,6 +209,7 @@ open class AccountData(
 
         if (SPUtils.getInstance().getString(Constant.oem) == "yrdz" || SPUtils.getInstance().getString(
                 Constant.oem) == "tjmd" ){
+            valueOfposition_keep_watch_profit_and_loss = 0.0
             newList.forEach {
                 var goodsInfoData: GoodsInfo
                 if (it.trademode == "16") {

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessBuyHallViewHolder.kt

@@ -57,18 +57,23 @@ class SwapsBusinessBuyHallViewHolder(private val activity : AppCompatActivity, p
                             if (it?.pricemode == "3"){
                                 if (viewModel.quoteDayData.value?.getPrice() == 0.0){
                                     text = NumberUtils.roundNum(it.orderprice?.toDouble()?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                    tag = it?.pricemode
                                 }else{
                                     text = NumberUtils.roundNum(viewModel.quoteDayData.value?.getPrice()?.plus(it?.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0,2)
+                                    tag = it?.pricemode
                                 }
                             }else{
                                 text = NumberUtils.roundNum(it?.orderprice,2)
+                                tag = it?.pricemode
                             }
 
 
                         }
                         viewModel.quoteDayData.bindOptional(context){
                             val accordingText = it?.getPrice()?.plus(data.value?.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0
-                            text = NumberUtils.roundNum(accordingText,2)
+                            if (tag == 3) {
+                                text = NumberUtils.roundNum(accordingText, 2)
+                            }
                             if (accordingText.minus(it?.presettle ?: 0.0) > 0.0){
                                 textColorInt = R.color.rma_red_color
                             }else if (accordingText.minus(it?.presettle ?: 0.0) < 0.0){

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/business/SwapsBusinessSellHallViewHolder.kt

@@ -70,21 +70,27 @@ class SwapsBusinessSellHallViewHolder(
                                         it.orderprice?.toDouble()
                                             ?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0, 2
                                     )
+                                    tag = it?.pricemode
                                 } else {
                                     text = NumberUtils.roundNum(
                                         viewModel.quoteDayData.value?.getPrice()
                                             ?.plus(it.marketmaxsub?.toDouble() ?: 0.0) ?: 0.0, 2
                                     )
+                                    tag = it?.pricemode
                                 }
                             } else {
                                 text = NumberUtils.roundNum(it?.orderprice, 2)
+                                tag = it?.pricemode
                             }
                         }
+                        // 行情来了之后  需要区分是哪个可用刷新
                         viewModel.quoteDayData.bindOptional(context) {
                             val accordingText =
                                 it?.getPrice()?.plus(data.value?.marketmaxsub?.toDouble() ?: 0.0)
                                     ?: 0.0
-                            text = NumberUtils.roundNum(accordingText, 2)
+                            if (tag == 3){
+                                text = NumberUtils.roundNum(accordingText, 2)
+                            }
                             if (accordingText.minus(it?.presettle ?: 0.0) > 0.0) {
                                 textColorInt = R.color.rma_red_color
                             } else if (accordingText.minus(it?.presettle ?: 0.0) < 0.0) {