<!-- 我的 -->
<template>
	<view id="demoPage">
		<view class="button-view">下载</view>

		<uni-file-picker ref="files" :auto-upload="false" />
		<button @click="upload">上传文件</button>
		<view class="button-view"></view>
		<view class="button-view">预览</view>
		<view class="button-view">录音</view>
	</view>
</template>

<script>
	import {
		systemFileUpload
	} from '@/api/basicsModules/index.js'

	export default {
		data() {
			return {

				imageValue: []
			}
		},
		onLoad() {

		},
		onShow() {

		},
		methods: {
			upload() {
				this.$refs.files.upload()
			},
			// 获取上传状态
			select(e) {
				console.log('选择文件：', e)
			},
			// 获取上传进度
			progress(e) {
				console.log('上传进度：', e)
			},

			// 上传成功
			success(e) {
				console.log('上传成功')
			},

			// 上传失败
			fail(e) {
				console.log('上传失败：', e)
			},
			//上传
			async commonUploading(e) {
				console.log('e', e);
				return

				let self = this;
				const {
					data
				} = await systemFileUpload();
				if (data.code == 200) {

				}
			},
			// commonUploading(e) {
			// 	let self = this;
			// 	let str = "";
			// 	console.log(e.target.files[0])
			// 	let param = new FormData();
			// 	param.append('api_name', `uploadImg`);
			// 	param.append('openid', localStorage.getItem("openid"));
			// 	param.append('cover', e.target.files[0]);
			// 	let formData = new FormData();
			// 	formData.append("file", file);
			// 	systemFileUpload
			// },
		},
	}
</script>
<style lang="stylus" scoped>
	#demoPage {
		.button-view {
			width: 100rpx;
			margin: 100rpx auto;
			background: #dedede;
			border-radius: 4rpx;
			text-align: center;
		}
	}
</style>