import{_ as a,as as e,aA as s,ar as l,b as t,d as i,p as n,w as o,H as d,i as c,o as r,f as u,e as m,k as f,F as g,D as p,R as _}from"./index-2PZN6pGH.js";const h=a({data:()=>({title:"downloadFile",imageSrc:""}),onUnload(){this.imageSrc=""},methods:{downloadImage:function(){e({title:"下载中"});var a=this;s({url:"https://web-assets.dcloud.net.cn/unidoc/zh/uni-app.png",success:e=>{console.log("downloadFile success, res is",e),a.imageSrc=e.tempFilePath,l()},fail:a=>{console.log("downloadFile fail, err is:",a)}})}}},[["render",function(a,e,s,l,h,w){const k=t(i("page-head"),d),F=p,S=c,b=_;return r(),n(S,null,{default:o((()=>[u(k,{title:h.title},null,8,["title"]),u(S,{class:"uni-padding-wrap uni-common-mt"},{default:o((()=>[h.imageSrc?(r(),n(S,{key:0,class:"image-container"},{default:o((()=>[u(F,{class:"img",src:h.imageSrc,mode:"center"},null,8,["src"])])),_:1})):(r(),m(g,{key:1},[u(S,{class:"uni-hello-text"},{default:o((()=>[f(" 点击按钮下载服务端示例图片（下载网络文件到本地临时目录） ")])),_:1}),u(S,{class:"uni-btn-v"},{default:o((()=>[u(b,{type:"primary",onClick:w.downloadImage},{default:o((()=>[f("下载")])),_:1},8,["onClick"])])),_:1})],64))])),_:1})])),_:1})}],["__scopeId","data-v-b0f9ad54"]]);export{h as default};
