mali-applet-ui 1.0.25 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/ml-col/ml-col.vue +4 -3
- package/lib/components/ml-dict-type/ml-dict-type.vue +19 -19
- package/lib/components/ml-form-item/ml-form-item.vue +3 -0
- package/lib/components/ml-list-item/ml-list-item.vue +1 -0
- package/lib/components/ml-textarea/ml-textarea.vue +1 -1
- package/lib/components/ml-upload/ml-upload.vue +46 -3
- package/package.json +1 -1
- package/theme.scss +3 -0
|
@@ -46,10 +46,11 @@ export default {
|
|
|
46
46
|
$spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
|
|
47
47
|
37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
|
|
48
48
|
70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
|
|
49
|
-
&.is-light {
|
|
50
|
-
|
|
51
|
-
}
|
|
49
|
+
// &.is-light {
|
|
50
|
+
// color: rgba(0, 0, 0, 0.45);
|
|
51
|
+
// }
|
|
52
52
|
&.is-important {
|
|
53
|
+
color: $ml-font-color;
|
|
53
54
|
padding-bottom: 10rpx;
|
|
54
55
|
font-size: $ml-base-font-size;
|
|
55
56
|
}
|
|
@@ -121,50 +121,50 @@ export default {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
&.is-round {
|
|
124
|
-
padding:
|
|
124
|
+
padding: 6rpx 20rpx;
|
|
125
125
|
border-radius: $ml-border-radius;
|
|
126
|
-
font-size:
|
|
126
|
+
font-size: $ml-describe-font-size;
|
|
127
127
|
&.ss-primary {
|
|
128
|
-
color:
|
|
129
|
-
background:
|
|
128
|
+
color: $uni-color-primary;
|
|
129
|
+
background: #e0efff;
|
|
130
130
|
}
|
|
131
131
|
&.ss-success {
|
|
132
|
-
color:
|
|
133
|
-
background:
|
|
132
|
+
color: $uni-color-success;
|
|
133
|
+
background: #e0f5e8;
|
|
134
134
|
}
|
|
135
135
|
&.ss-info {
|
|
136
|
-
background: #
|
|
136
|
+
background: #eaebed;
|
|
137
137
|
}
|
|
138
138
|
&.ss-warning {
|
|
139
139
|
color: #ffffff;
|
|
140
140
|
background: $uni-color-warning;
|
|
141
141
|
}
|
|
142
142
|
&.ss-danger {
|
|
143
|
-
color:
|
|
144
|
-
background:
|
|
143
|
+
color: $uni-color-error;
|
|
144
|
+
background: #ffeaec;
|
|
145
145
|
}
|
|
146
146
|
&.ss-gray {
|
|
147
147
|
background: $ml-gray-color;
|
|
148
148
|
}
|
|
149
149
|
&.ss-blue {
|
|
150
|
-
color:
|
|
151
|
-
background:
|
|
150
|
+
color: $ml-blue-color;
|
|
151
|
+
background: #e0efff;
|
|
152
152
|
}
|
|
153
153
|
&.ss-green {
|
|
154
|
-
color:
|
|
155
|
-
background:
|
|
154
|
+
color: $ml-green-color;
|
|
155
|
+
background: #e0f5e8;
|
|
156
156
|
}
|
|
157
157
|
&.ss-pink {
|
|
158
|
-
color:
|
|
159
|
-
background:
|
|
158
|
+
color: $ml-pink-color;
|
|
159
|
+
background: #ffeaec;
|
|
160
160
|
}
|
|
161
161
|
&.ss-orange {
|
|
162
|
-
color:
|
|
163
|
-
background:
|
|
162
|
+
color: $ml-orange-color;
|
|
163
|
+
background: #ffedd6;
|
|
164
164
|
}
|
|
165
165
|
&.ss-purple {
|
|
166
|
-
color:
|
|
167
|
-
background:
|
|
166
|
+
color: $ml-purple-color;
|
|
167
|
+
background: #f2e9ff;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
&:not(.is-round) {
|
|
@@ -69,13 +69,45 @@ function normalizeChooseAndUploadFileRes (res, fileType) {
|
|
|
69
69
|
return res
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
function compressImages (tempFiles) {
|
|
73
|
+
return Promise.all(
|
|
74
|
+
tempFiles.map(tempFilePath => {
|
|
75
|
+
return new Promise(resolve => {
|
|
76
|
+
uni.compressImage({
|
|
77
|
+
src: tempFilePath,
|
|
78
|
+
quality: this.imageQuality,
|
|
79
|
+
success (compressRes) {
|
|
80
|
+
resolve(compressRes.tempFilePath)
|
|
81
|
+
},
|
|
82
|
+
fail () {
|
|
83
|
+
resolve(tempFilePath)
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
72
91
|
function uploadImageFiles (opts) {
|
|
73
92
|
return new Promise((resolve, reject) => {
|
|
74
93
|
uni.chooseImage({
|
|
75
94
|
count: opts.count || 9,
|
|
76
|
-
sourceType: opts.sourceType
|
|
77
|
-
|
|
78
|
-
|
|
95
|
+
sourceType: opts.sourceType,
|
|
96
|
+
// #ifdef MP-WEIXIN
|
|
97
|
+
sizeType: opts.sizeType,
|
|
98
|
+
// #endif
|
|
99
|
+
success (chooseRes) {
|
|
100
|
+
const rest = normalizeChooseAndUploadFileRes(chooseRes, 'image')
|
|
101
|
+
if (this.imageQuality) {
|
|
102
|
+
compressImages(rest.tempFiles).then((compressFiles) => {
|
|
103
|
+
resolve({
|
|
104
|
+
...rest,
|
|
105
|
+
tempFiles: compressFiles
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
} else {
|
|
109
|
+
resolve(rest)
|
|
110
|
+
}
|
|
79
111
|
},
|
|
80
112
|
fail (res) {
|
|
81
113
|
reject(res)
|
|
@@ -147,6 +179,15 @@ export default {
|
|
|
147
179
|
type: Object,
|
|
148
180
|
default: () => ({})
|
|
149
181
|
},
|
|
182
|
+
imageQuality: Number,
|
|
183
|
+
sizeType: {
|
|
184
|
+
type: Array,
|
|
185
|
+
default: () => ['original', 'compressed']
|
|
186
|
+
},
|
|
187
|
+
sourceType: {
|
|
188
|
+
type: Array,
|
|
189
|
+
default: () => ['album', 'camera']
|
|
190
|
+
},
|
|
150
191
|
getFileUrl: Function,
|
|
151
192
|
getThumbnailUrl: Function,
|
|
152
193
|
uploadFile: Function,
|
|
@@ -424,6 +465,8 @@ export default {
|
|
|
424
465
|
}
|
|
425
466
|
const uploadMethod = this.uploadFile ? this.uploadFile : (globalStore.upload ? globalStore.upload.uploadFile : null)
|
|
426
467
|
chooseMethod({
|
|
468
|
+
sizeType: this.sizeType,
|
|
469
|
+
sourceType: this.sourceType,
|
|
427
470
|
count: this.limit - this.fileList.length
|
|
428
471
|
}).then(res => {
|
|
429
472
|
const { tempFiles } = res
|
package/package.json
CHANGED