city-select.wxml 2.4 KB

1
  1. <view class="city-select"><scroll-view class="city-select-main" scroll-top="{{scrollTop}}" scroll-y="true" id="city-select-main" scroll-into-view="{{toView}}"><block wx:if="{{isSearch}}"><view class="city-serach"><input class="city-serach-input" placeholder="{{placeholder}}" data-event-opts="{{[['input',[['keyInput',['$event']]]]]}}" bindinput="__e"/></view></block><block wx:if="{{activeCity&&!serachCity}}"><view class="hot-title">当前定位城市</view></block><block wx:if="{{activeCity&&!serachCity}}"><view class="hot-city"><view data-event-opts="{{[['tap',[['cityTrigger',['$0'],['activeCity']]]]]}}" class="hot-item" bindtap="__e">{{activeCity[formatName]}}</view></view></block><block wx:if="{{$root.g0}}"><view class="hot-title">热门城市</view></block><block wx:if="{{$root.g1}}"><view class="hot-city"><block wx:for="{{hotCity}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['cityTrigger',['$0','hot'],[[['hotCity','',index]]]]]]]}}" class="hot-item" bindtap="__e">{{item[formatName]}}</view></block></view></block><block wx:if="{{!serachCity}}"><view class="citys"><block wx:for="{{sortItems}}" wx:for-item="city" wx:for-index="index" wx:key="index"><view hidden="{{!(city.isCity)}}" class="citys-row"><view class="citys-item-letter" id="{{'city-letter-'+(city.name==='#'?'0':city.name)}}">{{city.name}}</view><block wx:for="{{city.citys}}" wx:for-item="item" wx:for-index="inx" wx:key="inx"><view data-event-opts="{{[['tap',[['cityTrigger',['$0'],[[['sortItems','',index],['citys','',inx]]]]]]]}}" class="citys-item" bindtap="__e">{{item.cityName}}</view></block></view></block></view></block><block wx:if="{{serachCity}}"><view class="citys"><block wx:for="{{searchDatas}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="citys-row"><view data-event-opts="{{[['tap',[['cityTrigger',['$0'],[[['searchDatas','',index]]]]]]]}}" class="citys-item" bindtap="__e">{{item.name}}</view></view></block></view></block></scroll-view><block wx:if="{{!serachCity}}"><view class="city-indexs-view"><view class="city-indexs"><block wx:for="{{handleCity}}" wx:for-item="cityIns" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['cityindex',['$0'],[[['handleCity','',index,'forName']]]]]]]}}" hidden="{{!(cityIns.isCity)}}" class="city-indexs-text" bindtap="__e">{{''+cityIns.name+''}}</view></block></view></view></block></view>