HKTicketing 快达网 tickets page

快达网 票价,数量,寄送方式

  1. // ==UserScript==
  2. // @name HKTicketing 快达网 tickets page
  3. // @namespace https://www.jwang0614.top/scripts
  4. // @version 0.2
  5. // @description 快达网 票价,数量,寄送方式
  6. // @author Olivia
  7. // @match https://premier.hkticketing.com/events/*/venues/*/performances/*/tickets
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Your code here...
  15.  
  16. //第几档票价? Best Available Any Price Category 为0
  17. var price_category = 0;
  18.  
  19. //几个人
  20. var people = 1;
  21.  
  22. function timedRefresh(timeoutPeriod) {
  23. window.setTimeout("location.reload(true);",timeoutPeriod);
  24. }
  25.  
  26.  
  27. document.querySelectorAll(".seatarea li a")[price_category].click();
  28.  
  29.  
  30. document.querySelectorAll(".chooseTicketsPriceTypeQuantity select")[0].selectedIndex = people;
  31. document.querySelectorAll(".chooseTicketsPriceTypeQuantity select")[0].dispatchEvent(new Event('change'));
  32.  
  33.  
  34.  
  35. document.querySelector("#selectDeliveryType").selectedIndex = 1;
  36. document.querySelector("#selectDeliveryType").dispatchEvent(new Event('change'));
  37.  
  38. if (document.querySelector("#continueBar button").disabled == true) {
  39. timedRefresh(200);
  40.  
  41. } else {
  42. document.querySelector("#continueBar button").click()
  43. }
  44.  
  45.  
  46.  
  47.  
  48.  
  49. })();
  50.  
  51.  
  52.