|
|
|
@ -10,7 +10,7 @@ |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<th></th> |
|
|
|
<th></th> |
|
|
|
<th>Название</th> |
|
|
|
<th>Название</th> |
|
|
|
<th>Цена за 50 гр</th> |
|
|
|
<th>Цена за минимальную массу</th> |
|
|
|
<th>Вес</th> |
|
|
|
<th>Вес</th> |
|
|
|
<th></th> |
|
|
|
<th></th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
@ -37,8 +37,8 @@ |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<div class="select-wrapper"> |
|
|
|
<div class="select-wrapper"> |
|
|
|
<select class="selector" name="{{ type_name }}" id="{{ type_name }}" |
|
|
|
<select class="selector" name="{{ type_name }}" id="{{ type_name }}" |
|
|
|
onchange="change(value, '{{ type_name }}')"> |
|
|
|
onchange="change(value, '{{ type_name }}', {{ type.ms.1 }})"> |
|
|
|
{% for m in ms %} |
|
|
|
{% for m in type.ms %} |
|
|
|
<option value="{{ m }}">{{ m }}</option> |
|
|
|
<option value="{{ m }}">{{ m }}</option> |
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
@ -81,17 +81,21 @@ |
|
|
|
{% for type_name,type in category.items %} |
|
|
|
{% for type_name,type in category.items %} |
|
|
|
"{{ type_name }}": { |
|
|
|
"{{ type_name }}": { |
|
|
|
{% for key,item in type.items%} |
|
|
|
{% for key,item in type.items%} |
|
|
|
"{{ key }}": "{{ item }}", |
|
|
|
{% if not key == 'ms' %} |
|
|
|
|
|
|
|
"{{ key }}": "{{ item }}", |
|
|
|
|
|
|
|
{% else %} |
|
|
|
|
|
|
|
"{{ key }}": {{ item }}, |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function change(value, type) { |
|
|
|
function change(value, type, step) { |
|
|
|
choice[type] = parseInt(value) |
|
|
|
choice[type] = parseInt(value) |
|
|
|
const price_el = document.getElementById('price ' + type); |
|
|
|
const price_el = document.getElementById('price ' + type); |
|
|
|
price_el.innerText = parseInt(value) / 50 * parseInt(a[type].price) |
|
|
|
price_el.innerText = parseInt(value) / step * parseInt(a[type].price) |
|
|
|
sum_price() |
|
|
|
sum_price() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|