fix message provider get

This commit is contained in:
2024-10-31 14:17:40 +08:00
parent 51897133a7
commit 392a577a7e
7 changed files with 90 additions and 20 deletions

View File

@@ -1,12 +1,26 @@
<script setup lang="ts">
import { useAccount } from '@/api/account';
import { onMounted } from 'vue';
import { ConsumptionTypes } from '@/api/models/consumption';
import { NFlex, NIcon, NLayout, NLayoutSider, NMenu, NTabPane, NTabs } from 'naive-ui';
import { h, onMounted } from 'vue';
import { useConsumptionSettingStore } from '@/store/usePaymentSettingStore';
import { CheckmarkCircle24Filled } from '@vicons/fluent';
const accountInfo = useAccount()
const useConsumption = useConsumptionSettingStore()
const { } = defineProps<{
}>()
const enabledIcon = h(NIcon, { component: CheckmarkCircle24Filled, color: 'lightgrey' })
const disabledIcon = h(NIcon, { component: CheckmarkCircle24Filled, color: 'red' })
const tabDisplay = (type: ConsumptionTypes) => {
const setting = useConsumption.GetSetting(type)
return h(NFlex, {}, () => [
h(NIcon, { component: setting.isEnabled ? enabledIcon : disabledIcon, }),
h('span', {}, setting.isEnabled ? '已启用' : '未启用'),
])
}
async function getAccountPaymentSettings() {
try {
@@ -22,5 +36,11 @@ onMounted(() => {
</script>
<template>
WIP...
<NTabs animated type="line">
<NTabPane name="弹幕储存" tab="弹幕储存">
<template #tab>
<component :is="tabDisplay(ConsumptionTypes.DanmakuStorage)" />
</template>
</NTabPane>
</NTabs>
</template>