sadais-piui 1.2.7-beta125 → 1.2.7-beta126

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.
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2021-08-13 11:31:57
4
- * @LastEditTime: 2024-07-11 10:50:24
4
+ * @LastEditTime: 2024-10-15 16:45:22
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 图片上传组件
7
7
  * @FilePath: /piui-awesome/src/piui/components/pi-upload-img/index.vue
@@ -409,6 +409,9 @@ export default {
409
409
  }
410
410
  ]
411
411
  },
412
+ selectOnlyFile() {
413
+ return this.type === 'all' && this.fileTypes.length === 0
414
+ },
412
415
  isValString() {
413
416
  return this.$pi.lang.isString(this.val)
414
417
  },
@@ -719,7 +722,7 @@ export default {
719
722
  if (this.$pi.lang.isEmpty(this.headers)) {
720
723
  console.log(TAG, '当前图片上传headers为空,请检查是否需要配置授权信息')
721
724
  }
722
- console.log('当前上传文件类型累:', this.type)
725
+ console.log('当前上传文件类型:', this.type)
723
726
  if (this.type === 'all') {
724
727
  // #ifndef MP-WEIXIN
725
728
  this.handleChooseFile()
@@ -728,6 +731,11 @@ export default {
728
731
  // #ifdef MP-WEIXIN
729
732
  const { fromWxMessage } = this.getChooseFileOpts
730
733
  if (fromWxMessage) {
734
+ if (this.selectOnlyFile) {
735
+ this.handleSelectMessageFile()
736
+ return
737
+ }
738
+ this.$emit('show-actions')
731
739
  this.showActionSheet = true
732
740
  } else {
733
741
  this.handleChooseMedia()
@@ -786,7 +794,7 @@ export default {
786
794
  const [, result] = await uni.chooseMessageFile({
787
795
  count: this.getUploadMaxCount,
788
796
  type:
789
- this.fileTypes.includes('video') || this.fileTypes.includes('video')
797
+ this.fileTypes.includes('image') || this.fileTypes.includes('video')
790
798
  ? 'all'
791
799
  : 'file'
792
800
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta125",
3
+ "version": "1.2.7-beta126",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {