12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <!--components/input/index.wxml-->
- <!-- 单行文本 -->
- <van-cell border="{{ false }}" class="label-sm" wx:if="{{type == 'text'}}">
- <view slot="title">
- <text class="{{value?'text-green':'text-red'}}" wx:if="{{isRequired}}">*</text>
- <text class="van-cell-text">{{title}}</text>
- </view>
- <input type="{{inputType}}" maxlength="{{maxLength}}" value="{{value}}" placeholder="{{placeholder}}" bindinput="getValue" disabled="{{disabled}}" />
- </van-cell>
- <!-- 多行文本 -->
- <van-cell border="{{ false }}" class="label-sm" wx:if="{{type === 'textarea'}}">
- <view slot="title">
- <text class="{{value?'text-green':'text-red'}}">*</text>
- <text class="van-cell-text">{{title}}</text>
- </view>
- <textarea style="width: 100%;" value="{{value}}" placeholder="{{placeholder}}" auto-height="{{true}}" bindinput="getValue" disabled="{{disabled}}" />
- </van-cell>
- <!-- 日期选择器 -->
- <van-cell border="{{ false }}" class="label-sm" wx:if="{{type === 'date'}}">
- <view slot="title">
- <text wx:if="{{isRequired}}" class="{{value?'text-green':'text-red'}}">*</text>
- <text class="van-cell-text">{{title}}</text>
- </view>
- <picker class="picker" mode="date" value="{{value}}" data-type="date" start="{{startDate}}" end="{{endDate}}" bindchange="getValue" disabled="{{disabled}}">
- <text class="pick-text">{{value ?value:placeholder}}</text>
- <van-icon class="icon" name="arrow" />
- </picker>
- </van-cell>
- <!-- 时间选择器 -->
- <van-cell border="{{ false }}" class="label-sm" wx:if="{{type === 'time' }}">
- <view slot="title">
- <text wx:if="{{isRequired}}" class="{{value?'text-green':'text-red'}}">*</text>
- <text class="van-cell-text">{{title}}</text>
- </view>
- <picker class="picker" mode="time" value="{{value}}" data-type="time" bindchange="getValue" disabled="{{disabled}}" start="{{startTime}}" end="{{endTime}}">
- <text class="pick-text">{{value ?value:placeholder}}</text>
- <van-icon class="icon" name="arrow" />
- </picker>
- </van-cell>
- <!-- 计数器 -->
- <van-cell border="{{ false }}" class="label-sm" wx:if="{{type === 'stepper'}}">
- <view slot="title">
- <text wx:if="{{isRequired}}" class="{{value?'text-green':'text-red'}}">*</text>
- <text class="van-cell-text">{{title}}</text>
- </view>
- <van-stepper value="{{ value }}" bind:change="getValue" data-type="1" integer max="{{stepperMax}}" min="{{1}}" />
- </van-cell>
- <!-- 单选 -->
- <van-cell border="{{ false }}" class="label-sm" wx:if="{{type === 'radio'}}" title-width="200rpx">
- <view slot="title">
- <text class="{{value?'text-green':'text-red'}}" wx:if="{{isRequired}}">*</text>
- <text class="van-cell-text">{{title}}</text>
- </view>
- <van-radio-group value="{{ value }}" bind:change="getValue" data-type="1">
- <van-radio class="dis" wx:for="{{listErgodic}}" wx:key="index" name="{{item[key1]}}">{{item[name1]}}</van-radio>
- </van-radio-group>
- </van-cell>
- <!-- 单张照片 -->
- <van-cell border="{{ false }}" class="label-sm" wx:if="{{type === 'image'}}">
- <view slot="title">
- <text class="{{value?'text-green':'text-red'}}" wx:if="{{isRequired}}">*</text>
- <text class="van-cell-text">{{title}}</text>
- </view>
- <view bindtap="ChooseImage" class="img">
- <view wx:if="{{value}}" class="have-photo">
- <image src="{{value}}" />
- <van-icon name="clear" size="40rpx" class="clear-icon" catchtap="clearImg" />
- </view>
- <view wx:else class="default-photo">
- <van-icon name="photo-o" size="50rpx" color="#E0E1E5" />
- </view>
- </view>
- </van-cell>
|