kjh.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var lotterytype = $("#code").val();
  2. $(function () {
  3. $("#termInput").click(function (e) {
  4. $(".query-select").show();
  5. e.stopPropagation();
  6. })
  7. $(".query-select li").click(function (e) {
  8. $(".query-select").hide();
  9. e.stopPropagation();
  10. })
  11. $(window).click(function (event) {
  12. var e = event || window.event;
  13. if ($(".query-select").css("display") != "none") {
  14. $(".query-select").hide();
  15. }
  16. })
  17. })
  18. function updateTable(obj, tr, type) {
  19. if (!$(obj).hasClass("active")) {
  20. $("#table").html("");
  21. $("#rows").html(tr);
  22. var index = $(obj).parents(".qishu-box:eq(0)").children(".lot-btn").index(obj);
  23. $(".qishu-box").each(function (i, e) {
  24. $(e).find(".lot-btn").removeClass("active").eq(index).addClass("active");
  25. })
  26. queryKSJH(type, "Year", tr)
  27. }
  28. }
  29. function queryKSJH(type, type2, tr) {
  30. if (type2 == 'Term') {
  31. var Term = $("#termInput").val();
  32. if (Term != '') {
  33. window.open("/" + type + "/" + lotterytype + "-q" + Term + ".html");
  34. }
  35. }
  36. if (type2 == 'Year') {
  37. if (!tr) {
  38. var Year = $("#yearInput").val();
  39. if (Year != '') {
  40. window.open("/" + type + "/" + lotterytype + "-y" + Year + ".html");
  41. }
  42. } else {
  43. var qs = $("#qs1").text();
  44. if (qs != '') {
  45. window.open("/" + type + "/" + lotterytype + "-" + qs + "-" + tr + ".html");
  46. }
  47. }
  48. }
  49. if (type2 == 'range') {
  50. var minTerm = $("#startInput").val();
  51. var maxTerm = $("#endInput").val();
  52. if (minTerm != '' && maxTerm != '') {
  53. window.open("/" + type + "/" + lotterytype + "-" + minTerm + "-" + maxTerm + ".html");
  54. }
  55. }
  56. }