frontend/build/static/js/9.cb83589d.chunk.js

2 lines
163 KiB
JavaScript
Raw Normal View History

2023-12-27 16:43:52 +08:00
/*! For license information please see 9.cb83589d.chunk.js.LICENSE.txt */
(this.webpackJsonpmarketingsystem=this.webpackJsonpmarketingsystem||[]).push([[9],{434:function(e,t,i){},435:function(e,t,i){},479:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return Se}));var l=i(59),o=(i(36),i(68)),s=i(433),a=i.n(s),c=i(449),n=i(475),m=i(484),r=i(1),d=i.n(r),u=i(383),h=i(175),b=i(198),N=i(200),p=i(210),f=i(235),g=i(361),j=i(478),v=i(284),x=i(176),E=i(482),C=(i(85),i(64)),D=i(115),O=i.n(D),V=i(10);class _ extends d.a.Component{constructor(e){super(e),this.state={editorHtml:""}}componentDidMount(){let e=JSON.parse(sessionStorage.getItem("editorConfig")),t=this;const i=new O.a("#wangeditorDom");this.setState({editor:i}),i.config.colors=["#696969","#9093a2","#fgddbb","#e3e7eb"],i.config.pasteText=!0,i.config.height=200,i.config.menus=["bold","foreColor","italic","indent","link","justify"],i.config.onchange=function(e){var l=i.txt.text();if(0==l.length&&t.props.setEdittext(""),l.length>1e3){let e=l.slice(0,1e3);return t.setState({editorHtml:e}),i.txt.html(e),void t.props.setEdittext(e)}t.setState({editorHtml:e}),t.props.setEdittext(e)},i.create();let l="",o=e.exchangeList;"landeditor"==this.props.pageType&&(l=e&&o?o.land.describe.content:""),["goodeditor","goodsuseditor"].includes(this.props.pageType)&&(l=e&&o&&o.product_list?o.product_list.describe.content:""),["detaileditor","detailsuseditor"].includes(this.props.pageType)&&(l=e&&o&&o.product_detail?o.product_detail.describe.content:""),i.txt.html(l)}render(){return Object(V.jsxDEV)("div",{id:"wangeditorDom"},void 0,!1,{fileName:"D:\\project\\\u8425\u9500\u7cfb\u7edf\\frontend\\src\\pages\\exchangepage\\edittemplate\\exchange\\wangeditorCom.js",lineNumber:67,columnNumber:12},this)}}var y=i(63),S="D:\\project\\\u8425\u9500\u7cfb\u7edf\\frontend\\src\\pages\\exchangepage\\edittemplate\\exchange\\detailsPage.js";class w extends d.a.Component{constructor(e){super(e),this.onUploadError=(e,t)=>{"overMaxAmount"===e?u.a.error(`\u6700\u591a\u53ef\u4e0a\u4f20 ${t.maxAmount} \u5f20\u56fe\u7247`):"overMaxSize"===e&&u.a.error(`\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ${t.formattedMaxSize}`)},this.controlColor=(e,t)=>{let i=this.state.model;i[e]=t,this.setState({model:i}),this.props.setGoodDetailConfig({attr:e,value:t})},this.onUpload=(e,t)=>new Promise(((i,o)=>{let s="",a=new FormData;a.append("file",e),a.append("path","common_image"),Object(l.Uc)(a).then((e=>{Object(l.Kb)(e,((e,t)=>{s=e.path}),(e=>{o()}))}));let c=0;const n=()=>{s?i(s):c<100?(c+=2,t(c),setTimeout(n,500)):o()};setTimeout(n,500)})),this.state={model:{font_color:"#ffffff",button_color:"#FACD6A",describe:{type:"",content:" ",bg_image:""}}}}onactivityChange(e,t){let i=this.state.model;i.describe[e]=t.target.value,this.setState({model:i}),this.props.setdetailActive({attr:e,value:t.target.value})}getsusEditext(e){let t=this.state.model;t.describe.content=e,this.setState({model:t}),this.props.setdetailActive({attr:"content",value:e})}onUploadChange(e){let t=this.state.model;t.describe.bg_image="",this.props.setdetailActive({attr:"bg_image",value:""}),e.length>0&&"success"==e[0].status&&(t.describe.bg_image=e[0].src,this.props.setdetailActive({attr:"bg_image",value:e[0].src})),this.setState({model:t})}hasItemFn(e){let t=this.state.model;e==t.describe.type&&(t.describe.type="",this.setState({model:t}),this.props.setdetailActive({attr:"type",value:""}))}componentWillMount(){let e=JSON.parse(sessionStorage.getItem("editorConfig"));e&&e.exchangeList&&e.exchangeList.product_detail&&this.setState({model:e.exchangeList.product_detail})}componentWillUnmount(){let e=JSON.parse(sessionStorage.getItem("editorConfig")),t=e.exchangeList;t.product_detail=this.state.model,e.exchangeList=t,sessionStorage.setItem("editorConfig",JSON.stringify(e))}render(){return Object(V.jsxDEV)("div",{style:{width:"92%",margin:"0 auto",overflow:"auto",maxHeight:"100%"},children:Object(V.jsxDEV)(C.a,{model:this.state.model,ref:"form1",children:[Object(V.jsxDEV)("div",{style:{fontWeight:"bold",marginBottom:"20px"},children:"\u6837\u5f0f"},void 0,!1,{fileName:S,lineNumber:134,columnNumber:11},this),Object(V.jsxDEV)(y