mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 21:36:39 +08:00
优化代码
This commit is contained in:
parent
14b8a68b0f
commit
73a8c1bbac
@ -11,7 +11,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getHeaders} from '../../lib/java110/api/SystemApi.js';
|
||||
import {
|
||||
getHeaders
|
||||
} from '../../lib/java110/api/SystemApi.js';
|
||||
import url from '@/constant/url.js'
|
||||
|
||||
export default {
|
||||
@ -27,6 +29,25 @@
|
||||
},
|
||||
_doUploadFile: function() {
|
||||
let _that = this;
|
||||
// #ifdef H5
|
||||
uni.chooseFile({
|
||||
count: 1, //默认100
|
||||
type: 'all',
|
||||
extension: ['.zip', '.jpg', '.png', '.xlsx', '.doc', 'docx', '.xls'],
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
if (res.tempFiles[0].size / 1024 / 1024 > 20) {
|
||||
_that.$refs.uToast.show({
|
||||
title: '附件大小不能超过20M',
|
||||
type: 'warning',
|
||||
})
|
||||
return;
|
||||
}
|
||||
_that.resultPath(res.tempFiles[0].path, res.tempFiles[0].name);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
uni.chooseMessageFile({
|
||||
count: 1, //默认100
|
||||
type: 'all',
|
||||
@ -43,6 +64,7 @@
|
||||
_that.resultPath(res.tempFiles[0].path, res.tempFiles[0].name);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
resultPath(path, fileName) {
|
||||
let _that = this;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user