12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <view class="{{classPrefix}} {{prefix}}-class">
- <t-grid gutter="{{gutter}}" border="{{false}}" align="center" column="{{column}}">
- <!-- 图片/视频 -->
- <t-grid-item
- wx:for="{{customFiles}}"
- wx:key="index"
- wx:for-item="file"
- t-class="{{classPrefix}}__grid {{classPrefix}}__grid-file"
- t-class-content="{{classPrefix}}__grid-content"
- >
- <view class="{{classPrefix}}__wrapper" slot="image" style="{{gridItemStyle}}">
- <t-image
- wx:if="{{file.type !== 'video'}}"
- bindtap="onProofTap"
- data-index="{{index}}"
- t-class="{{classPrefix}}__thumbnail"
- src="{{file.url}}"
- mode="{{imageProps.mode}}"
- error="{{imageProps.error}}"
- lazy="{{imageProps.lazy}}"
- loading="{{imageProps.loading}}"
- shape="{{imageProps.shape}}"
- webp="{{imageProps.webp}}"
- showMenuByLongpress="{{image.showMenuByLongpress}}"
- />
- <video
- wx:if="{{file.type === 'video'}}"
- class="{{classPrefix}}__thumbnail"
- src="{{file.url}}"
- controls
- autoplay="{{false}}"
- objectFit="contain"
- />
- <!-- 失败重试 -->
- <view
- data-index="{{index}}"
- wx:if="{{file.percent !== undefined && file.percent !== 100}}"
- class="{{classPrefix}}__progress-mask"
- >
- <view wx:if="{{file.percent === -1}}" class="{{classPrefix}}__progress-failed">
- <t-icon name="refresh" size="45rpx" color="#fff" />
- </view>
- <view wx:else class="{{classPrefix}}__progress-value">{{file.percent}}%</view>
- </view>
- <!-- 删除 -->
- <view class="{{classPrefix}}__close-btn hotspot-expanded" bindtap="onDelete" data-index="{{index}}">
- <slot wx:if="{{deleteBtn === 'slot'}}" name="deleteBtn" />
- <t-icon wx:else name="close" size="34rpx" color="#fff" />
- </view>
- </view>
- </t-grid-item>
- <!-- 添加 -->
- <t-grid-item
- wx:if="{{customLimit > 0}}"
- t-class="{{classPrefix}}__grid"
- t-class-content="{{classPrefix}}__grid-content"
- bindclick="onAddTap"
- >
- <view class="{{classPrefix}}__wrapper" slot="image" style="{{gridItemStyle}}">
- <view class="{{classPrefix}}__add-icon">
- <slot wx:if="{{addContent === 'slot'}}" name="addContent" />
- <t-icon wx:else name="add" size="40rpx" color="rgba(0,0,0,0.26)" />
- </view>
- </view>
- </t-grid-item>
- </t-grid>
- </view>
|