sadais-piui 1.2.7-beta180 → 1.2.7-beta181

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.
@@ -480,6 +480,10 @@ export default {
480
480
  // #endif
481
481
  return isQYWX
482
482
  },
483
+ // 是否pc端
484
+ isPcMiniProgram() {
485
+ return this.$pi.system.systemInfo.platform === 'windows'
486
+ },
483
487
  getDisabled() {
484
488
  const parent = this.$pi.parent(this, 'PiFormItem')
485
489
  return this.disabled || (parent && parent.getDisabled)
@@ -503,8 +507,13 @@ export default {
503
507
  {
504
508
  id: 2,
505
509
  text: '选择微信聊天文件'
510
+ },
511
+ {
512
+ id: 3,
513
+ text: '选择文件',
514
+ hidden: !this.isPcMiniProgram
506
515
  }
507
- ]
516
+ ].filter(item => !item.hidden)
508
517
  },
509
518
  currentSourceType() {
510
519
  if (this.type === 'video') {
@@ -679,6 +688,7 @@ export default {
679
688
  return ext.toLocaleUpperCase()
680
689
  },
681
690
  isRightType(selectFile) {
691
+ if(this.getExtension.length === 0) return true
682
692
  const isRightType = this.getExtension.some(ext =>
683
693
  selectFile.name.endsWith(ext)
684
694
  )
@@ -1234,8 +1244,10 @@ export default {
1234
1244
  this.compressOption
1235
1245
  )
1236
1246
  filePath = filePaths[0]
1237
- } else {
1247
+ } else if (isVideoFilename(tempFilePath)) {
1238
1248
  filePath = await this.handleCompressVideo(tempFile.tempFilePath)
1249
+ } else {
1250
+ filePath = tempFile.tempFilePath
1239
1251
  }
1240
1252
 
1241
1253
  compressTempFiles.push(filePath)
@@ -1277,8 +1289,10 @@ export default {
1277
1289
  handleActionSheetSelect(type) {
1278
1290
  if (type.id === 1) {
1279
1291
  this.handleChooseMedia()
1280
- } else {
1292
+ } else if (type.id === 2) {
1281
1293
  this.handleSelectMessageFile()
1294
+ } else if (type.id === 3) {
1295
+ this.handleChooseFile()
1282
1296
  }
1283
1297
  },
1284
1298
  handleEmitTakePhoto(takeType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta180",
3
+ "version": "1.2.7-beta181",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {