inleft
2022-03-02 e33959d3ca88b9fae5f6fe1048c8a1f7751e6f21
完成评论页
6 files modified
57 ■■■■ changed files
src/App.vue 1 ●●●● patch | view | raw | blame | history
src/api/blogArticleComment.js 8 ●●●●● patch | view | raw | blame | history
src/components/fixed/header.vue 2 ●●● patch | view | raw | blame | history
src/components/group/MyPreviewModal.vue 2 ●●● patch | view | raw | blame | history
src/components/mini/box12-comment.vue 41 ●●●● patch | view | raw | blame | history
src/components/mini/box13-reply.vue 3 ●●●● patch | view | raw | blame | history
src/App.vue
@@ -50,7 +50,6 @@
    }
    
    a {
        color: #555;
        position: relative;
    }
    
src/api/blogArticleComment.js
@@ -26,3 +26,11 @@
        params: parameter
    })
}
export function queryBlogCommentSubList(parameter) {
    return axios({
        url: '/outside/blogComment/queryBlogCommentSubList',
        method: 'get',
        params: parameter
    })
}
src/components/fixed/header.vue
@@ -4,7 +4,7 @@
            <div class="menu">
                <router-link to="/">Home</router-link>
                <router-link to="/main2">乐谱搜索</router-link>
                <router-link to="/main3">我的网盘</router-link>
                <router-link to="/comment">碎碎念</router-link>
                <router-link to="/link">友人帐</router-link>
                <router-link to="/login">登录</router-link>
                <!-- <router-link to="/comment">测试页</router-link> -->
src/components/group/MyPreviewModal.vue
@@ -1,7 +1,7 @@
<template>
    <div class="myModal">
        <a-modal v-model="visible" title="编辑预览"  width="60%" :footer="null"
            :bodyStyle="{'overflow':'overlay','width': '100%','height': '100%'}">
            :bodyStyle="{'overflow':'overlay','width': '100%','height': '700px'}">
            <div style="display: flex;">
                <a-textarea style="height: 750px;min-width: 50%" v-model="text"  />
                <div class="markdown-body article-detail" style="min-width: 50%;border: 1px solid #d9d9d9;">
src/components/mini/box12-comment.vue
@@ -3,7 +3,7 @@
        <h1 style="text-align: center;">碎碎念</h1>
        <replyBox ref="commentBoxId"></replyBox>
        <a-modal v-model="visible" :title="replyTaget" :footer="null"
            :bodyStyle="{'overflow':'overlay','maxHeight': '550px'}">
            :bodyStyle="{'overflow':'overlay','maxHeight': '550px','scrollbarWidth': 'none'}">
            <replyBox ref="replyBoxId"></replyBox>
        </a-modal>
@@ -18,7 +18,7 @@
                            回复
                        </span>
                        <span @click="loadMore()">
                        <span @click="loadMore(temp)" v-if="temp.isHasNext==1">
                            <a-icon type="down" />更多..
                        </span>
                    </span>
@@ -31,22 +31,25 @@
                    <p slot="content">{{temp.commentContent}}</p>
                    <!-- <a-comment v-for="tempData in temp.replyList.listData">
                    <a-comment v-for="tempData in temp.replyList">
                        <span slot="actions" key="comment-nested-reply-to" @click="replyCall(tempData)">
                            <a-icon type="edit" />回复
                        </span>
                        <div slot="avatar">
                            <a :href="tempData.userHomePage" target="_blank" class="no-underline">
                                {{tempData.userName}}
                                {{tempData.visitorNickName}}
                            </a>
                            @<p style="display: inline;">{{tempData.replyUserName}} </p>:
                            @
                            <a :href="tempData.replyUserHomePage" target="_blank" class="no-underline">
                                {{tempData.replyUserName}} :
                            </a>
                        </div>
                        <p slot="content">{{tempData.userComment}}</p>
                    </a-comment> -->
                        <p slot="content">{{tempData.commentContent}}</p>
                    </a-comment>
                    <!-- <div class="loadMore" v-if="temp.isHasNext!=1">
                        <a-icon type="smile" /><span>到底了..</span>
                    </div> -->
                </a-comment>
            </div>
        </div>
@@ -65,7 +68,8 @@
    import replyBox from "./box13-reply.vue"
    import {
        queryBlogCommentList
        queryBlogCommentList,
        queryBlogCommentSubList
    } from '../../api/blogArticleComment.js'
    export default {
@@ -95,15 +99,23 @@
                    this.page.total = Number(res.data.total)
                    this.page.pageSize = Number(res.data.size);
                    this.commentListData = res.data.records;
                    return res
                })
            },
            loadMore() {
                this.$message.info("11")
            loadMore(temp) {
                temp.isHasNext = 0;
                queryBlogCommentSubList({
                    commentId: temp.id
                }).then((res) => {
                    if (res.data.length == temp.replyList.length) {
                        this.$message.info("没有更多了..")
                    }
                    temp.replyList = res.data;
                })
            },
            replyCall(obj, replyId) {
                this.visible = true;
                this.replyTaget = "回复Ta @" + obj.userName;
                this.replyTaget = "回复Ta @" + obj.visitorNickName;
                var msgInfo = {
                    useName: obj.visitorNickName,
                    userComment: obj.commentContent,
@@ -211,6 +223,11 @@
        user-select: none;
    }
    .ant-drawer-wrapper-body::-webkit-scrollbar,
    .ant-modal-body::-webkit-scrollbar {
        display: none;
    }
    .commentList {
        a {
            color: black;
src/components/mini/box13-reply.vue
@@ -193,8 +193,9 @@
<style lang="less">
    .replyMsgInfo {
        display: flex;
        border-radius: 4px;
        box-shadow: 0px 9px 10px 0 rgba(0, 0, 0, 0.24), 1px 3px 15px 0 rgba(0, 0, 0, 0.19);
        padding: 20px 20px;
        padding: 20px 25px 20px;
        margin-left: 15px;
        margin-top: 10px;
    }