<template>
    <div class="version">
        <div class="title">当前版本：{{ curVersion }}</div>
        <div v-for="log in updateLogs">
            <div class="title">{{ log.date }}({{ log.version }})</div>
            <div v-if="log.desc" class="desc">-{{ log.desc }}</div>
            <div v-if="log.adjust" class="sub-title">
                <span>功能</span>
                <div class="item" v-for="adjust in log.adjust">-{{ adjust }}</div>
            </div>
            <div v-if="log.tuning" class="sub-title">
                <span>优化</span>
                <div class="item" v-for="tuning in log.tuning">-{{ tuning }}</div>
            </div>
            <div v-if="log.bug" class="sub-title">
                <span>BUG</span>
                <div class="item" v-for="bug in log.bug">-{{ bug }}</div>
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { useStore } from "vuex";
import { reactive, onMounted, ref } from "vue";
import { useI18n } from "vue3-i18n";

const { t } = useI18n();
const { state, commit, dispatch } = useStore();

const curVersion = '测试版';

const updateLogs: any = [{
    date: '2025-04-26', version: '测试版',
    adjust: [
        '新增装备强化继承功能',
    ]
}, {
    date: '2025-04-25', version: '测试版',
    adjust: [
        '适配移动端',
        '更新日志菜单快捷键调整为(U)',
        '静态资源网络分流'
    ],
    bug: [
        '修复静态资源分流后部分图片路径不正确问题',
        '修复背景音乐路径不正确问题'
    ]
}, {
    date: '2025-04-23', version: '测试版',
    adjust: [
        '调整战斗逻辑，战斗伤害不再使用用期望值，每回合伤害独立计算，击败怪物的回合怪物将不造成伤害',
        '新增战斗过程查看'
    ],
    tuning: [
        '修复菜单tip突变不显示BUG'
    ]
}, {
    date: '2025-04-22', version: '测试版',
    adjust: [
        '新增版本信息和更新日志',
    ],
    tuning: [
        '优化静态资源加载'
    ]
}, {
    date: '2025-04-21', version: '测试版',
    adjust: [
        '新增装备图鉴',
        '商店免费刷新次数增加为10次',
        '新增版本更新提醒',
        '新增在线人数统计(后台统计,界面不显示)',
    ],
    bug: [
        '修复了强化失败后可SL存档恢复强化等级的BUG',
    ]
}, {
    date: '2025-04-20', version: '测试版',
    adjust: [
        '增加垫刀功能',
    ],
    bug: [
        '修复强化12成功率异常问题',
    ]
}, {
    date: '2025-04-18', version: '测试版',
    adjust: [
        '商店界面添加玩家金币数量显示',
    ],
    tuning: [
        '怪物名称前缀添加副本难度',
        '调整部分弹框UI显示位置'
    ],
    bug: [
        '修复购买了独特装备后刷新商店仍提示确认BUG',
        '修复金币过大是显示超长UI错乱BUG'
    ]
}, {
    date: '2025-04-18', version: '测试版初版发布',
    adjust: [
        '通过副本获得装备与金币',
        '副本分简单、普通、困难、极难四个难度，普通难度外副本通关后变为普通难度，普通难度副本通关后回继续挑战副本',
        '通用装备分为四个等级：破旧、普通、神器、史诗', '主角默认每秒回血 2%',
        '默认暴击伤害 150%',
        '完成副本时可能掉落独特级别(5 个词条)的装备（通关后 2.5%掉落率，无尽挑战不会掉落）'
    ]
}]

onMounted(() => { });
</script>
<style lang="scss" scoped>
.version {
    text-align: start;
    padding: 1rem 2rem;

    .title {
        font-size: 1.5rem;
        margin-top: 1rem;
        font-weight: bold;
    }

    .sub-title {
        font-size: 1.3rem;
        font-weight: bold;
        padding-left: 1rem;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .item {
        font-size: 0.9rem;
        font-weight: normal;
    }
}
</style>