import{_ as a,ab as e,u as s,G as o,aa as l,b as c,d as t,p as i,w as n,H as d,i as u,o as m,f as r,k as g,D as p}from"./index-2PZN6pGH.js";const f=a({data:()=>({title:"uploadFile",imageSrc:""}),onUnload(){this.imageSrc=""},methods:{chooseImage:function(){e({count:1,sizeType:["compressed"],sourceType:["album"],success:a=>{console.log("chooseImage success, temp path is",a.tempFilePaths[0]);var e=a.tempFilePaths[0];s({url:"https://unidemo.dcloud.net.cn/upload",filePath:e,fileType:"image",name:"data",success:a=>{console.log("uploadImage success, res is:",a),o({title:"上传成功",icon:"success",duration:1e3}),this.imageSrc=e},fail:a=>{console.log("uploadImage fail",a),l({content:a.errMsg,showCancel:!1})}})},fail:a=>{console.log("chooseImage fail",a)}})}}},[["render",function(a,e,s,o,l,f){const h=c(t("page-head"),d),I=p,_=u;return m(),i(_,null,{default:n((()=>[r(h,{title:l.title},null,8,["title"]),r(_,{class:"uni-padding-wrap uni-common-mt"},{default:n((()=>[r(_,{class:"demo"},{default:n((()=>[l.imageSrc?(m(),i(I,{key:0,src:l.imageSrc,class:"image",mode:"widthFix"},null,8,["src"])):(m(),i(_,{key:1,class:"uni-hello-addfile",onClick:f.chooseImage},{default:n((()=>[g("+ 选择图片")])),_:1},8,["onClick"]))])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-a9fdaa0a"]]);export{f as default};
