后台列表总数改到每页左边,报价模板页同样靠右。陆运选线补每段车型。多段群每次带出询价字段时,底部补上另报提示。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-12 14:59:07 +08:00
co-authored by Cursor
parent 739ba401aa
commit 4f8c373121
9 changed files with 106 additions and 10 deletions
@@ -1,7 +1,7 @@
"""
陆运选线路 H5 页。
本文件职责:按完整线路列出各段成本与合计,提交所选下标。
本文件职责:按完整线路列出各段车型、成本与合计,提交所选下标。
样式对齐空运选线路页。禁止 URL userid;禁止本页查 TMS。
"""
@@ -64,19 +64,40 @@ def render_land_route_ok() -> str:
)
def _segment_vehicle(leg: dict[str, Any] | None) -> str:
"""每段车型用 TMS 的 vehicleType 原文。没有台数,空值显示 -。"""
src = dict(leg or {})
raw = str(
src.get("vehicleType") or src.get("vehicle_type") or src.get("truckType") or ""
).strip()
if raw.lower() in {"none", "null"}:
raw = ""
return raw or "-"
def _route_card(index: int, route: dict[str, Any], quote: dict[str, Any] | None = None) -> str:
"""一张线路:航线、各段路段+TMS 费目、合计。"""
"""一张线路:航线、各段路段、车型、TMS 费目、合计。"""
line = html.escape(route_line(route))
blocks = land_leg_fee_blocks_for_route(quote, route)
shown_legs = [
leg
for leg in list(route.get("legs") or [])
if str(leg.get("origin") or "").strip() or str(leg.get("destination") or "").strip()
]
etas = {i: d for i, (_, d) in enumerate(option_eta_bits(route), 1)}
fee_bits: list[str] = []
items = ""
if blocks:
for i, (title, fees, eta) in enumerate(blocks, 1):
vehicle = _segment_vehicle(shown_legs[i - 1] if i - 1 < len(shown_legs) else None)
items += (
f"<li class='leg'><span class='n'>{html.escape(title)}</span>"
"<span></span></li>"
)
items += (
f"<li><span class='n'>车型 {html.escape(vehicle)}</span>"
"<span></span></li>"
)
for fee in fees:
amount = _money(fee.get("amount"), str(fee.get("currency") or "").strip())
name = str(fee.get("name") or "").strip()