import{B as e,c as r,f as t,g as i,E as s,z as o,s as a,i as n,bh as u,A as d}from"./index-007bf156.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,h=p,m=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,h("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(m.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 _};
