57 lines
1.1 KiB
Vue
57 lines
1.1 KiB
Vue
![]() |
<template>
|
||
|
<view style="height: 600px; display: flex; justify-content: center; align-items: center;">
|
||
|
<view style="width: 95%;">
|
||
|
<u-line-progress :striped="true" :percent="progress" :striped-active="true"></u-line-progress>
|
||
|
<view style="width: 100%; text-align: center;margin-top: 20rpx;">更新中</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
progress: 0,
|
||
|
url: ''
|
||
|
}
|
||
|
},
|
||
|
onLoad(params) {
|
||
|
this.url = params.url
|
||
|
},
|
||
|
mounted() {
|
||
|
/* let _this = this
|
||
|
console.log(this.url)
|
||
|
setTimeout(() => {
|
||
|
const downloadTask = uni.downloadFile({
|
||
|
url: _this.url,
|
||
|
success(res) {
|
||
|
if(res['statusCode'] === 200){
|
||
|
uni.openDocument({
|
||
|
filePath: res['tempFilePath'],
|
||
|
success: function(res) {}
|
||
|
});
|
||
|
}else{
|
||
|
uni.showToast({
|
||
|
title: '下载更新失败,请检查网络',
|
||
|
duration: 2000
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
|
||
|
downloadTask.onProgressUpdate((res) => {
|
||
|
_this.progress = res.progress;
|
||
|
});
|
||
|
}, 300) */
|
||
|
|
||
|
},
|
||
|
methods: {
|
||
|
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
|
||
|
</style>
|