Explorar o código

Merge branch 'dev' of http://192.168.0.115:3000/4dkankan/4dkankan_bim into dev

rindy %!s(int64=2) %!d(string=hai) anos
pai
achega
e358c5aab3

+ 2 - 2
public/smart-kankan.html

@@ -36,8 +36,8 @@
         </div>
         <script src="<%= BASE_URL %><%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=<%= VUE_APP_VERSION %>"></script>
         <script src="<%= BASE_URL %><%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=<%= VUE_APP_VERSION %>"></script>
-
-        <!-- <script src="http://127.0.0.1:3099/dist/sdk/kankan-sdk-deps.js"></script>
+<!-- 
+        <script src="http://127.0.0.1:3099/dist/sdk/kankan-sdk-deps.js"></script>
         <script src="http://127.0.0.1:3099/dist/sdk/kankan-sdk.js"></script> -->
         <script>
             window.onload = function () {

+ 22 - 5
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,18 +9,20 @@
             </header>
             <article>
                 <TagMsg @setShow="setShow"></TagMsg>
-                <Comment :slideHeigt="slideHeigt"></Comment>
+                <Comment v-if="isLogin" :slideHeigt="slideHeigt"></Comment>
             </article>
             <!-- <footer></footer> -->
         </div>
     </div>
 </template>
 <script setup>
-import { ref, onMounted, onBeforeUnmount, computed, inject } from 'vue'
+import { ref, onMounted, onBeforeUnmount, computed, inject, watch } 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)
@@ -45,7 +47,16 @@ const setShow = data => {
         slideHeigt.value = document.querySelector('.left-item').offsetHeight
     })
 }
-onMounted(() => {
+
+watch(
+    () => notify.value,
+    (val, old) => {
+        if (val) {
+            goFocusTag()
+        }
+    }
+)
+const goFocusTag = () => {
     if (window.kankan) {
         window.kankan.TagManager.focusTag(notify.value.sid, {
             direction: 'left',
@@ -60,6 +71,9 @@ onMounted(() => {
             sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
         })
     }
+}
+onMounted(() => {
+  goFocusTag()
     onResize()
     window.addEventListener('resize', onResize)
 })
@@ -281,6 +295,9 @@ onBeforeUnmount(() => {
     border: 1px solid #000000;
     backdrop-filter: blur(4px);
     color: #fff;
+    &.no-comment {
+        width: 400px;
+    }
 
     header {
         padding: 0 20px;
@@ -306,7 +323,7 @@ onBeforeUnmount(() => {
         overflow: hidden;
         > div {
             width: 50%;
-            
+
             // &.left-item {
             //     border-right: solid 1px rgba(255, 255, 255, 0.16);
             // }

+ 14 - 14
src/components/files/content/Comment.vue

@@ -219,20 +219,20 @@ const delComment = data => {
 }
 onMounted(() => {
     getAllComments()
-    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.position
-            sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
-        })
-    }
+    // 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.position
+    //         sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
+    //     })
+    // }
     nextTick(() => {
         input$.value.addEventListener('keydown', function (e) {
             if (e.keyCode == 8) {

+ 20 - 16
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)
@@ -155,20 +156,20 @@ onMounted(() => {
         }
     })
 
-    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.position
-            sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
-        })
-    }
+    // 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.position
+    //         sdk.scene.comeToTag(new THREE.Vector3(pos.x, pos.y, pos.z))
+    //     })
+    // }
 })
 
 onBeforeUnmount(() => {})
@@ -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;

+ 7 - 5
src/components/form/SelectList.vue

@@ -114,11 +114,12 @@ li {
             left: -1px;
             right: -1px;
             top: calc(100% + 4px);
-            background: rgba(27, 27, 28, 0.8);
+            background: rgba(27, 27, 28, 0.9);
+            // background: rgb(57, 57, 60, 0.9);
             box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
             border-radius: 4px 4px 4px 4px;
             border: 1px solid #000000;
-            max-height: 200px;
+            max-height: 250px;
             overflow: hidden;
             overflow-y: auto;
             z-index: 1000;
@@ -133,6 +134,7 @@ li {
                 > div {
                     display: flex;
                     align-items: center;
+                    color:rgba(255, 255, 255, 0.6)
                 }
             }
         }
@@ -160,8 +162,8 @@ li {
         content: '';
         border: 1px solid #666;
         border-radius: 2px;
-        width: 16px;
-        height: 16px;
+        width: 14px;
+        height: 14px;
         position: absolute;
         left: 0px;
         top: 0;
@@ -173,7 +175,7 @@ li {
             background-color: #0076f6;
         }
         &::after {
-            left: 4px;
+            left: 3px;
             top: 7px;
             position: absolute;
             display: table;

+ 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>

+ 2 - 2
src/components/header/Login.vue

@@ -9,14 +9,14 @@
                         <span class="icon">
                             <i class="iconfont icon-user"></i>
                         </span>
-                        <input type="text" v-model.trim="username" />
+                        <input type="text" v-model.trim="username" :placeholder="$t('header.inputPhoneNum')" />
                         <div class="tips" v-show="errors.username">{{ errors.username }}</div>
                     </div>
                     <div class="input">
                         <span class="icon">
                             <i class="iconfont icon-password"></i>
                         </span>
-                        <input :type="showpass ? 'text' : 'password'" v-model.trim="password" />
+                        <input :type="showpass ? 'text' : 'password'" v-model.trim="password" :placeholder="$t('header.inputPassword')" />
                         <div class="tips" v-show="errors.password">{{ errors.password }}</div>
                         <span class="showpass" @click="showpass = !showpass">
                             <i class="iconfont" :class="[showpass ? 'icon-log_eye_selected' : 'icon-log_eye_normal']"></i>

+ 2 - 0
src/locales/zh.json

@@ -12,6 +12,8 @@
   },
   "home.name": "首页",
   "header": {
+    "inputPhoneNum": "请输入手机号码",
+    "inputPassword": "请输入密码",
     "passwordText1": "密码不能为空",
     "phoneText1": "手机号码不能为空",
     "phoneText2": "请输入正确手机号",