feat(distribution): 完善分销收号资产双视图、商户提现、自主加价、品牌装修与数据大盘
This commit is contained in:
@@ -47,6 +47,9 @@ const siteStore = useDistributionSiteStore()
|
||||
const announcements = ref<string[]>(defaultHomeAnnouncements)
|
||||
const displayAnnouncements = computed(() => {
|
||||
if (siteStore.isDistribution) {
|
||||
if (siteStore.announcements && siteStore.announcements.length > 0) {
|
||||
return siteStore.announcements
|
||||
}
|
||||
return [
|
||||
`【${siteStore.siteName}】官方认证独立分销站:账号实时同步主站,官方质检,安全秒交接!`,
|
||||
...announcements.value,
|
||||
@@ -55,6 +58,19 @@ const displayAnnouncements = computed(() => {
|
||||
return announcements.value
|
||||
})
|
||||
const banners = ref<HomeBannerSlide[]>(defaultHomeBanners)
|
||||
const displayBanners = computed<HomeBannerSlide[]>(() => {
|
||||
if (siteStore.isDistribution && siteStore.banners && siteStore.banners.length > 0) {
|
||||
return siteStore.banners.map((b) => ({
|
||||
eyebrow: siteStore.siteName,
|
||||
title: b.title || '精选游戏账号 · 随租随玩',
|
||||
badge: '分销精选',
|
||||
pill: '官方保障',
|
||||
tone: 'gold',
|
||||
image_url: b.image_url,
|
||||
}))
|
||||
}
|
||||
return banners.value
|
||||
})
|
||||
const awRecycle = ref<AWRecycleConfig>({ ...defaultAWRecycleConfig })
|
||||
const awRecycleDialogVisible = ref(false)
|
||||
const cooperationFeedback = ref<CooperationFeedbackConfig>({ ...defaultCooperationFeedbackConfig })
|
||||
@@ -463,7 +479,7 @@ if (!restored) {
|
||||
</div>
|
||||
|
||||
<div class="hero-section">
|
||||
<HomeBanner :banners="banners" :stats="statCards" />
|
||||
<HomeBanner :banners="displayBanners" :stats="statCards" />
|
||||
</div>
|
||||
|
||||
<div class="biz-entry-grid" aria-label="业务入口">
|
||||
|
||||
@@ -53,6 +53,15 @@
|
||||
box-shadow: 0 3px 10px rgba(255, 106, 0, 0.28);
|
||||
}
|
||||
|
||||
.pc-brand-logo-img {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 11px;
|
||||
object-fit: contain;
|
||||
background: #ffffff;
|
||||
border: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.pc-brand-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -146,7 +146,13 @@ async function handleSupportClick() {
|
||||
<div class="pc-app-shell">
|
||||
<header class="pc-topbar">
|
||||
<RouterLink class="pc-brand" to="/">
|
||||
<span class="pc-brand-mark">{{
|
||||
<img
|
||||
v-if="siteStore.logoUrl"
|
||||
:src="siteStore.logoUrl"
|
||||
alt="Site Logo"
|
||||
class="pc-brand-logo-img"
|
||||
/>
|
||||
<span v-else class="pc-brand-mark">{{
|
||||
siteStore.isDistribution ? siteStore.siteName.slice(0, 1) : '锤'
|
||||
}}</span>
|
||||
<div class="pc-brand-info">
|
||||
@@ -379,15 +385,34 @@ async function handleSupportClick() {
|
||||
|
||||
<footer class="pc-footer">
|
||||
<div class="pc-footer-inner">
|
||||
<a
|
||||
href="https://beian.miit.gov.cn/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="pc-footer-icp"
|
||||
>湘ICP备2025146668号</a
|
||||
>
|
||||
<span class="pc-footer-divider">|</span>
|
||||
<span class="pc-footer-copyright">版权所有 ©2026 {{ siteStore.siteName }}</span>
|
||||
<template v-if="siteStore.footerInfo">
|
||||
<a
|
||||
v-if="siteStore.footerInfo.icp"
|
||||
href="https://beian.miit.gov.cn/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="pc-footer-icp"
|
||||
>
|
||||
{{ siteStore.footerInfo.icp }}
|
||||
</a>
|
||||
<span v-if="siteStore.footerInfo.icp" class="pc-footer-divider">|</span>
|
||||
<span class="pc-footer-copyright">{{ siteStore.footerInfo.copyright || `版权所有 ©2026 ${siteStore.siteName}` }}</span>
|
||||
<template v-if="siteStore.footerInfo.contact">
|
||||
<span class="pc-footer-divider">|</span>
|
||||
<span class="pc-footer-contact">{{ siteStore.footerInfo.contact }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a
|
||||
href="https://beian.miit.gov.cn/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="pc-footer-icp"
|
||||
>湘ICP备2025146668号</a
|
||||
>
|
||||
<span class="pc-footer-divider">|</span>
|
||||
<span class="pc-footer-copyright">版权所有 ©2026 {{ siteStore.siteName }}</span>
|
||||
</template>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,19 @@ import { defineStore } from 'pinia'
|
||||
import { apiClient } from '@/shared/api/client'
|
||||
import type { ApiResponse } from '@/shared/types/types'
|
||||
|
||||
export interface DistributionBanner {
|
||||
image_url: string
|
||||
link_url?: string
|
||||
title?: string
|
||||
}
|
||||
|
||||
export interface DistributionFooterInfo {
|
||||
icp?: string
|
||||
copyright?: string
|
||||
contact?: string
|
||||
disclaimer?: string
|
||||
}
|
||||
|
||||
export interface DistributionSiteInfo {
|
||||
site_code: string
|
||||
site_name: string
|
||||
@@ -9,6 +22,11 @@ export interface DistributionSiteInfo {
|
||||
status: string
|
||||
display_account_enabled: boolean
|
||||
default_support_group_id?: number | null
|
||||
logo_url?: string
|
||||
favicon_url?: string
|
||||
banners_json?: string
|
||||
announcements_json?: string
|
||||
footer_info_json?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,6 +67,11 @@ export const useDistributionSiteStore = defineStore('distributionSite', {
|
||||
isDistribution: Boolean(code),
|
||||
displayAccountEnabled: true,
|
||||
defaultSupportGroupId: null as number | null,
|
||||
logoUrl: '',
|
||||
faviconUrl: '',
|
||||
banners: [] as DistributionBanner[],
|
||||
announcements: [] as string[],
|
||||
footerInfo: null as DistributionFooterInfo | null,
|
||||
initialized: false,
|
||||
}
|
||||
},
|
||||
@@ -119,12 +142,53 @@ export const useDistributionSiteStore = defineStore('distributionSite', {
|
||||
this.isDistribution = true
|
||||
this.displayAccountEnabled = info.display_account_enabled ?? true
|
||||
this.defaultSupportGroupId = info.default_support_group_id ?? null
|
||||
this.logoUrl = info.logo_url || ''
|
||||
this.faviconUrl = info.favicon_url || ''
|
||||
|
||||
if (info.banners_json) {
|
||||
try {
|
||||
this.banners = JSON.parse(info.banners_json)
|
||||
} catch {
|
||||
this.banners = []
|
||||
}
|
||||
} else {
|
||||
this.banners = []
|
||||
}
|
||||
|
||||
if (info.announcements_json) {
|
||||
try {
|
||||
this.announcements = JSON.parse(info.announcements_json)
|
||||
} catch {
|
||||
this.announcements = []
|
||||
}
|
||||
} else {
|
||||
this.announcements = []
|
||||
}
|
||||
|
||||
if (info.footer_info_json) {
|
||||
try {
|
||||
this.footerInfo = JSON.parse(info.footer_info_json)
|
||||
} catch {
|
||||
this.footerInfo = null
|
||||
}
|
||||
} else {
|
||||
this.footerInfo = null
|
||||
}
|
||||
|
||||
sessionStorage.setItem('hfb_site_code', this.siteCode)
|
||||
sessionStorage.setItem('hfb_site_name', this.siteName)
|
||||
|
||||
// 更新页面标题
|
||||
// 更新页面标题和 Favicon
|
||||
document.title = `【${this.siteName}】租号商城 - 精选游戏账号平台`
|
||||
if (this.faviconUrl && typeof document !== 'undefined') {
|
||||
let link = document.querySelector("link[rel*='icon']") as HTMLLinkElement | null
|
||||
if (!link) {
|
||||
link = document.createElement('link')
|
||||
link.rel = 'icon'
|
||||
document.head.appendChild(link)
|
||||
}
|
||||
link.href = this.faviconUrl
|
||||
}
|
||||
} else {
|
||||
this.resetToMainSite()
|
||||
}
|
||||
@@ -143,6 +207,11 @@ export const useDistributionSiteStore = defineStore('distributionSite', {
|
||||
this.isDistribution = false
|
||||
this.displayAccountEnabled = true
|
||||
this.defaultSupportGroupId = null
|
||||
this.logoUrl = ''
|
||||
this.faviconUrl = ''
|
||||
this.banners = []
|
||||
this.announcements = []
|
||||
this.footerInfo = null
|
||||
sessionStorage.removeItem('hfb_site_code')
|
||||
sessionStorage.removeItem('hfb_site_name')
|
||||
localStorage.removeItem('hfb_site_code')
|
||||
|
||||
Reference in New Issue
Block a user