Browse Source

prev time显示

龚成明 2 năm trước cách đây
mục cha
commit
fcfdd2fc54
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      scripts/one-pro.js

+ 4 - 2
scripts/one-pro.js

@@ -3,6 +3,7 @@ const OneInch = require('../libs/web3/1inch')
 const BinanceSpot = require('../libs/binance/binance-spot')
 const Config = require('../config/config')
 const NumKit = require('../kit/num-kit')
+const TimeKit = require('../kit/time-kit')
 const TableKit = require('../kit/table-kit')
 
 const orderHandler = function(context, task) {
@@ -45,7 +46,7 @@ const orderHandler = function(context, task) {
   })
 }
 
-const table = new TableKit(['pair', 'binance', 'order price', 'profit'], 25)
+const table = new TableKit(['pair', 'binance', 'order price', 'profit', 'prev time'], 20)
 
 const pricesHandler = function(context, task) {
   const logger = task.logger
@@ -63,13 +64,14 @@ const pricesHandler = function(context, task) {
     const percentage = NumKit.getSubFloat((DiffPrice / OneInchPrice) * 100, 2)
     const orderPrice = token.orderPrice ? token.orderPrice : NaN
     const orderPercentage = NumKit.getSubFloat(((BinancePrice - orderPrice) / orderPrice) * 100, 2)
+    const prevTimeStr = token.prevHandleTime ? TimeKit.getTimeByMillisecond(token.prevHandleTime) : ''
 
     // 价格非法的就不处理了
     // if ((() => {
     //
     // })()) return
 
-    const rows = [pair.toString(), BinancePrice.toString(), orderPrice.toString(), orderPercentage.toString().concat('%')]
+    const rows = [pair.toString(), BinancePrice.toString(), orderPrice.toString(), orderPercentage.toString().concat('%'), prevTimeStr]
 
     // 识别到在拉盘
     token.isLong = (() => {