Ver Fonte

解决部分bug

yu.jie há 3 anos atrás
pai
commit
4ea31fb0db

+ 4 - 4
RMA/app/src/main/java/cn/muchinfo/rma/global/data/chart/ChartTSData.kt

@@ -29,7 +29,7 @@ data class ChartTSData(
         val historyHashMap = hashMapOf<String, Double>()
         if(historyDatas != null && historyDatas.isNotEmpty()){
             historyDatas.forEach {
-                historyHashMap[it.getTime().toShowTime2()] = it.c!!.toDouble()
+                historyHashMap[it.getTime().toShowTimeNoT()] = it.c!!.toDouble()
             }
         }
         return timeList.map{
@@ -140,11 +140,11 @@ data class ChartTSData(
 //        if (TimeUtils.isPm(this,SimpleDateFormat("yyyy-MM-dd HH:mm:ss"))){
 //            timeString = this
 //        }else{
-        val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss+08:00", Locale.CHINA)
+        val sdf = SimpleDateFormat("yyyy-MM-ddHH:mm:ss", Locale.CHINA)
         val sdf1 = SimpleDateFormat(format, Locale.CHINA)
-        timeString = sdf1.format(sdf.parse(this.replace("T"," "))!!)
-//        }
+        timeString = sdf1.format(sdf.parse(this.replace("T","").replace("+08:00", ""))!!)
 
+//        }
         return timeString
     }
 

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tjmd/TjmdHomeViewModel.kt

@@ -182,7 +182,7 @@ class TjmdHomeViewModel : BaseViewModel(){
                 wrAverageTradePriceMax = 0f
                 // 计算历史走势图Y轴最小值与最大值
                 respData?.forEach {
-                    val s = it.s?.toDouble() ?: 0.0
+                    val s = it.c?.toDouble() ?: 0.0
                     if (s < wrAverageTradePriceMin) wrAverageTradePriceMin = s.toFloat()
                     if (s > wrAverageTradePriceMax) wrAverageTradePriceMax = s.toFloat()
                 }