From e25a0bad090c444970b48df2713f02d691666b08 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 05 二月 2024 14:19:49 +0800
Subject: [PATCH] 看盘功能完善

---
 kp_html/kp/js/http.js |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/kp_html/kp/js/http.js b/kp_html/kp/js/http.js
index 65bdcdf..5ee87f1 100644
--- a/kp_html/kp/js/http.js
+++ b/kp_html/kp/js/http.js
@@ -146,15 +146,41 @@
 			}
 		});
 	},
-
+	get_sign:function(data){
+		var params=new Array();
+		for(key in data){
+		   	if(data[key] instanceof Object || data[key] instanceof Array){
+				console.log(typeof data[key])
+				params.push(key+"="+JSON.stringify(data[key]))
+			}else{
+				params.push(key+"="+data[key])
+			}
+		}
+		params.sort()
+		params.push("%Yeshi2014@#.")
+		var params_str=""
+		params.forEach(function(re){
+			params_str += re+"&";
+		});
+		if(params_str.endsWith("&")){
+			params_str = params_str.substring(0,params_str.length - 1);
+		}
+		
+		console.log(params_str)
+		
+		 md5Hash = crypto.createHash("md5").update(params_str).digest("hex");
+		 return md5Hash;
+	},
 	cancel_order: function(code, success) {
 		var data = {
-			"type": 80,
-			"data": {
+			type: "cancel_order",
+			data: {
 				"code": code
 			}
 		};
-		pyjs.socket_request(JSON.stringify(data), function(result) {
+		
+		http_util.socket_request(JSON.stringify(data), function(result) {
+			console.log("鎾ゅ崟缁撴灉",result)
 			result = JSON.parse(result);
 			if (result.code == 0) {
 				success()
@@ -229,6 +255,21 @@
 		var params={code:code}
 	    http_util.http_request("/get_xgb_limit_up_reasons", params, callback);
 	},
+	set_real_place_order_index:function(code, index, callback){
+		data = {type:"common", data: {ctype:"set_real_place_order_index",code:code,index:index},sign:''}
+		http_util.socket_request(JSON.stringify(data), function(result) {
+			result = JSON.parse(result);
+			callback(result);
+		});
+	},
+	get_l2_cant_buy_reasons:function(code, callback){
+		var params={code:code}
+		console.log("鍙傛暟",params)
+		http_util.http_request("/get_l2_cant_buy_reasons", params, callback);
+	}
+	
+	
+	
 	
 	
 	 

--
Gitblit v1.8.0