40 lines
2.8 KiB
Plaintext
40 lines
2.8 KiB
Plaintext
<!--components/wan-select/select.wxml-->
|
|
<view class="w100 select_all_view">
|
|
<!-- 标题,可以没有 -->
|
|
<view class="mr-10 pt-10 size-28" style="width: {{titleWidth}};" wx:if="{{title}}">{{title}}</view>
|
|
<view class="select_view relative" style="width: {{title ? 'calc(100% - ' + titleWidth + ' - 10rpx)' : '100%'}};max-width: {{title ? 'calc(100% - ' + titleWidth + ' - 10rpx)' : '100%'}};">
|
|
<view class="inputPlaceholder h100 w100 radius-10 relative flex_l pd-10 {{ disabled ? 'gray-3' : 'black' }}" bindtap="{{disabled || readonly ? '' : 'changeShow'}}" style="background: {{disabled ?'#f5f7fa' : bgColor}};border: 2rpx solid #ddd;">
|
|
<block wx:if="{{disabled || readonly}}">
|
|
<view class="flex-1" wx:if="{{selectLabel}}">{{selectLabel}}</view>
|
|
<view class="flex-1 gray-3 line-1" wx:else>{{placeholder}}</view>
|
|
<van-icon class="gray-3" name="arrow-down" />
|
|
</block>
|
|
<block wx:else>
|
|
<block wx:if="{{selectLabel}}">
|
|
<!-- <view class="flex-1">{{selectLabel}}</view>
|
|
<van-icon class="gray-3" name="clear" wx:if='{{!show}}' catchtap="clearInput" />
|
|
<van-icon class="gray-3" name="arrow-up" wx:else /> -->
|
|
<view class="flex-1">{{selectLabel}}</view>
|
|
<van-icon class="gray-3" name="arrow-down" wx:if='{{!show}}' />
|
|
<van-icon class="gray-3" name="arrow-up" wx:else />
|
|
</block>
|
|
<block wx:else>
|
|
<view class="flex-1 gray-3 line-1">{{placeholder}}</view>
|
|
<van-icon class="gray-3" name="arrow-down" class="transfer {{show ? 'is-reverse' : 'no-reverse' }}" />
|
|
</block>
|
|
</block>
|
|
</view>
|
|
<!-- 下拉展开后的可选择内容 -->
|
|
<block wx:if='{{show}}'>
|
|
<view class="{{toTop ? 'triangleBox-top' : 'triangleBox'}}">
|
|
<view class="{{toTop ? 'triangle-top' : 'triangle'}}"></view>
|
|
</view>
|
|
<view class="content radius-10 pd-20 size-28" style="{{toTop ? 'top: -' + (options.length > 4 ? 296 : (options.length * 64 + 40)) + 'rpx; margin-top: -10rpx;' : 'margin-top: 10rpx;'}}">
|
|
<view class="pd-10 center gray-3" wx:if="{{options.length < 1}}">暂无数据</view>
|
|
<view class="line-1 w100 pd-10 contentItem {{item[valueName] == selectValue ? 'bold':''}}" wx:for="{{options}}" wx:key="index" bindtap="handleChange" data-item="{{item}}" style="color: {{ item[valueName] == selectValue ? textColor : '#000'}}; background: {{item[valueName] == selectValue ? itemBgColor:''}};">
|
|
{{item[labelName]}}
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</view> |