1 |
- import{d as u,R as m,c as s,b9 as v,ah as y,r as E,y as I,$ as k,aj as b,bI as S,ak as P,al as O,m as C,g as x,bv as L,p as B,bG as U,bH as z}from"./index.5f7ffb46.js";import{s as r}from"./index.module.ccd53496.js";import{O as D}from"./index.7790de2a.js";import{O as T}from"./index.1d6ac2c5.js";import{I as j}from"./index.4f3f29e9.js";import{L as H}from"./index.9ef28852.js";import"./ImagePreview.289405c5.js";import"./index.99e0cf1f.js";import"./index.276a5d68.js";import"./use-tab-status.69b57a37.js";const R="_imgWrap_12n2v_1";var V={imgWrap:R},F=u({name:"o-image",props:{src:{type:String,default:""}},setup(n){const i=m(!0);return()=>s("div",{class:V.imageWrap,style:i.value?"":{backgroundImage:`url(${n.src})`,backgroundSize:"cover"}},[s(v,{name:"van-fade"},{default:()=>[i.value&&s("img",{style:{display:"none"},src:n.src,onLoad:()=>{i.value=!1}},null)]})])}}),M="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAetJREFUWEftlz1OAzEQhd8EboH4KamT3AEQDQ0kIISoEiquEOcKFAgoEQI2aSjhEJuWmizHgB20PwHHu+s4u04kJKfdmXmfn2ccm2Dpx/32Pji8ASgEcYd6gzcbpclGkagG91ufYKyl9T5IeFs2alsBZCFqwPu3BBSS8FYcoKkDzkFTp4rinIPOwQoOuHOwgnlxqnPQOWjigDuoZ7nE4ngXFN7FccyXJAYvco6pgyyODkB0ldSpdUg8vc7Spnq9vkNEt4k2d0ejUeYmzP3WGIz1pBh/gWqn1Hv2JsVNALnfboHDB4BW0/MjoJ63oQI2m809Zo55iKhLjUZjDEzEMfZ9f1NNmgbMQs4CzMAlB1wuoMITRIAsA/m+nzkb460Bhr+rV5zUAebCRbsAHKqtEpVVeYwAY8/ULZIgwdvDvCu/LkduEdmg0oB6SJyB6VESCkF0MtVzBf2rtlMlQC3kpPkTxRDgsKgldJNbGbAYUiebnfyiaCuA80Gaw1UakrwV5w+BHDkfnHVAvZPzwy0E8A+Soymupf7FU1x0lCx8SHK3W7TPAb5Ov12Q8O51IAsfkjLiJjnWpthErEyMAyzjmrX/4qriJvn/f4tNVrnMmMx9cJniJlrqld8kZ5kxAUmPlPRRtEx9rVYQPZp+ANi5nail81YsAAAAAElFTkSuQmCC";function Q(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!O(n)}var _=u({name:"photo-detail",props:{orchestraId:{type:String,default:""}},setup(n){const i=y();console.log("\u{1F680} ~ route",i);const e=E({downLoading:!1,downIndex:0,refreshing:!1,loading:!1,finished:!1,pages:{page:1,rows:20},list:[],startPosition:0,imgShow:!1}),d=async()=>{var a;if(!e.loading){e.loading=!0,e.refreshing&&(e.list=[],e.pages.page=1);try{const t=await C.post(`${x.platformApi}/orchestraPhoto/page`,{data:{...e.pages,orchestraPhotoAlbumId:i.query.photoId}});Array.isArray((a=t==null?void 0:t.data)==null?void 0:a.rows)?(e.list=e.list.concat(t.data.rows),e.pages.page=t.data.current+1,e.finished=!t.data.next):e.finished=!0}catch{e.finished=!0}e.refreshing=!1,e.loading=!1}},c=I(()=>e.list.map(a=>a.fileUrl)),p=m(),f=a=>{e.downIndex=e.startPosition=a,e.imgShow=!0},h=a=>{const t=document.createElement("canvas");t.width=a.width,t.height=a.height;const o=t.getContext("2d");return o==null||o.drawImage(a,0,0,t.width,t.height),t.toDataURL("image/png")},A=async()=>{const a=c.value[e.downIndex];if(e.downLoading||!a)return;const t=L({message:"\u4FDD\u5B58\u4E2D",duration:0}),o=document.createElement("img");o.crossOrigin="anonymous",o.onload=async()=>{var g;const w=h(o);try{const l=await B({api:"savePicture",content:{base64:w}});((g=l==null?void 0:l.content)==null?void 0:g.status)==="success"?U("\u4FDD\u5B58\u6210\u529F"):z("\u4FDD\u5B58\u5931\u8D25")}catch{}t.close(),e.downLoading=!1},o.src=a+`?v=${Date.now()}`};return k(()=>{d(),document.title=i.query.name||""}),()=>{let a;return s("div",null,[s(D,{onGetHeight:t=>{document.documentElement.style.setProperty("--header-height",t+"px")}},{default:()=>[s(b,null,null)]}),s(T,{modelValue:e.refreshing,onRefresh:()=>{e.refreshing=!0,d()}},{default:()=>[s("div",{class:r.phoneListDetailWrap},[s(H,{loadingText:" ",finished:e.finished,finishedText:" ",onLoad:d,immediateCheck:!1},{default:()=>[s("div",{class:r.phoneListDetail},[s(S,{name:"van-fade"},Q(a=e.list.map((t,o)=>s("div",{key:`index-${o}`,class:r.gridItem,onClick:()=>f(o)},[s(F,{class:r.gridImg,src:t.fileUrl},null)])))?a:{default:()=>[a]}),!e.loading&&!e.list.length&&s(P,{key:"OEmpty1",btnStatus:!1,tips:"\u6682\u65E0\u7167\u7247"},null)])]})])]}),s(j,{ref:p,show:e.imgShow,"onUpdate:show":t=>e.imgShow=t,startPosition:e.startPosition,images:c.value,onChange:t=>e.downIndex=t},{cover:()=>s("div",{class:r.downBtn,onClick:()=>A()},[s("img",{src:M},null)])})])}}});export{_ as default};
|