|
29 | 29 | <t-image
|
30 | 30 | wx:if="{{file.type !== 'video'}}"
|
31 | 31 | data-file="{{file}}"
|
32 |
| - bind:tap="onProofTap" |
33 | 32 | data-index="{{index}}"
|
34 | 33 | t-class="{{classPrefix}}__thumbnail"
|
35 | 34 | style="{{imageProps && imageProps.style || ''}}"
|
|
41 | 40 | shape="{{imageProps && imageProps.shape || 'round'}}"
|
42 | 41 | webp="{{imageProps && imageProps.webp || false}}"
|
43 | 42 | showMenuByLongpress="{{imageProps && imageProps.showMenuByLongpress || false}}"
|
| 43 | + bind:tap="onProofTap" |
44 | 44 | />
|
45 | 45 | <video
|
46 |
| - data-file="{{file}}" |
47 |
| - bind:tap="onFileClick" |
48 | 46 | wx:if="{{file.type === 'video'}}"
|
49 | 47 | class="{{classPrefix}}__thumbnail"
|
50 | 48 | src="{{file.url}}"
|
51 | 49 | poster="{{ file.thumb }}"
|
52 | 50 | controls
|
53 | 51 | autoplay="{{false}}"
|
54 | 52 | objectFit="contain"
|
| 53 | + data-file="{{file}}" |
| 54 | + bind:tap="onFileClick" |
55 | 55 | />
|
56 | 56 | <!-- 失败重试 -->
|
57 | 57 | <view
|
58 |
| - data-index="{{index}}" |
59 | 58 | wx:if="{{file.status && file.status != 'done'}}"
|
60 | 59 | class="{{classPrefix}}__progress-mask"
|
| 60 | + data-index="{{index}}" |
61 | 61 | data-file="{{file}}"
|
62 | 62 | bind:tap="onFileClick"
|
63 | 63 | >
|
|
73 | 73 |
|
74 | 74 | <!-- 删除 -->
|
75 | 75 | <view
|
| 76 | + wx:if="{{ _.isBoolean(file.removeBtn) ? file.removeBtn : removeBtn}}" |
76 | 77 | class="{{classPrefix}}__close-btn hotspot-expanded"
|
77 |
| - bindtap="onDelete" |
78 | 78 | data-index="{{index}}"
|
79 | 79 | aria-role="button"
|
80 | 80 | aria-label="删除"
|
| 81 | + bindtap="onDelete" |
81 | 82 | >
|
82 | 83 | <t-icon name="close" size="32rpx" color="#fff" />
|
83 | 84 | </view>
|
|
86 | 87 |
|
87 | 88 | <!-- 添加 -->
|
88 | 89 | <t-grid-item
|
89 |
| - wx:if="{{customLimit > 0}}" |
| 90 | + wx:if="{{ addBtn && customLimit > 0}}" |
90 | 91 | t-class="{{classPrefix}}__grid"
|
91 | 92 | t-class-content="{{classPrefix}}__grid-content"
|
92 |
| - bindclick="onAddTap" |
93 | 93 | aria-label="上传"
|
| 94 | + bindclick="onAddTap" |
94 | 95 | >
|
95 | 96 | <view class="{{classPrefix}}__wrapper" style="{{gridItemStyle}}">
|
96 | 97 | <slot name="add-content" />
|
|
112 | 113 | >
|
113 | 114 | <view
|
114 | 115 | class="{{classPrefix}}__drag-item"
|
| 116 | + style="width: {{100 / column}}%; --td-upload-drag-transition-duration: {{transition.duration}}ms; --td-upload-drag-transition-timing-function: {{transition.timingFunction}}" |
115 | 117 | wx:for="{{customFiles}}"
|
116 | 118 | wx:key="url"
|
117 | 119 | wx:for-item="file"
|
118 |
| - style="width: {{100 / column}}%; --td-upload-drag-transition-duration: {{transition.duration}}ms; --td-upload-drag-transition-timing-function: {{transition.timingFunction}}" |
| 120 | + data-index="{{index}}" |
119 | 121 | bind:longpress="{{handler.longPress}}"
|
120 | 122 | catch:touchmove="{{dragging ? handler.touchMove : ''}}"
|
121 | 123 | catch:touchend="{{dragging ? handler.touchEnd : ''}}"
|
122 |
| - data-index="{{index}}" |
123 | 124 | >
|
124 | 125 | <!-- 图片/视频 -->
|
125 | 126 | <t-grid-item
|
|
137 | 138 | <t-image
|
138 | 139 | wx:if="{{file.type !== 'video'}}"
|
139 | 140 | data-file="{{file}}"
|
140 |
| - bind:tap="onProofTap" |
141 | 141 | data-index="{{index}}"
|
142 | 142 | t-class="{{classPrefix}}__thumbnail"
|
143 | 143 | style="{{imageProps && imageProps.style || ''}}"
|
|
149 | 149 | shape="{{imageProps && imageProps.shape || 'round'}}"
|
150 | 150 | webp="{{imageProps && imageProps.webp || false}}"
|
151 | 151 | showMenuByLongpress="{{imageProps && imageProps.showMenuByLongpress || false}}"
|
| 152 | + bind:tap="onProofTap" |
152 | 153 | />
|
153 | 154 | <video
|
154 |
| - data-file="{{file}}" |
155 |
| - bind:tap="onFileClick" |
156 | 155 | wx:if="{{file.type === 'video'}}"
|
157 | 156 | class="{{classPrefix}}__thumbnail"
|
158 | 157 | src="{{file.url}}"
|
159 | 158 | poster="{{ file.thumb }}"
|
160 | 159 | controls
|
161 | 160 | autoplay="{{false}}"
|
162 | 161 | objectFit="contain"
|
| 162 | + data-file="{{file}}" |
| 163 | + bind:tap="onFileClick" |
163 | 164 | />
|
164 | 165 | <!-- 失败重试 -->
|
165 | 166 | <view
|
166 |
| - data-index="{{index}}" |
167 | 167 | wx:if="{{file.status && file.status != 'done'}}"
|
168 | 168 | class="{{classPrefix}}__progress-mask"
|
| 169 | + data-index="{{index}}" |
169 | 170 | data-file="{{file}}"
|
170 | 171 | bind:tap="onFileClick"
|
171 | 172 | >
|
|
191 | 192 |
|
192 | 193 | <!-- 删除 -->
|
193 | 194 | <view
|
| 195 | + wx:if="{{ _.isBoolean(file.removeBtn) ? file.removeBtn : removeBtn}}" |
194 | 196 | class="{{classPrefix}}__close-btn hotspot-expanded"
|
195 |
| - bindtap="onDelete" |
196 | 197 | data-index="{{index}}"
|
197 | 198 | data-url="{{file.url}}"
|
198 | 199 | aria-role="button"
|
199 | 200 | aria-label="删除"
|
| 201 | + bindtap="onDelete" |
200 | 202 | >
|
201 | 203 | <t-icon name="close" size="32rpx" color="#fff" />
|
202 | 204 | </view>
|
203 | 205 | </view>
|
204 | 206 | </t-grid-item>
|
205 |
| - <!-- 添加 --> |
206 | 207 | </view>
|
207 |
| - <view class="{{classPrefix}}__drag-item" style="width: {{100 / column}}%" wx:if="{{customLimit > 0}}"> |
| 208 | + <!-- 添加 --> |
| 209 | + <view wx:if="{{addBtn && customLimit > 0}}" class="{{classPrefix}}__drag-item" style="width: {{100 / column}}%"> |
208 | 210 | <t-grid-item
|
209 | 211 | t-class="{{classPrefix}}__grid"
|
210 | 212 | t-class-content="{{classPrefix}}__grid-content"
|
211 |
| - bindclick="onAddTap" |
212 | 213 | aria-label="上传"
|
213 | 214 | style="width: 100%"
|
| 215 | + bindclick="onAddTap" |
214 | 216 | >
|
215 | 217 | <view class="{{classPrefix}}__wrapper" style="{{gridItemStyle}}">
|
216 | 218 | <slot name="add-content" />
|
|
0 commit comments