index.wxml 1.8 KB

12345678910111213141516171819202122232425
  1. <van-cell-group>
  2. <van-field wx:for="{{fromList}}" wx:key="{{item.label}}" data-item="{{item}}" data-index="{{index}}" value="{{ item.value }}" label="{{item.label}}" placeholder="{{item.placeholder}}" error='{{item.error}}' required='{{item.required}}' input-align='right' bind:change='inputChange' bind:clear='inputClear' clearable>
  3. <view class="section" wx:if="{{item.type=='date'}}" slot='input'>
  4. <picker mode="date" value="{{item.value}}" end="{{endTime}}" data-index="{{index}}" bindchange="bindDateChange">
  5. <view class="picker" style="color:{{item.error?'var(--field-input-error-text-color,#ee0a24)':'var(--field-input-text-color,#323233)'}}">
  6. <text wx:if="{{item.value==''}}" style="opacity:{{item.error?1:.4}}">请选择</text>
  7. <text wx:else>{{item.value}}</text>
  8. </view>
  9. </picker>
  10. </view>
  11. <!-- 性别选择器 -->
  12. <view class="section" wx:if="{{item.type=='sex'}}" slot='input' catchtap="seleteSex">
  13. <view class="picker">
  14. <text wx:if="{{item.value}}" style="color:rgba(0, 0, 0, 1) ;">{{item.value}}</text>
  15. <text wx:else>请选择</text>
  16. </view>
  17. </view>
  18. <slot name='slot' wx:if="{{item.type=='slot'}}" slot='input' />
  19. <slot name='slot1' wx:if="{{item.type=='custom'}}" slot='input' />
  20. <slot name='slot2' wx:if="{{item.type=='custom'}}" slot='input' />
  21. <slot name='slot3' wx:if="{{item.type=='custom'}}" slot='input' />
  22. <slot name='slot4' wx:if="{{item.type=='custom'}}" slot='input' />
  23. </van-field>
  24. </van-cell-group>
  25. <van-action-sheet show="{{ seleteSexShow }}" actions="{{ sexActions }}" bind:cancel='cancel' bind:select='handleSex' cancel-text="取消" />