首次提交:初始化项目代码

This commit is contained in:
sunct
2026-07-31 14:42:05 +08:00
commit ecca407485
84 changed files with 24158 additions and 0 deletions
+76
View File
@@ -0,0 +1,76 @@
<template>
<view class="title-badge" :style="{ background: badgeGradient }">
<text class="badge-icon">{{ icon }}</text>
<text class="badge-title">{{ title }}</text>
<text class="badge-level">Lv.{{ level }}</text>
</view>
</template>
<script>
import themeMixin from '../mixins/themeMixin.js'
import { THEME_CHANGE_EVENT } from '../utils/theme.js'
export default {
name: 'TitleBadge',
mixins: [themeMixin],
props: {
level: {
type: Number,
default: 1
},
title: {
type: String,
default: ''
},
icon: {
type: String,
default: ''
}
},
created() {
this.syncThemeConfig()
this.watchThemeChange()
},
beforeUnmount() {
if (this.themeChangeHandler) {
uni.$off(THEME_CHANGE_EVENT, this.themeChangeHandler)
}
},
computed: {
badgeGradient() {
const theme = this.themeConfig
return `linear-gradient(135deg, ${theme.primaryColor}, ${theme.secondaryColor})`
}
}
}
</script>
<style scoped>
.title-badge {
display: inline-flex;
align-items: center;
padding: 8rpx 24rpx;
border-radius: 12rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.15);
gap: 12rpx;
}
.badge-icon {
font-size: 32rpx;
line-height: 1;
}
.badge-title {
font-size: 26rpx;
font-weight: 600;
color: #ffffff;
}
.badge-level {
font-size: 22rpx;
color: rgba(255, 255, 255, 0.9);
background: rgba(255, 255, 255, 0.25);
padding: 2rpx 10rpx;
border-radius: 20rpx;
}
</style>