Files
danyang-match/miniapp/components/photo-uploader/index.wxml
T

46 lines
1.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<view class="ui-photo">
<view class="ui-photo__list">
<view
wx:for="{{photos}}"
wx:key="index"
class="ui-photo__item"
data-index="{{index}}"
bindtap="onTap"
>
<image class="ui-photo__img" src="{{item.url}}" mode="aspectFill" />
<view wx:if="{{item.status && item.status !== 'uploaded'}}" class="ui-photo__status">
<ui-status-badge
kind="{{photoStatusKindMap[item.status]}}"
label="{{photoStatusLabelMap[item.status]}}"
/>
</view>
<view
wx:if="{{!readonly && item.status !== 'uploading'}}"
class="ui-photo__remove"
catchtap="onRemove"
data-index="{{index}}"
>×</view>
<view
wx:if="{{item.status === 'failed'}}"
class="ui-photo__retry"
catchtap="onRetry"
data-index="{{index}}"
>重试</view>
<view wx:if="{{item.status === 'uploading'}}" class="ui-photo__mask">
<view class="ui-photo__spinner"></view>
</view>
</view>
<view
wx:if="{{!readonly && photos.length < max}}"
class="ui-photo__add"
bindtap="onAdd"
>
<view class="ui-photo__add-icon">+</view>
<text class="ui-photo__add-text">{{photos.length}}/{{max}}</text>
</view>
</view>
<view class="ui-photo__hint">
<text>最多 {{max}} 张,建议真人生活照,避免过度美颜</text>
</view>
</view>