From 9cacd9bb9931802d0857363e36f6f1f521801d25 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 08 六月 2023 10:25:53 +0800 Subject: [PATCH] 华鑫日志接入 --- kp_html/kp/js/code_list.js | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 43 insertions(+), 5 deletions(-) diff --git a/kp_html/kp/js/code_list.js b/kp_html/kp/js/code_list.js index 87e3ae0..6f53ba3 100644 --- a/kp_html/kp/js/code_list.js +++ b/kp_html/kp/js/code_list.js @@ -1,5 +1,43 @@ +document.addEventListener("DOMContentLoaded", function() { + //鎶婂璞¤祴鍊煎埌JS涓� + try { + new QWebChannel(qt.webChannelTransport, function(channel) { + window.pyjs = channel.objects.Bridge; + console.log("鍥炶皟鎴愬姛"); + }); + } catch (e) { + + } +}); var app; $(function() { + function is_trade_time() { + var nowdate = new Date(); + h = nowdate.getHours(); + m = nowdate.getMinutes(); + total_m = h * 60 + m; + if ((total_m >= (9 * 60 + 25) && total_m <= (11 * 60 + 30)) || (total_m >= 13 * 60 && total_m <= 15 * + 60)) { + return true; + } else { + return false; + } + } + // 瀹氭椂鎷夊彇H鎾ゆ暟鎹� + setInterval(function() { + if (app.code != '000000' && app.trade_data) { + if (is_trade_time()) { + http_util.get_h_cancel_data(app.code, function(res) { + res = JSON.parse(res); + console.log("缁撴灉:", res) + if (res.code == 0) { + app.$set(app.trade_data, 'h_cancel', res.data) + } + }); + } + } + }, 3000) + new VConsole(); app = new Vue({ el: "#app", @@ -62,14 +100,14 @@ } else { app.initiative_buy_codes = null; } - - if(passive_buy_codes){ + + if (passive_buy_codes) { app.passive_buy_codes = JSON.parse(passive_buy_codes); - }else{ + } else { app.passive_buy_codes = null; } - - + + } } }) -- Gitblit v1.8.0