Browse Source

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

zhengyingya 5 years ago
parent
commit
59ff0403fc

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

145
             return _react2.default.createElement(_ContentItem2.default, {
145
             return _react2.default.createElement(_ContentItem2.default, {
146
               commentId: commentId,
146
               commentId: commentId,
147
               replyId: item.id,
147
               replyId: item.id,
148
+              user_id: item.user_id,
148
               key: item.id,
149
               key: item.id,
149
               content: item,
150
               content: item,
150
               action: "replyToReply" // 评论的回复
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
               }
169
               }
170
             },
170
             },
171
             _reactIntlUniversal2.default.get("bilingually.follow", { ext: "" })
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
   border: 1px solid rgba(113, 193, 53, 1);
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
 .modalContainer {
99
 .modalContainer {
84
   background: #fff;
100
   background: #fff;
85
   padding: 20px;
101
   padding: 20px;

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

118
   width: 112px;
118
   width: 112px;
119
   height: 36px;
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
         followers: 10,
148
         followers: 10,
149
         fans: 11,
149
         fans: 11,
150
         isFollowed: false
150
         isFollowed: false
151
+      },
152
+      58297: {
153
+        nickname: "aaaaa",
154
+        followers: 10,
155
+        fans: 11,
156
+        isFollowed: false
151
       }
157
       }
152
     },
158
     },
153
     showHoverCard: true,
159
     showHoverCard: true,
182
     onBeforeUpdateComment: function onBeforeUpdateComment() {
188
     onBeforeUpdateComment: function onBeforeUpdateComment() {
183
       console.log("onBeforeUpdateComment");
189
       console.log("onBeforeUpdateComment");
184
     },
190
     },
191
+    sendMessage: function sendMessage(id) {
192
+      console.log("sendMessage", id);
193
+    },
185
     editorProps: {
194
     editorProps: {
186
       onCommentSuccess: function onCommentSuccess(data) {
195
       onCommentSuccess: function onCommentSuccess(data) {
187
         console.log(data);
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
 {
1
 {
2
     "name":       "comment",
2
     "name":       "comment",
3
-    "buildDate":  1565074347387,
3
+    "buildDate":  1565080180929,
4
     "version":    "1.0.4",
4
     "version":    "1.0.4",
5
-    "numCommits": 180,
6
-    "hash":       "10d16ee",
5
+    "numCommits": 181,
6
+    "hash":       "d2c0f01",
7
     "dirty":      false
7
     "dirty":      false
8
 }
8
 }

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

85
               <ContentItem
85
               <ContentItem
86
                 commentId={commentId}
86
                 commentId={commentId}
87
                 replyId={item.id}
87
                 replyId={item.id}
88
+                user_id={item.user_id}
88
                 key={item.id}
89
                 key={item.id}
89
                 content={item}
90
                 content={item}
90
                 action="replyToReply" // 评论的回复
91
                 action="replyToReply" // 评论的回复

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

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
           </Row>
121
           </Row>
120
         )}
122
         )}
121
       </div>
123
       </div>

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

80
   border: 1px solid rgba(113, 193, 53, 1);
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
 .modalContainer {
99
 .modalContainer {
84
   background: #fff;
100
   background: #fff;
85
   padding: 20px;
101
   padding: 20px;

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

118
   width: 112px;
118
   width: 112px;
119
   height: 36px;
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
         followers: 10,
113
         followers: 10,
114
         fans: 11,
114
         fans: 11,
115
         isFollowed: false
115
         isFollowed: false
116
+      },
117
+      58297: {
118
+        nickname: "aaaaa",
119
+        followers: 10,
120
+        fans: 11,
121
+        isFollowed: false
116
       }
122
       }
117
     },
123
     },
118
     showHoverCard: true,
124
     showHoverCard: true,
147
     onBeforeUpdateComment: () => {
153
     onBeforeUpdateComment: () => {
148
       console.log("onBeforeUpdateComment");
154
       console.log("onBeforeUpdateComment");
149
     },
155
     },
156
+    sendMessage: id => {
157
+      console.log("sendMessage", id);
158
+    },
150
     editorProps: {
159
     editorProps: {
151
       onCommentSuccess: data => {
160
       onCommentSuccess: data => {
152
         console.log(data);
161
         console.log(data);