wx-guyantv/pages/search/index.wxml
2025-01-06 14:18:31 +08:00

30 lines
1.5 KiB
Plaintext

<!-- index.wxml -->
<view class="flex flex-col items-center">
<view class="flex sticky top-[-1rpx] left-0 w-full h-100">
<van-search class="w-full" custom-class="p-0" value="{{ value }}" placeholder="请输入搜索关键词" bind:search="onSearch"
bind:change="onChange" bind:clear="onClear" />
</view>
<view class="px-main w-full pb-main" wx:if="{{!isSearch || !list.length || !value}}">
<view class=" pt-main flex flex-wrap justify-between items-center sticky top-[99rpx] bg-fff">
<view class="">搜索</view>
<i class="iconfont icon-shanchu text-40" bind:tap="clearHistory" />
</view>
<view class="flex flex-wrap pt-12">
<view
class="h-48 border-2 border-[#FDBAC5] text-[#F9637B] mr-24 px-24 flex- items-center rounded-full max-w-full break-all line-clamp-1 mt-24"
wx:for="{{historyList}}" wx:key="*this" bind:tap="search" data-item="{{item}}">
{{item}}
</view>
</view>
</view>
<view class="p-main w-full" wx:if="{{list.length}}">
<view class="grid grid-cols-3 gap-20 w-full">
<view class="pb-14" wx:for="{{list}}" wx:key="*this" bind:tap="openDetail" data-item="{{item}}">
<image src="{{item.cover || '/static/no-img.png'}}" mode="aspectFill"
class="w-full h-370 rounded-16 align-bottom" />
<view class="text-24 line-clamp-2 pt-16">{{item.name}}</view>
</view>
</view>
</view>
<van-empty description="没有搜索结果" wx:if="{{ isSearch && list.length===0}}" />
</view>