|
|
|
@ -29,24 +29,27 @@
|
|
|
|
|
<div class="selectionMemo">
|
|
|
|
|
US$199
|
|
|
|
|
</div>
|
|
|
|
|
<div id='premium_khomloy_left' class="dynamic-label" style="font-size: 18px;">Sold out</div>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="optionLable" id="ticket_type_vip_khomloy">
|
|
|
|
|
<input type="radio" value="VIP+Transfer+Dinner" id="vip_khomloy" data-price="179" name="ticket_type" checked>
|
|
|
|
|
<input type="radio" value="VIP+Transfer+Dinner" checked id="vip_khomloy" data-price="179" name="ticket_type">
|
|
|
|
|
<label for="vip_khomloy" style="font-size:18px;">
|
|
|
|
|
VIP+Transfer+Dinner
|
|
|
|
|
<div class="selectionMemo">
|
|
|
|
|
US$179
|
|
|
|
|
</div>
|
|
|
|
|
<div id='vip_khomloy_left' class="dynamic-label" style="font-size: 18px;">93 left</div>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="optionLable" id="ticket_type_standard_khomloy">
|
|
|
|
|
<input type="radio" disabled ="Standard+Transfer+Dinner" id="standard_khomloy" data-price="139" name="ticket_type" value="Standard+Transfer+Dinner">
|
|
|
|
|
<input type="radio" id="standard_khomloy" data-price="139" name="ticket_type" value="Standard+Transfer+Dinner">
|
|
|
|
|
<label for="standard_khomloy" style="font-size:18px;">
|
|
|
|
|
Standard+Transfer+Dinner
|
|
|
|
|
<div class="selectionMemo">
|
|
|
|
|
US$139
|
|
|
|
|
</div>
|
|
|
|
|
<div id='standard_khomloy_left' class="dynamic-label" style="font-size: 18px;">Sold out</div>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -412,102 +415,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
|
function initDefaultSelection() {
|
|
|
|
|
// 初始化时添加默认的余量信息
|
|
|
|
|
addStyledLabel("ticket_type_premium_khomloy", "Sold out", "dynamic-label");
|
|
|
|
|
addStyledLabel("ticket_type_vip_khomloy", "93 tickets left", "dynamic-label");
|
|
|
|
|
addStyledLabel("ticket_type_standard_khomloy", "Sold out", "dynamic-label");
|
|
|
|
|
}
|
|
|
|
|
var premium_khomloy_left = document.getElementById("premium_khomloy_left");
|
|
|
|
|
var vip_khomloy_left = document.getElementById("vip_khomloy_left");
|
|
|
|
|
var standard_khomloy_left = document.getElementById("standard_khomloy_left");
|
|
|
|
|
|
|
|
|
|
// 初始化默认显示
|
|
|
|
|
initDefaultSelection();
|
|
|
|
|
var premium_khomloy_input = document.getElementById("premium_khomloy");
|
|
|
|
|
var vip_khomloy_input = document.getElementById("vip_khomloy");
|
|
|
|
|
var standard_khomloy_input = document.getElementById("standard_khomloy");
|
|
|
|
|
|
|
|
|
|
var ticket_date_november15th = document.getElementById("ticket_date_november15th");
|
|
|
|
|
var ticket_date_november16th = document.getElementById("ticket_date_november16th");
|
|
|
|
|
|
|
|
|
|
vip_khomloy_input.checked = true;
|
|
|
|
|
|
|
|
|
|
premium_khomloy_input.disabled = true;
|
|
|
|
|
vip_khomloy_input.disabled = false;
|
|
|
|
|
standard_khomloy_input.disabled = true;
|
|
|
|
|
|
|
|
|
|
ticket_date_november15th.addEventListener('click', function () {
|
|
|
|
|
console.log("ticket_date_november15th clicked");
|
|
|
|
|
// 先移除旧的标签
|
|
|
|
|
removeExistingLabels("ticket_type_premium_khomloy", "dynamic-label");
|
|
|
|
|
removeExistingLabels("ticket_type_vip_khomloy", "dynamic-label");
|
|
|
|
|
removeExistingLabels("ticket_type_standard_khomloy", "dynamic-label");
|
|
|
|
|
|
|
|
|
|
// 添加新的余量标签
|
|
|
|
|
addStyledLabel("ticket_type_premium_khomloy", "Sold out", "dynamic-label");
|
|
|
|
|
addStyledLabel("ticket_type_vip_khomloy", "93 left", "dynamic-label");
|
|
|
|
|
addStyledLabel("ticket_type_standard_khomloy", "Sold out", "dynamic-label");
|
|
|
|
|
|
|
|
|
|
// 设置standard_khomloy为disabled
|
|
|
|
|
var standardInput = document.getElementById("standard_khomloy");
|
|
|
|
|
if (standardInput) {
|
|
|
|
|
standardInput.disabled = true;
|
|
|
|
|
}
|
|
|
|
|
var premiumInput = document.getElementById("premium_khomloy");
|
|
|
|
|
if (premiumInput) {
|
|
|
|
|
premiumInput.disabled = true;
|
|
|
|
|
}
|
|
|
|
|
premium_khomloy_left.innerText ='Sold out'
|
|
|
|
|
vip_khomloy_left.innerText ='93 left'
|
|
|
|
|
standard_khomloy_left.innerText ='Sold out'
|
|
|
|
|
|
|
|
|
|
premium_khomloy_input.disabled = true;
|
|
|
|
|
vip_khomloy_input.disabled = false;
|
|
|
|
|
standard_khomloy_input.disabled = true;
|
|
|
|
|
|
|
|
|
|
vip_khomloy_input.checked = true;
|
|
|
|
|
var dataPrice = parseInt(vip_khomloy_input.getAttribute('data-price'));
|
|
|
|
|
adultNumberValue = parseInt(adultNumberNode.value);
|
|
|
|
|
calcTotalPrice(dataPrice, adultNumberValue);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ticket_date_november16th.addEventListener('click', function () {
|
|
|
|
|
console.log("ticket_date_november16th clicked");
|
|
|
|
|
// 先移除旧的标签
|
|
|
|
|
removeExistingLabels("ticket_type_premium_khomloy", "dynamic-label");
|
|
|
|
|
removeExistingLabels("ticket_type_vip_khomloy", "dynamic-label");
|
|
|
|
|
removeExistingLabels("ticket_type_standard_khomloy", "dynamic-label");
|
|
|
|
|
|
|
|
|
|
// 添加新的余量标签
|
|
|
|
|
addStyledLabel("ticket_type_premium_khomloy", "240 left", "dynamic-label");
|
|
|
|
|
addStyledLabel("ticket_type_vip_khomloy", "149 left", "dynamic-label");
|
|
|
|
|
addStyledLabel("ticket_type_standard_khomloy", "19 left", "dynamic-label");
|
|
|
|
|
|
|
|
|
|
var standardInput = document.getElementById("standard_khomloy");
|
|
|
|
|
if (standardInput) {
|
|
|
|
|
standardInput.disabled = false;
|
|
|
|
|
}
|
|
|
|
|
var premiumInput = document.getElementById("premium_khomloy");
|
|
|
|
|
if (premiumInput) {
|
|
|
|
|
premiumInput.disabled = false;
|
|
|
|
|
}
|
|
|
|
|
premium_khomloy_left.innerText ='240 left'
|
|
|
|
|
vip_khomloy_left.innerText ='149 left'
|
|
|
|
|
standard_khomloy_left.innerText ='19 left'
|
|
|
|
|
|
|
|
|
|
premium_khomloy_input.disabled = false;
|
|
|
|
|
vip_khomloy_input.disabled = false;
|
|
|
|
|
standard_khomloy_input.disabled = false;
|
|
|
|
|
|
|
|
|
|
premium_khomloy_input.checked = true;
|
|
|
|
|
var dataPrice = parseInt(premium_khomloy_input.getAttribute('data-price'));
|
|
|
|
|
adultNumberValue = parseInt(adultNumberNode.value);
|
|
|
|
|
calcTotalPrice(dataPrice, adultNumberValue);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 添加新的余量信息标签
|
|
|
|
|
function addStyledLabel(targetId, text, labelClass) {
|
|
|
|
|
var target = document.getElementById(targetId);
|
|
|
|
|
if (target) {
|
|
|
|
|
removeExistingLabels(targetId, labelClass);
|
|
|
|
|
var existingLabel = target.querySelector('label[for]');
|
|
|
|
|
if (existingLabel) {
|
|
|
|
|
var selectionMemo = existingLabel.querySelector('.selectionMemo');
|
|
|
|
|
if (selectionMemo) {
|
|
|
|
|
var newLabel = document.createElement('label');
|
|
|
|
|
newLabel.style.fontSize = '18px';
|
|
|
|
|
newLabel.textContent = text;
|
|
|
|
|
newLabel.classList.add(labelClass);
|
|
|
|
|
selectionMemo.parentNode.insertBefore(newLabel, selectionMemo.nextSibling);
|
|
|
|
|
} else {
|
|
|
|
|
console.error('SelectionMemo element not found within label.');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
console.error('Existing label not found within target ID:', targetId);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
console.error('Element not found for ID:', targetId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 移除旧的余量标签
|
|
|
|
|
function removeExistingLabels(targetId, labelClass) {
|
|
|
|
|
var target = document.getElementById(targetId);
|
|
|
|
|
if (target) {
|
|
|
|
|
var existingLabels = target.querySelectorAll('.' + labelClass);
|
|
|
|
|
existingLabels.forEach(function(label) {
|
|
|
|
|
label.parentNode.removeChild(label);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var venueList = document.querySelectorAll("input[name='Venue']");
|
|
|
|
|
|
|
|
|
|
var totalPriceText = document.getElementById("totalPriceText");
|
|
|
|
|