From cd3eccb32719bb5409ec62f4e201b85992df2d33 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 30 六月 2025 18:14:50 +0800 Subject: [PATCH] 网页修改 --- kp_html/kp/js/code_list.js | 250 ++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 214 insertions(+), 36 deletions(-) diff --git a/kp_html/kp/js/code_list.js b/kp_html/kp/js/code_list.js index f848eba..d356838 100644 --- a/kp_html/kp/js/code_list.js +++ b/kp_html/kp/js/code_list.js @@ -43,12 +43,15 @@ passive_buy_codes: null, data_type: 0, trade_progress_index: -1, - latest_real_order_index: -1, + trade_progress_percent: 0, + real_order_indexes: new Array(), hidden_canceled: true, //闅愯棌鎾ゅ崟 hidden_cancel: true, hidden_little_money: true, hidden_sell: true, + // 涓嶉殣钘忓凡鎾ゅぇ鍗� + not_hidden_canceled_big_money:true, l2_datas: [], l2_colors_class: ["color-single-start", "color-single-exec", "color-cancel", "color-real-order" @@ -64,7 +67,20 @@ delegated_buy_code_infos: [], layui_element: null, l2_cant_buy_reasons: [], - latest_cancel_orders: [] + latest_cancel_orders: [], + l2_min_volume:'', + l2_max_volume:'', + kpl_open_limit_up_count_rank:[], + // 澶у崟涔板崠鏁伴噺 + big_buy_order_count:0, + big_sell_order_count:0, + // 杩囨护鐨勭储寮� + filter_indexes:[], + // 璐圭敤鏁版嵁 + commission_data:{"total_commission":0, "month_commission":0}, + // L2鏁版嵁缁撴潫绱㈠紩 + l2_end_index:null + }, watch: { delegated_buy_code_infos: function() { @@ -80,10 +96,20 @@ var element = layui.element; app.layui_element = element; }); + + layui.use('laydate', function(){ + var laydate = layui.laydate; + + //鎵ц涓�涓猯aydate瀹炰緥 + laydate.render({ + elem: '#date' ,//鎸囧畾鍏冪礌 + type: 'date', + position:'abolute' + }); + }); setInterval(function() { if (is_trade_time()) { - app.get_delegated_buy_code_infos(); app.get_latest_cancel_orders(); } }, 1000 * 3); @@ -113,6 +139,8 @@ console.log("鎴愪氦杩涘害", res.data); if (!res.data.is_default) { app.trade_progress_index = res.data.trade_progress; + + app.trade_progress_percent = res.data.percent; } } }); @@ -123,7 +151,9 @@ alert("娌℃湁鑾峰彇鍒颁唬鐮�") return; } - http_util.get_l2_l_cancel_datas(app.code, app.operate_index, function(res) { + var date = $("#date").val(); + + http_util.get_l2_l_cancel_datas(app.code, app.operate_index, date, function(res) { console.log("L鎾ょ粨鏋�", res); res = JSON.parse(res); if (res.code == 0) { @@ -143,6 +173,7 @@ } http_util.get_l2_h_cancel_datas(app.code, app.operate_index, function(res) { res = JSON.parse(res); + console.log("H鎾ゆ暩鎿�",res) if (res.code == 0) { app.h_cancel_indexes = res.data; } @@ -155,21 +186,25 @@ } var index = layer.load(1, { - shade: [0.1, '#fff'] //0.1閫忔槑搴︾殑鐧借壊鑳屾櫙 + shade: [0.1, '#fff'], //0.1閫忔槑搴︾殑鐧借壊鑳屾櫙 + shadeClose:true }); + + var date = $("#date").val(); - http_util.get_l2_datas(app.code, function(res) { + http_util.get_l2_datas(app.code, date, app.l2_end_index, function(res) { layer.close(index); - console.log("鑾峰彇鍒癓2鏁版嵁锛�", res) res = JSON.parse(res); if (res.code == 0) { - var real_order_index = -1; + var real_order_indexes = new Array(); var buy_singles = []; - res.data.data.forEach(function(e) { + var big_buy_order=0; + var big_sell_order=0; + res.data.data.delegates.forEach(function(e) { if (e[1] != null) { if (e[1][0] == 3) { //鐪熷疄涓嬪崟浣嶇疆 - real_order_index = e[2][0]; + real_order_indexes.push(e[2][0]) } else if (e[1][0] == 0) { // 淇″彿浣嶇疆 buy_singles.push(e[2][0]) @@ -179,11 +214,37 @@ e[1] = ''; } e[2][3] = e[2][3].slice(0, e[2][3].length - 1) + + if(parseFloat(e[2][3])>=299&&e[2][6]=='涔癟'&&e[2][8]&&e[2][8].indexOf(":")>=0&&e[2][8].indexOf("-")<0&&e[2][8].indexOf("鎴愪氦")<0){ + // 澶у崟鏁伴噺 + big_buy_order+=1; + } + + if(e[2][5] == 6){ + console.log("灏忓崟锛�", e) + } + }); - console.log("鏈�杩戠湡瀹炰笅鍗曚綅缃細", real_order_index); - app.latest_real_order_index = real_order_index; + res.data.data.transactions.forEach(function(e) { + if(parseFloat(e[2][3])>=299){ + // 澶у崟鏁伴噺 + big_sell_order+=1; + } + + }); + + app.big_buy_order_count = big_buy_order; + app.big_sell_order_count = big_sell_order; + + console.log("澶у崟淇℃伅锛�","涔帮細"+big_buy_order,"鍗栵細"+big_sell_order); + + console.log("鏈�杩戠湡瀹炰笅鍗曚綅缃細", real_order_indexes); + app.real_order_indexes = real_order_indexes; app.l2_datas = res.data.data; - console.log("L2鏁版嵁:", app.l2_datas); + + console.log("绗�1鏉2鏁版嵁锛�", res.data.data[0]) + + // console.log("L2鏁版嵁:", app.l2_datas); var code_name = res.data.code_name; var code_ = res.data.code; app.l2_code_name = code_ + " " + code_name; @@ -226,9 +287,6 @@ app.account_available_money = result.data.account_available_money; app.reset_l2_height(); - } else { - console.log("宸叉寕涔板崟閿欒锛�", result.msg); - app.delegated_buy_code_infos = []; } }); }, @@ -248,7 +306,7 @@ reset_l2_height: function() { var height = document.documentElement.clientHeight; console.log("灞忓箷锛�", height); - $(".l2-content").eq(0).css("height", (height - 370 - 66 * app + $(".l2-content").eq(0).css("height", (height - 390 - 76 * app .delegated_buy_code_infos.length - 24 * app.latest_cancel_orders.length ) + "px"); }, @@ -257,17 +315,6 @@ app.l_up_cancel_indexes = []; app.l_down_cancel_indexes = []; app.h_cancel_indexes = []; - }, - get_last_trade_day_reasons: function(code) { - http_util.get_last_trade_day_reasons(code, function(res) { - res = JSON.parse(res); - console.log("杩斿洖鍐呭", res); - if (res.code == 0) { - app.same_reason_codes = res.data; - } else { - app.same_reason_codes = null; - } - }); }, hidden_canceled_check: function(e) { @@ -287,6 +334,10 @@ hidden_little_money_check: function(e) { app.hidden_little_money = e.currentTarget.checked; }, + + hidden_canceled_big_money_check: function(e) { + app.not_hidden_canceled_big_money = e.currentTarget.checked; + }, select_row: function(index) { console.log("鐐瑰嚮浜嬩欢", index); @@ -305,7 +356,6 @@ console.log("浜ゆ槗鏁版嵁", trade_data) console.log("浜ゆ槗璁板綍鏁版嵁", trade_record) app.code = code; - // app.get_last_trade_day_reasons(code); app.code_name = code_name; if (trade_data) { console.log("浜ゆ槗鏁版嵁绫诲瀷", typeof trade_data) @@ -408,28 +458,65 @@ }, need_show: function(item) { + + if(app.filter_indexes.length>0){ + if(app.filter_indexes.indexOf(item[2][0])>=0) + { + return true; + }else{ + return false; + } + } + + + if(app.real_order_indexes.includes( item[2][0])){ + return true; + } + + + if (app.hidden_canceled && (item[2][6].indexOf('涔版挙') >= 0 || (item[2][8] != null && item[2][8].indexOf("-") > 0))) { - return false; + if(!app.not_hidden_canceled_big_money){ + // 闅愯棌宸叉挙澶у崟 + return false; + }else{ + // 涓嶉殣钘忓凡鎾ゅぇ鍗� + if(parseFloat(item[2][3])<299) + { + return false; + } + } } if (app.hidden_sell && item[2][6].indexOf('鍗�') >= 0) { return false; } + if (app.hidden_cancel && (item[2][6].indexOf('涔版挙') >= 0)) { return false; } - if (app.hidden_little_money && parseFloat(item[2][3]) < 50 && item[2][0] != app - .latest_real_order_index) { + if (app.hidden_little_money && parseFloat(item[2][3]) < 5) { return false; } + + if(app.l2_min_volume!=null&&!isNaN(app.l2_min_volume)&&parseInt(app.l2_min_volume) > parseInt(item[2][5])){ + return false; + } + + if(app.l2_max_volume!=null&&!isNaN(app.l2_max_volume)&&parseInt(app.l2_max_volume) < parseInt(item[2][5])){ + return false; + } + + return true; }, get_score_data: function(code, name, callback) { console.log("鑾峰彇鍒嗘暟鏁版嵁锛�", code, name); - http_util.get_score_data(code, name, function(res) { + var date = $("#date").val(); + http_util.get_score_data(code, name,date, function(res) { res = JSON.parse(res) console.log("鍒嗘暟璇锋眰缁撴灉锛�", res) if (res.code == 0) { @@ -473,11 +560,18 @@ load_data: function(refresh_l2) { if (app.origin_code) { app.get_score_data(app.origin_code, null, function(e) { - if (refresh_l2) { - app.refresh_l2_data(); + // if (refresh_l2) { + // app.refresh_l2_data(); + // } + }); + + app.get_l2_cant_buy_reasons(app.origin_code); + http_util.get_open_limit_up_count_rank(null,function(res){ + res = JSON.parse(res); + if(res.code ==0){ + app.kpl_open_limit_up_count_rank = res.data; } }); - app.get_l2_cant_buy_reasons(app.origin_code); } }, cancel_order: function(code) { @@ -511,6 +605,90 @@ app.l2_cant_buy_reasons = [] } }); + }, + screen_l2_data:function(code){ + // 绛涢�塴2鏁版嵁 + layer.open({ + title: 'L2鏁版嵁绛涢��', + type: 1, + content: $("#l2_screen"), + }); + + + }, + l2_screen_click:function(){ + + // L2绛涢�� + if(!isNaN($("#min-volume").val())){ + app.l2_min_volume=$("#min-volume").val(); + }else{ + app.l2_min_volume=null; + } + + if(!isNaN($("#max-volume").val())){ + app.l2_max_volume=$("#max-volume").val(); + }else{ + app.l2_max_volume=null; + } + + + if(!isNaN($("#end-index").val())){ + app.l2_end_index=$("#end-index").val(); + }else{ + app.l2_end_index=null; + } + + watch_indexes_str = $("#watch_indexes").val(); + if(watch_indexes_str!=null&&watch_indexes_str.length>0){ + var final_indexes=[]; + var indexes = watch_indexes_str.split(","); + indexes.forEach(function(e){ + final_indexes.push(parseInt(e)); + }); + app.filter_indexes = final_indexes; + console.log("閫変腑绱㈠紩锛�",final_indexes); + }else{ + app.filter_indexes =[]; + } + layer.msg("璁剧疆鎴愬姛") + + + }, + fordbidden_buy:function(code){ + // 鍔犲叆榛戝悕鍗� + http_util.do_action_for_code(code,null,0,function(res){ + if(res.code!=0){ + layer.msg(res.msg); + } + }); + }, + get_account_commission_detail:function(){ + + http_util.get_account_commission_detail(function(res){ + + res = JSON.parse(res); + console.log(res); + if(res.code!=0){ + layer.msg(res.msg); + }else{ + let commission_data ={}; + // commission_data.commission = =res.data.commission; + commission_data.delegates =res.data.delegates ; + commission_data.deals =res.data.deals; + var total_money = 0; + for(let k in commission_data.delegates){ + total_money -=commission_data.delegates[k]["money"]; + } + for(let k in commission_data.deals){ + total_money +=commission_data.deals[k]["money"]; + } + commission_data.total_commission = total_money.toFixed(2); + commission_data.commission = res.data.commission; + commission_data.month_commission = res.data.month_commission; + console.log(commission_data) + app.commission_data = commission_data; + } + }); } } }) -- Gitblit v1.8.0