mirror of
https://gitee.com/wot-design-uni/wot-design-uni.git
synced 2025-12-06 09:08:51 +08:00
Merge branch 'release'
This commit is contained in:
commit
99185310bc
@ -139,6 +139,11 @@ export default defineConfig({
|
||||
{
|
||||
text: 'Donor List',
|
||||
link: '/en-US/reward/donor',
|
||||
},
|
||||
// 赞助渠道
|
||||
{
|
||||
text: 'Sponsor',
|
||||
link: '/reward/sponsor',
|
||||
}
|
||||
],
|
||||
'/en-US/component/': [
|
||||
|
||||
@ -147,7 +147,11 @@ export default defineConfig({
|
||||
{
|
||||
text: '榜上有名',
|
||||
link: '/reward/donor',
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '成为赞助者',
|
||||
link: '/reward/sponsor',
|
||||
},
|
||||
],
|
||||
'/component/': [
|
||||
{
|
||||
|
||||
@ -1,22 +1,97 @@
|
||||
<!--
|
||||
* @Author: weisheng
|
||||
* @Date: 2025-09-21 17:13:45
|
||||
* @LastEditTime: 2025-09-21 19:08:34
|
||||
* @LastEditors: weisheng
|
||||
* @Description:
|
||||
* @FilePath: /wot-design-uni/docs/.vitepress/theme/components/AsideSponsors.vue
|
||||
* 记得注释
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { VPDocAsideSponsors } from 'vitepress/theme'
|
||||
import { useSponsor } from '../composables/sponsor'
|
||||
import { useAdSponsor } from '../composables/adSponsor'
|
||||
|
||||
const { data } = useSponsor()
|
||||
const { data } = useAdSponsor()
|
||||
|
||||
const sponsors = computed(() => {
|
||||
return (
|
||||
data?.value.map((sponsor) => {
|
||||
return {
|
||||
size: sponsor.size === 'big' ? 'mini' : 'xmini',
|
||||
items: sponsor.items,
|
||||
}
|
||||
}) ?? []
|
||||
)
|
||||
// 分离超级赞助和金牌赞助
|
||||
const superSponsors = computed(() => {
|
||||
return data.value?.find(sponsor => sponsor.tier === 'Platinum')
|
||||
})
|
||||
|
||||
const goldSponsors = computed(() => {
|
||||
return data.value?.find(sponsor => sponsor.tier === 'Gold')
|
||||
})
|
||||
|
||||
// 判断金牌赞助数量是否为奇数
|
||||
const isGoldSponsorsOdd = computed(() => {
|
||||
return (goldSponsors.value?.items?.length||0) % 2 === 1
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VPDocAsideSponsors v-if="data" :data="sponsors" />
|
||||
<div class="VPDocAsideSponsors">
|
||||
<div class="VPSponsors vp-sponsor aside">
|
||||
<!-- 超级赞助:一行一个 -->
|
||||
<section class="vp-sponsor-section" v-if="superSponsors?.items.length">
|
||||
<div class="VPSponsorsGrid vp-sponsor-grid mini" data-vp-grid="1">
|
||||
<div class="vp-sponsor-grid-item" v-for="sponsor in superSponsors.items" :key="sponsor.name">
|
||||
<a class="vp-sponsor-grid-link" :href="sponsor.url" target="_blank" rel="sponsored noopener">
|
||||
<article class="vp-sponsor-grid-box">
|
||||
<h4 class="visually-hidden">{{ sponsor.url }}</h4>
|
||||
<img v-if="sponsor.img" class="vp-sponsor-grid-image" :src="sponsor.img" :alt="sponsor.name">
|
||||
<span v-else class="vp-sponsor-grid-text">{{ sponsor.name }}</span>
|
||||
</article>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 金牌赞助:一行两个 -->
|
||||
<section class="vp-sponsor-section" v-if="goldSponsors?.items.length">
|
||||
<div class="VPSponsorsGrid vp-sponsor-grid xmini" data-vp-grid="2">
|
||||
<div class="vp-sponsor-grid-item" v-for="sponsor in goldSponsors.items" :key="sponsor.name">
|
||||
<a class="vp-sponsor-grid-link" :href="sponsor.url" target="_blank" rel="sponsored noopener">
|
||||
<article class="vp-sponsor-grid-box">
|
||||
<h4 class="visually-hidden">{{ sponsor.name }}</h4>
|
||||
<img v-if="sponsor.img" class="vp-sponsor-grid-image" :src="sponsor.img" :alt="sponsor.name">
|
||||
<span v-else class="vp-sponsor-grid-text">{{ sponsor.name }}</span>
|
||||
</article>
|
||||
</a>
|
||||
</div>
|
||||
<!-- 当金牌赞助为奇数时,默认赞助位填补到金牌赞助位置 -->
|
||||
<div class="vp-sponsor-grid-item" v-if="isGoldSponsorsOdd">
|
||||
<a class="vp-sponsor-grid-link" href="/reward/sponsor" rel="sponsored noopener">
|
||||
<article class="vp-sponsor-grid-box">
|
||||
<span class="vp-sponsor-grid-text">成为赞助商</span>
|
||||
</article>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 当金牌赞助为偶数或没有金牌赞助时,默认赞助位占据一整行 -->
|
||||
<section class="vp-sponsor-section" v-if="!isGoldSponsorsOdd || !goldSponsors?.items.length">
|
||||
<div class="VPSponsorsGrid vp-sponsor-grid xmini" data-vp-grid="1">
|
||||
<div class="vp-sponsor-grid-item">
|
||||
<a class="vp-sponsor-grid-link" href="/reward/sponsor" rel="sponsored noopener">
|
||||
<article class="vp-sponsor-grid-box">
|
||||
<span class="vp-sponsor-grid-text">成为赞助商</span>
|
||||
</article>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.vp-sponsor-grid-text {
|
||||
color: var(--vp-c-text-2);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.dark .vp-sponsor-grid-text {
|
||||
color: var(--vp-c-gray-1);
|
||||
}
|
||||
</style>
|
||||
116
docs/.vitepress/theme/components/SpecialSponsor.vue
Normal file
116
docs/.vitepress/theme/components/SpecialSponsor.vue
Normal file
@ -0,0 +1,116 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useAdSponsor } from '../composables/adSponsor'
|
||||
|
||||
interface Props {
|
||||
title?: string
|
||||
}
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
title: '超级赞助',
|
||||
})
|
||||
|
||||
const { data } = useAdSponsor()
|
||||
|
||||
// 获取第一个铂金赞助商
|
||||
const platinumSponsor = computed(() => {
|
||||
const platinum = data.value?.find(sponsor => sponsor.tier === 'Platinum')
|
||||
return platinum?.items?.[0] || null
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section v-if="platinumSponsor" class="special-sponsor">
|
||||
<h3>{{ title }}</h3>
|
||||
<div class="special-sponsor-container">
|
||||
<a class="logo" :href="platinumSponsor.url" target="_blank" rel="sponsored noopener">
|
||||
<picture >
|
||||
<img :src="platinumSponsor.img" :alt="platinumSponsor.name" style="height: 72px;" />
|
||||
</picture>
|
||||
|
||||
</a>
|
||||
<span>{{ platinumSponsor.name }}</span>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.special-sponsor {
|
||||
border-top: 1px solid var(--vp-c-gray-soft);
|
||||
border-bottom: 1px solid var(--vp-c-gray-soft);
|
||||
padding: 12px 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 64px;
|
||||
}
|
||||
|
||||
.special-sponsor h3 {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.special-sponsor-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.special-sponsor .logo {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.special-sponsor span {
|
||||
color: var(--vp-c-text-2);
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
vertical-align: middle;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.special-sponsor a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
.special-sponsor-empty {
|
||||
border-top: 1px solid var(--vp-c-gray-soft);
|
||||
border-bottom: 1px solid var(--vp-c-gray-soft);
|
||||
padding: 12px 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 64px;
|
||||
}
|
||||
|
||||
.special-sponsor-empty span:first-child {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.special-sponsor-empty img {
|
||||
height: 42px;
|
||||
margin: -6px 0;
|
||||
}
|
||||
|
||||
.dark .special-sponsor-empty img {
|
||||
filter: grayscale(1) invert(1);
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.special-sponsor-empty {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
}
|
||||
.special-sponsor-empty img {
|
||||
height: 36px;
|
||||
margin: 8px 0;
|
||||
}
|
||||
.special-sponsor-empty span {
|
||||
text-align: center !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
53
docs/.vitepress/theme/composables/adSponsor.ts
Normal file
53
docs/.vitepress/theme/composables/adSponsor.ts
Normal file
@ -0,0 +1,53 @@
|
||||
import { ref, onMounted } from 'vue'
|
||||
import axios from 'axios'
|
||||
|
||||
export type GridSize = 'xmini' | 'mini' | 'small' | 'medium' | 'big'
|
||||
|
||||
export interface Sponsor {
|
||||
name: string
|
||||
img: string
|
||||
url: string
|
||||
}
|
||||
export interface Sponsors {
|
||||
tier?: string
|
||||
size?: GridSize
|
||||
items: Sponsor[]
|
||||
}
|
||||
|
||||
|
||||
const data = ref<Sponsors[]>([])
|
||||
|
||||
export function useAdSponsor() {
|
||||
onMounted(async () => {
|
||||
// 定义数据源URL列表,按优先级排序
|
||||
const urls = [
|
||||
'https://sponsor.wot-ui.cn/sponsor.json',
|
||||
'https://wot-sponsors.pages.dev/sponsor.json'
|
||||
]
|
||||
|
||||
// 尝试从多个数据源获取数据
|
||||
const fetchData = async () => {
|
||||
for (const url of urls) {
|
||||
try {
|
||||
const response = await axios.get(url, {
|
||||
timeout: 5000 // 设置5秒超时
|
||||
})
|
||||
return response?.data?.data // 成功获取数据后直接返回
|
||||
} catch (error) {
|
||||
console.warn(`Failed to fetch from ${url}`)
|
||||
// 继续尝试下一个URL
|
||||
}
|
||||
}
|
||||
return [] // 所有数据源都失败时返回null
|
||||
}
|
||||
|
||||
data.value = await fetchData()
|
||||
})
|
||||
|
||||
return {
|
||||
data,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ export function useAds() {
|
||||
onMounted(async () => {
|
||||
// 定义数据源URL列表,按优先级排序
|
||||
const urls = [
|
||||
'https://sponsor.wot-design-uni.cn/ads.json',
|
||||
'https://sponsor.wot-ui.cn/ads.json',
|
||||
'https://wot-sponsors.pages.dev/ads.json'
|
||||
]
|
||||
|
||||
|
||||
@ -1,3 +1,12 @@
|
||||
/*
|
||||
* @Author: weisheng
|
||||
* @Date: 2025-08-30 13:06:10
|
||||
* @LastEditTime: 2025-09-21 15:07:39
|
||||
* @LastEditors: weisheng
|
||||
* @Description:
|
||||
* @FilePath: /wot-design-uni/docs/.vitepress/theme/composables/cases.ts
|
||||
* 记得注释
|
||||
*/
|
||||
import { ref, onMounted } from 'vue'
|
||||
import axios from 'axios'
|
||||
|
||||
@ -13,7 +22,7 @@ export function useCaseData() {
|
||||
onMounted(async () => {
|
||||
// 定义数据源URL列表,按优先级排序
|
||||
const urls = [
|
||||
'https://sponsor.wot-design-uni.cn',
|
||||
'https://sponsor.wot-ui.cn',
|
||||
'https://wot-sponsors.pages.dev'
|
||||
]
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ export function useFriendly() {
|
||||
|
||||
// 定义数据源URL列表,按优先级排序
|
||||
const urls = [
|
||||
'https://sponsor.wot-design-uni.cn/friendly.json',
|
||||
'https://sponsor.wot-ui.cn/friendly.json',
|
||||
'https://wot-sponsors.pages.dev/friendly.json'
|
||||
]
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: weisheng
|
||||
* @Date: 2023-08-01 11:12:05
|
||||
* @LastEditTime: 2025-05-07 23:07:17
|
||||
* @Date: 2025-09-21 15:01:29
|
||||
* @LastEditTime: 2025-09-21 18:00:09
|
||||
* @LastEditors: weisheng
|
||||
* @Description:
|
||||
* @FilePath: /wot-design-uni/docs/.vitepress/theme/composables/sponsor.ts
|
||||
@ -21,7 +21,7 @@ export function useSponsor() {
|
||||
|
||||
// 定义数据源URL列表,按优先级排序
|
||||
const urls = [
|
||||
'https://sponsor.wot-design-uni.cn/wot-design-uni.json',
|
||||
'https://sponsor.wot-ui.cn/wot-design-uni.json',
|
||||
'https://wot-sponsors.pages.dev/wot-design-uni.json'
|
||||
]
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: weisheng
|
||||
* @Date: 2024-10-12 22:09:33
|
||||
* @LastEditTime: 2025-09-10 23:37:53
|
||||
* @LastEditTime: 2025-09-21 19:12:31
|
||||
* @LastEditors: weisheng
|
||||
* @Description:
|
||||
* @FilePath: /wot-design-uni/docs/.vitepress/theme/index.ts
|
||||
@ -20,10 +20,11 @@ import SvgImage from './components/SvgImage.vue'
|
||||
import HomeStar from './components/HomeStar.vue'
|
||||
import ExternalLink from './components/ExternalLink.vue'
|
||||
import WwAds from './components/WwAds.vue'
|
||||
import SpecialSponsor from './components/SpecialSponsor.vue'
|
||||
import ElementPlus, { ElMessageBox } from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import 'element-plus/theme-chalk/dark/css-vars.css'
|
||||
|
||||
import AsideSponsors from './components/AsideSponsors.vue'
|
||||
// 声明百度统计全局变量
|
||||
declare global {
|
||||
interface Window {
|
||||
@ -37,6 +38,8 @@ export default {
|
||||
Layout() {
|
||||
return h(Theme.Layout, null, {
|
||||
'home-hero-info-after':()=>h(HomeStar),
|
||||
'home-hero-after': () => h(SpecialSponsor),
|
||||
'aside-ads-before': () => h(AsideSponsors),
|
||||
'home-features-after': () => h(HomeFriendly),
|
||||
'layout-bottom':() => h(CustomFooter),
|
||||
'nav-bar-title-after': () => h(NavBarTitleAfter),
|
||||
|
||||
BIN
docs/public/assets/sponsor-1.png
Normal file
BIN
docs/public/assets/sponsor-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
docs/public/assets/sponsor-2.png
Normal file
BIN
docs/public/assets/sponsor-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 975 KiB |
33
docs/reward/sponsor.md
Normal file
33
docs/reward/sponsor.md
Normal file
@ -0,0 +1,33 @@
|
||||
# 成为赞助者
|
||||
|
||||
wot-ui 是采用 MIT 许可的开源项目,使用完全免费。
|
||||
|
||||
发布以来,我们在 uni-app 开源社区中得到了广泛的认可和支持,但是维护一个大型的开源项目需要付出大量的时间和精力,所以我们需要您的赞助来帮助我们继续维护和发展这个项目。
|
||||
|
||||
## 赞助渠道
|
||||
|
||||
可以通过爱发电平台或者微信扫码来支持 wot-ui 的开发,赞助时可以联系 1780903673@qq.com 对接相关事宜。赞助分为铂金赞助商和黄金赞助商,爱发电上的赞助等级和本页下面列出的赞助等级是一一对应的。
|
||||
|
||||
<p style="display: flex;">
|
||||
<a href="https://afdian.com/a/weisheng233" style="margin-right: 20px;">
|
||||
<img width="200" src="https://pic1.afdiancdn.com/static/img/welcome/button-sponsorme.png" alt="">
|
||||
</a >
|
||||
|
||||
<img src="/weixinQrcode.jpg" alt="weixinQrcode.png" style="max-width: 200px;" />
|
||||
</p>
|
||||
|
||||
|
||||
### 铂金赞助商权益
|
||||
1. wot-ui 首屏无需滚动可见的 logo 展示位:
|
||||
|
||||
|
||||
<img src="/assets/sponsor-1.png" alt="sponsor-1.png" style="max-width: 688px;" />
|
||||
|
||||
2. 所有内容页面的侧边栏上的明显的 logo 展示位:
|
||||
|
||||
<img src="/assets/sponsor-2.png" alt="sponsor-2.png" style="max-width: 688px;" />
|
||||
|
||||
### 黄金赞助商权益
|
||||
1. 所有内容页面的侧边栏上的明显的 logo 展示位:
|
||||
|
||||
<img src="/assets/sponsor-2.png" alt="sponsor-2.png" style="max-width: 688px;" />
|
||||
Loading…
x
Reference in New Issue
Block a user