0.0.176 routes

This commit is contained in:
SBD
2025-02-28 16:07:53 +03:00
parent fd343f098e
commit 134216c5f5
5 changed files with 47 additions and 4 deletions

View File

@@ -0,0 +1,31 @@
function loadMoreMyRoutesRoutes (el){
if (!el) return;
let formData = new FormData();
let from_el = parseInt(el.dataset.from_el);
let to_el = from_el + parseInt(el.dataset.more_count);
formData.append('from_el', from_el);
formData.append('to_el', to_el);
let request = new api({
url: '/routes/get_routes/',
data: formData,
data_type: 'formData',
success: (res) => {
if (!res.html) return;
let $parent = $('.info_profile')[0];
let $next_page_btn = $parent.querySelector('.container_btns[data-next_page_btn]')
$next_page_btn.remove();
appendNodes($parent, templateStrToNode(`
<div class="next_page" style="
margin: 50px 0;
width: 100%;
background: #212121;
height: 1px;"></div>
`));
appendNodes($parent, templateStrToNode(res.html));
}
});
request.ajaxRequest()
}

View File

@@ -37,6 +37,7 @@
<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>
<script src='{% static "v2/js/blocks/b_my_routes.js" %}'></script>
{% include "connect_ws_js.html" %}
<link rel="stylesheet" href="{% static "v2/css/widgets/w_route_card.css" %}">

View File

@@ -5,4 +5,15 @@
{% for route in routes %}
{% include 'v2/widgets/w_route_card.html' with route=route %}
{% endfor %}
</div>
</div>
{% if not last_block %}
<div class="container_btns" data-next_page_btn="true" style="--justify: center;margin-top: 20px">
<div class="primary_btn"
onclick="loadMoreMyRoutesRoutes(this)"
style="--padding: 19px 34px 21px 34px"
data-from_el="{{ last_el }}"
data-more_count="{{ next_page_els_count }}">
{% trans "Показать ещё" %} {{ next_page_els_count }}
</div>
</div>
{% endif %}

View File

@@ -12,7 +12,7 @@
<div class="card_owner_type {{ route.owner_type }}">{% if route.owner_type == 'customer' %}{% trans "Нужен перевозчик" %}{% else %}{% trans "Могу перевезти" %}{% endif %}</div>
<div class="card_cargo_type">{% trans "Тип посылки:" %} <div class="orange">{{ route.cargo_type|get_cargo_type_for_show }}</div></div>
</div>
<div class="route_btn inactive" style="--route-btn-width: max-content;--route-btn-height: min-content;--route-btn-padding: 7.5px 11px;max-width: 142px;">
<div class="route_btn inactive" style="--route-btn-width: max-content;--route-btn-height: min-content;--route-btn-padding: 7.5px 11px;max-width: 155px;">
<img src="{% static "v2/icons/widgets/w_route_card/phone_half_opacity.svg" %}" alt="">
<div class="route_btn_title big">{{ route.phone }}</div>
</div>

View File

@@ -16,12 +16,12 @@
<div class="form_line _50_grid">
<div class="field_container" data-type="location" data-name="from_city" data-datepicker="departure_DT">
<label for="id_from_city"><div class="required_field_icon">*</div> {% trans "Пункт отправления" %}</label>
{% include 'v2/widgets/w_select_country.html' with name='from_city' placeholder=placeholder_for_city initial=form.initial.from_city %}
{% include 'v2/widgets/w_select_country.html' with name='from_city' placeholder=placeholder_for_city initial=form.instance.from_city %}
{% if form.errors.from_city %}<div class="error_container">{{ form.errors.from_city.0 }}</div>{% endif %}
</div>
<div class="field_container" data-type="location" data-name="to_city" data-datepicker="arrival_DT">
<label for="id_from_city"><div class="required_field_icon">*</div> {% trans "Пункт прибытия" %}</label>
{% include 'v2/widgets/w_select_country.html' with name='to_city' placeholder=placeholder_for_city initial=form.initial.to_city %}
{% include 'v2/widgets/w_select_country.html' with name='to_city' placeholder=placeholder_for_city initial=form.instance.to_city %}
{% if form.errors.to_city %}<div class="error_container">{{ form.errors.to_city.0 }}</div>{% endif %}
</div>
</div>