1 |
- import{v as e,c as r,e as t,d as i,n as s,u as o,s as a,z as n,aW as u,k as d}from"./index-Dhufwzns.js";import{_ as l}from"./_plugin-vue_export-helper.BCo6x5W8.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-76b85271"]]);export{p as _};
|