Перемещены поля адреса доставки под кнопки выбора типа доставки
- Все поля ввода адреса доставки теперь расположены под кнопками "С ДОСТАВКОЙ" / "САМОВЫВОЗ" - Поля адреса скрыты когда выбран вариант "САМОВЫВОЗ" - Поля адреса видны только когда выбрана "С ДОСТАВКОЙ" - Переименован div с id="delivery-fields" на id="delivery-mode-fields" для лучшей организации - Обновлена функция syncDeliveryType() для управления видимостью полей доставки - Улучшена структура формы для лучшей UX 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -207,8 +207,6 @@
|
||||
<!-- Скрытое поле для передачи значения is_delivery -->
|
||||
<input type="hidden" id="{{ form.is_delivery.id_for_label }}" name="{{ form.is_delivery.name }}" value="on">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<!-- Кнопки выбора типа доставки -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label d-block mb-2">Тип доставки</label>
|
||||
@@ -225,6 +223,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Поля доставки (показываются только если выбрана доставка) -->
|
||||
<div id="delivery-mode-fields" style="display: block;">
|
||||
<!-- Чекбокс "Покупатель = получатель" -->
|
||||
<div class="mb-3 form-check">
|
||||
{{ form.customer_is_recipient }}
|
||||
@@ -232,8 +232,6 @@
|
||||
Покупатель является получателем
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Поля получателя (показываются когда покупатель != получатель) -->
|
||||
<div class="row" id="recipient-fields" style="display: none;">
|
||||
@@ -261,8 +259,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="delivery-fields">
|
||||
<!-- Способ указания адреса -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ form.address_mode.label }}</label>
|
||||
@@ -423,6 +421,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Товары в заказе -->
|
||||
<div class="card mb-3">
|
||||
@@ -984,7 +983,7 @@ if (typeof $ !== 'undefined') {
|
||||
// === УПРАВЛЕНИЕ ТИПОМ ДОСТАВКИ (КНОПКИ) ===
|
||||
const deliveryTypeRadios = document.querySelectorAll('input[name="delivery-type"]');
|
||||
const isDeliveryCheckbox = document.getElementById('{{ form.is_delivery.id_for_label }}');
|
||||
const deliveryFields = document.getElementById('delivery-fields');
|
||||
const deliveryModeFields = document.getElementById('delivery-mode-fields');
|
||||
const pickupFields = document.getElementById('pickup-fields');
|
||||
|
||||
function syncDeliveryType() {
|
||||
@@ -993,14 +992,14 @@ if (typeof $ !== 'undefined') {
|
||||
if (selectedType === 'delivery') {
|
||||
// Доставка
|
||||
isDeliveryCheckbox.checked = true;
|
||||
deliveryFields.style.display = '';
|
||||
deliveryModeFields.style.display = 'block';
|
||||
pickupFields.style.display = 'none';
|
||||
console.log('[DELIVERY TYPE] Delivery selected');
|
||||
} else {
|
||||
// Самовывоз
|
||||
isDeliveryCheckbox.checked = false;
|
||||
deliveryFields.style.display = 'none';
|
||||
pickupFields.style.display = '';
|
||||
deliveryModeFields.style.display = 'none';
|
||||
pickupFields.style.display = 'block';
|
||||
console.log('[DELIVERY TYPE] Pickup selected');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user