mirror of
https://gitee.com/niucloud-team/javashop.git
synced 2026-05-29 20:18:21 +00:00
2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
import{_ as q}from"./index.vue_vue_type_style_index_0_lang-fec0a266.js";import{_ as X}from"./index.vue_vue_type_script_setup_true_lang-6d238483.js";import G from"./index-81ade9a3.js";import{d as H,q as i,r as y,n as E,aI as J,a_ as K,a2 as Q,h as d,c as p,R as h,a0 as v,u as t,a as s,t as m,e as l,w as r,i as N,F as b,T as z,v as R,A as W,B as Y,b as Z,a1 as ee,L as te,M as oe,E as le,X as ne,d5 as ae}from"./index-057133d3.js";/* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{S as se}from"./sortable.esm-be94e56d.js";import{u as ie}from"./diy-bbbffff0.js";import{r as re}from"./range-9efef6d1.js";const me={class:"content-wrap float-btn"},de={class:"edit-attr-item-wrap"},pe={class:"mb-[10px]"},ce={class:"flex flex-wrap"},ue=["onClick"],_e=["src"],fe={class:"dialog-footer"},ge={class:"mb-[10px]"},xe={class:"ml-[10px] flex items-center"},be=["onClick"],Ce={class:"edit-attr-item-wrap"},ye={class:"mb-[10px]"},he={class:"text-[12px] text-[#999] mb-[15px] mt-[5px]"},ve=["onClick"],we={class:"style-wrap"},ke=H({__name:"edit-float-btn",setup(Se,{expose:I}){const e=ie();e.editComponent.ignore=["pageBgColor","marginTop","marginBottom","marginBoth"],e.editComponent.verify=a=>{const n={code:!0,message:""};return e.value[a].list.forEach(x=>{if(x.imageUrl==="")return n.code=!1,n.message=i("imageUrlTip"),n}),n};const g=y(!1),c=E({title:e.editComponent.styleName,value:e.editComponent.style}),T=()=>{g.value=!0,c.title=e.editComponent.styleName,c.value=e.editComponent.style},L=E([{url:"addon/shop/diy/goods_coupon/style-1.png",title:"风格1",value:"style-1"},{url:"addon/shop/diy/goods_coupon/style-2.png",title:"风格2",value:"style-2"}]),$=a=>{c.title=a.title,c.value=a.value},A=()=>{e.editComponent.styleName=c.title,e.editComponent.style=c.value,g.value=!1,C.value={name:"右下",src:"iconyouxiajiao",className:"lowerRight"},e.editComponent.bottomPosition="lowerRight"},w=y([{name:"左上",src:"iconzuoshangpc",className:"upperLeft"},{name:"右上",src:"iconyoushangpc",className:"upperRight"},{name:"左下",src:"iconzuoxiapc",className:"lowerLeft"},{name:"右下",src:"iconyouxiapc",className:"lowerRight"}]);let C=y({});w.value.forEach(a=>{a.className==e.editComponent.bottomPosition&&(C.value=a)});const j=a=>{C.value=a,e.editComponent.bottomPosition=a.className},D=()=>{e.editComponent.list.push({id:e.generateRandom(),imageUrl:"",link:{name:""}})},U=y();return e.editComponent.list.forEach(a=>{a.id||(a.id=e.generateRandom())}),J(()=>{K(()=>{const a=se.create(U.value,{group:"item-wrap",animation:200,onEnd:n=>{const x=e.editComponent.list[n.oldIndex];e.editComponent.list.splice(n.oldIndex,1),e.editComponent.list.splice(n.newIndex,0,x),a.sort(re(e.editComponent.list.length).map(k=>k.toString()))}})})}),I({}),(a,n)=>{const x=Q("ArrowRight"),k=ee,u=te,S=oe,V=le,F=ne,B=ae,P=G,M=X,O=q;return d(),p(b,null,[h(s("div",me,[s("div",de,[s("h3",pe,m(t(i)("selectStyle")),1),l(S,{"label-width":"80px",class:"px-[10px]"},{default:r(()=>[l(u,{label:t(i)("selectStyle"),class:"flex"},{default:r(()=>[s("span",{class:"text-primary flex-1 cursor-pointer",onClick:T},m(t(e).editComponent.styleName),1),l(k,null,{default:r(()=>[l(x)]),_:1})]),_:1},8,["label"])]),_:1}),l(F,{modelValue:g.value,"onUpdate:modelValue":n[1]||(n[1]=o=>g.value=o),title:t(i)("selectStyle"),width:"500px"},{footer:r(()=>[s("span",fe,[l(V,{onClick:n[0]||(n[0]=o=>g.value=!1)},{default:r(()=>[N(m(t(i)("cancel")),1)]),_:1}),l(V,{type:"primary",onClick:A},{default:r(()=>[N(m(t(i)("confirm")),1)]),_:1})])]),default:r(()=>[s("div",ce,[(d(!0),p(b,null,z(L,(o,_)=>(d(),p("div",{key:_,class:R([{"border-primary":c.value==o.value},"flex items-center justify-center overflow-hidden w-[200px] h-[100px] mr-[12px] cursor-pointer border bg-gray-50"]),onClick:f=>$(o)},[s("img",{src:t(W)(o.url)},null,8,_e)],10,ue))),128))])]),_:1},8,["modelValue","title"]),s("h3",ge,m(t(i)("floatBtnBtton")),1),l(S,{"label-width":"80px",class:"px-[10px]"},{default:r(()=>[l(u,{label:t(i)("floatBtnBtton")},{default:r(()=>[s("span",null,m(t(C).name),1),s("ul",xe,[(d(!0),p(b,null,z(w.value,(o,_)=>(d(),p(b,{key:_},[t(e).editComponent.style==="style-1"||t(e).editComponent.style==="style-2"&&_>1?(d(),p("li",{key:0,class:R(["w-[50px] h-[32px] flex items-center justify-center border-solid border-[1px] border-[#eee] cursor-pointer",{"border-r-transparent":w.value.length!=_+1},o.className==t(e).editComponent.bottomPosition?"!border-[var(--el-color-primary)]":""]),onClick:f=>j(o)},[s("span",{class:R(["iconfont !text-[20px]",o.src])},null,2)],10,be)):Y("",!0)],64))),128))])]),_:1},8,["label"]),l(u,{label:t(i)("floatBtnOffset")},{default:r(()=>[l(B,{modelValue:t(e).editComponent.offset,"onUpdate:modelValue":n[2]||(n[2]=o=>t(e).editComponent.offset=o),"show-input":"",size:"small",class:"ml-[10px] horz-blank-slider",max:100},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),s("div",Ce,[s("h3",ye,m(t(i)("floatBtnImageSet")),1),l(S,{"label-width":"80px",class:"px-[10px]"},{default:r(()=>[l(u,{label:t(i)("floatBtnImageSize")},{default:r(()=>[l(B,{modelValue:t(e).editComponent.imageSize,"onUpdate:modelValue":n[3]||(n[3]=o=>t(e).editComponent.imageSize=o),"show-input":"",size:"small",class:"ml-[10px] horz-blank-slider",min:30,max:100},null,8,["modelValue"])]),_:1},8,["label"]),l(u,{label:t(i)("floatBtnAroundRadius")},{default:r(()=>[l(B,{modelValue:t(e).editComponent.aroundRadius,"onUpdate:modelValue":n[4]||(n[4]=o=>t(e).editComponent.aroundRadius=o),"show-input":"",size:"small",class:"ml-[10px] graphic-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"]),s("div",he,m(t(i)("floatBtnImageSuggest")),1),s("div",{ref_key:"imageBoxRef",ref:U},[(d(!0),p(b,null,z(t(e).editComponent.list,(o,_)=>(d(),p("div",{key:o.id,class:"item-wrap p-[10px] pb-0 relative border border-dashed border-gray-300 mb-[16px]"},[l(u,{label:t(i)("image")},{default:r(()=>[l(P,{modelValue:o.imageUrl,"onUpdate:modelValue":f=>o.imageUrl=f,limit:1},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"]),h(s("div",{class:"del absolute cursor-pointer z-[2] top-[-8px] right-[-8px]",onClick:f=>t(e).editComponent.list.splice(_,1)},[l(M,{name:"element CircleCloseFilled",color:"#bbb",size:"20px"})],8,ve),[[v,t(e).editComponent.list.length>1]]),l(u,{label:t(i)("link")},{default:r(()=>[l(O,{modelValue:o.link,"onUpdate:modelValue":f=>o.link=f},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label"])]))),128))],512)]),_:1}),h(l(V,{class:"w-full",onClick:D},{default:r(()=>[N(m(t(i)("addImageAd")),1)]),_:1},512),[[v,t(e).editComponent.list.length<3]])])],512),[[v,t(e).editTab=="content"]]),h(s("div",we,[Z(a.$slots,"style")],512),[[v,t(e).editTab=="style"]])],64)}}}),Me=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{Me as _};
|