frontend/build/static/js/9.5082dd20.chunk.js

2 lines
130 KiB
JavaScript
Raw Normal View History

2024-11-04 16:50:57 +08:00
/*! For license information please see 9.5082dd20.chunk.js.LICENSE.txt */
(this.webpackJsonpmarketingsystem=this.webpackJsonpmarketingsystem||[]).push([[9],{535:function(e,t,o){},536:function(e,t,o){},595:function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return ve}));var i=o(71),c=o(72),a=o(24),s=o(25),n=o(28),l=o(26),r=o(27),d=o(60),u=(o(39),o(80)),h=o(534),m=o.n(h),b=o(507),f=o(529),p=o(540),g=o(0),j=o.n(g),x=o(472),v=o(228),O=o(265),C=o(264),y=o(258),_=o(300),S=o(454),N=o(594),k=o(350),w=o(218),E=o(598),A=(o(112),o(64)),F=o(134),T=o.n(F),U=o(1),I=function(e){Object(l.a)(o,e);var t=Object(r.a)(o);function o(e){var i;return Object(a.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 T.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 c=i.slice(0,1e3);return t.setState({editorHtml:c}),o.txt.html(c),void t.props.setEdittext(c)}t.setState({editorHtml:e}),t.props.setEdittext(e)},o.create();var i="",c=e.exchangeList;"landeditor"==this.props.pageType&&(i=e&&c?c.land.describe.content:""),["goodeditor","goodsuseditor"].includes(this.props.pageType)&&(i=e&&c&&c.product_list?c.product_list.describe.content:""),["detaileditor","detailsuseditor"].includes(this.props.pageType)&&(i=e&&c&&c.product_detail?c.product_detail.describe.content:""),o.txt.html(i)}},{key:"render",value:function(){return Object(U.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(a.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 c="",a=new FormData;a.append("file",e),a.append("path","common_image"),Object(d.sd)(a).then((function(e){Object(d.cc)(e,(function(e,t){c=e.path}),(function(e){i()}))}));var s=0;setTimeout((function e(){c?o(c):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(U.jsx)("div",{style:{width:"92%",margin:"0 auto",overflow:"auto",maxHeight:"100%"},children:Object(U.jsxs)(A.a,{model:this.s