0.0.42 fix form

This commit is contained in:
SBD
2025-01-16 17:18:12 +03:00
parent b3e8d75539
commit 529b324817
8 changed files with 68 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
.w_route_card {
padding: 20px;
--route-card-bg: #FFFFFF;
--route-card-margin: 20px 0;
--route-card-box_shadow: 0 -1px 10px rgba(198, 199, 203, 0.2), -1px 4px 10px rgba(198, 199, 203, 0.2);
--route-text-color: #272424;
@@ -34,6 +35,7 @@
--route-btn-text-data-color: #27242499;
background: var(--route-card-bg);
margin: var(--route-card-margin);
box-shadow: var(--route-card-box_shadow);
border-radius: 10px;
color: var(--route-text-color);
@@ -84,6 +86,9 @@
background: #E6E6E6;
}
.card_owner_type{
&.mover{
--route-owner-type-color: #45C226;
}
font-size: var(--medium-font-size);
color: var(--route-owner-type-color);
font-weight: 600;
@@ -174,7 +179,7 @@
border-radius: 100%;
position: absolute;
top: -10px;
z-index: 2;
z-index: 11;
&:first-of-type{
border: 3px solid #065BFF;
left: 0;
@@ -202,6 +207,7 @@
z-index: 10;
background-image: url("/static/v2/icons/widgets/w_route_card/route_arrow.svg");
background-repeat: repeat-x;
background-size: 10px;
}
}
}

View File

@@ -0,0 +1,3 @@
<svg width="16" height="15" viewBox="0 0 16 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.74083 6.54208C4.88083 8.7825 6.7175 10.6112 8.95792 11.7592L10.6996 10.0175C10.9133 9.80375 11.23 9.7325 11.5071 9.8275C12.3938 10.1204 13.3517 10.2788 14.3333 10.2788C14.7688 10.2788 15.125 10.635 15.125 11.0704V13.8333C15.125 14.2688 14.7688 14.625 14.3333 14.625C6.89958 14.625 0.875 8.60042 0.875 1.16667C0.875 0.73125 1.23125 0.375 1.66667 0.375H4.4375C4.87292 0.375 5.22917 0.73125 5.22917 1.16667C5.22917 2.15625 5.3875 3.10625 5.68042 3.99292C5.7675 4.27 5.70417 4.57875 5.4825 4.80042L3.74083 6.54208Z" fill="#FF613A" fill-opacity="0.6"/>
</svg>

After

Width:  |  Height:  |  Size: 663 B

View File

@@ -17,11 +17,11 @@ function makeMoverOrder(form) {
if (!profile_root) return;
profile_root.innerHTML = res.html
let created_route = document.querySelector(`[data-number-of-route="${created_route_id}"]`);
let created_route = document.querySelector(`.w_route_card[data-route_id="${created_route_id}"]`);
created_route.scrollIntoView({
behavior:"smooth",
block:'start',
inline:'start'
block:'center',
inline:'center'
});
let new_url = window.location.pathname

View File

@@ -17,7 +17,7 @@ function makePosterOrder(form) {
if (!profile_root) return;
profile_root.innerHTML = res.html
let created_route = document.querySelector(`[data-number-of-route="${created_route_id}"]`);
let created_route = document.querySelector(`.w_route_card[data-route_id="${created_route_id}"]`);
created_route.scrollIntoView({
behavior:"smooth",
block:'start',

View File

@@ -0,0 +1,22 @@
function changeRoute(el) {
if (!el) return;
let $parent = el.closest(".w_route_card")
if (!$parent) return;
let data = {
'route_id': $parent.dataset.route_id,
'owner_type': $parent.dataset.owner_type,
}
let request = new api({
url: '/routes/create_or_change_route/',
data: data,
data_type: 'json',
success: (res) => {
}, error: (res) => {
}
});
request.ajaxRequest()
}

View File

@@ -32,11 +32,13 @@
<script src='{% static "v2/js/widgets/w_select_country.js" %}'></script>
<script src='{% static "v2/js/widgets/w_radio_inputs.js" %}'></script>
<script src='{% static "v2/js/widgets/w_route_card.js" %}'></script>
<script src='{% static "v2/js/widgets/w_daterangepicker.js" %}'></script>
<script src='{% static "v2/js/widgets/w_textarea_w_counter.js" %}'></script>
<script src='{% static "v2/js/forms/f_make_poster_order.js" %}'></script>
<script src='{% static "v2/js/forms/f_make_mover_order.js" %}'></script>
{% include "connect_ws_js.html" %}
<link rel="stylesheet" href="{% static "v2/css/widgets/w_route_card.css" %}">
<script defer src='{% static "js/check_new_messages.js" %}'></script>

View File

@@ -1,7 +1,8 @@
{% load static %}
{% load i18n %}
<link rel="stylesheet" href="{% static "v2/css/widgets/w_route_card.css" %}">
<div class="b_my_routes">
{% include 'v2/widgets/w_customer_route_card.html' %}
{% for route in routes %}
{% include 'v2/widgets/w_customer_route_card.html' with route=route %}
{% endfor %}
</div>

View File

@@ -1,24 +1,28 @@
{% load i18n %}
{% load static %}
<div class="w_customer_route_card w_route_card">
<div class="w_customer_route_card w_route_card" data-route_id="{{ route.id }}" data-owner_type="{{ route.owner_type }}">
<div class="route_card_info_data">
<img class="route_card_text_img" src="{% static "v2/icons/widgets/w_route_card/route_card_avatar_spline.svg" %}">
<img class="route_card_owner_avatar" src="{% static "v2/icons/widgets/w_additional_info/Info.svg" %}">
<div class="route_card_owner_info">
<div class="route_card_info_left_part">
<div class="card_owner_name">Александр</div>
<div class="card_owner_name">{{ route.owner.username }}</div>
<div class="card_splitter"></div>
<div class="card_owner_type">Нужен перевозчик</div>
<div class="card_cargo_type">Тип посылки: <div class="orange">Документы</div></div>
<div class="card_owner_type {{ route.owner_type }}">{% if route.owner_type == 'customer' %}{% trans "Нужен перевозчик" %}{% else %}{% trans "Могу перевезти" %}{% endif %}</div>
<div class="card_cargo_type">Тип посылки: <div class="orange">{{ route.get_cargo_type_display }}</div></div>
</div>
<div class="route_btn inactive" style="--route-btn-width: 206px;--route-btn-height: min-content;">
<img src="{% static "v2/icons/widgets/w_route_card/phone.svg" %}" alt="">
<div class="title big">+ 6 (666) 666-66-66</div>
<img src="{% static "v2/icons/widgets/w_route_card/phone_half_opacity.svg" %}" alt="">
<div class="route_btn_title big">{{ route.phone }}</div>
</div>
</div>
<div class="route_card_text_container">
Требуется забрать документы из Минска и отдать в Варшаве. Цена перевозки договорная. Требуется забрать документы из Минска и отдать в Варшаве.
{% if route.comment %}
{{ route.comment }}
{% else %}
{% trans "Комментарий отсутствует" %}
{% endif %}
</div>
</div>
<div class="route_card_route_data">
@@ -26,18 +30,25 @@
<div class="label departure_from">{% trans "Забрать из:" %}</div>
<div class="place">
<div class="country">
<img src="{% static "v2/icons/widgets/w_select_country/flag_of_belarus_temp.svg" %}" alt="">
<div class="country_code">BY</div>
<img src="{{ route.from_city.country.flag.url }}" alt="">
<div class="country_code">{{ route.from_city.name }}</div>
</div>
<div class="place_title">
Минск/Беларусь
{{ route.from_city.name }}/{{ route.from_city.country.name }}
</div>
</div>
</div>
<div class="route_way_data">
<div class="route_transport">
<div class="route_transport_name">Авиаперевозка</div>
<img src="{% static "v2/icons/widgets/w_route_card/plane.svg" %}" alt="">
<div class="route_transport_name">{{ route.get_type_transport_display }}</div>
{% if route.type_transport == '' %}
<img src="{% static "v2/icons/widgets/w_route_card/plane.svg" %}" alt="">
<img src="{% static "v2/icons/widgets/w_route_card/car.svg" %}" alt="">
{% elif route.type_transport == 'road' %}
<img src="{% static "v2/icons/widgets/w_route_card/car.svg" %}" alt="">
{% elif route.type_transport == 'avia' %}
<img src="{% static "v2/icons/widgets/w_route_card/plane.svg" %}" alt="">
{% endif %}
</div>
<div class="way_progress_line_container">
<div class="way_progress_round"></div>
@@ -50,11 +61,11 @@
<div class="label arrival_to">{% trans "Доставить в:" %}</div>
<div class="place">
<div class="country">
<img src="{% static "v2/icons/widgets/w_select_country/flag_of_belarus_temp.svg" %}" alt="">
<div class="country_code">BY</div>
<img src="{{ route.to_city.country.flag.url }}" alt="">
<div class="country_code">{{ route.to_city.name }}</div>
</div>
<div class="place_title">
Минск/Беларусь
{{ route.to_city.name }}/{{ route.to_city.country.name }}
</div>
</div>
</div>
@@ -70,7 +81,7 @@
<div class="route_btn_title">{% trans "Выделить цветом" %}</div>
<div class="route_btn_data">Осталось выделений: 0</div>
</div>
<div class="route_btn solid" data-action="change">
<div class="route_btn solid" data-action="change" onclick="changeRoute(this)">
<div class="route_btn_title">{% trans "Редактировать" %}</div>
</div>
</div>