index.wxml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <view class='action-panel'>
  2. <view class='search-box'>
  3. <view class='search'>
  4. <i-icon type="search" size='20' color='#cbcdd3' />
  5. <input class='search-input' confirm-type="search" value="{{inputValue}}" bindblur='bindKeyInput' placeholder="输出城市名快速查找" placeholder-style="color:#cbcdd3;" />
  6. </view>
  7. <navigator open-type='navigateBack'>
  8. <text>取消</text>
  9. </navigator>
  10. </view>
  11. </view>
  12. <view hidden='{{inputValue}}'>
  13. <block wx:if="{{isShowLetter}}">
  14. <view class="showSlectedLetter">
  15. {{showLetter}}
  16. </view>
  17. </block>
  18. <view class="searchLetter touchClass">
  19. <view wx:for="{{searchLetter}}" style="height:{{itemH}}px" wx:key="index" data-letter="{{item.name}}" catchtouchstart="searchStart" catchtouchmove="searchMove" catchtouchend="searchEnd">{{item.name}}</view>
  20. </view>
  21. <scroll-view scroll-y="true" style="height:{{winHeight}}px" bindscroll="bindScroll" scroll-into-view="{{showLetter}}">
  22. <view class="selection" wx:for="{{cityList}}" wx:key="{{item.firstNameLetter}}" id="{{item.firstNameLetter}}">
  23. <block wx:if="{{index===0}}">
  24. <view class='panel'>定位城市</view>
  25. <view class='location_city'>
  26. <view class="btn active" data-text="{{city}}" data-code="{{cityCode}}" bindtap="wxSortPickerViewItemTap">{{city}}</view>
  27. <view class='position' catchtap="cxgps">
  28. <i-icon type="refresh" />
  29. <text>重新定位</text>
  30. </view>
  31. </view>
  32. <view class='panel' wx:if="{{hotList.length}}">热门城市</view>
  33. <view class='hot_city' wx:if="{{hotList.length}}">
  34. <view class="btn" wx:for="{{hotList}}" wx:key="*this" wx:for-index="idx" wx:for-item="cityName" data-text="{{cityName}}" data-code="{{hotCodeList[idx]}}" bindtap="wxSortPickerViewItemTap">{{cityName}}</view>
  35. </view>
  36. </block>
  37. <view class="item_letter">{{item.firstNameLetter}}</view>
  38. <view class="item_city" wx:for="{{item.cityInfo}}" wx:for-item="ct" wx:key="{{ct.cityCode}}" wx:for-index="idx" data-text="{{ct.cityName}}" data-code='{{ct.cityCode}}' bindtap="wxSortPickerViewItemTap">
  39. {{ct.cityName}}
  40. </view>
  41. </view>
  42. </scroll-view>
  43. </view>
  44. <view class='result-list' wx:if="{{inputValue}}" style="margin-top:20px">
  45. <view class="item_city" wx:for="{{searchList}}" wx:key="*this" data-text="{{item.cityName}}" data-code="{{item.cityCode}}" bindtap="wxSortPickerViewItemTap">{{item.cityName}}</view>
  46. </view>