123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <view class="progress-box">
- <progress :percent="progress" show-info stroke-width="3" />
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- progress:0
- }
- },
- methods: {
-
- },
- onLoad(option) {
- const downloadTask = uni.downloadFile({
- url: option.url,
- success: (res) => {
- if (res.statusCode === 200) {
- uni.openDocument({
- filePath:res.tempFilePath,
- })
- }
- }
- });
- downloadTask.onProgressUpdate((res) => {
- this.progress=res.progress
- });
- },
- onShow() {
- if(this.progress==100){
- uni.navigateBack()
- }
- }
- }
- </script>
- <style>
- </style>
|