2026-02-04 19:56:19 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="flex h-screen w-screen overflow-hidden bg-white">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<div ref="sidebarRef" class="flex flex-col items-center py-4 border-r z-50"
|
|
|
|
|
|
style="flex: 0 0 calc(100vw * 2 / 19); min-width: 96px; max-width: 400px; background-color: #F8F9FA;">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<div class="mb-6" style="border-bottom: 1px solid #A0AEC023; padding: 10%;">
|
2026-04-16 17:31:45 +08:00
|
|
|
|
<div>
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="yoloIcon" class="yolo-logo" />
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<div class="flex-1 flex flex-col w-full px-2" style="gap: 2vh;">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<button @click="currentView = 'tk'"
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
|
|
|
|
|
:class="currentView === 'tk' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="currentView === 'tk' ? nav11 : nav1" class="w-9 h-9 object-contain flex-shrink-0" />
|
|
|
|
|
|
<span class="text-base font-medium truncate">TK 工作台</span>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</button>
|
2026-02-11 18:30:45 +08:00
|
|
|
|
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<button @click="currentView = 'hosts'"
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
|
|
|
|
|
:class="currentView === 'hosts' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="currentView === 'hosts' ? nav22 : nav2" class="w-9 h-9 object-contain flex-shrink-0" />
|
|
|
|
|
|
<span class="text-base font-medium truncate">主播列表</span>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</button>
|
2026-02-08 15:33:10 +08:00
|
|
|
|
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<button @click="currentView = 'auto_dm'"
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
|
|
|
|
|
:class="currentView === 'auto_dm' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="currentView === 'auto_dm' ? nav33 : nav3" class="w-9 h-9 object-contain flex-shrink-0" />
|
|
|
|
|
|
<span class="text-base font-medium truncate">自动私信</span>
|
2026-02-08 20:53:39 +08:00
|
|
|
|
</button>
|
|
|
|
|
|
|
2026-04-21 17:21:32 +08:00
|
|
|
|
<!-- <button @click="currentView = 'auto_dm_tk'"
|
2026-04-17 16:32:07 +08:00
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
|
|
|
|
|
:class="currentView === 'auto_dm_tk' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
2026-04-16 17:31:45 +08:00
|
|
|
|
<img :src="currentView === 'auto_dm_tk' ? nav33 : nav3" class="w-9 h-9 object-contain flex-shrink-0" />
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<span class="text-base font-medium truncate">自动私信TK版</span>
|
2026-04-21 17:21:32 +08:00
|
|
|
|
</button> -->
|
2026-04-16 17:31:45 +08:00
|
|
|
|
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<button @click="currentView = 'FanWorkbench'"
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
|
|
|
|
|
:class="currentView === 'FanWorkbench' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="currentView === 'FanWorkbench' ? nav44 : nav4" class="w-9 h-9 object-contain flex-shrink-0" />
|
|
|
|
|
|
<span class="text-base font-medium truncate">大哥工作台</span>
|
2026-02-08 20:53:39 +08:00
|
|
|
|
</button>
|
|
|
|
|
|
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<button @click="currentView = 'pk_mini'"
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
|
|
|
|
|
:class="currentView === 'pk_mini' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="currentView === 'pk_mini' ? nav55 : nav5" class="w-9 h-9 object-contain flex-shrink-0" />
|
|
|
|
|
|
<span class="text-base font-medium truncate">PK 工作台</span>
|
2026-02-08 15:33:10 +08:00
|
|
|
|
</button>
|
2026-02-12 13:03:52 +08:00
|
|
|
|
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<button @click="currentView = 'shop'"
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200" style="height: 6vh;"
|
|
|
|
|
|
:class="currentView === 'shop' ? 'bg-white text-blue-600 shadow shadow-blue-900/20' : 'text-slate-400 hover:bg-[rgba(21,96,250,0.06)]'">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="currentView === 'shop' ? nav66 : nav6" class="w-9 h-9 object-contain flex-shrink-0" />
|
|
|
|
|
|
<span class="text-base font-medium truncate">TK商店</span>
|
2026-02-12 13:03:52 +08:00
|
|
|
|
</button>
|
2026-03-30 09:53:08 +08:00
|
|
|
|
|
2026-04-16 17:31:45 +08:00
|
|
|
|
<button
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 transition-all duration-200 text-slate-400 hover:bg-[rgba(21,96,250,0.06)]"
|
2026-04-17 16:32:07 +08:00
|
|
|
|
style="height: 6vh;">
|
2026-04-16 17:31:45 +08:00
|
|
|
|
<span class="text-base font-medium truncate">敬请期待...</span>
|
2026-03-30 09:53:08 +08:00
|
|
|
|
</button>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-11 18:30:45 +08:00
|
|
|
|
<div class="mt-auto w-full px-2">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<button @click="$emit('logout')"
|
|
|
|
|
|
class="w-full rounded-xl flex items-center gap-2 px-3 py-2.5 text-slate-400 bg-white shadow shadow-blue-900/20 transition-all">
|
2026-03-03 21:57:18 +08:00
|
|
|
|
<img :src="backIcon" class="w-9 h-9 object-contain flex-shrink-0" />
|
|
|
|
|
|
<span class="text-base font-medium" style="color: #ED4949;">退出登录</span>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="flex-1 h-full relative">
|
|
|
|
|
|
<div v-show="currentView === 'auto_dm'" class="absolute inset-0 z-10 h-full w-full">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<PermissionMask permission-key="webAi" title="自动私信工作台未开通" description="您当前没有使用自动私信功能的权限"
|
|
|
|
|
|
:placeholder-image="placeholderWebAi" :contacts="serviceContacts">
|
2026-02-04 21:24:11 +08:00
|
|
|
|
<div v-if="autoDmMode === 'config'" class="h-full w-full bg-slate-50 overflow-auto">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<ConfigPage @go-to-browser="handleGoToBrowser" @logout="$emit('logout')"
|
|
|
|
|
|
@config-updated="handleConfigUpdated" />
|
2026-02-04 21:24:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-show="autoDmMode === 'browser'" class="h-full w-full">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<YoloBrowser v-bind="$attrs" :nav-sidebar-width="navSidebarWidth" @go-back="handleBackToConfig"
|
|
|
|
|
|
@stop-all="handleStopAll" />
|
2026-02-04 21:24:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</PermissionMask>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-04-16 17:31:45 +08:00
|
|
|
|
<div v-show="currentView === 'auto_dm_tk'" class="absolute inset-0 z-20 h-full w-full">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<PermissionMask permission-key="autotk" title="自动私信(TK版)工作台未开通" description="您当前没有使用自动私信(TK版)功能的权限"
|
|
|
|
|
|
:placeholder-image="placeholderWebAi" :contacts="serviceContacts">
|
2026-04-16 17:31:45 +08:00
|
|
|
|
<AutoDmTkWorkbench :nav-sidebar-width="navSidebarWidth" />
|
|
|
|
|
|
</PermissionMask>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-04 19:56:19 +08:00
|
|
|
|
<div v-show="currentView === 'tk'" class="absolute inset-0 z-20 bg-gray-50 h-full overflow-hidden">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<PermissionMask permission-key="crawl" title="TK工作台未开通" description="您当前没有使用TK工作台功能的权限"
|
|
|
|
|
|
:placeholder-image="placeholderTk" :contacts="serviceContacts">
|
2026-03-30 09:53:08 +08:00
|
|
|
|
<TkWorkbenches :key="tkWorkbenchKey" />
|
2026-02-04 21:24:11 +08:00
|
|
|
|
</PermissionMask>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-03-05 14:47:02 +08:00
|
|
|
|
<div v-show="currentView === 'hosts'" class="absolute inset-0 z-20 bg-gray-50 h-full overflow-hidden">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<PermissionMask permission-key="crawl" title="主播列表未开通" description="您当前没有使用主播列表功能的权限"
|
|
|
|
|
|
:placeholder-image="placeholderHosts" :contacts="serviceContacts">
|
2026-02-04 21:24:11 +08:00
|
|
|
|
<HostsList />
|
|
|
|
|
|
</PermissionMask>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-03-05 14:47:02 +08:00
|
|
|
|
<div v-show="currentView === 'FanWorkbench'" class="absolute inset-0 z-20 bg-gray-50 h-full overflow-hidden">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<PermissionMask permission-key="bigBrother" title="大哥工作台未开通" description="您当前没有使用大哥工作台功能的权限"
|
|
|
|
|
|
:placeholder-image="placeholderBigBrother" :contacts="serviceContacts">
|
2026-02-04 21:24:11 +08:00
|
|
|
|
<FanWorkbench />
|
|
|
|
|
|
</PermissionMask>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</div>
|
2026-02-08 15:33:10 +08:00
|
|
|
|
|
|
|
|
|
|
<div v-show="currentView === 'pk_mini'" class="absolute inset-0 z-20 h-full overflow-hidden">
|
|
|
|
|
|
<PkMiniWorkbench />
|
|
|
|
|
|
</div>
|
2026-02-12 13:03:52 +08:00
|
|
|
|
|
|
|
|
|
|
<div v-show="currentView === 'shop'" class="absolute inset-0 z-20 h-full overflow-hidden">
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<div v-if="isElectron()"
|
|
|
|
|
|
class="w-full h-full flex items-center justify-center text-base text-slate-500 bg-white">
|
2026-02-28 14:32:26 +08:00
|
|
|
|
正在进入商店...
|
|
|
|
|
|
</div>
|
2026-04-17 16:32:07 +08:00
|
|
|
|
<iframe v-else-if="adminLoaded" :src="shopUrl" class="w-full h-full border-0"
|
2026-02-12 13:03:52 +08:00
|
|
|
|
allow="clipboard-read; clipboard-write"
|
2026-04-17 16:32:07 +08:00
|
|
|
|
sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-downloads" />
|
2026-02-12 13:03:52 +08:00
|
|
|
|
</div>
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-03-03 21:57:18 +08:00
|
|
|
|
import { ref, watch, onMounted, onUnmounted, useTemplateRef } from 'vue'
|
2026-02-04 19:56:19 +08:00
|
|
|
|
import { isElectron } from '@/utils/electronBridge'
|
|
|
|
|
|
import YoloBrowser from '@/views/YoloBrowser.vue'
|
|
|
|
|
|
import TkWorkbenches from '@/views/tk/Workbenches.vue'
|
|
|
|
|
|
import HostsList from '@/views/tk/HostsList.vue'
|
|
|
|
|
|
import ConfigPage from '@/pages/ConfigPage.vue'
|
2026-02-04 21:24:11 +08:00
|
|
|
|
import FanWorkbench from '@/views/tk/FanWorkbench.vue'
|
2026-02-08 15:33:10 +08:00
|
|
|
|
import PkMiniWorkbench from '@/views/pk-mini/PkMiniWorkbench.vue'
|
2026-04-16 17:31:45 +08:00
|
|
|
|
import AutoDmTkWorkbench from '@/views/auto-dm/AutoDmTkWorkbench.vue'
|
2026-02-04 21:24:11 +08:00
|
|
|
|
import PermissionMask from '@/components/PermissionMask.vue'
|
2026-02-26 13:15:19 +08:00
|
|
|
|
import { ENV } from '@/config'
|
2026-03-03 21:57:18 +08:00
|
|
|
|
import { getCustomServiceInfo } from '@/api/account'
|
|
|
|
|
|
|
|
|
|
|
|
import yoloIcon from '@/assets/nav/yolo.png'
|
|
|
|
|
|
import nav1 from '@/assets/nav/nav1.png'
|
|
|
|
|
|
import nav11 from '@/assets/nav/nav11.png'
|
|
|
|
|
|
import nav2 from '@/assets/nav/nav2.png'
|
|
|
|
|
|
import nav22 from '@/assets/nav/nav22.png'
|
|
|
|
|
|
import nav3 from '@/assets/nav/nav3.png'
|
|
|
|
|
|
import nav33 from '@/assets/nav/nav33.png'
|
|
|
|
|
|
import nav4 from '@/assets/nav/nav4.png'
|
|
|
|
|
|
import nav44 from '@/assets/nav/nav44.png'
|
|
|
|
|
|
import nav5 from '@/assets/nav/nav5.png'
|
|
|
|
|
|
import nav55 from '@/assets/nav/nav55.png'
|
|
|
|
|
|
import nav6 from '@/assets/nav/nav6.png'
|
|
|
|
|
|
import nav66 from '@/assets/nav/nav66.png'
|
|
|
|
|
|
import backIcon from '@/assets/nav/back.png'
|
2026-02-04 21:24:11 +08:00
|
|
|
|
|
|
|
|
|
|
import placeholderTk from '@/assets/placeholder-tk.png'
|
|
|
|
|
|
import placeholderHosts from '@/assets/placeholder-hosts.png'
|
|
|
|
|
|
import placeholderWebAi from '@/assets/placeholder-webai.png'
|
|
|
|
|
|
import placeholderBigBrother from '@/assets/placeholder-bigbrother.png'
|
2026-02-04 19:56:19 +08:00
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['logout', 'go-back', 'stop-all'])
|
|
|
|
|
|
|
2026-04-16 17:31:45 +08:00
|
|
|
|
const currentView = ref('tk')
|
|
|
|
|
|
const autoDmMode = ref('config')
|
|
|
|
|
|
const adminLoaded = ref(false)
|
|
|
|
|
|
const shopOpened = ref(false)
|
2026-02-26 13:15:19 +08:00
|
|
|
|
const shopUrl = ENV.SHOP_URL
|
2026-03-03 21:57:18 +08:00
|
|
|
|
const sidebarRef = useTemplateRef('sidebarRef')
|
2026-04-16 17:31:45 +08:00
|
|
|
|
const navSidebarWidth = ref(200)
|
|
|
|
|
|
const tkWorkbenchKey = ref(0)
|
2026-03-30 09:53:08 +08:00
|
|
|
|
|
|
|
|
|
|
const reloadTkWorkbench = () => {
|
|
|
|
|
|
tkWorkbenchKey.value++
|
|
|
|
|
|
console.log('TK 工作台已重新加载')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
window.reloadTkWorkbench = reloadTkWorkbench
|
2026-03-03 21:57:18 +08:00
|
|
|
|
|
|
|
|
|
|
const serviceContacts = ref([])
|
|
|
|
|
|
const loadServiceContacts = async () => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
try {
|
|
|
|
|
|
const res = await getCustomServiceInfo()
|
|
|
|
|
|
if (res) {
|
|
|
|
|
|
serviceContacts.value = res.map(item => ({
|
|
|
|
|
|
avatar: item.avater,
|
|
|
|
|
|
name: item.name,
|
|
|
|
|
|
desc: item.description,
|
|
|
|
|
|
qrcode: item.concat,
|
|
|
|
|
|
phone: item.phone
|
|
|
|
|
|
}))
|
2026-03-03 21:57:18 +08:00
|
|
|
|
}
|
2026-03-30 09:53:08 +08:00
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('获取客服名片失败:', e)
|
|
|
|
|
|
}
|
2026-03-03 21:57:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let resizeObserver = null
|
|
|
|
|
|
const notifySidebarWidth = (width) => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
navSidebarWidth.value = Math.round(width)
|
|
|
|
|
|
if (isElectron()) {
|
2026-04-17 16:32:07 +08:00
|
|
|
|
window.electronAPI.setSidebarWidth(Math.round(width)).catch(() => { })
|
2026-03-30 09:53:08 +08:00
|
|
|
|
}
|
2026-03-03 21:57:18 +08:00
|
|
|
|
}
|
2026-04-16 17:31:45 +08:00
|
|
|
|
|
2026-03-03 21:57:18 +08:00
|
|
|
|
onMounted(() => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
loadServiceContacts()
|
|
|
|
|
|
if (!isElectron()) return
|
|
|
|
|
|
resizeObserver = new ResizeObserver((entries) => {
|
|
|
|
|
|
const width = entries[0]?.contentRect.width
|
|
|
|
|
|
if (width) notifySidebarWidth(width)
|
|
|
|
|
|
})
|
|
|
|
|
|
if (sidebarRef.value) {
|
|
|
|
|
|
resizeObserver.observe(sidebarRef.value)
|
|
|
|
|
|
notifySidebarWidth(sidebarRef.value.getBoundingClientRect().width)
|
|
|
|
|
|
}
|
2026-03-03 21:57:18 +08:00
|
|
|
|
})
|
2026-04-16 17:31:45 +08:00
|
|
|
|
|
2026-03-03 21:57:18 +08:00
|
|
|
|
onUnmounted(() => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
resizeObserver?.disconnect()
|
2026-03-03 21:57:18 +08:00
|
|
|
|
})
|
2026-02-04 19:56:19 +08:00
|
|
|
|
|
|
|
|
|
|
const handleGoToBrowser = async () => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
autoDmMode.value = 'browser'
|
|
|
|
|
|
if (isElectron()) {
|
|
|
|
|
|
await window.electronAPI.showViews()
|
|
|
|
|
|
}
|
2026-02-04 19:56:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleBackToConfig = async () => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
autoDmMode.value = 'config'
|
|
|
|
|
|
if (isElectron()) {
|
|
|
|
|
|
await window.electronAPI.hideViews()
|
|
|
|
|
|
}
|
2026-02-04 19:56:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleStopAll = () => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
emit('stop-all')
|
2026-02-04 19:56:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-01 13:27:27 +08:00
|
|
|
|
const handleConfigUpdated = () => {
|
|
|
|
|
|
window.dispatchEvent(new CustomEvent('config-updated'))
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-04 19:56:19 +08:00
|
|
|
|
watch(currentView, async (newVal, oldVal) => {
|
2026-02-28 14:32:26 +08:00
|
|
|
|
if (newVal === 'shop' && !adminLoaded.value && !isElectron()) {
|
2026-02-12 13:03:52 +08:00
|
|
|
|
adminLoaded.value = true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-04 19:56:19 +08:00
|
|
|
|
if (!isElectron()) return
|
|
|
|
|
|
|
2026-02-28 14:32:26 +08:00
|
|
|
|
if (newVal === 'shop') {
|
2026-04-16 17:31:45 +08:00
|
|
|
|
try {
|
2026-02-28 14:32:26 +08:00
|
|
|
|
shopOpened.value = true
|
2026-04-16 17:31:45 +08:00
|
|
|
|
await window.electronAPI.openShop(shopUrl)
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('打开商店失败:', e)
|
2026-02-28 14:32:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else if (oldVal === 'shop') {
|
|
|
|
|
|
try {
|
|
|
|
|
|
await window.electronAPI.hideShop()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('隐藏商店失败:', e)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-16 17:31:45 +08:00
|
|
|
|
const shouldShowAutoDmViews =
|
|
|
|
|
|
newVal === 'auto_dm' && autoDmMode.value === 'browser'
|
|
|
|
|
|
|
|
|
|
|
|
if (shouldShowAutoDmViews) {
|
2026-02-04 19:56:19 +08:00
|
|
|
|
try {
|
|
|
|
|
|
await window.electronAPI.showViews()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('Failed to show views:', e)
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
try {
|
|
|
|
|
|
await window.electronAPI.hideViews()
|
|
|
|
|
|
} catch (e) {
|
2026-04-16 17:31:45 +08:00
|
|
|
|
console.error('Failed to hide views:', e)
|
2026-02-04 19:56:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
watch(autoDmMode, async (newVal) => {
|
2026-03-30 09:53:08 +08:00
|
|
|
|
if (currentView.value !== 'auto_dm') return
|
|
|
|
|
|
|
|
|
|
|
|
if (newVal === 'browser') {
|
|
|
|
|
|
if (isElectron()) await window.electronAPI.showViews()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (isElectron()) await window.electronAPI.hideViews()
|
|
|
|
|
|
}
|
2026-02-04 19:56:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');
|
2026-03-03 21:57:18 +08:00
|
|
|
|
|
2026-03-30 09:53:08 +08:00
|
|
|
|
.yolo-logo {
|
2026-03-03 21:57:18 +08:00
|
|
|
|
width: 70%;
|
|
|
|
|
|
}
|
2026-02-04 19:56:19 +08:00
|
|
|
|
</style>
|