{{include "header.html"}}
{{include "nav.html"}}
{{include "list-hero.html"}}

<section class="section">
  <div class="wrap list-toolbar">
    <p>{{if .Pager.Enabled}}共 {{.Pager.TotalItems}} 件 · 第 {{.Pager.Current}} / {{.Pager.TotalPages}} 页{{else}}共 {{len .List}} 件{{end}}</p>
    <a class="btn small" href="/message">咨询商品清单</a>
  </div>

  {{$filters := ColumnExtFilter .CurrentColumn .Request}}
  {{if $filters}}
  <div class="wrap filter-panel">
    {{range $filters}}
    <div class="filter-row">
      <strong>{{.Label}}</strong>
      <div>{{range .Options}}<a href="{{.URL}}" class="{{if .Selected}}active{{end}}">{{.Label}}</a>{{end}}</div>
    </div>
    {{end}}
  </div>
  {{end}}

  {{if .List}}
  <div class="wrap product-grid">
    {{range .List}}
    <a class="product-card" href="{{.URL}}">
      <span class="product-image">
        {{if .Img}}<img src="{{.Img}}" alt="{{.Title}}">{{end}}
        {{$badge := index .Ext "badge"}}{{if $badge}}<em>{{$badge}}</em>{{end}}
      </span>
      <span class="product-body">
        <span class="product-meta">{{index .Ext "brand"}} · {{index .Ext "category"}}</span>
        <strong>{{.Title}}</strong>
        <span class="desc">{{StrSub .Description 68}}</span>
        <span class="spec-row">{{index .Ext "spec"}}</span>
        <span class="price-row">{{if .Price}}参考价 ¥{{.Price}}{{else}}价格面议{{end}}<b>{{index .Ext "stock_status"}}</b></span>
      </span>
    </a>
    {{end}}
  </div>
  {{else}}
  <div class="wrap empty-state">暂无商品，您可以稍后查看或提交咨询。</div>
  {{end}}
  <div class="wrap">{{include "pager.html"}}</div>
</section>

{{include "footer.html"}}
{{include "js.html"}}
