fix(activity): 完善活动大厅主题事件监听与生命周期绑定

这个提交包含在:
wikiboss
2026-09-16 20:18:44 +08:00
父节点 57b8aeebe4
当前提交 21549b1f13

查看文件

@@ -129,13 +129,28 @@
</template>
<script setup>
import { ref, computed } from 'vue';
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { ACTIVITIES_LIST } from '@/common/mock.js';
import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey } from '@/common/theme.js';
const activities = ref(ACTIVITIES_LIST);
const currentTab = ref('ALL');
const currentCategory = ref('ALL');
const currentThemeKey = ref(getCurrentThemeKey());
const onThemeChanged = (key) => {
currentThemeKey.value = key;
};
onMounted(() => {
currentThemeKey.value = getCurrentThemeKey();
uni.$on('theme-change', onThemeChanged);
});
onUnmounted(() => {
uni.$off('theme-change', onThemeChanged);
});
const categoryOptions = [
{ key: 'ALL', label: '全部品类' },
@@ -501,4 +516,51 @@ const createActivity = () => {
0%, 100% { box-shadow: 0 8rpx 24rpx rgba(99, 102, 241, 0.45); }
50% { box-shadow: 0 8rpx 36rpx rgba(99, 102, 241, 0.75); }
}
.activity-container.theme-warm {
background-color: #140E0A;
.tab-header {
background-color: #221711;
border-color: rgba(249, 115, 22, 0.12);
.tab-item.active {
background: rgba(249, 115, 22, 0.2);
.tab-text {
color: #FFF7ED;
}
.tab-indicator {
background: #F97316;
box-shadow: 0 0 10rpx #F97316;
}
}
}
.tips-bar {
background: rgba(249, 115, 22, 0.1);
border-color: rgba(249, 115, 22, 0.25);
.tips-text {
color: #FB923C;
}
}
.cat-filter-list .cat-chip.active {
background: linear-gradient(135deg, #F97316, #F59E0B);
box-shadow: 0 4rpx 14rpx rgba(249, 115, 22, 0.4);
.chip-text {
color: #FFF7ED;
}
}
.activity-list .activity-card {
background-color: #221711;
border-color: rgba(249, 115, 22, 0.12);
}
.fab-btn {
background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
box-shadow: 0 8rpx 28rpx rgba(249, 115, 22, 0.55);
}
}
</style>