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

Loading…
Cancel
Save