location.wxml 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. <view class='list-city'>
  2. <!-- 城市列表 -->
  3. <scroll-view scroll-y="true" style="height:100%;" scroll-into-view="{{scrollTopId}}" scroll-with-animation="true" enable-back-to-top="true">
  4. <view class='item' style="padding-bottom:25rpx;">
  5. <view class='py'>当前城市</view>
  6. <view class='fullname hot-city' data-name="{{city}}" bindtap='selectCity'>{{city}}</view>
  7. </view>
  8. <!-- 热门城市 -->
  9. <view class='item' style="padding-bottom:25rpx;">
  10. <view class='py' id="hot">热门城市</view>
  11. <view style="width:720rpx;margin-right:30rpx">
  12. <view class="hot-city" wx:for="{{hotCityData}}" wx:key="key" data-name="{{item.name}}" data-lat="{{item.location.lat}}" data-lng="{{item.location.lng}}" bindtap='selectCity'>{{item.fullname}}
  13. </view>
  14. </view>
  15. </view>
  16. <!-- 全部 -->
  17. <view class='item' wx:for="{{cityData}}" wx:for-index="idx" wx:for-item="group" wx:key="key">
  18. <view class='py' id="{{idx}}">{{idx}}</view>
  19. <view class="fullname" wx:for="{{group}}" wx:key="key" data-name="{{item.name}}" data-lat="{{item.location.lat}}" data-lng="{{item.location.lng}}" bindtap='selectCity'>{{item.fullname}}
  20. </view>
  21. </view>
  22. </scroll-view>
  23. <!-- 首字母 -->
  24. <view class='city-py' bindtouchstart="tStart" bindtouchend="tEnd" catchtouchmove="tMove">
  25. <view wx:for="{{_py}}" wx:key="key" bindtouchstart="getPy" bindtouchend="setPy" id="{{item}}">{{item == 'hot' ? "★" : item}}
  26. </view>
  27. </view>
  28. </view>
  29. <!--选择显示-->
  30. <view hidden="{{hidden}}" class="showPy">{{showPy == 'hot' ? "★" : showPy}}</view>