sadais-piui 1.2.7-beta124 → 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-
|
|
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('
|
|
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('
|
|
797
|
+
this.fileTypes.includes('image') || this.fileTypes.includes('video')
|
|
790
798
|
? 'all'
|
|
791
799
|
: 'file'
|
|
792
800
|
})
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
<view class="pi-scroll-container">
|
|
3
3
|
<!-- #ifndef MP -->
|
|
4
4
|
<slot name="title">
|
|
5
|
-
<pi-navbar :show-home="showHome">{{ title }}</pi-navbar>
|
|
5
|
+
<pi-navbar :show-home="showHome" :fixed="false">{{ title }}</pi-navbar>
|
|
6
6
|
</slot>
|
|
7
7
|
<!-- #endif -->
|
|
8
8
|
<!-- #ifndef APP-PLUS -->
|
|
9
|
-
<
|
|
9
|
+
<view class="pi-scroll pi-safearea">
|
|
10
|
+
<web-view v-if="webviewURL" :progress="true" :src="webviewURL" />
|
|
11
|
+
</view>
|
|
10
12
|
<!-- #endif -->
|
|
11
13
|
</view>
|
|
12
14
|
</template>
|
|
@@ -57,7 +59,8 @@ export default {
|
|
|
57
59
|
// H5 url 需要加时间戳,否则会有缓存问题
|
|
58
60
|
this.webviewURL = this.autoAddTimestamp
|
|
59
61
|
? this.urlAddParam(this.url || '', {
|
|
60
|
-
sadaisTimestamp:
|
|
62
|
+
sadaisTimestamp:
|
|
63
|
+
new Date().getTime() + '-' + Math.round(Math.random(1) * 10000)
|
|
61
64
|
})
|
|
62
65
|
: this.url
|
|
63
66
|
console.log('webview页面即将打开以下URL:', this.webviewURL)
|