From 964a4e638feee3e541f008f56c15d5c5d3627547 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 06 六月 2023 18:11:58 +0800 Subject: [PATCH] 看盘端html文件融入/华鑫接口接入 --- kp_html/kp/js/page.js | 109 ++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 77 insertions(+), 32 deletions(-) diff --git a/kp_html/kp/js/page.js b/kp_html/kp/js/page.js index 2103eb3..f4f945c 100644 --- a/kp_html/kp/js/page.js +++ b/kp_html/kp/js/page.js @@ -14,9 +14,9 @@ $(function() { function _resize() { console.log("鎬婚珮", $(window).height()) - var bottom_height = $(window).height() - 450 - 80; + var bottom_height = $(window).height() - 465 - 110; console.log("搴曢儴楂�", bottom_height) - $("#body>div:nth-child(2)>div").css("height",450).css("max-height",450); + $("#body>div:nth-child(2)>div").css("height", 465).css("max-height", 465); $("#body>div:nth-child(3)").css("height", bottom_height) $("#body>div:nth-child(3)>div:nth-child(2)").css("height", bottom_height - 10) $("#body>div:nth-child(3)>div:nth-child(3)").css("height", bottom_height - 60) @@ -68,6 +68,7 @@ setInterval(function() { if (is_trade_time()) { app.get_industry_data(app.industry_data_type); + app.get_jingxuan_data(app.jingxuan_data_type); } }, 3000, 10000); @@ -201,14 +202,14 @@ }, kpl_code_info: { code_records: [ - ["鍘熷洜", "2020-01-01", "鏉垮潡"], - ["鍘熷洜", "2020-01-01", "鏉垮潡"], - ["鍘熷洜", "2020-01-01", "鏉垮潡"] + [["鍘熷洜",''], "2020-01-01", [["鏉垮潡",'']]], + [["鍘熷洜",''], "2020-01-01", [["鏉垮潡",'']]], + [["鍘熷洜",''], "2020-01-01", [["鏉垮潡",'']]] ], - today: ["娑ㄥ仠鍘熷洜", "2023-01-01", "浼犲獟"], + today: [["娑ㄥ仠鍘熷洜",''], "2023-01-01", [["浼犲獟",'']]], plate: [ - ["鏉垮潡1", "1%"], - ["鏉垮潡2", "0.5%"] + ["鏉垮潡1", "1%",''], + ["鏉垮潡2", "0.5%",''] ] }, initiative_buy_codes: [{ @@ -246,13 +247,14 @@ industry_datas: [ ["璐甸噾灞�", "1.56浜�", "0.9%"] ], + jingxuan_datas: [], //娑ㄥ仠浠g爜淇℃伅 first_info: { limit_up_count: 10, open_limit_up_count: 10, limit_up_codes: [ //(浠g爜,鍚嶇О,娑ㄥ仠鐘舵��(0-鏃犵姸鎬� 1-娑ㄥ仠 2-鐐告澘),榫欏嚑,棣栨澘,鍒嗗��,娑ㄥ仠鏃堕棿,鍘熷洜,鐩稿悓鍘熷洜浠g爜鏁伴噺,鑷敱娴侀��,涔嬪墠鐨勬澘鍧�) - ["000333", "缇庣殑闆嗗洟", 1, "榫�1", "棣栨澘", "200", "10:00:00", "涓�瀛e害澧為暱", "1", "12.02浜�", + ["000333", "缇庣殑闆嗗洟", 1, "榫�1", "棣栨澘", "200", "10:00:00", "涓�瀛e害澧為暱", "1", "12.02浜�",'12浜�','', '' ], ["000333", "缇庣殑闆嗗洟", 1, "榫�1", "棣栨澘", "200", "10:00:00", "涓�瀛e害澧為暱", "1", "12.02浜�", @@ -332,7 +334,8 @@ first: '', second: '' }, - industry_data_type: 2 + industry_data_type: 0, + jingxuan_data_type: 0, }, methods: { @@ -356,10 +359,26 @@ } }); }, - get_score_data: function(code,name, callback) { - http_util.get_score_data(code,name, function(res) { + get_jingxuan_data: function(type) { + app.jingxuan_data_type = type; + if (type == 0) { + type = 2; + } else { + type = 3; + } + + http_util.get_market_data(type, function(result) { + result = JSON.parse(result); + if (result.code == 0) { + app.jingxuan_datas = result.data; + } + }); + }, + get_score_data: function(code, name, callback) { + console.log("鑾峰彇鍒嗘暟鏁版嵁锛�", code, name); + http_util.get_score_data(code, name, function(res) { res = JSON.parse(res) - console.log(res) + console.log("鍒嗘暟璇锋眰缁撴灉锛�", res) if (res.code == 0) { console.log("鑾峰彇鍒嗘暟", res) app.code = res.data.code @@ -386,7 +405,11 @@ pyjs.set_trade_info(app.code, app.code_name, res.data .trade_data ? JSON.stringify(res.data.trade_data) : "", res.data.trade_record ? JSON.stringify(res.data - .trade_record) : ''); + .trade_record) : '', res.data + .initiative_buy_codes ? JSON.stringify(res.data + .initiative_buy_codes) : '', res.data + .passive_buy_codes ? JSON.stringify(res.data + .passive_buy_codes) : ''); if (callback) { callback() @@ -430,12 +453,25 @@ }); }, cancel_order: function() { - if (!trade_data.order) { - return; - } + // if (!trade_data.order) { + // return; + // } http_util.cancel_order(app.code, function() { //鎾ゅ崟鎴愬姛锛屽埛鏂颁唬鐮� - app.get_score_data(app.code,null); + app.get_score_data(app.code, null); + }); + }, + forbidden_plate: function(plate, type) { + http_util.forbidden_plate(plate, function(res) { + res = JSON.parse(res) + if (res.code == 0) { + layer.msg("鍒犻櫎鎴愬姛"); + if (type == 0) { + app.get_industry_data(app.industry_data_type); + } else { + app.get_jingxuan_data(app.jingxuan_data_type); + } + } }); }, //閫変腑1绾т唬鐮� @@ -443,7 +479,8 @@ var el = event.currentTarget; if (app.choose_code.first != app.first_info.limit_up_codes[index][0]) { app.choose_code.first = app.first_info.limit_up_codes[index][0]; - app.get_score_data(app.first_info.limit_up_codes[index][0],app.first_info.limit_up_codes[index][1]); + app.get_score_data(app.first_info.limit_up_codes[index][0], app.first_info + .limit_up_codes[index][1]); app.get_plate_info(app.first_info.limit_up_codes[index][0]); } }, @@ -469,7 +506,8 @@ .code_info[0]) app.choose_code.second = app.choose_code_info.code_list_info[index] .code_info[0]; - app.get_score_data(app.choose_code_info.code_list_info[index].code_info[0],app.choose_code_info.code_list_info[index].code_info[1], + app.get_score_data(app.choose_code_info.code_list_info[index].code_info[0], + app.choose_code_info.code_list_info[index].code_info[1], function() { app.choose_code_info.code_list_info[index].code_records = app .kpl_code_info.code_records; @@ -478,10 +516,14 @@ .plate; app.$set(app.choose_code_info.code_list_info, index, app .choose_code_info.code_list_info[index]); - //鏆傚瓨閫変腑浜岀骇浠g爜鏁版嵁 - app.choose_code.second_info.code_records = app.kpl_code_info - .code_records; - app.choose_code.second_info.plate = app.kpl_code_info.plate; + if (app.choose_code.second_info) + { + //鏆傚瓨閫変腑浜岀骇浠g爜鏁版嵁 + app.choose_code.second_info.code_records = app.kpl_code_info + .code_records; + app.choose_code.second_info.plate = app.kpl_code_info.plate; + } + }); } }, @@ -514,18 +556,21 @@ http_util.do_action_for_code(app.code, plate, type, function(result) {}); }, set_target_code: function(code) { - console.log("set_target_code", code); + console.log("璁剧疆鐩爣浠g爜", code); app.origin_code = code; app.code = code; init_data(); }, show_want_codes: function(plate) { - http_util.get_want_codes(plate, function(result) { - datas = result.data; + http_util.get_plate_codes(plate, function(result) { + result = JSON.parse(result); + console.log("娑ㄥ仠鍘熷洜鎴愬垎鑲¤繑鍥烇細",result); + var datas = result.data; app.want_codes = datas; + console.log("娑ㄥ仠鍘熷洜鎴愬垎鑲★細",datas) setTimeout(function() { layer.open({ - title: "鎯充拱鍗曪紙" + plate + "锛�", + title: plate, type: 1, content: $("#want_code_dialog"), }) @@ -539,15 +584,14 @@ }, delete_from_want_codes: function(index) { - http_util.do_action_for_code(app.want_codes[index].split(":")[1], "", 5, + http_util.do_action_for_code(app.want_codes[index][0], "", 5, function(result) { if (result.code == 0) { - app.want_codes.splice(index, 1); + app.want_codes[index][2]=0; + app.$set(app.want_codes,index,app.want_codes[index]); app.get_limit_up_list(app.code, true); } }); - - } } }); @@ -555,6 +599,7 @@ function init_data() { app.get_industry_data(app.industry_data_type); + app.get_jingxuan_data(app.jingxuan_data_type); app.get_score_data(app.code); app.get_limit_up_list(app.code, false); } -- Gitblit v1.8.0