|
|
|
(this.webpackJsonpmarketingsystem=this.webpackJsonpmarketingsystem||[]).push([[9],{440:function(e,t,i){},441:function(e,t,i){},485:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return Se}));var l=i(59),o=(i(36),i(69)),s=i(439),a=i.n(s),c=i(455),n=i(481),m=i(490),r=i(1),d=i.n(r),u=i(390),h=i(177),b=i(199),N=i(201),p=i(211),f=i(240),g=i(368),j=i(484),v=i(291),x=i(167),E=i(488),C=(i(85),i(63)),D=i(99),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:"/Users/zhangds/web/blue-brother/frontend/src/pages/exchangepage/edittemplate/exchange/wangeditorCom.js",lineNumber:67,columnNumber:12},this)}}var y=i(62),S="/Users/zhangds/web/blue-brother/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.cd)(a).then((e=>{Object(l.Tb)(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.a,{labelname:"\u5b57\u4f53
|