Browse Source

修改添加表情默认choosekey

yu_ber 4 years ago
parent
commit
03f6f17def

+ 0 - 0
UI/src/pages/contentManage/articleManage.js


+ 18 - 0
UI/src/pages/contentManage/index.js

@@ -0,0 +1,18 @@
+import React from 'react';
+class ArticleManage extends React.Component {
+  constructor(props) {
+    super(props)
+    this.state = {
+      
+    }
+  }
+
+  render() {
+    return (
+      <div className="ArticleManage">
+            <h2>sfddsfsdfsdf</h2>
+      </div>
+    )
+  }
+}
+export default ArticleManage

+ 4 - 3
UI/src/pages/sellmanage/msgComponent.js

@@ -53,7 +53,7 @@ class MsgComponent extends React.Component {
             imgSelect: "",
             mediaId: "",
             mouseOver: false,
-            chooseKey: "",
+            chooseKey: "text",
             mediaIdText: mediaIdText,
             mediaIdNews: mediaIdNews,
             mediaIdMini: mediaIdMini,
@@ -320,7 +320,7 @@ class MsgComponent extends React.Component {
     };
     componentDidMount() {
         let self = this;
-        self.setState({ chooseKey: self.props.chooseKey, _ID: self.props.mediaId }, () => { self.loadImgs() });
+        self.setState({ chooseKey: self.props.chooseKey != null ? self.props.chooseKey : "text" , _ID: self.props.mediaId }, () => { self.loadImgs() });
         //隐藏表情弹框
         document.addEventListener('click', () => {
             self.setState({
@@ -333,7 +333,7 @@ class MsgComponent extends React.Component {
         // 默认选中
         if (nextProps.selectKeys == nextProps.tabIndex && !nextProps.type) {
             this.setState({
-                chooseKey: nextProps.chooseKey,
+                chooseKey:nextProps.chooseKey? nextProps.chooseKey :"text",
             })
             if (nextProps.mediaId || nextProps.thumbMediaId) {
                 this.setState({
@@ -400,6 +400,7 @@ class MsgComponent extends React.Component {
 
     //添加粉丝昵称
     addfansName = () => {
+        console.log(this.state.chooseKey,'chooseKey');
         if (this.state.chooseKey == 'text') {
             let existContent = this.props.form.getFieldValue('content') ? this.props.form.getFieldValue('content') : "";
             this.props.form.setFieldsValue({ content: existContent + '|$fansName$|' });