纸通宝商家版本的小程序,原生微信开发。
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.
 

57 lines
3.2 KiB

<cu-custom bgColor="bg-white" isBack="{{true}}">
<view slot="content">城市选择</view>
</cu-custom>
<!-- <view class="bg-white" style="padding: 0rpx 32rpx;">
<free-input value="{{value}}" placeholder="请输入城市首字母或者城市名称" bind:input="getInputValue"
bind:close="closeInput" close="{{true}}"></free-input>
</view> -->
<van-search value="{{ value}}" shape="round" placeholder="请输入城市首字母或者城市名称" bind:change="onChange"></van-search>
<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" style="padding: 8rpx 72rpx 16rpx 32rpx;" wx:if="{{type == 0 || type == 1}}">
<view class="text-df">
<text class="text-gray">当前城市:</text>
<text class="text-blue">{{nowCity || '暂无'}}</text>
</view>
</view>
<view class="bg-white flex" style="padding: 8rpx 72rpx 16rpx 32rpx;" wx:if="{{type == 0 || type == 1}}">
<view class="text-df">
<text class="text-gray">定位城市:</text>
<view class="city-name-item" bindtap="lookNow" wx:if="{{localCity}}">{{localCity.cityName}}</view>
<text class="text-black" wx:else>暂无定位城市</text>
</view>
</view>
<!-- 历史城市 -->
<view wx:if="{{hotCity.length && (type == 0 || type == 1)}}">
<view class="text-df text-gray" style="padding: 12rpx 32rpx;">历史城市</view>
<view class="bg-white" style="padding: 8rpx 60rpx 24rpx 16rpx;">
<van-grid column-num="3" border="{{fasle}}">
<van-grid-item use-slot wx:for="{{ hotCity }}" wx:key="index" content-style="padding:12rpx">
<van-button plain custom-style="height:56rpx;width:150rpx;" data-index="{{index}}" bind:click="lookItem">{{item.name}}</van-button>
</van-grid-item>
</van-grid>
</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>