From 5a2ef3a696ddccbc1faef1e2e90f5b535ec24a0d Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 11 一月 2024 10:06:14 +0800
Subject: [PATCH] 看盘网页修改/接口本地化代理

---
 kp_html/kp/js/code_list.js |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/kp_html/kp/js/code_list.js b/kp_html/kp/js/code_list.js
index cad32a0..bdc6391 100644
--- a/kp_html/kp/js/code_list.js
+++ b/kp_html/kp/js/code_list.js
@@ -30,6 +30,7 @@
 		data: {
 			code: "000000",
 			code_name: "娴嬭瘯浠g爜",
+			origin_code:null,
 			trade_data: {},
 			trade_record: {
 				open_limit_up: "",
@@ -50,12 +51,35 @@
 			l2_colors_class: ["color-single-start", "color-single-exec", "color-cancel",
 				"color-real-order"
 			],
+			kpl_code_info: null,
 			l_up_cancel_indexes: [],
 			l_down_cancel_indexes: [],
 			h_cancel_indexes: [],
 			buy_single_indexes: [],
 			l2_code_name: '',
-			operate_index: -1
+			operate_index: -1,
+			// 宸茬粡濮旀墭鐨勪拱浠g爜淇℃伅
+			delegated_buy_code_infos:[],
+			layui_element:null
+		},
+		watch:{
+			delegated_buy_code_infos:function(){
+				if(app.layui_element){
+					setTimeout(()=>{
+						app.layui_element.render();
+					})
+				}
+			}
+		},
+		mounted:function(){
+			 layui.use('element', function(){
+			    var element = layui.element;
+				app.layui_element=element;
+			  });
+			
+			setInterval(function(){
+				app.get_delegated_buy_code_infos();
+			},1000*600*5);
 		},
 		methods: {
 			change_data_type: function(type) {
@@ -122,7 +146,7 @@
 					if (res.code == 0) {
 						var real_order_index = -1;
 						var buy_singles = [];
-						res.data.forEach(function(e) {
+						res.data.data.forEach(function(e) {
 							if (e[1] != null) {
 								if (e[1][0] == 3) {
 									//鐪熷疄涓嬪崟浣嶇疆
@@ -139,9 +163,10 @@
 						});
 						console.log("鏈�杩戠湡瀹炰笅鍗曚綅缃細", real_order_index);
 						app.latest_real_order_index = real_order_index;
-						app.l2_datas = res.data;
-						app.l2_code_name = app.code_name.slice(0, app.code_name.indexOf(
-							" "))
+						app.l2_datas = res.data.data;
+						var code_name = res.data.code_name;
+						var code_ = res.data.code;
+						app.l2_code_name = code_ + " " + code_name;
 						// 娓呴櫎鎴愪氦杩涘害锛孡鎾�, H鎾�
 						app.trade_progress_index = -1;
 						app.l_up_cancel_indexes = [];
@@ -154,6 +179,24 @@
 				});
 
 			},
+			get_delegated_buy_code_infos:function(){
+				// 鑾峰彇鏁版嵁
+				http_util.get_delegated_buy_code_infos(function(result){
+					if (result.code == 0) {
+						console.log("宸叉寕涔板崟鏁版嵁锛�",result.data);
+						result.data.forEach(function(e){
+							if(e.total_num>0){
+								e.percent = e.finish_num*100/e.total_num;
+							}else{
+								e.percent = 0;
+							}
+						});
+						app.delegated_buy_code_infos = result.data
+					}
+				});
+			},
+			
+			
 			clear_cancel_mark: function() {
 				//娓呴櫎鎾ゅ崟鏍囪
 				app.l_up_cancel_indexes = [];
@@ -330,12 +373,11 @@
 			set_target_code: function(code) {
 				console.log("璁剧疆鐩爣浠g爜", code);
 				app.origin_code = code;
-				app.code = code;
 				app.code_name = code;
 			},
 			load_data:function(){
-				if(app.code){
-					app.get_score_data(app.code,null,null);
+				if(app.origin_code){
+					app.get_score_data(app.origin_code,null,null);
 				}
 				
 			}

--
Gitblit v1.8.0