Authored by 邱骏

长文章iphoneX适配,评论列表点击下方评论框直接弹出输入框

... ... @@ -71,6 +71,7 @@
:add-type="0"
:column-type="columnType"
:authorUid="authorUid"
:direct-comment="true"
@on-comment="onComment">
参与评论
</CommentPlaceholderActionSheet>
... ...
... ... @@ -34,6 +34,7 @@ export default {
const uid = get(await this.$sdk.getUser(), 'uid', 0);
const commentId = this.$attrs['dest-id'];
const articleId = this.$attrs['article-id'];
const directComment = this.$attrs['direct-comment'] || ''; // 是否直接调用评论框,不弹出actionSheet
const commentType = this.$attrs.commentType;
let menu = [];
... ... @@ -61,58 +62,64 @@ export default {
];
}
this.$createActionSheet({
data: menu,
zIndex: 200,
onSelect: item => {
switch (item.content) {
case ITEM.comment: {
this.$refs.placeholder.openComentInput();
break;
}
case ITEM.remove: {
this.setCommentStatus({ type: 1, commentId }).then(result => {
if (result.code === 200) {
this.$createToast({
txt: '已删除',
type: 'correct',
time: 2000
}).show();
this.$emit('remove-comment', { commentId, commentType, articleId });
} else {
this.$createToast({
txt: '删除失败,请重试',
type: 'warn',
time: 2000
}).show();
}
});
break;
}
case ITEM.report: {
this.setCommentStatus({ type: 2, commentId }).then(result => {
if (result.code === 200) {
this.$createToast({
txt: '已举报',
type: 'correct',
time: 2000
}).show();
} else {
this.$createToast({
txt: '举报失败,请重试',
type: 'warn',
time: 2000
}).show();
}
});
break;
}
default: {
// pass
if (directComment) {
return this.$refs.placeholder.openComentInput();
} else {
this.$createActionSheet({
data: menu,
zIndex: 200,
onSelect: item => {
switch (item.content) {
case ITEM.comment: {
this.$refs.placeholder.openComentInput();
break;
}
case ITEM.remove: {
this.setCommentStatus({ type: 1, commentId }).then(result => {
if (result.code === 200) {
this.$createToast({
txt: '已删除',
type: 'correct',
time: 2000
}).show();
this.$emit('remove-comment', { commentId, commentType, articleId });
} else {
this.$createToast({
txt: '删除失败,请重试',
type: 'warn',
time: 2000
}).show();
}
});
break;
}
case ITEM.report: {
this.setCommentStatus({ type: 2, commentId }).then(result => {
if (result.code === 200) {
this.$createToast({
txt: '已举报',
type: 'correct',
time: 2000
}).show();
} else {
this.$createToast({
txt: '举报失败,请重试',
type: 'warn',
time: 2000
}).show();
}
});
break;
}
default: {
// pass
}
}
}
}
}).show();
}).show();
}
}
}
};
... ...
... ... @@ -386,7 +386,8 @@ export default {
}
.article-context {
padding: 30px 0;
padding-top: calc(env(safe-area-inset-bottom) + 30px);
padding-bottom: 30px;
}
.context-title {
... ...