|
@ -10,6 +10,7 @@ |
|
|
@mouseover="mouseover(item.name)" |
|
|
@mouseover="mouseover(item.name)" |
|
|
@click="openGame(item.name)" |
|
|
@click="openGame(item.name)" |
|
|
:style="{ 'background-image': `url(${base}page3/${item.name}.jpg)` }" |
|
|
:style="{ 'background-image': `url(${base}page3/${item.name}.jpg)` }" |
|
|
|
|
|
@mouseout="hoverEnd" |
|
|
></div> |
|
|
></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="btn btn-right" :class="{ disabled: page === total - 1 }" @click="handleNext"></div> |
|
|
<div class="btn btn-right" :class="{ disabled: page === total - 1 }" @click="handleNext"></div> |
|
@ -18,13 +19,19 @@ |
|
|
|
|
|
|
|
|
<script setup> |
|
|
<script setup> |
|
|
import { useStore } from 'vuex'; |
|
|
import { useStore } from 'vuex'; |
|
|
|
|
|
import { useRoute } from 'vue-router'; |
|
|
import { computed, ref } from 'vue'; |
|
|
import { computed, ref } from 'vue'; |
|
|
|
|
|
|
|
|
// TODO: 训练部位的本地记录 或者 url记录 |
|
|
// TODO: 训练部位的本地记录 或者 url记录 |
|
|
|
|
|
|
|
|
const store = useStore(); |
|
|
const store = useStore(); |
|
|
|
|
|
const route = useRoute(); |
|
|
const base = import.meta.env.BASE_URL; |
|
|
const base = import.meta.env.BASE_URL; |
|
|
|
|
|
|
|
|
|
|
|
if (route.query && route.query.site) { |
|
|
|
|
|
store.commit('setSelectedSite', route.query.site); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const allGames = computed(() => store.getters.selectedGames); // 当前训练部位对应的游戏 |
|
|
const allGames = computed(() => store.getters.selectedGames); // 当前训练部位对应的游戏 |
|
|
const gameImage = ref(`page3/${allGames.value[0].name}.jpg`); // 大图背景 |
|
|
const gameImage = ref(`page3/${allGames.value[0].name}.jpg`); // 大图背景 |
|
|
const page = ref(0); // 第几页 |
|
|
const page = ref(0); // 第几页 |
|
@ -59,8 +66,19 @@ function openGame(gameName) { |
|
|
* @param {string} gameName 游戏name |
|
|
* @param {string} gameName 游戏name |
|
|
*/ |
|
|
*/ |
|
|
function mouseover(gameName) { |
|
|
function mouseover(gameName) { |
|
|
|
|
|
hover(); |
|
|
gameImage.value = `/page3/${gameName}.jpg`; |
|
|
gameImage.value = `/page3/${gameName}.jpg`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function hover() { |
|
|
|
|
|
const audioActive = document.getElementById('audio-active'); |
|
|
|
|
|
audioActive.play(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function hoverEnd() { |
|
|
|
|
|
const audioActive = document.getElementById('audio-active'); |
|
|
|
|
|
audioActive.pause(); |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|