index_any_day.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>股票信息接口</title>
  6. <script type="text/javascript" src="js/jquery.1.9.1.min.js"></script>
  7. <script type="text/javascript" src="js/func.common.js"></script>
  8. <script type="text/javascript" src="js/func.js"></script>
  9. <script type="text/javascript" src="js/jquery.md5.js">//$.md5()</script>
  10. <script type="text/javascript" src="js/jquery.base64.js">//$.base64.encode()</script>
  11. <script src="js/c.js" type="text/javascript"></script>
  12. <script src="js/urchin.js" type="text/javascript"></script>
  13. <link href="css/s.css" type="text/css" rel="stylesheet">
  14. <link href="css/base.css" type="text/css" rel="stylesheet">
  15. <script type="text/javascript">
  16. $(function(){
  17. $('#btn').click(function(){
  18. var method = $('input[name="method"]').val();
  19. var index_type = $('input[name="index_type"]').val();
  20. var date = $('input[name="date"]').val();
  21. var timestamp = $('input[name="timestamp"]').val();
  22. var sign = $.md5(method+timestamp);
  23. $('#sign').val(sign);
  24. $.ajax({
  25. type : 'POST',
  26. data : {
  27. 'method' :method,
  28. 'index_type' :index_type,
  29. 'date' :date,
  30. 'timestamp' :timestamp,
  31. 'sign' : sign
  32. },
  33. url : "../api.php",
  34. beforeSend : function(data){
  35. $('#Canvas').html('<p>请求处理中...</p>');
  36. },
  37. success : function(data){
  38. Process(data);
  39. },
  40. error : function(request, errtext, e){
  41. $('#Canvas').html('<p><b>发生错误</b></p><p>'+request.status+'<br/>'+errtext+'</p>');
  42. }
  43. });
  44. });
  45. });
  46. </script>
  47. </head>
  48. <body>
  49. <div id="head"><p>指数某天数据</p></div>
  50. <div id="content">
  51. <div id="left">
  52. <div class ="message"><p>接口返回:</p></div>
  53. <div id="Canvas" class="Canvas"></div>
  54. </div>
  55. <div id="right">
  56. <div class ="message"><p>请求数据:</p></div>
  57. <form>
  58. <p>
  59. <span>method:</span>
  60. <input type="text" class="input-text" name="method" value="index_any_day"/>
  61. </p>
  62. <p>
  63. <span>timestamp:</span>
  64. <input type="text" class="input-text" name="timestamp" value="11111111" />
  65. </p>
  66. <p>
  67. <span>code</span>
  68. <input type="text" class="input-text" name="code" value="600008"/>
  69. </p>
  70. <p>
  71. <span>date</span>
  72. <input type="text" class="input-text" name="date" value=20201201 />
  73. </p>
  74. <p>
  75. <span>index_type:0:表示全部指数,1:上证指数,2:深成指数 3:上证50指数 4:沪深300 5:创业板指数 6:科创50指数 </span>
  76. <input type="text" class="input-text" name="index_type" value=0 />
  77. </p>
  78. <p>
  79. </p>
  80. <p><span>校验码:</span><input type="text" class="input-text" id="sign" readonly/></p>
  81. <p><button class="button success small" id="btn" type="button">发送请求</button></p>
  82. </form>
  83. </div>
  84. </div>
  85. </body>
  86. </html>