|
|
|
@ -534,13 +534,12 @@ |
|
|
|
|
|
|
|
|
|
|
|
<view style="font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 12rpx; margin-left: 10rpx;">地区</view> |
|
|
|
<view |
|
|
|
class="region-picker input" |
|
|
|
bindtap="openCreateRegionModal" |
|
|
|
style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block;" |
|
|
|
> |
|
|
|
<text>{{newSupply.region || '请选择省市区'}}</text> |
|
|
|
</view> |
|
|
|
<view bindtap="openCreateRegionModal" style="width: 100%; height: 90rpx; line-height: 90rpx; padding: 0 24rpx; font-size: 30rpx; border: 2rpx solid #eee; border-radius: 12rpx; box-sizing: border-box; margin: 0 auto 30rpx; display: block; background: white; position: relative; z-index: 1;"> |
|
|
|
<view style="display: flex; justify-content: space-between; align-items: center;"> |
|
|
|
<text>{{newSupply.region || '请选择省市区'}}</text> |
|
|
|
<text style="color: #999;">▼</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view style="display: flex; justify-content: space-between; margin-top: 20rpx; margin-bottom: 20rpx; gap: 20rpx;"> |
|
|
|
<button bindtap="hideModal" style="flex: 1; height: 90rpx; line-height: 90rpx; background-color: #f5f5f5; color: #666; font-size: 30rpx; border-radius: 12rpx; margin: 0; display: flex; align-items: center; justify-content: center;">取消</button> |
|
|
|
@ -857,7 +856,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 地区选择弹窗 --> |
|
|
|
<view class="region-select-modal" wx:if="{{showRegionSelectModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; z-index: 9999;" catchtouchmove="true"> |
|
|
|
<view class="region-select-modal" wx:if="{{showRegionSelectModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; z-index: 9999;"> |
|
|
|
<view style="position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 20rpx 20rpx 0 0; max-height: 80vh;"> |
|
|
|
<!-- 顶部操作栏:取消和确定按钮 --> |
|
|
|
<view style="padding: 20rpx; display: flex; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #eee;"> |
|
|
|
@ -865,44 +864,80 @@ |
|
|
|
<view bindtap="confirmRegionSelection" style="font-size: 32rpx; color: #07c160; padding: 10rpx 20rpx;">确定</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 搜索框区域 --> |
|
|
|
<view style="padding: 20rpx;"> |
|
|
|
<view style="position: relative; background: #f5f5f5; border-radius: 40rpx; padding: 0 30rpx;"> |
|
|
|
<!-- 搜索框 --> |
|
|
|
<view style="padding: 12rpx 20rpx; border-bottom: 1rpx solid #eee;"> |
|
|
|
<view class="search-box-compact"> |
|
|
|
<text class="search-icon-text">🔍</text> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
placeholder="搜索地区" |
|
|
|
value="{{currentRegionMode === 'create' ? regionSearchKeyword : editRegionSearchKeyword}}" |
|
|
|
bindinput="{{currentRegionMode === 'create' ? 'onRegionSearchInput' : 'onEditRegionSearchInput'}}" |
|
|
|
confirm-type="search" |
|
|
|
style="width: 100%; height: 70rpx; line-height: 70rpx; font-size: 28rpx; background: transparent;" |
|
|
|
class="search-input-compact" |
|
|
|
placeholder="搜索地区" |
|
|
|
value="{{currentRegionMode === 'create' ? regionSearchKeyword : editRegionSearchKeyword}}" |
|
|
|
bindinput="onRegionSearchInput" |
|
|
|
bindfocus="onRegionSearchFocus" |
|
|
|
/> |
|
|
|
<view |
|
|
|
wx:if="{{currentRegionMode === 'create' ? regionSearchKeyword : editRegionSearchKeyword}}" |
|
|
|
bindtap="{{currentRegionMode === 'create' ? 'clearRegionSearch' : 'clearEditRegionSearch'}}" |
|
|
|
style="position: absolute; right: 30rpx; top: 50%; transform: translateY(-50%); color: #999;" |
|
|
|
> |
|
|
|
✕ |
|
|
|
</view> |
|
|
|
<image |
|
|
|
class="clear-icon-compact" |
|
|
|
wx:if="{{(currentRegionMode === 'create' && regionSearchKeyword) || (currentRegionMode === 'edit' && editRegionSearchKeyword)}}" |
|
|
|
src="/images/close.png" |
|
|
|
mode="aspectFit" |
|
|
|
bindtap="clearRegionSearch" |
|
|
|
></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 地区列表 --> |
|
|
|
<!-- 显示当前选择的地区 --> |
|
|
|
<view style="padding: 20rpx; text-align: center; color: #666; font-size: 28rpx; border-bottom: 1rpx solid #f0f0f0;"> |
|
|
|
当前选择: {{regionOptions[selectedProvinceIndex].name}} {{currentCities[selectedCityIndex].name}} {{currentDistricts[selectedDistrictIndex]}} |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 搜索结果区域 --> |
|
|
|
<scroll-view |
|
|
|
scroll-y="true" |
|
|
|
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch;" |
|
|
|
enable-back-to-top="false" |
|
|
|
wx:if="{{showSearchResults}}" |
|
|
|
style="max-height: 200rpx; border-bottom: 1rpx solid #eee;" |
|
|
|
scroll-y |
|
|
|
> |
|
|
|
<view |
|
|
|
wx:for="{{filteredRegionOptions}}" |
|
|
|
wx:key="index" |
|
|
|
class="region-item {{selectedRegionIndex === index ? 'selected' : ''}}" |
|
|
|
bindtap="selectRegion" |
|
|
|
data-index="{{index}}" |
|
|
|
style="padding: 32rpx 40rpx; border-bottom: 1rpx solid #f0f0f0; font-size: 32rpx; color: {{selectedRegionIndex === index ? '#07c160' : '#131413'}}; text-align: center;" |
|
|
|
wx:key="item" |
|
|
|
class="search-result-item" |
|
|
|
bindtap="selectSearchRegion" |
|
|
|
data-region="{{item.region}}" |
|
|
|
data-province-index="{{item.provinceIndex}}" |
|
|
|
data-city-index="{{item.cityIndex}}" |
|
|
|
data-district-index="{{item.districtIndex}}" |
|
|
|
> |
|
|
|
{{item}} |
|
|
|
{{item.region}} |
|
|
|
</view> |
|
|
|
<view wx:if="{{filteredRegionOptions.length === 0}}" style="padding: 20rpx; text-align: center; color: #999;"> |
|
|
|
未找到匹配的地区 |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
<!-- 三级联动地区选择器 --> |
|
|
|
<view style="height: 400rpx; padding: 20rpx 0;"> |
|
|
|
<picker-view |
|
|
|
indicator-style="height: 60rpx; background-color: rgba(245, 245, 245, 0.8);" |
|
|
|
style="width: 100%; height: 100%;" |
|
|
|
value="{{[selectedProvinceIndex, selectedCityIndex, selectedDistrictIndex]}}" |
|
|
|
bindchange="onRegionChange" |
|
|
|
> |
|
|
|
<picker-view-column> |
|
|
|
<view wx:for="{{regionOptions}}" wx:key="index" style="line-height: 60rpx; text-align: center; font-size: 32rpx;"> |
|
|
|
{{item.name}} |
|
|
|
</view> |
|
|
|
</picker-view-column> |
|
|
|
<picker-view-column> |
|
|
|
<view wx:for="{{currentCities}}" wx:key="index" style="line-height: 60rpx; text-align: center; font-size: 32rpx;"> |
|
|
|
{{item.name}} |
|
|
|
</view> |
|
|
|
</picker-view-column> |
|
|
|
<picker-view-column> |
|
|
|
<view wx:for="{{currentDistricts}}" wx:key="index" style="line-height: 60rpx; text-align: center; font-size: 32rpx;"> |
|
|
|
{{item}} |
|
|
|
</view> |
|
|
|
</picker-view-column> |
|
|
|
</picker-view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|