| | |
| | | |
| | | console.log("http请求路径", path, key); |
| | | |
| | | pyjs.http_request(path, JSON.stringify(data), JSON.stringify(["http_util_of_ls.http_request_result", key])); |
| | | pyjs.http_request(path, JSON.stringify(data), JSON.stringify(["http_util_of_ls.http_request_result", |
| | | key])); |
| | | }, |
| | | socket_request: function(data, callback) { |
| | | key = "http_callback_" + new Date().getTime() + "_" + Math.round(Math.random() * 100000000); |
| | |
| | | result = JSON.parse(result); |
| | | callback(result); |
| | | }); |
| | | }, |
| | | set_settings: function(data_params, callback) { |
| | | let data = { |
| | | ctype: "set_settings" |
| | | }; |
| | | for(key in data_params){ |
| | | data[key] = data_params[key]; |
| | | } |
| | | var params = { |
| | | type: "common", |
| | | data: data, |
| | | sign: '' |
| | | } |
| | | http_util_of_ls.socket_request(JSON.stringify(params), function(result) { |
| | | result = JSON.parse(result); |
| | | callback(result); |
| | | }); |
| | | }, |
| | | get_plate_white_list: function(callback) { |
| | | let data = { |
| | | ctype: "plate_white_list", |
| | | operate: 3 |
| | | }; |
| | | var params = { |
| | | type: "common", |
| | | data: data, |
| | | sign: '' |
| | | } |
| | | http_util_of_ls.socket_request(JSON.stringify(params), function(result) { |
| | | result = JSON.parse(result); |
| | | callback(result); |
| | | }); |
| | | }, |
| | | |
| | | delete_plate_white_list: function(plate,callback) { |
| | | let data = { |
| | | ctype: "plate_white_list", |
| | | operate: 2, |
| | | plate: plate |
| | | }; |
| | | var params = { |
| | | type: "common", |
| | | data: data, |
| | | sign: '' |
| | | } |
| | | http_util_of_ls.socket_request(JSON.stringify(params), function(result) { |
| | | result = JSON.parse(result); |
| | | callback(result); |
| | | }); |
| | | }, |
| | | add_plate_white_list: function(plate,callback) { |
| | | let data = { |
| | | ctype: "plate_white_list", |
| | | operate: 4, |
| | | plate: plate |
| | | }; |
| | | var params = { |
| | | type: "common", |
| | | data: data, |
| | | sign: '' |
| | | } |
| | | http_util_of_ls.socket_request(JSON.stringify(params), function(result) { |
| | | result = JSON.parse(result); |
| | | callback(result); |
| | | }); |
| | | }, |
| | | |
| | | get_place_order_records:function(callback){ |
| | | let data = { |
| | | ctype: "get_place_order_records" |
| | | }; |
| | | var params = { |
| | | type: "common", |
| | | data: data, |
| | | sign: '' |
| | | } |
| | | http_util_of_ls.socket_request(JSON.stringify(params), function(result) { |
| | | result = JSON.parse(result); |
| | | callback(result); |
| | | }); |
| | | } |
| | | |
| | | }; |