纸通宝小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

53 lines
2.7 KiB

<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">城市选择</view>
</cu-custom>
<view class="bg-white">
<free-input value="{{value}}" placeholder="请输入城市首字母或者城市名称" bind:input="getInputValue"
bind:close="closeInput" close="{{true}}"></free-input>
</view>
<scroll-view scroll-y scroll-into-view="{{scrollViewId}}" style="height:{{height}}rpx">
<!-- 查询城市 -->
<view wx:if="{{value}}">
<view class="bg-white" wx:for="{{searchResult}}" style="padding: 0rpx 32rpx" wx:key="index">
<view class="solid-bottom" style="padding: 24rpx 0rpx;" bindtap="lookItem" data-index="{{index}}">{{item.name}}</view>
</view>
</view>
<view wx:else>
<view class="bg-white flex flex-justify" style="padding: 8rpx 72rpx 16rpx 32rpx;">
<view class="text-df">
<text class="text-gray">当前城市:</text>
<text class="text-blue">{{nowCity || '暂无'}}</text>
</view>
<view class="text-df">
<text class="text-gray">定位城市:</text>
<text class="text-black">{{localCity || '暂无定位城市'}}</text>
</view>
</view>
<!-- 热门城市 -->
<view wx:if="{{hotCity.length}}">
<view class="text-df text-gray" style="padding: 12rpx 32rpx;">热门城市</view>
<view class="bg-white" style="padding: 8rpx 60rpx 24rpx 16rpx;">
<wux-grids col="4" bordered="{{ false }}">
<wux-grid wx:for="{{hotCity}}" wx:key="index" hover-class="none">
<view class="city-name-item" bindtap="lookItem" data-index="{{index}}">{{item.name}}</view>
</wux-grid>
</wux-grids>
</view>
</view>
<!-- 列表 -->
<view>
<block wx:for="{{lists}}" wx:for-index="pageIndex" wx:key="pageIndex" wx:for-item="pageItem" wx:if="{{pageItem.data[0]}}">
<view class="text-gray" style="padding: 12rpx 32rpx;" id="{{pageItem.letter}}">{{pageItem.letter}}</view>
<view class="bg-white" style="padding: 0rpx 32rpx" wx:for="{{pageItem.data}}" wx:key="index">
<view class="solid-bottom" style="padding: 24rpx 0rpx;" data-page="{{pageIndex}}" data-index="{{index}}" bindtap="lookItem">{{item.name}}</view>
</view>
</block>
</view>
</view>
</scroll-view>
<!-- 右侧定位 -->
<view wx:if="{{!value}}" class="list-bar" style="height:{{indexHeight}}rpx;top:{{titleHeight}}rpx"
catchtouchstart="touchStart" catchtouchmove="touchMove" catchtouchend="touchEnd" catchtouchcancel="touchEnd">
<text wx:for="{{lists}}" wx:key="index" class="list-text" style="height:{{itemHeight}}rpx;color:{{index == touchmoveIndex ? '#008AFF' : '#333333'}}">{{item.letter}}</text>
</view>
<view class="list-alert" wx:if="{{touchmove && lists[touchmoveIndex].letter}}">{{lists[touchmoveIndex].letter}}</view>