jinx 2 anni fa
parent
commit
0a64c3eaf5

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

@@ -1,7 +1,7 @@
 <template>
     <div class="tag-view" v-show="canShow">
         <!-- <div class="tag-view-content" :style="{ height: height + 'px' }"> -->
-        <div class="tag-view-content">
+        <div class="tag-view-content" :class="!isLogin ? 'no-comment' : ''">
             <header>
                 <span>{{ notify.title }}</span>
                 <!-- <i class="iconfont icon-close" @click="emits('action', null)"></i> -->
@@ -9,7 +9,7 @@
             </header>
             <article>
                 <TagMsg @setShow="setShow"></TagMsg>
-                <Comment :slideHeigt="slideHeigt"></Comment>
+                <Comment v-if="isLogin" :slideHeigt="slideHeigt"></Comment>
             </article>
             <!-- <footer></footer> -->
         </div>
@@ -21,6 +21,8 @@ import { ref, onMounted, onBeforeUnmount, computed, inject } from 'vue'
 import TagMsg from './content/TagMsg.vue'
 import Comment from './content/Comment.vue'
 import { nextTick } from 'process'
+
+const isLogin = inject('isLogin')
 const notify = inject('notify')
 const emits = defineEmits(['action'])
 const height = ref(0)
@@ -281,6 +283,9 @@ onBeforeUnmount(() => {
     border: 1px solid #000000;
     backdrop-filter: blur(4px);
     color: #fff;
+    &.no-comment {
+        width: 400px;
+    }
 
     header {
         padding: 0 20px;
@@ -306,7 +311,7 @@ onBeforeUnmount(() => {
         overflow: hidden;
         > div {
             width: 50%;
-            
+
             // &.left-item {
             //     border-right: solid 1px rgba(255, 255, 255, 0.16);
             // }

+ 6 - 2
src/components/files/content/TagMsg.vue

@@ -1,7 +1,7 @@
 <!--  -->
 <template>
-    <div class="aside-item left-item">
-        <UiAudio v-if="notify.type == 'audio'" :src="notify.media?.[notify.type][0].src" />
+    <div class="aside-item left-item" :class="!isLogin ? 'no-comment' : ''">
+        <UiAudio v-if="notify.type == 'audio' && notify.media?.[notify.type]" :src="notify.media?.[notify.type][0].src" />
 
         <div class="content-item">
             <div class="item-title">{{ $t('tag.createTime') }}</div>
@@ -64,6 +64,7 @@ import i18n from '@/i18n'
 const { t } = i18n.global
 const projectId = browser.valueFromUrl('projectId') || 1
 const notify = inject('notify')
+const isLogin = inject('isLogin')
 // const props = defineProps(['notify'])
 const emits = defineEmits(['action', 'setShow'])
 const height = ref(0)
@@ -236,6 +237,9 @@ onBeforeUnmount(() => {})
     &.left-item {
         width: 400px;
         border-right: solid 1px rgba(255, 255, 255, 0.16);
+        &.no-comment {
+            border-right: none;
+        }
         .item-title {
             font-size: 14px;
             color: #999;

+ 2 - 2
src/components/form/medias/Link.vue

@@ -6,11 +6,11 @@
     </div>
     <div class="placeholder" v-show="url == null">
         <div class="icon">
-            <span>{{$t('components.linkView')}}</span>
+            <span>{{ $t('components.linkView') }}</span>
         </div>
         <div class="link">
             <input type="text" placeholder="https://" v-model.trim="href" />
-            <div class="save" @click="onConfirm"><i class="iconfont icon-checkbox1"></i></div>
+            <div class="save" :class="{ disabled: !href }" @click="onConfirm"><i class="iconfont icon-checkbox1"></i></div>
         </div>
     </div>
 </template>