forked from ant-design/ant-design-mini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.axml.tsx
90 lines (88 loc) · 2.84 KB
/
index.axml.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import Icon from '../Icon/index.axml';
import Loading from '../Loading/index.axml';
import { View, Slot, InternalData, TSXMLProps, Image } from 'tsxml';
import { IUploaderProps } from './props';
export default (
{ className,
style,
imageMode,
maxCount,
uploadingText,
uploadfailedText
}: TSXMLProps<IUploaderProps>,
{ mixin }: InternalData
) => (
<View class={`ant-image-upload ${className || ''}`} style={style || ''}>
{/* #if ALIPAY */}
<Slot fileList={mixin.value}>
{/* #endif */}
{mixin.value.map((item) => (
<View key={item.uid} class="ant-image-upload-show">
<View data-uid={item.uid} onTap="onRemove">
{/* #if ALIPAY */}
<Slot name="removeButton">
{/* #endif */}
<View class="ant-image-upload-close" />
{/* #if ALIPAY */}
</Slot>
{/* #endif */}
</View>
{/* #if ALIPAY */}
<Slot name="image" value={item}>
{/* #endif */}
{(item.status === 'uploading' || item.status === 'error') && (
<View class="ant-image-upload-cover">
{item.status === 'uploading' && (
<View class="ant-image-upload-cover-loading">
<Loading className="ant-image-upload-cover-loading-icon" />
<View class="ant-image-upload-cover-loading-text">
{uploadingText}
</View>
</View>
)}
{item.status === 'error' && (
<View class="ant-image-upload-cover-error">
<Icon
className="ant-image-upload-cover-error-icon"
type="CloseCircleOutline"
/>
<View class="ant-image-upload-cover-error-text">
{uploadfailedText}
</View>
</View>
)}
</View>
)}
<Image
class="ant-image-upload-image"
mode={imageMode}
src={item.url || item.path}
data-uid={item.uid}
onTap="onPreview"
/>
{/* #if ALIPAY */}
</Slot>
{/* #endif */}
</View>
))}
<View onTap="chooseImage">
{/* #if ALIPAY */}
<Slot name="uploadButton">
{/* #endif */}
{(!maxCount || mixin.value.length < maxCount) && (
<View class="ant-image-upload-add-image-wrapper">
<Icon
type="AddOutline"
className="ant-image-upload-add-image-icon"
/>
</View>
)}
{/* #if ALIPAY */}
</Slot>
{/* #endif */}
</View>
{/* #if ALIPAY */}
</Slot>
{/* #endif */}
</View>
);