Browse Source

修改版本请求地址

master
邓宏 2 years ago
parent
commit
64679f6377
  1. 8
      pages/home/login.vue

8
pages/home/login.vue

@ -80,7 +80,7 @@
</view> </view>
</template> </template>
<script> <script>
import request from "@/common/request" import request,{host} from "@/common/request"
export default { export default {
data(){ data(){
return{ return{
@ -157,11 +157,12 @@ export default {
this.modalOptions.modalTitle="开始下载" this.modalOptions.modalTitle="开始下载"
this.modalOptions.isDownApp=true this.modalOptions.isDownApp=true
this.modalOptions.isShowCancel=false this.modalOptions.isShowCancel=false
var dtask=plus.downloader.createDownload(this.appDownLoadUrl,{ var dtask=plus.downloader.createDownload(host()+'/'+this.appDownLoadUrl,{
filename: "_downloads/", filename: "_downloads/",
timeout:30, timeout:30,
retry:1 retry:1
},(d,status)=>{ },(d,status)=>{
console.log(d,status,'----111----')
this.modalOptions.isDownApp=false this.modalOptions.isDownApp=false
this.modalOptions.asyncClose=false this.modalOptions.asyncClose=false
this.modalOptions.okText="确认" this.modalOptions.okText="确认"
@ -179,8 +180,9 @@ 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)
if(e&&e.totalSize>0){ if(e&&e.totalSize>0){
// console.log("state",e.state,"::::","--------statechanged-----------",e.downloadedSize) console.log("state",e.state,";","downloadedSize",e.downloadedSize)
this.modalOptions.process=Math.floor((e.downloadedSize/e.totalSize)*10000)/100 this.modalOptions.process=Math.floor((e.downloadedSize/e.totalSize)*10000)/100
} }
},false) },false)

Loading…
Cancel
Save