Browse Source

修改下载app提示

master
邓宏 2 years ago
parent
commit
dbb8970c76
  1. 9
      pages/home/login.vue

9
pages/home/login.vue

@ -72,11 +72,7 @@
:show-cancel-button="modalOptions.isShowCancel" :show-cancel-button="modalOptions.isShowCancel"
@close="!modalOptions.isDownApp && (isShowModal=false)" @close="!modalOptions.isDownApp && (isShowModal=false)"
@cancel="isShowModal=false" @cancel="isShowModal=false"
@confirm="upgrade"> @confirm="upgrade"/>
<template v-if="modalOptions.isDownApp">
<u-line-progress active-color="#10C176" :percentage="modalOptions.process" />
</template>
</u-modal>
</view> </view>
</template> </template>
<script> <script>
@ -155,6 +151,7 @@ export default {
//#ifdef APP-PLUS //#ifdef APP-PLUS
if(this.modalOptions.isShowCancel){ if(this.modalOptions.isShowCancel){
this.modalOptions.modalTitle="开始下载" this.modalOptions.modalTitle="开始下载"
this.modalOptions.modalContent="下载中..."
this.modalOptions.isDownApp=true this.modalOptions.isDownApp=true
this.modalOptions.isShowCancel=false this.modalOptions.isShowCancel=false
console.log(this.appDownLoadUrl,'-----url----') console.log(this.appDownLoadUrl,'-----url----')
@ -181,7 +178,7 @@ export default {
console.log(dtask,'--dtask----') console.log(dtask,'--dtask----')
if(dtask){ if(dtask){
dtask.addEventListener("statechanged",e=>{ dtask.addEventListener("statechanged",e=>{
console.log(`totalSize:${e.totalSize};downloadedSize:${e.downloadedSize}`) // console.log(`totalSize:${e.totalSize};downloadedSize:${e.downloadedSize}`)
if(e&&e.totalSize>0){ if(e&&e.totalSize>0){
this.modalOptions.process=Math.floor((e.downloadedSize/e.totalSize)*10000)/100 this.modalOptions.process=Math.floor((e.downloadedSize/e.totalSize)*10000)/100
} }

Loading…
Cancel
Save