This commit is contained in:
2026-03-05 14:47:02 +08:00
parent 89d3487c02
commit ab645588ac
12 changed files with 135 additions and 78 deletions

View File

@@ -7,4 +7,4 @@ VITE_REGISTER_API_URL=http://192.168.2.22:48080
# pk api地址
VITE_PK_MINI_API_URL=http://192.168.2.22:8086
# 商店地址
VITE_SHOP_URL=https://ck.ninisc.cn/
VITE_SHOP_URL=https://www.tkzyw.com

View File

@@ -230,19 +230,19 @@ const handleGoToConfig = async () => {
}
const handleLogout = async () => {
if (isElectron()) {
await window.electronAPI.logout()
}
stopHealthCheck()
currentPage.value = 'login'
localStorage.removeItem(USER_KEY)
if (isElectron()) {
try { await window.electronAPI.logout() } catch (e) { console.warn('[App] logout失败:', e) }
try {
await window.electronAPI.hideViews()
await handleStopAll()
} catch (e) {
console.warn('[App] 清理视图失败:', e)
}
currentPage.value = 'login'
localStorage.removeItem(USER_KEY)
// currentPage.value = 'login'
}
}
const handleStopAll = async () => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
src/assets/nav/card.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
src/assets/nav/exchange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
src/assets/nav/phone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -36,7 +36,7 @@
<div class="flex flex-wrap items-center gap-4 text-sm">
<label class="flex items-center gap-2 cursor-pointer">
<input type="checkbox" v-model="filters.gold" class="w-4 h-4" />
<span class="text-yellow-600"></span>
<span class="text-yellow-600">进阶</span>
</label>
<label class="flex items-center gap-2 cursor-pointer">
<input type="checkbox" v-model="filters.ordinary" class="w-4 h-4" />
@@ -144,7 +144,7 @@
'px-1.5 py-0.5 rounded border',
host.invitationType === 2 ? 'text-yellow-600 border-yellow-400' : 'border-gray-300'
]">
{{ host.invitationType === 2 ? '票' : '普票' }}
{{ host.invitationType === 2 ? '进阶票' : '普票' }}
</span>
</div>
</div>
@@ -199,7 +199,7 @@
</button>
<button @click="addForm.invitationType = '2'"
:class="['px-4 py-2 rounded-lg text-sm border transition-all', addForm.invitationType === '2' ? 'bg-yellow-500 text-white border-yellow-500' : 'bg-white text-gray-600 border-gray-300 hover:border-yellow-300']">
进阶
</button>
</div>
</div>
@@ -424,7 +424,7 @@ const loadConfig = async () => {
if (config?.filters?.hostsLevelList) {
selectedLevels.value = new Set(config.filters.hostsLevelList)
}
// 加载票/普票过滤配置
// 加载进阶票/普票过滤配置
if (config?.filters?.gold !== undefined) {
filters.value.gold = config.filters.gold
}

View File

@@ -28,7 +28,7 @@
<p class="mask-description">{{ description }}</p>
<div class="mask-hint">
<span class="material-icons-round hint-icon">info</span>
<span>请联系管理员开通权限</span>
<span>请联系下方客服开通权限</span>
</div>
</div>
</div>
@@ -36,10 +36,7 @@
<!-- 下方名片区域 -->
<div v-if="contacts && contacts.length" class="cards-area">
<div class="cards-header">
<button class="refresh-btn" @click="shuffleContacts">
<span class="material-icons-round" style="font-size:18px;">refresh</span>
换一批
</button>
<img :src="exchangeIcon" class="refresh-btn" @click="shuffleContacts" alt="换一批" />
</div>
<div class="cards-row">
<div
@@ -50,12 +47,13 @@
<div class="card-avatar-wrapper">
<img :src="contact.avatar" class="card-avatar" alt="" />
</div>
<img :src="cardBg" class="card-bg" alt="" />
<div class="card-body">
<div class="card-name">{{ contact.name }}</div>
<div class="card-desc">{{ contact.desc }}</div>
<img :src="contact.qrcode" class="card-qrcode" alt="二维码" />
<div class="card-phone">
<span class="material-icons-round phone-icon">phone</span>
<img :src="phoneIcon" class="phone-icon" alt="" />
{{ contact.phone }}
</div>
</div>
@@ -70,6 +68,9 @@
<script setup>
import { ref, computed, onMounted, onUnmounted, watch } from 'vue'
import { getPermissions } from '@/utils/storage'
import cardBg from '@/assets/nav/card.png'
import phoneIcon from '@/assets/nav/phone.png'
import exchangeIcon from '@/assets/nav/exchange.png'
const props = defineProps({
permissionKey: {
@@ -98,7 +99,8 @@ const props = defineProps({
const wrapperRef = ref(null)
const maskRef = ref(null)
const contactOffset = ref(0)
const visibleIndices = ref([])
const visibleContacts = ref([])
const guardKey = computed(() => `guard_${props.permissionKey}_${Date.now()}`)
@@ -108,16 +110,48 @@ const hasAccess = computed(() => {
return permissionsData.value[props.permissionKey] === 1
})
// 每次显示3张换一批向后轮转
const visibleContacts = computed(() => {
if (!props.contacts.length) return []
const pickRandomIndices = (sourceIndices, count) => {
const arr = [...sourceIndices]
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1))
;[arr[i], arr[j]] = [arr[j], arr[i]]
}
return arr.slice(0, count)
}
const updateVisibleContacts = (excludeCurrent = false) => {
const total = props.contacts.length
return [0, 1, 2].map(i => props.contacts[(contactOffset.value + i) % total])
})
if (total === 0) {
visibleIndices.value = []
visibleContacts.value = []
return
}
if (total <= 3) {
const all = [...Array(total).keys()]
visibleIndices.value = pickRandomIndices(all, total)
visibleContacts.value = visibleIndices.value.map(i => props.contacts[i])
return
}
const all = [...Array(total).keys()]
let candidates = all
if (excludeCurrent && visibleIndices.value.length) {
const current = new Set(visibleIndices.value)
candidates = all.filter(i => !current.has(i))
if (candidates.length < 3) {
candidates = all
}
}
visibleIndices.value = pickRandomIndices(candidates, 3)
visibleContacts.value = visibleIndices.value.map(i => props.contacts[i])
}
const shuffleContacts = () => {
if (props.contacts.length <= 3) return
contactOffset.value = (contactOffset.value + 3) % props.contacts.length
updateVisibleContacts(true)
}
let permissionCheckInterval = null
@@ -160,8 +194,7 @@ const setupDOMProtection = () => {
}
onMounted(() => {
console.log("获取名片",props.contacts)
updateVisibleContacts(false)
permissionCheckInterval = setInterval(refreshPermissions, 2000)
setTimeout(setupDOMProtection, 100)
})
@@ -171,6 +204,14 @@ onUnmounted(() => {
if (observer) observer.disconnect()
})
watch(
() => props.contacts,
() => {
updateVisibleContacts(false)
},
{ deep: true }
)
watch(hasAccess, (newVal) => {
if (observer) observer.disconnect()
if (!newVal) setTimeout(setupDOMProtection, 100)
@@ -305,7 +346,7 @@ watch(hasAccess, (newVal) => {
/* 名片区域 */
.cards-area {
width: 100%;
padding: 3vh 4rem 2rem;
padding: 3vh 0 2rem;
animation: slideUp 0.4s ease-out 0.1s both;
}
@@ -313,25 +354,18 @@ watch(hasAccess, (newVal) => {
display: flex;
justify-content: flex-end;
margin-bottom: 1rem;
padding-right: 10%;
}
.refresh-btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 0.5rem 1.25rem;
background: #2563eb;
color: #fff;
border: none;
border-radius: 9999px;
font-size: 0.9rem;
font-weight: 500;
height: 2.2vw;
cursor: pointer;
transition: background 0.2s;
display: block;
transition: opacity 0.2s;
}
.refresh-btn:hover {
background: #1d4ed8;
opacity: 0.8;
}
.cards-row {
@@ -341,30 +375,47 @@ watch(hasAccess, (newVal) => {
/* 单张名片 */
.contact-card {
flex: 1;
max-width: 280px;
background: #fff;
width: 17%;
flex: none;
max-width: unset;
aspect-ratio: 2 / 3;
background: transparent;
border-radius: 1.25rem;
padding-top: 52px;
padding-top: 0;
position: relative;
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
box-shadow: none;
display: flex;
flex-direction: column;
align-items: center;
}
.contact-card::before {
display: none;
}
.card-bg {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: fill;
border-radius: 1.25rem;
z-index: 0;
pointer-events: none;
}
.card-avatar-wrapper {
position: absolute;
top: -44px;
left: 50%;
transform: translateX(-50%);
width: 88px;
height: 88px;
width: 40%;
aspect-ratio: 1;
border-radius: 50%;
border: 4px solid #fff;
border: 3px solid #fff;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
overflow: hidden;
background: #e2e8f0;
z-index: 2;
}
.card-avatar {
@@ -377,43 +428,50 @@ watch(hasAccess, (newVal) => {
display: flex;
flex-direction: column;
align-items: center;
padding: 0.5rem 1.5rem 1.5rem;
padding: 50% 8% 6%;
width: 100%;
height: 100%;
position: relative;
z-index: 1;
justify-content: flex-start;
box-sizing: border-box;
}
.card-name {
font-size: 1.25rem;
font-size: 1.1vw;
font-weight: 700;
color: #1e293b;
margin-bottom: 0.5rem;
margin-bottom: 0.3vw;
text-align: center;
}
.card-desc {
font-size: 0.8125rem;
font-size: 0.8vw;
color: #64748b;
text-align: center;
margin-bottom: 1rem;
line-height: 1.5;
margin-bottom: 0.5vw;
line-height: 1.4;
}
.card-qrcode {
width: 140px;
height: 140px;
width: 60%;
aspect-ratio: 1;
object-fit: contain;
margin-bottom: 1rem;
margin-bottom: 0.5vw;
}
.card-phone {
display: flex;
align-items: center;
gap: 6px;
font-size: 1rem;
gap: 0.3vw;
font-size: 0.85vw;
color: #2563eb;
font-weight: 500;
}
.phone-icon {
font-size: 1.1rem;
color: #2563eb;
width: 0.9vw;
height: 0.9vw;
object-fit: contain;
}
</style>

View File

@@ -12,7 +12,7 @@ export const PK_MINI_CONFIG = {
// GoEasy 配置
GOEASY: {
HOST: 'singapore.goeasy.io',
APP_KEY: 'PC-8b16068a70024e27a17f93e36080afcd',
APP_KEY: 'PC-cfd3ebc8401447be8562b00d243ea82f',
},
// API 基础地址(从中心配置读取,随环境自动切换)

View File

@@ -119,7 +119,7 @@
</div>
<!-- Tab 3: Hosts List - crawl 权限 -->
<div v-show="currentView === 'hosts'" class="absolute inset-0 z-20 bg-gray-50 h-full overflow-hidden p-4">
<div v-show="currentView === 'hosts'" class="absolute inset-0 z-20 bg-gray-50 h-full overflow-hidden">
<PermissionMask
permission-key="crawl"
title="主播列表未开通"
@@ -132,7 +132,7 @@
</div>
<!-- Tab 4: Fan Workbench - bigBrother 权限 -->
<div v-show="currentView === 'FanWorkbench'" class="absolute inset-0 z-20 bg-gray-50 h-full overflow-hidden p-4">
<div v-show="currentView === 'FanWorkbench'" class="absolute inset-0 z-20 bg-gray-50 h-full overflow-hidden">
<PermissionMask
permission-key="bigBrother"
title="大哥工作台未开通"

View File

@@ -92,7 +92,7 @@ export default {
sure: '确定',
invitationType: '邀请类型',
invitationType1: '普票',
invitationType2: '票',
invitationType2: '进阶票',
liveSessions: '直播场次',
viewSessions: '查看场次',
liveRevenue: '直播收益',

View File

@@ -108,8 +108,8 @@
<span class="flex items-center gap-2">
<svg class="w-4 h-4 animate-spin" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10"
stroke="currentColor" stroke-width="4"></circle>
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor"
stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
</path>
@@ -233,8 +233,7 @@
d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
</svg>
</div>
<input type="password" v-model="registerForm.confirmPassword"
placeholder="请再次输入密码"
<input type="password" v-model="registerForm.confirmPassword" placeholder="请再次输入密码"
class="focus:ring-[#4F81E6] focus:border-[#4F81E6] block w-full pl-10 sm:text-sm border-gray-300 rounded-lg py-2.5 transition-colors bg-gray-50 focus:bg-white" />
</div>
</div>
@@ -262,8 +261,8 @@
<span class="flex items-center gap-2">
<svg class="w-4 h-4 animate-spin" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10"
stroke="currentColor" stroke-width="4"></circle>
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor"
stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
</path>
@@ -323,7 +322,7 @@ import { isElectron, getAppVersion } from '../utils/electronBridge'
import { setUser, setToken, setUserPass, getUserPass, setPermissions } from '@/utils/storage'
import { tenantRegister } from '@/api/register'
import logo from '../assets/logo.png'
import illustration from '../assets/illustration.png'
import illustration from '../assets/illustration.webp'
const emit = defineEmits(['loginSuccess'])