瀏覽代碼

feat: 完善评论已经批注交互

jinx 2 年之前
父節點
當前提交
3ab4a9d200

+ 1 - 0
src/components/files/TagEditor.vue

@@ -77,6 +77,7 @@ const onClose = () => {
         }
     } else {
     }
+    isEdit.value = false
     notify.value = null
 }
 const onSubmit = async () => {

+ 174 - 125
src/components/files/TagView.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="tag-view">
+    <div class="tag-view" v-show="canShow">
         <!-- <div class="tag-view-content" :style="{ height: height + 'px' }"> -->
         <div class="tag-view-content">
             <header>
@@ -8,41 +8,8 @@
                 <i class="iconfont icon-close" @click="onClose"></i>
             </header>
             <article>
-                <div class="aside-item left-item">
-                    <div class="content-item">
-                        <div class="item-title">创建时间</div>
-                        <span class="content-desc">2021-04-25</span>
-                    </div>
-                    <div class="content-item">
-                        <div class="item-title">创建人</div>
-                        <span class="content-desc">陈工</span>
-                    </div>
-                    <div class="content-item">
-                        <div class="item-title">状态</div>
-                        <span class="content-desc" v-for="i in data.status">
-                            <span v-if="i.value == form.status">{{ i.text }}</span></span
-                        >
-                    </div>
-                    <div class="content-item">
-                        <div class="item-title">涉及的成员</div>
-                        <span class="content-desc" v-for="(i, index) in form.members"
-                            ><span>{{ i.text }}</span>
-                            <span v-if="index < form.members.length - 1">、</span>
-                        </span>
-                    </div>
-                    <div class="content-item">
-                        <div class="item-title">描述</div>
-                        <span class="content-desc">{{ form.describe }}</span>
-                    </div>
-                    <div class="media-box" :class="notify.type == 'image' ? 'zoom-in' : ''">
-                        <component :is="component" :viewer="viewer"></component>
-                    </div>
-                </div>
-                <div class="aside-item right-item">
-                    <div class="comment-content">
-                        <div class="comment-header"><span>评论</span></div>
-                    </div>
-                </div>
+                <TagMsg @setShow="setShow"></TagMsg>
+                <Comment></Comment>
             </article>
             <!-- <footer></footer> -->
         </div>
@@ -50,47 +17,13 @@
 </template>
 <script setup>
 import { ref, onMounted, onBeforeUnmount, computed, inject } from 'vue'
-import { http } from '@/utils/request'
-import browser from '@/utils/browser'
-import Image from '@/components/form/medias/Image.vue'
-import Video from '@/components/form/medias/Video.vue'
-import Audio from '@/components/form/medias/Audio.vue'
-import Link from '@/components/form/medias/Link.vue'
-const projectId = browser.valueFromUrl('projectId') || 1
+
+import TagMsg from './content/TagMsg.vue'
+import Comment from './content/Comment.vue'
 const notify = inject('notify')
-console.log(notify.value)
-const viewer = ref(true)
-// const props = defineProps(['notify'])
 const emits = defineEmits(['action'])
 const height = ref(0)
-const form = ref({
-    title: '',
-    describe: '',
-    status: '',
-    members: [],
-})
-const data = ref({
-    status: [
-        { text: '待处理', value: 1 },
-        { text: '进行中', value: 2 },
-        { text: '未解决', value: 3 },
-        { text: '已解决', value: 4 },
-    ],
-    members: [],
-})
-const media = ref('video')
-const component = computed(() => {
-    switch (media.value) {
-        case 'image':
-            return Image
-        case 'video':
-            return Video
-        case 'audio':
-            return Audio
-        case 'link':
-            return Link
-    }
-})
+const canShow = ref(false)
 const onResize = () => {
     height.value = window.innerHeight - 90
 }
@@ -103,34 +36,10 @@ const onClose = () => {
     }
     notify.value = null
 }
+const setShow = () => {
+    canShow.value = true
+}
 onMounted(() => {
-    http.post(`smart-site/projectTeam/select`, { projectId }).then(response => {
-        data.value.members = response.data.map(item => {
-            return {
-                text: item.nickName,
-                value: item.userId,
-            }
-        })
-
-        if (notify.value) {
-            form.value.status = String(notify.value.status || '')
-            form.value.title = notify.value.title || ''
-            form.value.describe = notify.value.content || ''
-            form.value.members = []
-            if (notify.value.members && notify.value.members.length) {
-                notify.value.members.forEach(item => {
-                    let find = data.value.members.find(c => c.value == item)
-                    if (find) {
-                        form.value.members.push(find)
-                    }
-                })
-            }
-            console.log(form.value)
-            //初始化markingId
-            console.log(notify.value)
-        }
-    })
-
     if (window.kankan) {
         window.kankan.TagManager.focusTag(notify.value.sid, {
             direction: 'left',
@@ -155,7 +64,7 @@ onBeforeUnmount(() => {
 </script>
 <style lang="scss" scoped>
 .aside-item {
-    padding: 30px 20px 0;
+    padding: 20px;
     box-sizing: border-box;
     line-height: 28px;
     .content-item {
@@ -164,37 +73,177 @@ onBeforeUnmount(() => {
         //     margin-bottom: 0;
         // }
     }
-    &.left-item {
-        width: 400px;
-        .item-title {
-            font-size: 14px;
-            color: #999;
-        }
-        .content-desc {
-            font-size: 14px;
-            line-height: 28px;
-        }
-        .media-box {
-            width: 360px;
-            height: 225px;
-            border-radius: 4px 4px 4px 4px;
-            opacity: 1;
-            border: 1px solid rgba(255, 255, 255, 0.2);
-            position: relative;
-            margin-bottom: 30px;
-            // &.zoom-in {
-            //     cursor: zoom-in;
-            // }
-        }
-    }
+    // &.left-item {
+    //     width: 400px;
+    //     .item-title {
+    //         font-size: 14px;
+    //         color: #999;
+    //     }
+    //     .content-desc {
+    //         font-size: 14px;
+    //         line-height: 28px;
+    //     }
+    //     .media-box {
+    //         width: 360px;
+    //         height: 225px;
+    //         border-radius: 4px 4px 4px 4px;
+    //         opacity: 1;
+    //         border: 1px solid rgba(255, 255, 255, 0.2);
+    //         position: relative;
+    //         // margin-bottom: 30px;
+    //         // &.zoom-in {
+    //         //     cursor: zoom-in;
+    //         // }
+    //     }
+    // }
 
     &.right-item {
+        position: relative;
+        .input-content {
+            width: 100%;
+            height: 34px;
+            margin: 20px 0;
+            padding: 0 20px;
+            position: absolute;
+            bottom: 0;
+            left: 0;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            .input-box {
+                width: 226px;
+                height: 34px;
+                background: rgba(255, 255, 255, 0.1);
+                border-radius: 4px;
+                opacity: 1;
+                border: 1px solid rgba(255, 255, 255, 0.2);
+                input {
+                    line-height: 34px;
+                    padding: 0 10px;
+                    color: #fff;
+                }
+            }
+            .send-btn {
+                width: 60px;
+                height: 34px;
+                background: #0076f6;
+                border-radius: 4px;
+                opacity: 1;
+                text-align: center;
+                line-height: 34px;
+                cursor: pointer;
+            }
+        }
         .comment-content {
             .comment-header {
                 font-size: 16px;
                 font-weight: bold;
                 color: #999;
             }
+            .comment-msg {
+                .comment-item {
+                    display: flex;
+                    align-items: flex-start;
+                    justify-content: flex-start;
+                    margin-top: 14px;
+                    .avatar-box {
+                        width: 24px;
+                        height: 24px;
+                        border-radius: 50%;
+                        background: #f2f2f2;
+                        margin-right: 6px;
+                    }
+                    .comment-box {
+                        flex: 1;
+                        > div {
+                            display: flex;
+                            align-items: center;
+                            justify-content: space-between;
+                        }
+                        .view-top {
+                            .user-name {
+                                font-size: 14px;
+                                color: #999;
+                            }
+                            .iconfont {
+                                color: #999;
+                                font-size: 1em;
+                                cursor: pointer;
+                            }
+                        }
+                        .view-middle {
+                            .comment-text {
+                                font-size: 14px;
+                                color: #fff;
+                            }
+                        }
+                        .view-bottom {
+                            font-size: 12px;
+                            .comment-time {
+                                color: #999;
+                            }
+                            .reply-btn {
+                                color: #0076f6;
+                                cursor: pointer;
+                            }
+                        }
+                        .reply-content {
+                            .reply-item {
+                                display: flex;
+                                align-items: flex-start;
+                                justify-content: flex-start;
+                                margin-top: 14px;
+                                width: 100%;
+                                .avatar-box {
+                                    width: 24px;
+                                    height: 24px;
+                                    border-radius: 50%;
+                                    background: #f2f2f2;
+                                    margin-right: 6px;
+                                }
+                                .reply-box {
+                                    flex: 1;
+                                    > div {
+                                        display: flex;
+                                        align-items: center;
+                                        justify-content: space-between;
+                                    }
+                                    .view-top {
+                                        .user-name {
+                                            font-size: 14px;
+                                            color: #999;
+                                        }
+                                        .iconfont {
+                                            color: #999;
+                                            font-size: 1em;
+                                            cursor: pointer;
+                                        }
+                                    }
+                                    .view-middle {
+                                        .reply-text {
+                                            font-size: 14px;
+                                            color: #fff;
+                                            .reply-tips {
+                                                color: #999;
+                                            }
+                                        }
+                                    }
+                                    .view-bottom {
+                                        font-size: 12px;
+                                        .reply-time {
+                                            color: #999;
+                                        }
+                                        .reply-btn {
+                                            color: #0076f6;
+                                            cursor: pointer;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
         }
     }
 }

+ 311 - 0
src/components/files/content/Comment.vue

@@ -0,0 +1,311 @@
+<!--  -->
+<template>
+    <div class="aside-item right-item">
+        <div class="comment-content">
+            <div class="comment-header"><span>评论</span></div>
+            <div class="comment-msg">
+                <div class="comment-item">
+                    <div class="avatar-box"></div>
+                    <div class="comment-box">
+                        <div class="view-top">
+                            <span class="user-name">用户名称</span>
+                            <i class="iconfont icon-del"></i>
+                        </div>
+                        <div class="view-middle">
+                            <span class="comment-text">这个地方的油漆没有干</span>
+                        </div>
+                        <div class="view-bottom">
+                            <span class="comment-time">2022-11-28</span>
+                            <span class="reply-btn" @click="handlerReply">回复</span>
+                        </div>
+                        <div class="reply-content">
+                            <div class="reply-item">
+                                <div class="avatar-box"></div>
+                                <div class="reply-box">
+                                    <div class="view-top">
+                                        <span class="user-name">用户名称</span>
+                                        <i class="iconfont icon-del"></i>
+                                    </div>
+                                    <div class="view-middle">
+                                        <span class="reply-text">回复<span class="reply-tips">@用户A</span>这个地方的油漆没有干</span>
+                                    </div>
+                                    <div class="view-bottom">
+                                        <span class="reply-time">2022-11-28</span>
+                                        <span class="reply-btn">回复</span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="input-content">
+            <div class="input-box"><input ref="input$" @input="handlerInput" v-model="inputText" :placeholder="placeholderText" type="text" /></div>
+            <div class="send-btn" @click="hanlderSubmit">发布</div>
+        </div>
+    </div>
+    <Toast v-if="showTips" type="warn" :content="showTips" :close="() => (showTips = null)" />
+</template>
+
+<script setup>
+import { ref, onMounted, onBeforeUnmount, computed, inject, nextTick } from 'vue'
+import Toast from '@/components/dialog/Toast'
+import { http } from '@/utils/request'
+const notify = inject('notify')
+console.log(notify.value)
+const emits = defineEmits(['action'])
+const input$ = ref(null)
+const inputText = ref('')
+const placeholderText = ref('')
+const replyStatus = ref(false)
+
+const showTips = ref(null)
+const handlerReply = () => {
+    inputText.value = ''
+    placeholderText.value = '@用户名称'
+    replyStatus.value = true
+}
+
+const handlerInput = () => {
+    // console.log(inputText.value.length)
+    if (replyStatus.value && inputText.value.length) {
+        // console.log(1)
+    }
+}
+let parentId = null
+let commentId = null
+let userId = localStorage.getItem('userId')
+
+const hanlderSubmit = () => {
+    if (inputText.value == '') {
+        showTips.value = '请输入内容'
+        return
+    }
+    if (replyStatus.value) {
+    } else {
+    }
+
+    let params = {
+        commentId: commentId,
+        markingId: notify.value.id,
+        content: inputText.value,
+        userId: userId,
+        parentId: parentId,
+    }
+
+    // if (!params.commentId) {
+    //     delete params.commentId
+    // }
+    // if (!params.parentId) {
+    //     delete params.parentId
+    // }
+    console.log(params)
+    http.post(`smart-site/comment/reply`, params).then(response => {
+        console.log(response)
+        if (response.success) {
+        } else {
+            showTips.value = response.message
+        }
+    })
+}
+const onClose = () => {
+    if (window.kankan) {
+        if (notify.value.__temp) {
+            kankan.TagManager.remove(notify.value.sid)
+        }
+    } else {
+    }
+    notify.value = null
+}
+onMounted(() => {
+    http.post(`smart-site/comment/tree/all`, { markingId: notify.value.id }).then(response => {
+        // console.log(response)
+    })
+
+    if (window.kankan) {
+        window.kankan.TagManager.focusTag(notify.value.sid, {
+            direction: 'left',
+            attrs: {
+                width: 0,
+                // height: 400,
+            },
+        })
+    } else if (window.laser) {
+        window.laser.then(sdk => {
+            let pos = notify.value.tag.position
+            sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
+        })
+    }
+    nextTick(() => {
+        input$.value.addEventListener('keydown', function (e) {
+            if (e.keyCode == 8) {
+                if (replyStatus.value && !inputText.value.length) {
+                    replyStatus.value = false
+                    placeholderText.value = ''
+                }
+            }
+        })
+    })
+})
+
+onBeforeUnmount(() => {})
+</script>
+<style lang="scss" scoped>
+.aside-item {
+    padding: 20px;
+    box-sizing: border-box;
+    line-height: 28px;
+
+    &.right-item {
+        position: relative;
+        .input-content {
+            width: 100%;
+            height: 34px;
+            margin: 20px 0;
+            padding: 0 20px;
+            position: absolute;
+            bottom: 0;
+            left: 0;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            .input-box {
+                width: 226px;
+                height: 34px;
+                background: rgba(255, 255, 255, 0.1);
+                border-radius: 4px;
+                opacity: 1;
+                border: 1px solid rgba(255, 255, 255, 0.2);
+                input {
+                    line-height: 34px;
+                    padding: 0 10px;
+                    color: #fff;
+                }
+            }
+            .send-btn {
+                width: 60px;
+                height: 34px;
+                background: #0076f6;
+                border-radius: 4px;
+                opacity: 1;
+                text-align: center;
+                line-height: 34px;
+                cursor: pointer;
+            }
+        }
+        .comment-content {
+            .comment-header {
+                font-size: 16px;
+                font-weight: bold;
+                color: #999;
+            }
+            .comment-msg {
+                .comment-item {
+                    display: flex;
+                    align-items: flex-start;
+                    justify-content: flex-start;
+                    margin-top: 14px;
+                    .avatar-box {
+                        width: 24px;
+                        height: 24px;
+                        border-radius: 50%;
+                        background: #f2f2f2;
+                        margin-right: 6px;
+                    }
+                    .comment-box {
+                        flex: 1;
+                        > div {
+                            display: flex;
+                            align-items: center;
+                            justify-content: space-between;
+                        }
+                        .view-top {
+                            .user-name {
+                                font-size: 14px;
+                                color: #999;
+                            }
+                            .iconfont {
+                                color: #999;
+                                font-size: 1em;
+                                cursor: pointer;
+                            }
+                        }
+                        .view-middle {
+                            .comment-text {
+                                font-size: 14px;
+                                color: #fff;
+                            }
+                        }
+                        .view-bottom {
+                            font-size: 12px;
+                            .comment-time {
+                                color: #999;
+                            }
+                            .reply-btn {
+                                color: #0076f6;
+                                cursor: pointer;
+                            }
+                        }
+                        .reply-content {
+                            .reply-item {
+                                display: flex;
+                                align-items: flex-start;
+                                justify-content: flex-start;
+                                margin-top: 14px;
+                                width: 100%;
+                                .avatar-box {
+                                    width: 24px;
+                                    height: 24px;
+                                    border-radius: 50%;
+                                    background: #f2f2f2;
+                                    margin-right: 6px;
+                                }
+                                .reply-box {
+                                    flex: 1;
+                                    > div {
+                                        display: flex;
+                                        align-items: center;
+                                        justify-content: space-between;
+                                    }
+                                    .view-top {
+                                        .user-name {
+                                            font-size: 14px;
+                                            color: #999;
+                                        }
+                                        .iconfont {
+                                            color: #999;
+                                            font-size: 1em;
+                                            cursor: pointer;
+                                        }
+                                    }
+                                    .view-middle {
+                                        .reply-text {
+                                            font-size: 14px;
+                                            color: #fff;
+                                            .reply-tips {
+                                                color: #0076f6;
+                                                margin: 0 2px;
+                                            }
+                                        }
+                                    }
+                                    .view-bottom {
+                                        font-size: 12px;
+                                        .reply-time {
+                                            color: #999;
+                                        }
+                                        .reply-btn {
+                                            color: #0076f6;
+                                            cursor: pointer;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+</style>

+ 165 - 0
src/components/files/content/TagMsg.vue

@@ -0,0 +1,165 @@
+<!--  -->
+<template>
+    <div class="aside-item left-item">
+        <div class="content-item">
+            <div class="item-title">创建时间</div>
+            <span class="content-desc">{{notify.createTime}}</span>
+        </div>
+        <div class="content-item">
+            <div class="item-title">创建人</div>
+            <span class="content-desc">陈工</span>
+        </div>
+        <div class="content-item">
+            <div class="item-title">状态</div>
+            <span class="content-desc" v-for="i in data.status">
+                <span v-if="i.value == form.status">{{ i.text }}</span></span
+            >
+        </div>
+        <div class="content-item">
+            <div class="item-title">涉及的成员</div>
+            <span class="content-desc" v-for="(i, index) in form.members"
+                ><span>{{ i.text }}</span>
+                <span v-if="index < form.members.length - 1">、</span>
+            </span>
+        </div>
+        <div class="content-item">
+            <div class="item-title">描述</div>
+            <span class="content-desc">{{ form.describe }}</span>
+        </div>
+        <div class="media-box" v-if="notify.media?.[notify.type]?.length" :class="notify.type == 'image' ? 'zoom-in' : ''">
+            <component :is="component"></component>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { ref, onMounted, onBeforeUnmount, computed, inject } from 'vue'
+import { http } from '@/utils/request'
+import browser from '@/utils/browser'
+import Image from '@/components/form/medias/Image.vue'
+import Video from '@/components/form/medias/Video.vue'
+import Audio from '@/components/form/medias/Audio.vue'
+import Link from '@/components/form/medias/Link.vue'
+const projectId = browser.valueFromUrl('projectId') || 1
+const notify = inject('notify')
+// const props = defineProps(['notify'])
+const emits = defineEmits(['action', 'setShow'])
+const height = ref(0)
+const form = ref({
+    title: '',
+    describe: '',
+    status: '',
+    members: [],
+})
+
+const data = ref({
+    status: [
+        { text: '待处理', value: 1 },
+        { text: '进行中', value: 2 },
+        { text: '未解决', value: 3 },
+        { text: '已解决', value: 4 },
+    ],
+    members: [],
+})
+const media = computed(() => {
+    return notify.value.type || 'image'
+})
+const component = computed(() => {
+    switch (media.value) {
+        case 'image':
+            return Image
+        case 'video':
+            return Video
+        case 'audio':
+            return Audio
+        case 'link':
+            return Link
+    }
+})
+
+const onClose = () => {
+    if (window.kankan) {
+        if (notify.value.__temp) {
+            kankan.TagManager.remove(notify.value.sid)
+        }
+    } else {
+    }
+    notify.value = null
+}
+onMounted(() => {
+    http.post(`smart-site/projectTeam/select`, { projectId }).then(response => {
+        data.value.members = response.data.map(item => {
+            return {
+                text: item.nickName,
+                value: item.userId,
+            }
+        })
+
+        if (notify.value) {
+            form.value.status = String(notify.value.status || '')
+            form.value.title = notify.value.title || ''
+            form.value.describe = notify.value.content || ''
+            form.value.members = []
+            if (notify.value.members && notify.value.members.length) {
+                notify.value.members.forEach(item => {
+                    let find = data.value.members.find(c => c.value == item)
+                    if (find) {
+                        form.value.members.push(find)
+                    }
+                })
+            }
+        }
+        emits('setShow')
+    })
+
+    if (window.kankan) {
+        window.kankan.TagManager.focusTag(notify.value.sid, {
+            direction: 'left',
+            attrs: {
+                width: 0,
+                // height: 400,
+            },
+        })
+    } else if (window.laser) {
+        window.laser.then(sdk => {
+            let pos = notify.value.tag.position
+            sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
+        })
+    }
+})
+
+onBeforeUnmount(() => {})
+</script>
+<style lang="scss" scoped>
+.aside-item {
+    padding: 20px;
+    box-sizing: border-box;
+    line-height: 28px;
+    .content-item {
+        margin-bottom: 20px;
+    }
+    &.left-item {
+        width: 400px;
+        .item-title {
+            font-size: 14px;
+            color: #999;
+        }
+        .content-desc {
+            font-size: 14px;
+            line-height: 28px;
+        }
+        .media-box {
+            width: 360px;
+            height: 225px;
+            border-radius: 4px 4px 4px 4px;
+            opacity: 1;
+            border: 1px solid rgba(255, 255, 255, 0.2);
+            position: relative;
+            // margin-bottom: 30px;
+            // &.zoom-in {
+            //     cursor: zoom-in;
+            // }
+        }
+    }
+}
+</style>

+ 8 - 3
src/components/files/index.vue

@@ -10,9 +10,9 @@
             </div>
             <div class="list">
                 <ul>
-                    <li v-for="tag in tags">
+                    <li v-for="tag in tags" @click="onClick(tag)" :class="{ active: notify?.sid == tag.sid }">
                         <div class="title"><i></i>{{ tag.title }}</div>
-                        <div class="more" @click="onShowMore(tag)">
+                        <div class="more" @click.stop="onShowMore(tag)">
                             <i class="iconfont icon-more"></i>
                             <div v-if="showMoreSid == tag.id" v-click-outside="onOutside">
                                 <div @click.stop="onMoreHandler('modify', tag)">编辑</div>
@@ -50,7 +50,9 @@ const showMoreSid = ref('')
 const tags = inject('tags')
 const notify = inject('notify')
 const isEdit = inject('isEdit')
-
+const onClick = tag => {
+    notify.value = tag //{ event: 'focus', sid: props.tag.sid, tag: props.tag }
+}
 const onAdd = () => {
     if (window.kankan) {
         window.kankan.TagManager.editor.then(editor => {
@@ -321,6 +323,9 @@ li {
     align-items: center;
     justify-content: space-between;
     font-size: 14px;
+    &.active {
+        background-color: rgba(0, 118, 246, 0.1);
+    }
     .title {
     }
     .more {

+ 0 - 7
src/components/form/medias/Image.vue

@@ -33,13 +33,6 @@ const notify = inject('notify')
 const isEdit = inject('isEdit')
 const emits = defineEmits(['tips'])
 
-const props = defineProps({
-    viewer: {
-        type: Boolean,
-        default: false,
-    },
-})
-
 const file = ref(null)
 const swiper$ = ref(null)
 

+ 1 - 0
src/components/header/Login.vue

@@ -82,6 +82,7 @@ const onLogin = () => {
                     localStorage.removeItem('remember')
                     localStorage.removeItem('username')
                     localStorage.removeItem('password')
+                    localStorage.removeItem('userId')
                 }
                 localStorage.setItem('token', response.data.token)
                 emits('user', {

+ 2 - 0
src/components/header/index.vue

@@ -112,6 +112,8 @@ const getUserInfo = () => {
                     head: response.data.head,
                     nickName: response.data.nickName,
                 }
+                localStorage.setItem('userId', response.data.id)
+
             } else {
                 if (response.code == 4008) {
                     // 未登录

+ 1 - 0
src/pages/Viewer.vue

@@ -592,6 +592,7 @@ onMounted(() => {
             tags.value = response.data.list.map(item => {
                 item.hotData.visible = false
                 item.hotData.id = item.markingId
+                item.hotData.createTime = item.createTime
                 return item.hotData
             })
         }