mali-applet-ui 1.1.91 → 1.1.92

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.
@@ -10,12 +10,12 @@
10
10
  </view>
11
11
  </view>
12
12
  <template v-if="!isFromReadonly && !isLimit">
13
- <view v-if="hasForm" class="ml-upload-image-form-add-btn" @tap="chooseEvent">
13
+ <view v-if="hasForm" class="ml-upload-image-form-add-btn" @tap="chooseImgEvent">
14
14
  <ml-icon v-if="loading" name="loading" roll />
15
15
  <ml-icon v-else name="add-circle" />
16
16
  </view>
17
17
  <view v-else class="ml-upload-image-add">
18
- <view class="ml-upload-image-add-btn" @tap="chooseEvent">
18
+ <view class="ml-upload-image-add-btn" @tap="chooseImgEvent">
19
19
  <view class="ml-upload-image-add-icon">
20
20
  <ml-icon v-if="loading" name="loading" roll />
21
21
  <ml-icon v-else name="add" />
@@ -29,12 +29,12 @@
29
29
  <!-- 上传文件 -->
30
30
  <view v-else class="ml-upload-file-list-warpper">
31
31
  <template v-if="!isFromReadonly && !isLimit">
32
- <view v-if="hasForm" class="ml-upload-file-form-add-btn" @tap="chooseEvent">
32
+ <view v-if="hasForm" class="ml-upload-file-form-add-btn" @tap="chooseFileEvent">
33
33
  <ml-icon v-if="loading" name="loading" roll />
34
34
  <ml-icon v-else name="add-circle" />
35
35
  </view>
36
36
  <view v-else class="ml-upload-file-add">
37
- <view class="ml-upload-file-add-btn" @tap="chooseEvent">
37
+ <view class="ml-upload-file-add-btn" @tap="chooseFileEvent">
38
38
  <text class="ml-upload-file-add-icon">
39
39
  <ml-icon v-if="loading" name="loading" roll />
40
40
  <ml-icon v-else name="add" />
@@ -581,11 +581,11 @@ export default {
581
581
  })
582
582
  // #endif
583
583
  },
584
- choose () {
584
+ choose (type) {
585
585
  if (this.loading) {
586
586
  return
587
587
  }
588
- let chooseMethod = uploadAllFiles
588
+ let chooseMethod = type === 'image' ? uploadImageFiles : uploadAllFiles
589
589
  // 钉钉暂时只支持图片
590
590
  if (this.mediatype === 'image' || this.platformEnv.isDDMP || this.platformEnv.isQWMP) {
591
591
  chooseMethod = uploadImageFiles
@@ -639,8 +639,23 @@ export default {
639
639
  console.log(e)
640
640
  })
641
641
  },
642
- chooseEvent () {
643
- this.choose()
642
+ chooseImgEvent () {
643
+ this.choose('image')
644
+ },
645
+ chooseFileEvent () {
646
+ uni.showActionSheet({
647
+ itemList: ['选择图片', '选择文件'],
648
+ // #ifdef MP-DINGTALK
649
+ cancelButtonText: '取消',
650
+ // #endif
651
+ success: (res) => {
652
+ if (res.tapIndex === 1) {
653
+ this.choose()
654
+ } else {
655
+ this.choose('image')
656
+ }
657
+ }
658
+ })
644
659
  }
645
660
  }
646
661
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.1.91",
3
+ "version": "1.1.92",
4
4
  "description": "码里UI-小程序组件库(vue2)",
5
5
  "files": [
6
6
  "lib",