From 568c763084b926a6f2d632b7ac65b9ec8280752f Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 10 六月 2025 15:41:34 +0800 Subject: [PATCH] 网页功能完善 --- kp_html/kp/js/page.js | 208 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 185 insertions(+), 23 deletions(-) diff --git a/kp_html/kp/js/page.js b/kp_html/kp/js/page.js index 87bb074..d455c00 100644 --- a/kp_html/kp/js/page.js +++ b/kp_html/kp/js/page.js @@ -12,6 +12,7 @@ var app; $(function() { + var vConsole = new VConsole(); function _resize() { var code_info_height = 440; @@ -35,7 +36,7 @@ layer = layui.layer; }); - var vConsole = new VConsole(); + function request(params, callback) { pyjs.request(params, function(result) { @@ -88,16 +89,14 @@ } }, 3000, 3000); + setInterval(function() { + if (is_trade_time()) { + app.get_big_order_deal_info(app.code); + } + }, 3000, 3000); - - - - - - - function init() { app = new Vue({ el: "#body", @@ -399,15 +398,26 @@ block_codes_in:[], block_codes_out:[], l2_subscript_codes:[], - want_list:[] + want_list:[], + big_order_deal_info:null, // 澶у崟鎴愪氦 + show_third_block_info: false, // 鏄惁鏄剧ず绗笁鏂规澘鍧� + forbidden_buy_plates:[],//绂佹涔板叆鐨勬澘鍧� + deleted_forbidden_buy_plates:[],//宸茬粡鍒犻櫎鐨勬澘鍧� + code_special_blocks:{}, + special_codes_list:[], + forbidden_refer_codes:[],// 鏉垮潡鎷夐粦鐩戞祴鐨勭エ + new_block_code_special_blocks:{} }, watch: { want_codes: function() { - layer.open({ - title: app.want_codes_plate, - type: 1, - content: $("#want_code_dialog"), - }); + setTimeout(function(){ + layer.open({ + title: app.want_codes_plate, + type: 1, + content: $("#want_code_dialog"), + }); + }, 100); + } }, methods: { @@ -461,8 +471,8 @@ console.log("鑾峰彇鍒嗘暟鏁版嵁锛�", code, name); var date=$("#date").val(); http_util.get_score_data(code, name,date, function(res) { - res = JSON.parse(res) console.log("鍒嗘暟璇锋眰缁撴灉锛�", res) + res = JSON.parse(res) if (res.code == 0) { console.log("鑾峰彇鍒嗘暟", res) app.code = res.data.code @@ -611,18 +621,27 @@ } }); }, + + set_third_block_show: function(event) { + var el = event.currentTarget; + var checked = $(el).is(':checked'); + app.show_third_block_info = checked; + }, + //閫変腑1绾т唬鐮� select_code_level_1: function(event, index) { 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.code = app.first_info.limit_up_codes[index][0]; + pyjs.add_code_to_ths(app.code); app.code_name = app.code + "(" + 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]); app.get_code_third_blocks(app.code); + app.get_big_order_deal_info(app.code); } }, @@ -720,7 +739,11 @@ ")"; } }); + app.big_order_deal_info = null; app.get_code_third_blocks(code); + app.get_big_order_deal_info(code); + + //璇锋眰鏉垮潡 setTimeout(function() { @@ -749,8 +772,11 @@ app.kpl_code_info = res.data; // 璁剧疆褰撴棩娑ㄥ仠鍘熷洜 - app.kpl_limit_up_reason = app.kpl_code_info.today[0] - [0]; + try{ + app.kpl_limit_up_reason = app.kpl_code_info.today[0] + [0]; + }catch(e){ + } // 灏嗗綋鍓嶆定鍋滃師鍥犵疆椤� var limit_up_reason_statistic = app.first_info .limit_up_reason_statistic; @@ -775,8 +801,19 @@ }); }, 10); - this.set_selected_cb_top(true); + // this.set_selected_cb_top(true); //init_data(); + }, + + get_big_order_deal_info:function(code){ + + http_util.get_big_order_deal_info(code,function(res){ + res = JSON.parse(res); + if(res.code==0){ + app.big_order_deal_info = res.data[0]; + } + }); + }, show_want_codes: function(plate) { if (Date.now() - app.last_show_dialog < 500) { @@ -807,7 +844,9 @@ console.log("娑ㄥ仠鍘熷洜鎴愬垎鑲¤繑鍥烇細", result); var datas = result.data; app.want_codes_title = plate; - app.want_codes = datas; + app.want_codes = datas["limit_up_list"]; + app.special_codes_list = datas["speical_codes"]; + app.forbidden_refer_codes = datas["forbidden_refer_codes"]; console.log("娑ㄥ仠鍘熷洜鎴愬垎鑲★細", datas) }); @@ -969,9 +1008,7 @@ app.cb_selected_code = data[0][0]; this.set_selected_cb_top(false); }, - add_to_ths:function(code){ - pyjs.add_code_to_ths(code); - }, + buy_by_ths:function(code){ http_util.buy_by_ths(code,function(res){ res= JSON.parse(res); @@ -1020,7 +1057,12 @@ }, add_to_ths:function(code){ + console.log("================================="); pyjs.add_code_to_ths(code); + try{ + app.set_target_code(code); + }catch(e){ + } }, show_latest_limit_up_queue:function(time_str){ http_util.get_kpl_latest_limit_up_queue_by_time(time_str,function(res){ @@ -1132,18 +1174,138 @@ app.get_l2_subscript_codes(); }); }, + list_forbidden_buy_plates:function(){ + http_util.list_forbidden_plate(function(res){ + res = JSON.parse(res); + if(res.code==0){ + app.forbidden_buy_plates = res.data; + } + }); + app.list_deleted_forbidden_plate(); + }, + + list_deleted_forbidden_plate:function(){ + http_util.list_deleted_forbidden_plate(function(res){ + res = JSON.parse(res); + if(res.code==0){ + app.deleted_forbidden_buy_plates = res.data; + } + }); + + }, + + + + + + delete_forbidden_buy_plate:function(plate){ + http_util.delete_forbidden_plate(plate, function(res){ + res = JSON.parse(res); + if(res.code==0){ + layer.msg("绉婚櫎鎴愬姛"); + app.list_forbidden_buy_plates() + }else{ + layer.msg(res.msg); + } + }); + + }, + add_forbidden_buy_plate:function(plate){ + http_util.forbidden_plate(plate, function(res){ + res = JSON.parse(res); + if(res.code==0){ + layer.msg("娣诲姞鎴愬姛"); + app.list_forbidden_buy_plates() + }else{ + layer.msg(res.msg); + } + }); + + }, + get_all_special_codes:function(){ + http_util.get_all_special_codes(function(res){ + res = JSON.parse(res); + if(res.code==0){ + app.code_special_blocks = res.data; + }else{ + layer.msg(res.msg); + } + }); + }, + get_new_blocks_special_codes:function(){ + http_util.get_new_blocks_special_codes(function(res){ + res = JSON.parse(res); + if(res.code==0){ + app.new_block_code_special_blocks = res.data; + }else{ + layer.msg(res.msg); + } + }); + }, + edit_total_big_order_threshold:function(){ + // 缂栬緫鎬诲ぇ鍗� + let threshold_money =app.big_order_deal_info[2][4]? app.big_order_deal_info[2][4] : app.big_order_deal_info[2][2]; + var threshold_money_number = 0; + if(threshold_money.indexOf("涓�")>=0){ + threshold_money_number = (parseFloat(threshold_money.replace("涓�",""))/10000).toFixed(2) + }else if(threshold_money.indexOf("浜�")>=0){ + threshold_money_number = (parseFloat(threshold_money.replace("浜�",""))).toFixed(2) + } + + layer.prompt({ + title: '淇敼绱澶у崟鎴愪氦闃堝�硷紙鍗曚綅锛氫嚎锛夊師鍊硷細'+app.big_order_deal_info[2][3] + ,formType: 0, //杈撳叆妗嗙被鍨嬶紝鏀寔0锛堟枃鏈級榛樿1锛堝瘑鐮侊級2锛堝琛屾枃鏈級 + value: threshold_money_number, //鍒濆鏃剁殑鍊硷紝榛樿绌哄瓧绗� + maxlength: 20, //鍙緭鍏ユ枃鏈殑鏈�澶ч暱搴︼紝榛樿500 + area: ['200px', '150px'] //鑷畾涔夋枃鏈煙瀹介珮 + },function(val, index){ + // 鍙湁褰撶偣鍑荤‘璁ゆ椂鎵嶄細鎵ц杩欓噷 + if(isNaN(val)){ + layer.msg("杈撳叆鏍煎紡鏈夎") + return; + } + let money = parseFloat(val).toFixed(2)*100000000 + http_util.set_total_deal_big_order_threshold_money(app.code, money, function(res){ + if(res.code!=0){ + layer.msg(res.msg) + return; + } + layer.msg("淇敼鎴愬姛") + layer.close(index)// 鍏抽棴褰撳墠寮圭獥 + app.get_big_order_deal_info(app.code); + }); + }) + + + // layer.open({ + // type: 0, + // title:'淇敼澶у崟闃堝��', + // content: "<input type='text' value = '"+ threshold_money_number +"' class='layui-input'>浜�", //杩欓噷content鏄竴涓櫘閫氱殑String + // btn: ['纭淇敼', '鍙栨秷'], + // yes: function(index, layero){ + // // 楠岃瘉閫氳繃鍚庣殑鍥炶皟 + // alert("123"); + // } + + // }); + + } } }); } - function init_data() { + function init_data() { + app.get_all_special_codes(); + app.get_new_blocks_special_codes(); app.get_block_in_money_data(app.in_money_type); app.get_limit_up_list(app.code, false); app.get_limit_up_statistic_infos(true); app.get_kpl_market_feelings(); app.statistic_latest_limit_up_block(""); + app.list_forbidden_buy_plates(); + } $(".market .child-title").click(function() { -- Gitblit v1.8.0