Browse Source

修改 最新版本下载提示

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

13
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,6 +215,8 @@ import request,{host} from '@/common/request'
this.modalOptions.modalContent="下载升级包失败!" this.modalOptions.modalContent="下载升级包失败!"
} }
}) })
console.log(dtask,'--dtask---')
if(dtask){
dtask.addEventListener("statechanged",e=>{ dtask.addEventListener("statechanged",e=>{
if(e&&e.totalSize>0){ if(e&&e.totalSize>0){
// console.log("state",e.state,"::::","--------statechanged-----------",e.downloadedSize) // console.log("state",e.state,"::::","--------statechanged-----------",e.downloadedSize)
@ -222,6 +224,15 @@ import request,{host} from '@/common/request'
} }
},false) },false)
dtask.start(); dtask.start();
}else{
this.isShowModal=false
this.modalOptions=this.$options.data().modalOptions
uni.showModal({
title:"提示",
content:"下载最新版本失败!",
showCancel:false,
})
}
} }
//#endif //#endif
}, },

Loading…
Cancel
Save