Browse Source

add:头像弹框发送私信回调

zhengyingya 4 years ago
parent
commit
59ff0403fc

+ 1
- 0
lib/components/CommentBox/index.js View File

@@ -145,6 +145,7 @@ var CommentBox = function (_Component) {
145 145
             return _react2.default.createElement(_ContentItem2.default, {
146 146
               commentId: commentId,
147 147
               replyId: item.id,
148
+              user_id: item.user_id,
148 149
               key: item.id,
149 150
               content: item,
150 151
               action: "replyToReply" // 评论的回复

+ 1
- 1
lib/components/CommentBox/index.js.map
File diff suppressed because it is too large
View File


+ 10
- 0
lib/components/ContentItem/AvatarHoverCard.js View File

@@ -169,6 +169,16 @@ var AvatarHoverCard = function (_Component) {
169 169
               }
170 170
             },
171 171
             _reactIntlUniversal2.default.get("bilingually.follow", { ext: "" })
172
+          ),
173
+          _react2.default.createElement(
174
+            "div",
175
+            {
176
+              className: "privateMessageBtn " + (this.props.locale === "en-US" ? "enUs" : ""),
177
+              onClick: function onClick() {
178
+                return _this2.props.sendMessage({ id: user_id });
179
+              }
180
+            },
181
+            _reactIntlUniversal2.default.get("bilingually.im.send_msg")
172 182
           )
173 183
         )
174 184
       );

+ 1
- 1
lib/components/ContentItem/AvatarHoverCard.js.map
File diff suppressed because it is too large
View File


+ 16
- 0
lib/components/ContentItem/AvatarHoverCard.less View File

@@ -80,6 +80,22 @@
80 80
   border: 1px solid rgba(113, 193, 53, 1);
81 81
 }
82 82
 
83
+.privateMessageBtn {
84
+  width: 77px;
85
+  height: 31px;
86
+  line-height: 31px;
87
+  background: rgba(113, 193, 53, 1);
88
+  border-radius: 4px;
89
+  color: #fff;
90
+  font-size: 12px;
91
+  font-weight: 500;
92
+  text-align: center;
93
+  cursor: pointer;
94
+  margin: 0 5px;
95
+}
96
+.privateMessageBtn.enUs {
97
+  width: 90px;
98
+}
83 99
 .modalContainer {
84 100
   background: #fff;
85 101
   padding: 20px;

+ 12
- 0
lib/components/Editor/index.css View File

@@ -118,3 +118,15 @@
118 118
   width: 112px;
119 119
   height: 36px;
120 120
 }
121
+
122
+@media (max-width: 575px) {
123
+  .comment-unlogin-tip {
124
+    padding: 36px 0 16px 0;
125
+    font-size: 14px;
126
+  }
127
+
128
+  .comment-unlogin-button button {
129
+    width: 82px;
130
+    height: 28px;
131
+  }
132
+}

+ 9
- 0
lib/index.js View File

@@ -148,6 +148,12 @@ if (process.env.NODE_ENV !== "production") {
148 148
         followers: 10,
149 149
         fans: 11,
150 150
         isFollowed: false
151
+      },
152
+      58297: {
153
+        nickname: "aaaaa",
154
+        followers: 10,
155
+        fans: 11,
156
+        isFollowed: false
151 157
       }
152 158
     },
153 159
     showHoverCard: true,
@@ -182,6 +188,9 @@ if (process.env.NODE_ENV !== "production") {
182 188
     onBeforeUpdateComment: function onBeforeUpdateComment() {
183 189
       console.log("onBeforeUpdateComment");
184 190
     },
191
+    sendMessage: function sendMessage(id) {
192
+      console.log("sendMessage", id);
193
+    },
185 194
     editorProps: {
186 195
       onCommentSuccess: function onCommentSuccess(data) {
187 196
         console.log(data);

+ 1
- 1
lib/index.js.map
File diff suppressed because it is too large
View File


+ 3
- 3
lib/version.json View File

@@ -1,8 +1,8 @@
1 1
 {
2 2
     "name":       "comment",
3
-    "buildDate":  1565074347387,
3
+    "buildDate":  1565080180929,
4 4
     "version":    "1.0.4",
5
-    "numCommits": 180,
6
-    "hash":       "10d16ee",
5
+    "numCommits": 181,
6
+    "hash":       "d2c0f01",
7 7
     "dirty":      false
8 8
 }

+ 1
- 0
src/components/CommentBox/index.js View File

@@ -85,6 +85,7 @@ class CommentBox extends Component {
85 85
               <ContentItem
86 86
                 commentId={commentId}
87 87
                 replyId={item.id}
88
+                user_id={item.user_id}
88 89
                 key={item.id}
89 90
                 content={item}
90 91
                 action="replyToReply" // 评论的回复

+ 8
- 6
src/components/ContentItem/AvatarHoverCard.js View File

@@ -110,12 +110,14 @@ class AvatarHoverCard extends Component {
110 110
             )}
111 111
 
112 112
             {/* 发私信按钮,暂时隐藏 */}
113
-            {/* <div
114
-            className={styles.privateMessageBtn}
115
-            onClick={this.toggleShowModal}
116
-          >
117
-            发私信
118
-          </div> */}
113
+            <div
114
+              className={`privateMessageBtn ${
115
+                this.props.locale === "en-US" ? "enUs" : ""
116
+              }`}
117
+              onClick={() => this.props.sendMessage({ id: user_id })}
118
+            >
119
+              {intl.get("bilingually.im.send_msg")}
120
+            </div>
119 121
           </Row>
120 122
         )}
121 123
       </div>

+ 16
- 0
src/components/ContentItem/AvatarHoverCard.less View File

@@ -80,6 +80,22 @@
80 80
   border: 1px solid rgba(113, 193, 53, 1);
81 81
 }
82 82
 
83
+.privateMessageBtn {
84
+  width: 77px;
85
+  height: 31px;
86
+  line-height: 31px;
87
+  background: rgba(113, 193, 53, 1);
88
+  border-radius: 4px;
89
+  color: #fff;
90
+  font-size: 12px;
91
+  font-weight: 500;
92
+  text-align: center;
93
+  cursor: pointer;
94
+  margin: 0 5px;
95
+}
96
+.privateMessageBtn.enUs {
97
+  width: 90px;
98
+}
83 99
 .modalContainer {
84 100
   background: #fff;
85 101
   padding: 20px;

+ 12
- 0
src/components/Editor/index.css View File

@@ -118,3 +118,15 @@
118 118
   width: 112px;
119 119
   height: 36px;
120 120
 }
121
+
122
+@media (max-width: 575px) {
123
+  .comment-unlogin-tip {
124
+    padding: 36px 0 16px 0;
125
+    font-size: 14px;
126
+  }
127
+
128
+  .comment-unlogin-button button {
129
+    width: 82px;
130
+    height: 28px;
131
+  }
132
+}

+ 9
- 0
src/index.js View File

@@ -113,6 +113,12 @@ if (process.env.NODE_ENV !== "production") {
113 113
         followers: 10,
114 114
         fans: 11,
115 115
         isFollowed: false
116
+      },
117
+      58297: {
118
+        nickname: "aaaaa",
119
+        followers: 10,
120
+        fans: 11,
121
+        isFollowed: false
116 122
       }
117 123
     },
118 124
     showHoverCard: true,
@@ -147,6 +153,9 @@ if (process.env.NODE_ENV !== "production") {
147 153
     onBeforeUpdateComment: () => {
148 154
       console.log("onBeforeUpdateComment");
149 155
     },
156
+    sendMessage: id => {
157
+      console.log("sendMessage", id);
158
+    },
150 159
     editorProps: {
151 160
       onCommentSuccess: data => {
152 161
         console.log(data);