sadais-piui 1.2.7-beta169 → 1.2.7-beta170
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.
|
@@ -453,7 +453,7 @@ export default {
|
|
|
453
453
|
default() {
|
|
454
454
|
return uploadImg.disablePreview
|
|
455
455
|
}
|
|
456
|
-
}
|
|
456
|
+
}
|
|
457
457
|
},
|
|
458
458
|
data() {
|
|
459
459
|
return {
|
|
@@ -479,15 +479,16 @@ export default {
|
|
|
479
479
|
return this.disabled || (parent && parent.getDisabled)
|
|
480
480
|
},
|
|
481
481
|
actionSheetItems() {
|
|
482
|
-
const hasImage = this.fileTypes.includes('image')
|
|
483
|
-
const hasVideo = this.fileTypes.includes('video')
|
|
484
|
-
const mediaTypesTitle =
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
482
|
+
const hasImage = this.fileTypes.includes('image')
|
|
483
|
+
const hasVideo = this.fileTypes.includes('video')
|
|
484
|
+
const mediaTypesTitle =
|
|
485
|
+
hasImage && hasVideo
|
|
486
|
+
? '图片/视频'
|
|
487
|
+
: hasImage
|
|
488
|
+
? '图片'
|
|
489
|
+
: hasVideo
|
|
490
|
+
? '视频'
|
|
491
|
+
: ''
|
|
491
492
|
return [
|
|
492
493
|
{
|
|
493
494
|
id: 1,
|
|
@@ -690,7 +691,7 @@ export default {
|
|
|
690
691
|
content: `请选择${this.getExtension.join('、')}类型的文件上传`,
|
|
691
692
|
showCancel: false,
|
|
692
693
|
confirmText: '好的',
|
|
693
|
-
success:
|
|
694
|
+
success: res => {
|
|
694
695
|
if (res.confirm) {
|
|
695
696
|
this.handleChoose()
|
|
696
697
|
}
|
|
@@ -999,9 +1000,9 @@ export default {
|
|
|
999
1000
|
async handleChooseFile() {
|
|
1000
1001
|
const { sizeType, sourceType, crop, extension } = this.getChooseFileOpts
|
|
1001
1002
|
try {
|
|
1002
|
-
const hasImage = this.fileTypes.includes('image')
|
|
1003
|
-
const hasVideo = this.fileTypes.includes('video')
|
|
1004
|
-
const type = hasImage && hasVideo ? 'all' : hasImage ? 'image' : 'video'
|
|
1003
|
+
const hasImage = this.fileTypes.includes('image')
|
|
1004
|
+
const hasVideo = this.fileTypes.includes('video')
|
|
1005
|
+
const type = hasImage && hasVideo ? 'all' : hasImage ? 'image' : 'video'
|
|
1005
1006
|
|
|
1006
1007
|
const [cancel, result] = await uni.chooseFile({
|
|
1007
1008
|
count: this.getUploadMaxCount,
|
|
@@ -1172,21 +1173,21 @@ export default {
|
|
|
1172
1173
|
}
|
|
1173
1174
|
},
|
|
1174
1175
|
async handleChooseMedia() {
|
|
1175
|
-
if(this.type === 'all') {
|
|
1176
|
+
if (this.type === 'all') {
|
|
1176
1177
|
// 选择图片/视频
|
|
1177
|
-
const hasImage = this.fileTypes.includes('image')
|
|
1178
|
-
const hasVideo = this.fileTypes.includes('video')
|
|
1179
|
-
const sourceType = this.getChooseFileOpts.sourceType
|
|
1180
|
-
if(hasImage && hasVideo) {
|
|
1181
|
-
this.handleUniChooseMedia(['mix'], sourceType)
|
|
1182
|
-
} else if(hasImage) {
|
|
1183
|
-
this.handleUniChooseMedia(['image'], sourceType)
|
|
1184
|
-
} else if(hasVideo) {
|
|
1185
|
-
this.handleUniChooseMedia(['video'], sourceType)
|
|
1178
|
+
const hasImage = this.fileTypes.includes('image')
|
|
1179
|
+
const hasVideo = this.fileTypes.includes('video')
|
|
1180
|
+
const sourceType = this.getChooseFileOpts.sourceType
|
|
1181
|
+
if (hasImage && hasVideo) {
|
|
1182
|
+
this.handleUniChooseMedia(['mix'], sourceType)
|
|
1183
|
+
} else if (hasImage) {
|
|
1184
|
+
this.handleUniChooseMedia(['image'], sourceType)
|
|
1185
|
+
} else if (hasVideo) {
|
|
1186
|
+
this.handleUniChooseMedia(['video'], sourceType)
|
|
1186
1187
|
}
|
|
1187
1188
|
} else {
|
|
1188
1189
|
// 选择视频
|
|
1189
|
-
this.handleUniChooseMedia(['video'], this.getChooseVideoOpts.sourceType)
|
|
1190
|
+
this.handleUniChooseMedia(['video'], this.getChooseVideoOpts.sourceType)
|
|
1190
1191
|
}
|
|
1191
1192
|
},
|
|
1192
1193
|
async handleUniChooseMedia(mediaType, sourceType) {
|
|
@@ -1281,7 +1282,8 @@ export default {
|
|
|
1281
1282
|
compressOption: this.compressOption,
|
|
1282
1283
|
chooseImageOpts: this.getChooseImageOpts,
|
|
1283
1284
|
chooseVideoOpts: this.getChooseVideoOpts,
|
|
1284
|
-
chooseFileOpts: this.getChooseFileOpts
|
|
1285
|
+
chooseFileOpts: this.getChooseFileOpts,
|
|
1286
|
+
maxCount: this.getUploadMaxCount
|
|
1285
1287
|
})
|
|
1286
1288
|
},
|
|
1287
1289
|
handleCustomTakePhotoSelect(type) {
|