import{y as e,c as r,e as t,f as i,A as s,v as o,s as a,g as n,b0 as u,x as d}from"./index-9aa72eed.js";import{_ as l}from"./_plugin-vue_export-helper.1b428a4d.js";const p=l({__name:"su-image",props:{src:{type:String,default:""},errorSrc:{type:String,default:"/static/img/shop/empty_network.png"},mode:{type:String,default:"widthFix"},isPreview:{type:Boolean,default:!1},previewList:{type:Array,default:()=>[]},current:{type:Number,default:-1},height:{type:Number,default:0},width:{type:Number,default:0},radius:{type:Number,default:0}},emits:["load","error"],setup(l,{emit:p}){const c=e({isError:!1,imgHeight:600}),g=l,m=p,h=r((()=>({height:(g.height||c.imgHeight)+"rpx",width:g.width?g.width+"rpx":"100%",borderRadius:g.radius?g.radius+"rpx":""})));function f(e){0===g.height&&(c.imgHeight=e.detail.height/e.detail.width*750)}function y(e){c.isError=!0,m("error",e)}function w(){g.isPreview&&u({urls:g.previewList.length<1?[g.src]:g.previewList,current:g.current,longPressActions:{itemList:["发送给朋友","保存图片","收藏"],success:function(e){console.log("选中了第"+(e.tapIndex+1)+"个按钮,第"+(e.index+1)+"张图片")},fail:function(e){console.log(e.errMsg)}}})}return(e,r)=>{const u=d;return c.isError?n("",!0):(t(),i(u,{key:0,class:"su-img",style:s(h.value),draggable:!1,mode:l.mode,src:o(a).$url.cdn(l.src),onClick:w,onLoad:f,onError:y},null,8,["style","mode","src"]))}}},[["__scopeId","data-v-74e3b72e"]]);export{p as _};
