From d1f88af76d8cb3b3751f53a1814081f2c5e997d1 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 21 二月 2024 17:45:23 +0800 Subject: [PATCH] HTML页面完善/添加同花顺加自选功能 --- kp_html/kp/js/page.js | 36 +++++++++++++++++++++++++++++++++++- 1 files changed, 35 insertions(+), 1 deletions(-) diff --git a/kp_html/kp/js/page.js b/kp_html/kp/js/page.js index eb6f156..994caec 100644 --- a/kp_html/kp/js/page.js +++ b/kp_html/kp/js/page.js @@ -89,6 +89,8 @@ trade_data: { order: 0 }, + // 浠g爜鐨勫紑鐩樺暒娑ㄥ仠鍘熷洜 + kpl_limit_up_reason:'', default_score_data: { volume: { "score": 0, @@ -456,6 +458,18 @@ res = JSON.parse(res) if (res.code == 0) { app.first_info = res.data + var temps = new Array(); + app.first_info.limit_up_reason_statistic.forEach(function(d){ + if(d[0]==app.kpl_limit_up_reason){ + current_limit_up_reason = d; + }else{ + temps.push(d); + } + }); + if(current_limit_up_reason){ + temps.unshift(current_limit_up_reason); + } + app.first_info.limit_up_reason_statistic = temps; // if (app.choose_code.first) { // app.get_plate_info(app.choose_code.first, is_auto_refresh); // } else if (app.first_info.limit_up_codes) { @@ -614,10 +628,30 @@ //璇锋眰鏉垮潡 setTimeout(function(){ http_util.get_kpl_block_info(code,function(res){ - console.log("鏉垮潡璇锋眰缁撴灉锛�",res); res = JSON.parse(res) + console.log("鏉垮潡璇锋眰缁撴灉锛�",res); if(res.code==0){ app.kpl_code_info = res.data; + // 璁剧疆褰撴棩娑ㄥ仠鍘熷洜 + app.kpl_limit_up_reason = app.kpl_code_info.today[0][0]; + // 灏嗗綋鍓嶆定鍋滃師鍥犵疆椤� + var limit_up_reason_statistic = app.first_info.limit_up_reason_statistic; + var current_limit_up_reason; + if(limit_up_reason_statistic){ + var temps = new Array(); + limit_up_reason_statistic.forEach(function(d){ + if(d[0]==app.kpl_limit_up_reason){ + current_limit_up_reason = d; + }else{ + temps.push(d); + } + }); + if(current_limit_up_reason){ + temps.unshift(current_limit_up_reason); + } + app.first_info.limit_up_reason_statistic = temps; + } + } }); app.get_last_trade_day_reasons(code); -- Gitblit v1.8.0