frontend/build/static/js/9.4ff6d3dd.chunk.js

2 lines
130 KiB
JavaScript
Raw Normal View History

2024-03-26 15:34:34 +08:00
/*! For license information please see 9.4ff6d3dd.chunk.js.LICENSE.txt */
(this.webpackJsonpmarketingsystem=this.webpackJsonpmarketingsystem||[]).push([[9],{452:function(e,t,o){},453:function(e,t,o){},497:function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return ve}));var i=o(70),a=o(71),c=o(24),s=o(25),n=o(28),l=o(26),r=o(27),d=o(60),u=(o(39),o(74)),h=o(451),m=o.n(h),b=o(467),f=o(493),p=o(501),g=o(0),j=o.n(g),x=o(401),v=o(184),O=o(208),C=o(210),y=o(220),_=o(249),S=o(379),N=o(496),k=o(301),w=o(174),E=o(500),A=(o(92),o(64)),U=o(106),F=o.n(U),T=o(1),I=function(e){Object(l.a)(o,e);var t=Object(r.a)(o);function o(e){var i;return Object(c.a)(this,o),(i=t.call(this,e)).state={editorHtml:""},i}return Object(s.a)(o,[{key:"componentDidMount",value:function(){var e=JSON.parse(sessionStorage.getItem("editorConfig")),t=this,o=new F.a("#wangeditorDom");this.setState({editor:o}),o.config.colors=["#696969","#9093a2","#fgddbb","#e3e7eb"],o.config.pasteText=!0,o.config.height=200,o.config.menus=["bold","foreColor","italic","indent","link","justify"],o.config.onchange=function(e){var i=o.txt.text();if(0==i.length&&t.props.setEdittext(""),i.length>1e3){var a=i.slice(0,1e3);return t.setState({editorHtml:a}),o.txt.html(a),void t.props.setEdittext(a)}t.setState({editorHtml:e}),t.props.setEdittext(e)},o.create();var i="",a=e.exchangeList;"landeditor"==this.props.pageType&&(i=e&&a?a.land.describe.content:""),["goodeditor","goodsuseditor"].includes(this.props.pageType)&&(i=e&&a&&a.product_list?a.product_list.describe.content:""),["detaileditor","detailsuseditor"].includes(this.props.pageType)&&(i=e&&a&&a.product_detail?a.product_detail.describe.content:""),o.txt.html(i)}},{key:"render",value:function(){return Object(T.jsx)("div",{id:"wangeditorDom"})}}]),o}(j.a.Component),D=o(63),z=function(e){Object(l.a)(o,e);var t=Object(r.a)(o);function o(e){var i;return Object(c.a)(this,o),(i=t.call(this,e)).onUploadError=function(e,t){"overMaxAmount"===e?x.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247")):"overMaxSize"===e&&x.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize))},i.controlColor=function(e,t){var o=i.state.model;o[e]=t,i.setState({model:o}),i.props.setGoodDetailConfig({attr:e,value:t})},i.onUpload=function(e,t){return new Promise((function(o,i){var a="",c=new FormData;c.append("file",e),c.append("path","common_image"),Object(d.dd)(c).then((function(e){Object(d.Ub)(e,(function(e,t){a=e.path}),(function(e){i()}))}));var s=0;setTimeout((function e(){a?o(a):s<100?(t(s+=2),setTimeout(e,500)):i()}),500)}))},i.state={model:{font_color:"#ffffff",button_color:"#FACD6A",describe:{type:"",content:" ",bg_image:""}}},i}return Object(s.a)(o,[{key:"onactivityChange",value:function(e,t){var o=this.state.model;o.describe[e]=t.target.value,this.setState({model:o}),this.props.setdetailActive({attr:e,value:t.target.value})}},{key:"getsusEditext",value:function(e){var t=this.state.model;t.describe.content=e,this.setState({model:t}),this.props.setdetailActive({attr:"content",value:e})}},{key:"onUploadChange",value:function(e){var 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})}},{key:"hasItemFn",value:function(e){var t=this.state.model;e==t.describe.type&&(t.describe.type="",this.setState({model:t}),this.props.setdetailActive({attr:"type",value:""}))}},{key:"componentWillMount",value:function(){var e=JSON.parse(sessionStorage.getItem("editorConfig"));e&&e.exchangeList&&e.exchangeList.product_detail&&this.setState({model:e.exchangeList.product_detail})}},{key:"componentWillUnmount",value:function(){var e=JSON.parse(sessionStorage.getItem("editorConfig")),t=e.exchangeList;t.product_detail=this.state.model,e.exchangeList=t,sessionStorage.setItem("editorConfig",JSON.stringify(e))}},{key:"render",value:function(){var e=this;return Object(T.jsx)("div",{style:{width:"92%",margin:"0 auto",overflow:"auto",maxHeight:"100%"},children:Object(T.jsxs)(A.a,{model:this.st