123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <template>
- <BackPage>
- <div v-if="route.query.type =='rule'">
- <div class="ruleImage-box">
- <img :src="ruleImage" />
- </div>
- <div class="IKnow-box">
- <img :src="IKnow" @click="goBack" />
- </div>
- </div>
- <div v-else>
- <div class="ruleImage-box">
- <img :src="TopImage" />
- <div class="Scroll-box">
- <div v-for="(item,index) in Toplist" :key="index" class="Scroll-box-Content">
- <div class="Scroll-box-Content-sum">{{ index+1 }}</div>
- <div class="Scroll-box-Content-name">{{ item.name }}</div>
- <img :src="item.avatar" />
- <div class="Scroll-box-Content-time">{{ item.totalMillsec/1000 }}s</div>
- </div>
- </div>
- </div>
- <div class="IKnow-box">
- <img :src="GoHome" @click="gohomePage" />
- </div>
- </div>
- </BackPage>
- </template>
-
- <script>
- import { useRoute, useRouter } from 'vue-router'
- import { onMounted, ref } from 'vue'
- import ruleImage from '@/assets/TipsImage/3-3.png'
- import IKnow from '@/assets/ButtonImage/我知道了.png'
- import TopImage from '@/assets/TipsImage/3-2.png'
- import GoHome from '@/assets/ButtonImage/返回首页.png'
- import { gameTop } from '@/utils/api'
-
- export default {
- setup() {
- const route = useRoute()
- const router = useRouter()
-
- const goBack = () => {
- // 字符串路径
- router.go(-1)
- }
-
- const gohomePage = () => {
- // 字符串路径
- router.push('/')
- }
- let Toplist = ref([])
-
- onMounted(() => {
- if (route.query.type == 'top') {
- gameTop().then((e) => {
- Toplist.value = e
- console.log(e)
- })
- }
- console.log(router)
- // 打印
- })
-
- return {
- goBack,
- gohomePage,
- ruleImage,
- IKnow,
- TopImage,
- GoHome,
- Toplist,
- router,
- route
- }
- }
- }
- </script>
-
- <style lang="less" scoped>
- .ruleImage-box {
- width: 100vw;
- position: absolute;
- top: 13vh;
- display: flex;
- justify-content: center;
- > img {
- width: 93%;
- height: 100%;
- }
- .Scroll-box {
- width: 80%;
- height: 61%;
- top: 18vh;
- position: absolute;
- overflow: auto;
- .Scroll-box-Content {
- display: flex;
- border-bottom: 1px dashed rgba(0, 0, 0, 0.3);
- align-items: center;
- height: 7vh;
-
- > img {
- width: 10vw;
- height: 5vh;
- border-radius: 50%;
- }
- &-sum {
- // text-align: left;
- // padding-left: 2em;
- width: 25vw;
- text-align: center;
- }
- &-name {
- width: 30vw;
- text-align: left;
- }
- &-time {
- width: 30vw;
- text-align: center;
- }
- }
- }
- }
- .IKnow-box {
- position: absolute;
- width: 100vw;
- z-index: 500;
- display: flex;
- bottom: 7vh;
-
- justify-content: center;
- > img {
- width: 30%;
- }
- }
- </style>
|