TopRulePage.vue 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <BackPage>
  3. <div v-if="route.query.type =='rule'">
  4. <div class="ruleImage-box">
  5. <img :src="ruleImage" />
  6. </div>
  7. <div class="IKnow-box">
  8. <img :src="IKnow" @click="goBack" />
  9. </div>
  10. </div>
  11. <div v-else>
  12. <div class="ruleImage-box">
  13. <img :src="TopImage" />
  14. <div class="Scroll-box">
  15. <div v-for="(item,index) in Toplist" :key="index" class="Scroll-box-Content">
  16. <div class="Scroll-box-Content-sum">{{ index+1 }}</div>
  17. <div class="Scroll-box-Content-name">{{ item.name }}</div>
  18. <img :src="item.avatar" />
  19. <div class="Scroll-box-Content-time">{{ item.totalMillsec/1000 }}s</div>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="IKnow-box">
  24. <img :src="GoHome" @click="gohomePage" />
  25. </div>
  26. </div>
  27. </BackPage>
  28. </template>
  29. <script>
  30. import { useRoute, useRouter } from 'vue-router'
  31. import { onMounted, ref } from 'vue'
  32. import ruleImage from '@/assets/TipsImage/3-3.png'
  33. import IKnow from '@/assets/ButtonImage/我知道了.png'
  34. import TopImage from '@/assets/TipsImage/3-2.png'
  35. import GoHome from '@/assets/ButtonImage/返回首页.png'
  36. import { gameTop } from '@/utils/api'
  37. export default {
  38. setup() {
  39. const route = useRoute()
  40. const router = useRouter()
  41. const goBack = () => {
  42. // 字符串路径
  43. router.go(-1)
  44. }
  45. const gohomePage = () => {
  46. // 字符串路径
  47. router.push('/')
  48. }
  49. let Toplist = ref([])
  50. onMounted(() => {
  51. if (route.query.type == 'top') {
  52. gameTop().then((e) => {
  53. Toplist.value = e
  54. console.log(e)
  55. })
  56. }
  57. console.log(router)
  58. // 打印
  59. })
  60. return {
  61. goBack,
  62. gohomePage,
  63. ruleImage,
  64. IKnow,
  65. TopImage,
  66. GoHome,
  67. Toplist,
  68. router,
  69. route
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="less" scoped>
  75. .ruleImage-box {
  76. width: 100vw;
  77. position: absolute;
  78. top: 13vh;
  79. display: flex;
  80. justify-content: center;
  81. > img {
  82. width: 93%;
  83. height: 100%;
  84. }
  85. .Scroll-box {
  86. width: 80%;
  87. height: 61%;
  88. top: 18vh;
  89. position: absolute;
  90. overflow: auto;
  91. .Scroll-box-Content {
  92. display: flex;
  93. border-bottom: 1px dashed rgba(0, 0, 0, 0.3);
  94. align-items: center;
  95. height: 7vh;
  96. > img {
  97. width: 10vw;
  98. height: 5vh;
  99. border-radius: 50%;
  100. }
  101. &-sum {
  102. // text-align: left;
  103. // padding-left: 2em;
  104. width: 25vw;
  105. text-align: center;
  106. }
  107. &-name {
  108. width: 30vw;
  109. text-align: left;
  110. }
  111. &-time {
  112. width: 30vw;
  113. text-align: center;
  114. }
  115. }
  116. }
  117. }
  118. .IKnow-box {
  119. position: absolute;
  120. width: 100vw;
  121. z-index: 500;
  122. display: flex;
  123. bottom: 7vh;
  124. justify-content: center;
  125. > img {
  126. width: 30%;
  127. }
  128. }
  129. </style>