This repository was archived by the owner on Nov 15, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Expand file tree Collapse file tree 3 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -274,3 +274,17 @@ export function patchCertification(payload) {
274
274
export function getUserVerifyInfo ( ) {
275
275
return api . get ( "/user/certification" , { validateStatus : s => s === 200 } ) ;
276
276
}
277
+
278
+ /**
279
+ * 举报用户
280
+ *
281
+ * @author mutoe <[email protected] >
282
+ * @export
283
+ * @param {number } userId
284
+ * @param {string } reason
285
+ * @returns
286
+ */
287
+ export function reportUser ( userId , reason ) {
288
+ const url = `/report/users/${ userId } ` ;
289
+ return api . post ( url , { reason } , { validateStatus : s => s === 201 } ) ;
290
+ }
Original file line number Diff line number Diff line change 9
9
10
10
<main class =" m-box-model m-aln-center m-justify-center" >
11
11
<div class =" m-box-model m-lim-width m-main" >
12
- <p class =" m-pinned-amount-label" >举报 {{ username }} 的 {{ typeText }}</p >
12
+ <p class =" m-pinned-amount-label" >举报 {{ username }} {{ typeText ? `的${typeText}` : '' }}</p >
13
13
<div class =" reference" >
14
14
{{ reference }}
15
15
</div >
@@ -39,6 +39,7 @@ import { noop } from "@/util";
39
39
import { reportFeed } from " @/api/feeds" ;
40
40
import { reportNews } from " @/api/news" ;
41
41
import { reportPost , reportPostComment } from " @/api/group" ;
42
+ import { reportUser } from " @/api/user" ;
42
43
import { reportComment } from " @/api" ;
43
44
import TextareaInput from " @/components/common/TextareaInput" ;
44
45
@@ -47,7 +48,8 @@ const apiMap = {
47
48
news: reportNews,
48
49
post: reportPost,
49
50
postComment: reportPostComment,
50
- comment: reportComment
51
+ comment: reportComment,
52
+ user: reportUser
51
53
};
52
54
53
55
export default {
Original file line number Diff line number Diff line change 22
22
<span class =" m-text-cut" >{{ user.name }}</span >
23
23
</div >
24
24
<div class =" m-box m-flex-grow1 m-aln-center m-flex-base0 m-justify-end" >
25
- <!-- < svg class="m-style-svg m-svg-def">
26
- <use xmlns: xlink="http://www.w3.org/1999/xlink" xlink: href="#icon-more"></use >
27
- </svg> -->
25
+ <svg class =" m-style-svg m-svg-def" @click = " onMoreClick " >
26
+ <use xlink: href =" #icon-more" / >
27
+ </svg >
28
28
</div >
29
29
</header >
30
30
<div v-if =" loading" class =" m-pos-f m-spinner" >
@@ -461,7 +461,6 @@ export default {
461
461
this .tags = data;
462
462
});
463
463
},
464
-
465
464
fetchUserFeed (loadmore ) {
466
465
if (this .fetchFeeding ) return ;
467
466
this .fetchFeeding = true ;
@@ -564,6 +563,21 @@ export default {
564
563
stopDrag () {
565
564
this .dragging = false ;
566
565
this .dY > 300 && this .scrollTop <= 0 ? this .updateData () : (this .dY = 0 );
566
+ },
567
+ onMoreClick () {
568
+ const actions = [];
569
+ actions .push ({
570
+ text: " 举报" ,
571
+ method : () => {
572
+ this .$bus .$emit (" report" , {
573
+ type: " user" ,
574
+ payload: this .userID ,
575
+ username: this .user .name ,
576
+ reference: this .user .bio
577
+ });
578
+ }
579
+ });
580
+ this .$bus .$emit (" actionSheet" , actions);
567
581
}
568
582
}
569
583
};
You can’t perform that action at this time.
0 commit comments