sheep/src/pages/IndexPage.vue

111 lines
2.2 KiB
Vue
Raw Normal View History

2022-09-16 18:14:04 +08:00
<template>
<div id="indexPage">
2022-09-16 19:06:06 +08:00
<h1>🐟 鱼了个鱼</h1>
<div style="margin-bottom: 16px">低配版羊了个羊小游戏仅供消遣</div>
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(easyGameConfig)"
>
简单模式
</a-button>
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(middleGameConfig)"
>
中等模式
</a-button>
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(hardGameConfig)"
>
困难模式
</a-button>
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(lunaticGameConfig)"
>
2022-09-16 22:41:26 +08:00
地狱模式
2022-09-16 19:06:06 +08:00
</a-button>
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(skyGameConfig)"
>
天域模式
</a-button>
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(yangGameConfig)"
>
羊了个羊模式
</a-button>
2022-09-17 17:30:42 +08:00
<a-button block style="margin-bottom: 16px" @click="() => toGamePage()">
自定义 🔥
2022-09-16 19:06:06 +08:00
</a-button>
<my-ad />
2022-09-17 12:09:46 +08:00
<div class="footer">
鱼了个鱼 ©2022 by
<a href="https://github.com/liyupi" target="_blank" style="color: #fff">
程序员鱼皮
</a>
|
<a
href="https://github.com/liyupi/yulegeyu"
target="_blank"
style="color: #fff"
>
代码开源
</a>
</div>
2022-09-16 18:14:04 +08:00
</div>
</template>
<script setup lang="ts">
2022-09-16 19:06:06 +08:00
import { useRouter } from "vue-router";
import {
easyGameConfig,
middleGameConfig,
hardGameConfig,
lunaticGameConfig,
skyGameConfig,
yangGameConfig,
2022-09-16 19:06:06 +08:00
} from "../core/gameConfig";
import { useGlobalStore } from "../core/globalStore";
import MyAd from "../components/MyAd.vue";
2022-09-16 18:14:04 +08:00
2022-09-16 19:06:06 +08:00
const router = useRouter();
2022-09-16 18:14:04 +08:00
2022-09-16 19:06:06 +08:00
const { setGameConfig } = useGlobalStore();
2022-09-16 18:14:04 +08:00
2022-09-17 12:09:46 +08:00
const toGamePage = (config?: GameConfigType) => {
2022-09-16 19:06:06 +08:00
if (config) {
setGameConfig(config);
2022-09-16 22:17:31 +08:00
router.push("/game");
} else {
router.push("/config");
2022-09-16 19:06:06 +08:00
}
};
</script>
2022-09-16 18:14:04 +08:00
2022-09-16 19:06:06 +08:00
<style scoped>
#indexPage {
2022-09-16 18:14:04 +08:00
text-align: center;
}
2022-09-17 12:09:46 +08:00
.footer {
background: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 12px;
text-align: center;
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
2022-09-16 18:14:04 +08:00
</style>