智慧教务系统 PHP-NiuCloud框架开发
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
9.1 KiB

import{d as G,k as a,l as w,r as O,N as j,h as m,c as _,J as T,a9 as I,u as o,a as p,t as u,e as l,w as s,i as y,F as k,O as $,n as A,z as L,m as x,B as b,b as H,T as J,G as q,H as K,E as Q,V as W,D as X,aa as Y,ab as Z,b4 as ee,b2 as oe}from"./index-be67c1b4.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{u as te}from"./diy-bd230451.js";import le from"./coupon-select-popup-b9896daa.js";const ne={class:"content-wrap"},ae={class:"edit-attr-item-wrap"},se={class:"mb-[10px]"},ie={class:"flex flex-wrap"},de=["onClick"],pe=["src"],ue={class:"dialog-footer"},me={class:"edit-attr-item-wrap"},re={class:"mb-[10px]"},ce={class:"edit-attr-item-wrap"},Ce={class:"mb-[10px]"},fe={class:"style-wrap"},_e={key:0,class:"edit-attr-item-wrap"},be={class:"mb-[10px]"},ye={key:1,class:"edit-attr-item-wrap"},ge={class:"mb-[10px]"},xe=G({__name:"edit-goods-coupon",setup(Ve,{expose:U}){const e=te();e.editComponent.ignore=["componentBgColor","componentBgUrl"],e.editComponent.verify=i=>{const t={code:!0,message:""};return e.value[i].source=="custom"&&e.value[i].couponIds.length==0?(t.code=!1,t.message=a("couponPlaceholder"),t):e.value[i].btnText==""?(t.code=!1,t.message=a("couponBtnTextPlaceholder"),t):e.value[i].couponTitle==""?(t.code=!1,t.message=a("couponTitlePlaceholder"),t):(e.value[i].couponSubTitle==""&&(t.code=!1,t.message=a("couponSubTitlePlaceholder")),t)};const r=w({title:e.editComponent.styleName,value:e.editComponent.style}),C=O(!1),B=()=>{C.value=!0,r.title=e.editComponent.styleName,r.value=e.editComponent.style},E=w([{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"},{url:"addon/shop/diy/goods_coupon/style-3.png",title:"风格3",value:"style-3"},{url:"addon/shop/diy/goods_coupon/style-4.png",title:"风格4",value:"style-4"}]),N=i=>{r.title=i.title,r.value=i.value},P=()=>{e.editComponent.styleName=r.title,e.editComponent.style=r.value,e.editComponent.style=="style-3"&&(e.editComponent.couponTitle&&e.editComponent.couponTitle.length>4&&(e.editComponent.couponTitle=e.editComponent.couponTitle.substring(0,4)),e.editComponent.couponSubTitle&&e.editComponent.couponSubTitle.length>7&&(e.editComponent.couponSubTitle=e.editComponent.couponSubTitle.substring(0,7))),V(),C.value=!1},V=()=>{let i=e.editComponent.ignore.indexOf("componentBgColor");e.editComponent.style=="style-4"&&i!=-1?(e.editComponent.ignore.splice(i,1),e.editComponent.titleColor="#ffffff",e.editComponent.subTitleColor="#ffffff",e.editComponent.couponItem.moneyColor="#fa191d",e.editComponent.couponItem.textColor="#333333",e.editComponent.couponItem.subTextColor="#999999",e.editComponent.couponItem.bgColor="#ffffff",e.editComponent.couponItem.aroundRadius=10,e.editComponent.componentStartBgColor="#fa191d"):e.editComponent.style!="style-4"&&i==-1&&e.editComponent.ignore.push("componentBgColor")};return V(),U({}),(i,t)=>{const R=j("ArrowRight"),D=J,d=q,f=K,h=Q,F=W,g=X,v=Y,z=Z,S=ee,c=oe;return m(),_(k,null,[T(p("div",ne,[p("div",ae,[p("h3",se,u(o(a)("selectStyle")),1),l(f,{"label-width":"80px",class:"px-[10px]"},{default:s(()=>[l(d,{label:o(a)("selectStyle"),class:"flex"},{default:s(()=>[p("span",{class:"text-primary flex-1 cursor-pointer",onClick:B},u(o(e).editComponent.styleName),1),l(D,null,{default:s(()=>[l(R)]),_:1})]),_:1},8,["label"])]),_:1}),l(F,{modelValue:C.value,"onUpdate:modelValue":t[1]||(t[1]=n=>C.value=n),title:o(a)("selectStyle"),width:"500px"},{footer:s(()=>[p("span",ue,[l(h,{onClick:t[0]||(t[0]=n=>C.value=!1)},{default:s(()=>[y(u(o(a)("cancel")),1)]),_:1}),l(h,{type:"primary",onClick:P},{default:s(()=>[y(u(o(a)("confirm")),1)]),_:1})])]),default:s(()=>[p("div",ie,[(m(!0),_(k,null,$(E,(n,M)=>(m(),_("div",{key:M,class:A([{"border-primary":r.value==n.value},"flex items-center justify-center overflow-hidden w-[200px] h-[100px] m-[6px] cursor-pointer border bg-gray-50"]),onClick:he=>N(n)},[p("img",{src:o(L)(n.url)},null,8,pe)],10,de))),128))])]),_:1},8,["modelValue","title"])]),p("div",me,[p("h3",re,u(o(a)("couponContent")),1),l(f,{"label-width":"90px",class:"px-[10px]"},{default:s(()=>[l(d,{label:o(a)("couponTitle")},{default:s(()=>[l(g,{modelValue:o(e).editComponent.couponTitle,"onUpdate:modelValue":t[2]||(t[2]=n=>o(e).editComponent.couponTitle=n),modelModifiers:{trim:!0},clearable:"",maxlength:o(e).editComponent.style=="style-3"?4:8,"show-word-limit":""},null,8,["modelValue","maxlength"])]),_:1},8,["label"]),l(d,{label:o(a)("couponSubTitle")},{default:s(()=>[l(g,{modelValue:o(e).editComponent.couponSubTitle,"onUpdate:modelValue":t[3]||(t[3]=n=>o(e).editComponent.couponSubTitle=n),modelModifiers:{trim:!0},clearable:"",maxlength:o(e).editComponent.style=="style-3"?7:10,"show-word-limit":""},null,8,["modelValue","maxlength"])]),_:1},8,["label"])]),_:1})]),p("div",ce,[p("h3",Ce,u(o(a)("couponData")),1),l(f,{"label-width":"90px",class:"px-[10px]"},{default:s(()=>[l(d,{label:o(a)("selectCoupon")},{default:s(()=>[l(z,{modelValue:o(e).editComponent.source,"onUpdate:modelValue":t[4]||(t[4]=n=>o(e).editComponent.source=n),title:o(a)("goodsSelectPopupSelectGoodsButton")},{default:s(()=>[l(v,{label:"all"},{default:s(()=>[y(u(o(a)("allSources")),1)]),_:1}),l(v,{label:"custom"},{default:s(()=>[y(u(o(a)("manualSelectionSources")),1)]),_:1})]),_:1},8,["modelValue","title"])]),_:1},8,["label"]),o(e).editComponent.source=="custom"?(m(),x(d,{key:0,label:o(a)("manualSelectionSources")},{default:s(()=>[l(le,{ref:"couponSelectPopupRef",modelValue:o(e).editComponent.couponIds,"onUpdate:modelValue":t[5]||(t[5]=n=>o(e).editComponent.couponIds=n),min:1,max:20},null,8,["modelValue"])]),_:1},8,["label"])):b("",!0),o(e).editComponent.source=="all"?(m(),x(d,{key:1,label:o(a)("couponNum")},{default:s(()=>[l(S,{"show-input":"",modelValue:o(e).editComponent.num,"onUpdate:modelValue":t[6]||(t[6]=n=>o(e).editComponent.num=n),min:1,max:"20",size:"small",class:"goods-coupon-slider"},null,8,["modelValue"])]),_:1},8,["label"])):b("",!0),o(e).editComponent.style!="style-4"?(m(),x(d,{key:2,label:o(a)("couponBtnText")},{default:s(()=>[l(g,{modelValue:o(e).editComponent.btnText,"onUpdate:modelValue":t[7]||(t[7]=n=>o(e).editComponent.btnText=n),modelModifiers:{trim:!0},clearable:"",maxlength:"5","show-word-limit":""},null,8,["modelValue"])]),_:1},8,["label"])):b("",!0)]),_:1})])],512),[[I,o(e).editTab=="content"]]),T(p("div",fe,[o(e).editComponent.style=="style-4"?(m(),_("div",_e,[p("h3",be,u(o(a)("couponTitleStyle")),1),l(f,{"label-width":"90px",class:"px-[10px]"},{default:s(()=>[l(d,{label:o(a)("couponTitleColor")},{default:s(()=>[l(c,{modelValue:o(e).editComponent.titleColor,"onUpdate:modelValue":t[8]||(t[8]=n=>o(e).editComponent.titleColor=n),"show-alpha":"",predefine:o(e).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),l(d,{label:o(a)("couponSubTitleColor")},{default:s(()=>[l(c,{modelValue:o(e).editComponent.subTitleColor,"onUpdate:modelValue":t[9]||(t[9]=n=>o(e).editComponent.subTitleColor=n),"show-alpha":"",predefine:o(e).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"])]),_:1})])):b("",!0),o(e).editComponent.style=="style-4"?(m(),_("div",ye,[p("h3",ge,u(o(a)("couponItemStyle")),1),l(f,{"label-width":"90px",class:"px-[10px]"},{default:s(()=>[l(d,{label:o(a)("couponMoney")},{default:s(()=>[l(c,{modelValue:o(e).editComponent.couponItem.moneyColor,"onUpdate:modelValue":t[10]||(t[10]=n=>o(e).editComponent.couponItem.moneyColor=n),"show-alpha":"",predefine:o(e).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),l(d,{label:o(a)("textColor")},{default:s(()=>[l(c,{modelValue:o(e).editComponent.couponItem.textColor,"onUpdate:modelValue":t[11]||(t[11]=n=>o(e).editComponent.couponItem.textColor=n),"show-alpha":"",predefine:o(e).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),l(d,{label:o(a)("subTextColor")},{default:s(()=>[l(c,{modelValue:o(e).editComponent.couponItem.subTextColor,"onUpdate:modelValue":t[12]||(t[12]=n=>o(e).editComponent.couponItem.subTextColor=n),"show-alpha":"",predefine:o(e).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),l(d,{label:o(a)("listFrameColor")},{default:s(()=>[l(c,{modelValue:o(e).editComponent.couponItem.bgColor,"onUpdate:modelValue":t[13]||(t[13]=n=>o(e).editComponent.couponItem.bgColor=n),"show-alpha":"",predefine:o(e).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),l(d,{label:o(a)("goodsRounded")},{default:s(()=>[l(S,{modelValue:o(e).editComponent.couponItem.aroundRadius,"onUpdate:modelValue":t[14]||(t[14]=n=>o(e).editComponent.couponItem.aroundRadius=n),"show-input":"",size:"small",class:"ml-[10px] diy-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})])):b("",!0),H(i.$slots,"style")],512),[[I,o(e).editTab=="style"]])],64)}}});const Ge=Object.freeze(Object.defineProperty({__proto__:null,default:xe},Symbol.toStringTag,{value:"Module"}));export{Ge as _};