From 59a65524fa3cf9e62e04c0e925651eae82cbb57d Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 12 Apr 2024 11:35:41 +0800 Subject: [PATCH] 2024-04-02, cityline allow to buy last one ticket --- .../js/cityline_performance.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/webdriver/Maxbotplus_1.0.0/js/cityline_performance.js b/webdriver/Maxbotplus_1.0.0/js/cityline_performance.js index ad1b13f..5346521 100644 --- a/webdriver/Maxbotplus_1.0.0/js/cityline_performance.js +++ b/webdriver/Maxbotplus_1.0.0/js/cityline_performance.js @@ -93,7 +93,29 @@ function cityline_performance() if(settings) { cityline_area_keyword(settings); - $("#ticketType0").val(settings.ticket_number); + //$("#ticketType0").val(settings.ticket_number); + let target_row=$("#ticketType0"); + let ticket_options = target_row.find("option"); + if (ticket_options.length) + { + let is_ticket_number_assign = false; + if (settings.ticket_number > 0) + { + ticket_options.each(function () + { + if ($(this).val() == settings.ticket_number) + { + $(this).prop('selected', true); + is_ticket_number_assign = true; + return false; + } + }); + } + if (!is_ticket_number_assign) + { + ticket_options.last().prop('selected', true); + } + } if(settings.advanced.disable_adjacent_seat) { $('input[type=checkbox]:checked').each(function() {