Browse Source

修改 最新版本下载提示

master
邓宏 2 years ago
parent
commit
09416e0caf
  1. 27
      pages/home/my.vue

27
pages/home/my.vue

@ -99,7 +99,7 @@
:content="modalOptions.modalContent" :content="modalOptions.modalContent"
:show-confirm-button="true" :show-confirm-button="true"
:show-cancel-button="modalOptions.isShowCancel" :show-cancel-button="modalOptions.isShowCancel"
@close="isShowModal=false" @close="!modalOptions.isDownApp && (isShowModal=false)"
@cancel="isShowModal=false" @cancel="isShowModal=false"
@confirm="upgrade"> @confirm="upgrade">
<template v-if="modalOptions.isDownApp"> <template v-if="modalOptions.isDownApp">
@ -215,13 +215,24 @@ import request,{host} from '@/common/request'
this.modalOptions.modalContent="下载升级包失败!" this.modalOptions.modalContent="下载升级包失败!"
} }
}) })
dtask.addEventListener("statechanged",e=>{ console.log(dtask,'--dtask---')
if(e&&e.totalSize>0){ if(dtask){
// console.log("state",e.state,"::::","--------statechanged-----------",e.downloadedSize) dtask.addEventListener("statechanged",e=>{
this.modalOptions.process=Math.floor((e.downloadedSize/e.totalSize)*10000)/100 if(e&&e.totalSize>0){
} // console.log("state",e.state,"::::","--------statechanged-----------",e.downloadedSize)
},false) this.modalOptions.process=Math.floor((e.downloadedSize/e.totalSize)*10000)/100
dtask.start(); }
},false)
dtask.start();
}else{
this.isShowModal=false
this.modalOptions=this.$options.data().modalOptions
uni.showModal({
title:"提示",
content:"下载最新版本失败!",
showCancel:false,
})
}
} }
//#endif //#endif
}, },

Loading…
Cancel
Save