ソースを参照

时间段自动回复

pzc 4 年 前
コミット
c43da6d6ea

BIN
UI/dist1/img/default.jpg


BIN
UI/dist1/img/header.png


BIN
UI/dist1/img/hint.png


BIN
UI/dist1/img/keydown.png


File diff suppressed because it is too large
+ 5 - 2
UI/dist1/umi.css


File diff suppressed because it is too large
+ 1 - 1
UI/dist1/umi.js


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

@@ -110,6 +110,7 @@ class MsgComponent extends React.Component {
             });
         }, 1500);
     }
+    
     //上传图片之前验证大小
     beforeUpload = (file) => {
         console.log(file.size);
@@ -453,6 +454,10 @@ class MsgComponent extends React.Component {
     }
     render() {
         let self = this;
+        
+
+        let SsoToken = util.auth.getToken();
+
         const data = this.state.currentData;
         const formItemLayout = {
             labelCol: {
@@ -475,6 +480,35 @@ class MsgComponent extends React.Component {
             listStyle: "none",
             overflow: "auto",
         }
+
+        let imgUrlText = self.state.imgUrlText;
+        if (imgUrlText) { 
+            let imgSeperator = "?";
+            if(imgUrlText.indexOf("?") !== -1 ) imgSeperator = "&";
+            if(imgUrlText.indexOf("&") !== -1 ) imgSeperator = "&";
+
+            imgUrlText = imgUrlText + imgSeperator + 'Sso-Token=' + SsoToken ;
+        }
+
+        let imgUrlNews = self.state.imgUrlNews;
+        if (imgUrlNews) { 
+            let imgSeperator = "?";
+            if(imgUrlNews.indexOf("?") !== -1 ) imgSeperator = "&";
+            if(imgUrlNews.indexOf("&") !== -1 ) imgSeperator = "&";
+
+            imgUrlNews = imgUrlNews + imgSeperator + 'Sso-Token=' + SsoToken ;
+        }
+
+        let imgUrlMini = self.state.imgUrlMini;
+        if (imgUrlMini) { 
+            let imgSeperator = "?";
+            if(imgUrlNews.indexOf("?") !== -1 ) imgSeperator = "&";
+            if(imgUrlNews.indexOf("&") !== -1 ) imgSeperator = "&";
+
+            imgUrlMini = imgUrlMini + imgSeperator + 'Sso-Token=' + SsoToken ;
+        }
+        
+
         return (
             <div>
                 <Tabs activeKey={self.state.chooseKey}
@@ -528,7 +562,7 @@ class MsgComponent extends React.Component {
                                     {/* <div>添加图片:</div> */}
                                     <div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
                                         style={{ position: "relative", display: (this.state.imgUrlText != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
-                                        <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlText} />
+                                        <img style={{ width: "100%", height: "100%" }} src={imgUrlText} />
                                         <div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
                                             <span onClick={self.upload1.bind(self)} style={{ marginLeft: "15px" }}>重新上传</span>
                                             <span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
@@ -589,7 +623,7 @@ class MsgComponent extends React.Component {
 
                                     <div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
                                         style={{ position: "relative", display: (this.state.imgUrlNews != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
-                                        <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlNews} />
+                                        <img style={{ width: "100%", height: "100%" }} src={imgUrlNews} />
                                         <div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
                                             <span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
                                             <span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
@@ -652,7 +686,7 @@ class MsgComponent extends React.Component {
 
                                     <div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
                                         style={{ position: "relative", display: (this.state.imgUrlMini != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
-                                        <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlMini} />
+                                        <img style={{ width: "100%", height: "100%" }} src={imgUrlMini} />
                                         <div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
                                             <span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
                                             <span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
@@ -736,6 +770,14 @@ class MsgComponent extends React.Component {
                         </div>
                         <div key="" style={{ width: "1050px", display: "flex", flexWrap: "wrap", margin: "0 auto" }}>
                             {data.map((item, i) => {
+                                
+                                if (item.localUrl) { 
+                                    let imgSeperator = "?";
+                                    if(item.localUrl.indexOf("?") !== -1 ) imgSeperator = "&";
+                                    if(item.localUrl.indexOf("&") !== -1 ) imgSeperator = "&";
+
+                                    item.localUrl = item.localUrl + imgSeperator + 'Sso-Token=' + SsoToken ;
+                                }
                                 if (item.localUrl == null || item.localUrl.trim == '' || item.localUrl.startsWith('http://mm')) {
                                     item.localUrl = 'http://img01.store.sogou.com/net/a/04/link?appid=100520029&url=' + item.materialUrl
                                 }

+ 11 - 6
UI/src/pages/sellmanage/pushMessage/index.js

@@ -215,12 +215,6 @@ class PushMessage extends React.Component {
   handleSubmit = key => {
     var initData = this.props.pushMessage && this.props.pushMessage.initData ? this.props.pushMessage.initData : undefined;
     var appId = this.props.wxAppIdValue
-    var data = initData.items[key];
-    if (typeof (data.disable) === 'undefined')
-      data.disable = 0;
-
-    if (typeof (data.week) === 'undefined')
-      data.week = 0;
 
 
     var items = this.props.pushMessage && this.props.pushMessage.initData && this.props.pushMessage.initData.items ? this.props.pushMessage.initData.items : undefined
@@ -245,6 +239,17 @@ class PushMessage extends React.Component {
       items[key].message = message1;
       initData.items = items;
     }
+
+    var data = initData.items[key];
+    if (typeof (data.disable) === 'undefined')
+      data.disable = 0;
+
+    if (typeof (data.week) === 'undefined')
+      data.week = 0;
+
+    if (typeof (data.tableNo) === 'undefined')
+      data.tableNo = key;
+
     this.props.dispatch({ type: 'pushMessage/updateState', payload: { initData: initData } });
     this.props.dispatch({ type: 'pushMessage/submit', payload: { data } });
   }

+ 2 - 2
UI/src/pages/sellmanage/pushMessage/model.js

@@ -36,7 +36,7 @@ export default {
           for(var k in defaulttimesList){
             tempItem = defaulttimesList[k];
             tempItem.message.chooseKey = tempItem.message.msgType; 
-            newItems[tempItem.week] = tempItem;
+            newItems[tempItem.tableNo] = tempItem;
           }
           data.items= newItems;
 
@@ -50,7 +50,7 @@ export default {
               timestr.push(timestr2);
               timeranges.push({value:timestr});
             }
-           times[newItems[i].week] = timeranges;
+           times[newItems[i].tableNo] = timeranges;
           }