|
@@ -4,6 +4,8 @@
|
|
|
:theme="theme"
|
|
|
:theme-overrides="themeOverrides"
|
|
|
:class="{ dark: mode }"
|
|
|
+ :locale="zhCN"
|
|
|
+ :date-locale="dateZhCN"
|
|
|
>
|
|
|
<n-layout position="absolute" style="height: 100vh">
|
|
|
<n-layout-header style="padding: 24px" bordered>
|
|
@@ -12,7 +14,7 @@
|
|
|
<n-icon size="24" :component="ChevronBackOutline" />
|
|
|
<span style="position: relative; top: -6px">返回我的场景</span>
|
|
|
</div>
|
|
|
- <n-button type="primary"> 保存 </n-button>
|
|
|
+ <n-button type="primary"> 保存</n-button>
|
|
|
</div>
|
|
|
</n-layout-header>
|
|
|
<n-layout
|
|
@@ -31,7 +33,19 @@
|
|
|
:native-scrollbar="false"
|
|
|
bordered
|
|
|
>
|
|
|
- <n-menu class="menu-class" style="--n-item-color-hover: rgb(243, 243, 245, .5);--n-item-text-color: white; --n-font-size: 14px;--n-item-icon-color: #fff; --n-item-icon-color-active: #316c72;" v-model:value="activeKey" :options="menuOptions" @update:value="handleUpdateValue" />
|
|
|
+ <n-menu
|
|
|
+ class="menu-class"
|
|
|
+ style="
|
|
|
+ --n-item-color-hover: rgb(243, 243, 245, 0.5);
|
|
|
+ --n-item-text-color: white;
|
|
|
+ --n-font-size: 14px;
|
|
|
+ --n-item-icon-color: #fff;
|
|
|
+ --n-item-icon-color-active: #316c72;
|
|
|
+ "
|
|
|
+ v-model:value="activeKey"
|
|
|
+ :options="menuOptions"
|
|
|
+ @update:value="handleUpdateValue"
|
|
|
+ />
|
|
|
</n-layout-sider>
|
|
|
<n-layout-content
|
|
|
content-class="layoutContent"
|
|
@@ -41,12 +55,25 @@
|
|
|
<div
|
|
|
class="app-scene"
|
|
|
ref="sceneRef"
|
|
|
- :style="{ width: sceneRefWidth, opacity: showScene ? 0 : 1 }"
|
|
|
+ :style="{
|
|
|
+ width: sceneRefWidth,
|
|
|
+ display: showScene ? 'none' : 'block'
|
|
|
+ }"
|
|
|
>
|
|
|
- <iframe v-if="sceneURL" :src="sceneURL" frameborder="0" :style="sceneMobileMode && {width:'375px',height:'677px'}" @load="setupSDK($event.target)"></iframe>
|
|
|
+ <iframe
|
|
|
+ v-if="sceneURL"
|
|
|
+ :src="sceneURL"
|
|
|
+ frameborder="0"
|
|
|
+ :style="sceneMobileMode && { width: '375px', height: '677px' }"
|
|
|
+ @load="setupSDK($event.target)"
|
|
|
+ ></iframe>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="app-view pointer-events-none" id="drawer-target">
|
|
|
+ <div
|
|
|
+ :class="{ isTran: showScene }"
|
|
|
+ class="app-view"
|
|
|
+ id="drawer-target"
|
|
|
+ >
|
|
|
<n-message-provider>
|
|
|
<n-dialog-provider>
|
|
|
<router-view />
|
|
@@ -65,9 +92,11 @@ import {
|
|
|
darkTheme,
|
|
|
lightTheme,
|
|
|
NDialogProvider,
|
|
|
- NMessageProvider
|
|
|
+ NMessageProvider,
|
|
|
+ zhCN,
|
|
|
+ dateZhCN
|
|
|
} from 'naive-ui'
|
|
|
-import { computed, ref, toRaw , watchEffect, h, onMounted, watch } from 'vue'
|
|
|
+import { computed, ref, toRaw, watchEffect, h, onMounted, watch } from 'vue'
|
|
|
import type { Component } from 'vue'
|
|
|
import { useMainStore } from '@/store'
|
|
|
import themeOverrides from '@/styles/theme.js'
|
|
@@ -81,9 +110,14 @@ import {
|
|
|
PeopleOutline,
|
|
|
ChatboxEllipses
|
|
|
} from '@vicons/ionicons5'
|
|
|
+
|
|
|
const darkStore = localStorage.getItem('dark')
|
|
|
import { RouterLink } from 'vue-router'
|
|
|
import { NIcon, useMessage } from 'naive-ui'
|
|
|
+import { useUrlSearchParams } from '@vueuse/core'
|
|
|
+
|
|
|
+const params = useUrlSearchParams('hash')
|
|
|
+
|
|
|
const route = useRoute()
|
|
|
const activeKey = ref(route.name)
|
|
|
|
|
@@ -107,6 +141,7 @@ const prefersDark: boolean = darkStore
|
|
|
|
|
|
const mode = ref<boolean>(prefersDark)
|
|
|
const theme = computed(() => (mode.value ? darkTheme : lightTheme))
|
|
|
+
|
|
|
const sceneRefWidth = computed(() => {
|
|
|
console.log('route', route, route.name === 'basicSettings')
|
|
|
if (route.name === 'basicSettings' || route.name === 'topicNavigation')
|
|
@@ -115,18 +150,21 @@ const sceneRefWidth = computed(() => {
|
|
|
return `calc(100% - ${mode.sceneRefWidth}px)`
|
|
|
})
|
|
|
|
|
|
-const sceneURL = computed(()=>main.sceneURL)
|
|
|
-const sceneMobileMode = computed(()=>main.sceneMode == 'mobile')
|
|
|
+const sceneURL = computed(() => main.sceneURL)
|
|
|
+const sceneMobileMode = computed(() => main.sceneMode == 'mobile')
|
|
|
|
|
|
const sceneRef = ref()
|
|
|
const main = useMainStore()
|
|
|
-const { setSceneLink,setSceneRef } = main
|
|
|
+const { setSceneLink, setSceneRef } = main
|
|
|
+
|
|
|
watchEffect(() => {
|
|
|
localStorage.setItem('dark', `${mode.value}`)
|
|
|
})
|
|
|
+
|
|
|
function renderIcon(icon: Component) {
|
|
|
return () => h(NIcon, null, { default: () => h(icon) })
|
|
|
}
|
|
|
+
|
|
|
const collapsed = ref(false)
|
|
|
const menuOptions = [
|
|
|
{
|
|
@@ -219,7 +257,9 @@ const handleUpdateValue = (value: string) => {
|
|
|
console.log(value)
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
- setSceneLink('/page/spg.html?m=KJ-t-3Y6dxgyehDk')
|
|
|
+ const sceneCode = params.m ? String(params.m) : 'KJ-t-3Y6dxgyehDk'
|
|
|
+ main.setSceneCode(sceneCode)
|
|
|
+ setSceneLink(`/page/spg.html?m=${main.sceneCode}`)
|
|
|
setSceneRef(sceneRef.value)
|
|
|
})
|
|
|
</script>
|
|
@@ -229,22 +269,28 @@ onMounted(() => {
|
|
|
font-family: Inter, Avenir, Helvetica, Arial, sans-serif
|
|
|
-webkit-font-smoothing: antialiased
|
|
|
-moz-osx-font-smoothing: grayscale
|
|
|
+
|
|
|
.layoutContent
|
|
|
position: relative
|
|
|
padding: 0px
|
|
|
height: calc(100vh - 83px)
|
|
|
overflow: hidden
|
|
|
-.app-wrap,.app-view
|
|
|
+
|
|
|
+.app-wrap, .app-view
|
|
|
position: absolute
|
|
|
left: 0
|
|
|
top: 0
|
|
|
width: 100%
|
|
|
height: 100%
|
|
|
z-index: 10
|
|
|
+
|
|
|
.app-view
|
|
|
z-index: 100
|
|
|
pointer-events: none
|
|
|
|
|
|
+ &.isTran
|
|
|
+ pointer-events: all
|
|
|
+
|
|
|
.app-scene
|
|
|
width: 100%
|
|
|
height: 100%
|
|
@@ -255,9 +301,11 @@ onMounted(() => {
|
|
|
.app-scene iframe
|
|
|
width: 100%
|
|
|
height: 100%
|
|
|
+
|
|
|
.required
|
|
|
padding-left: 10px
|
|
|
position: relative
|
|
|
+
|
|
|
&:after
|
|
|
content: " *"
|
|
|
color: red
|