search.wxml 3.55 KB
<!--pages/reserve/search.wxml-->
<nav id="nav">搜索</nav>
<view class="searchAddrView" style="height: {{navHeight+40}}px;">
    <view class="searchAddr flex-ll" style="margin-top: {{navHeight+5}}px;">
        <image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search26.png"></image>
        <input style="width: 100%;" placeholder="输入餐厅名或地名,快速订包间"
               type="text" confirm-type="done"
               focus
               bindinput="getsuggest" value="{{keyword}}"/>
        <image class="icon icon-del" wx:if="{{keyword.length>0}}"
               catchtap="clearKeyword"
               src="http://qn.colorcun.com/reserve/images/del.png"></image>
    </view>
</view>
<view class="pages">
    <view class="res-view">
        <!--绑定回填事件-->
        <block wx:for="{{suggestion}}" wx:key="index"
               bindtap="backfill" id="{{index}}">
            <search-item item="{{item}}" keyword="{{keyword}}" bindclick="searchItemClick"></search-item>
            <view wx:if="{{index==1 && hasSellerMore}}" class="see-more" bindtap="gotoList"></view>
            <view wx:if="{{index==sellerSplit && sellerSplit>-1}}" class="see-split"></view>
        </block>
        <view class="see-more bottom" wx:if="{{suggestion.length>0}}"></view>
    </view>
</view>
<view class="history" wx:if="{{suggestion.length<1}}">
    <view wx:if="{{keyword.length>0}}">
        <view class="flex-vc empty">
            <block wx:if="{{!hasFirstShow}}">
                <image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
                <view class="empty-t1">抱歉,没有找到符合的内容</view>
                <view class="empty-t2">试试搜搜别的</view>
            </block>
        </view>
        <view class="rsl-block" wx:if="{{rsl.length>0}}">
            <view class="line-push">为你推荐</view>
            <view class="transverse-list">
                <swiper
                        indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
                        interval="2000" duration="500"
                        previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
                        current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
                    <block wx:for="{{rsl}}" wx:key="rsl.key">
                        <swiper-item bindtap="gotoSellerDetail" id="{{item.id}}">
                            <view class="seller" id="seller-{{item.id}}">
                                <sb-tr seller="{{item}}"
                                       hasActivityTags="{{false}}"
                                       hasActivityShort="{{true}}"
                                       hasBrand="true" hasActivityTese="true"
                                       hasSlogan="{{false}}"></sb-tr>
                            </view>
                        </swiper-item>
                    </block>
                </swiper>
            </view>
        </view>
    </view>
    <view class="pages" wx:elif="{{history.length>0}}">
        <view class="flex-lr">
            <view class="history-title">最近搜索</view>
            <view class="history-empty" bindtap="historyEmpty"></view>
        </view>
        <view class="history-list">
            <block wx:for="{{history}}" wx:key="history.key">
                <search-item item="{{item}}" hasHistory bindclick="searchItemClick"></search-item>
            </block>
        </view>
    </view>
</view>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>