car_front/pages/index/index.wxml
2025-07-01 23:49:58 +08:00

117 lines
3.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 顶部轮播图 -->
<swiper autoplay="3000" circular indicator-dots class="banner">
<block wx:for="{{bannerList}}" wx:key="index">
<swiper-item>
<image src="{{item}}" class="banner-image" mode="aspectFill" />
</swiper-item>
</block>
</swiper>
<!-- 公司信息 -->
<view class="company-info">
<view class="company-name">{{company.name}}</view>
<view class="company-address">
<van-icon name="location-o" size="16px" />
<text>{{company.address}}</text>
</view>
<view class="company-actions">
<van-button size="small" type="primary" plain icon="location-o" bindtap="openMap">导航</van-button>
<van-button size="small" type="info" plain icon="phone" open-type="makePhoneCall" data-phone="{{company.phone}}">电话</van-button>
</view>
</view>
<!-- 车辆列表 -->
<!-- 筛选栏 -->
<view class="sticky-filter">
<van-dropdown-menu>
<van-dropdown-item
value="{{selectedSort}}"
options="{{sortOptions}}"
bind:change="onSortChange"
/>
<van-dropdown-item id="dropdownItemBrand" title="{{selectedBrandLabel}}" use-slot>
<van-tree-select
height="400"
items="{{brandTree}}"
main-active-index="{{mainActiveIndex}}"
active-id="{{selectedSeriesId}}"
bind:click-nav="onBrandClick"
bind:click-item="onSeriesSelect"
/>
</van-dropdown-item>
<van-dropdown-item
value="{{selectedPrice}}"
options="{{priceOptions}}"
bind:change="onPriceChange"
/>
<van-dropdown-item title="参数"
use-slot
id="dropdownItemParam"
>
<view class="filter-extend">
<view wx:for="{{extendFields}}" wx:key="id" class="filter-group">
<view class="filter-label">{{item.label}}</view>
<!-- 多选项字段 -->
<view wx:if="{{item.type === 'checkbox'}}" class="filter-tags">
<view
wx:for="{{item.options}}"
wx:for-item="opt"
wx:key="index"
class="filter-tag-item"
data-name="{{item.name}}"
data-value="{{opt.value}}"
bind:tap="onTagToggle"
>
<van-tag
class="mytag"
type="{{opt._checked ? 'success' : 'default'}}"
round
plain="{{!opt._checked}}"
>
{{opt.key}}
</van-tag>
</view>
</view>
<view wx:if="{{item.type === 'range'}}" class="filter-slider-group">
<view class="slider-label">
{{item.label}}{{item._rangeStart || item.options.start}}{{item.options.unit}} - {{item._rangeEnd || item.options.end}}{{item.options.unit}}
</view>
<van-slider
range
value="{{[item._rangeStart ? item._rangeStart : item.options.start, item._rangeEnd ? item._rangeEnd : item.options.end]}}"
min="{{item.options.start}}"
max="{{item.options.end}}"
data-name="{{item.name}}"
bind:change="onSliderChange"
/>
</view>
</view>
<van-button type="primary" block size="small" bind:tap="onExtendConfirm">确认</van-button>
</view>
</van-dropdown-item>
</van-dropdown-menu>
</view>
<!-- 汽车列表 -->
<view class="car-list">
<block wx:for="{{carList}}" wx:key="id">
<view class="car-item">
<image src="{{item.image}}" class="car-image" mode="aspectFill" />
<view class="car-info">
<view class="car-title">{{item.title}}</view>
<view class="car-detail">
<span class="car-subtext">{{item.registerDate}}</span>
<span class="car-subtext">{{item.mileage}} km</span>
<span class="car-subtext">{{item.emission}}</span>
</view>
</view>
</view>
</block>
</view>