medalPage.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div class="base-container">
  3. <fnHeader showDate hideSwitch></fnHeader>
  4. <div class="content">
  5. <div class="tool">
  6. <div class="button" @click="goBack">
  7. <img src="@/assets/images/common/back-icon.png" alt="" />
  8. 返回
  9. </div>
  10. </div>
  11. <div class="medal-list">
  12. <div class="medal-item" v-for="(item,index) in 20" :key="index">
  13. <div class="btn" :class="{active:index===0}">{{index===0?'已置顶':'设为置顶'}}</div>
  14. <img class="medal" src="@/assets/images/more/medal.png" alt="" />
  15. <div class="icon-name">水源洁净</div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script setup>
  22. import fnHeader from "@/components/fnHeader.vue";
  23. import {ref} from 'vue'
  24. import { Popup } from 'vant';
  25. import { useRouter } from "vue-router";
  26. const router = useRouter();
  27. const list = ref([
  28. {
  29. isDefalut:1
  30. }
  31. ])
  32. const showPopup = ref(false)
  33. const goBack = () =>{
  34. router.go('-1')
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .base-container {
  39. width: 100%;
  40. height: 100vh;
  41. color: #fff;
  42. box-sizing: border-box;
  43. background: #000;
  44. .content {
  45. width: 100%;
  46. height: 100%;
  47. height: calc(100% - 74px);
  48. padding: 16px 20px 0 20px;
  49. box-sizing: border-box;
  50. .tool{
  51. padding-bottom: 24px;
  52. border-bottom: 1px solid #444444;
  53. margin-bottom: 24px;
  54. display: flex;
  55. align-items: center;
  56. justify-content: space-between;
  57. .button {
  58. display: flex;
  59. align-items: center;
  60. justify-content: center;
  61. border: 1px solid rgba(255, 255, 255, 0.78);
  62. border-radius: 4px;
  63. padding: 9px;
  64. width: 104px;
  65. cursor: pointer;
  66. img {
  67. width: 14px;
  68. margin-right: 5px;
  69. }
  70. }
  71. }
  72. .medal-list{
  73. width: 100%;
  74. height: calc(100% - 65px - 24px);
  75. overflow-y: auto;
  76. display: flex;
  77. align-content: flex-start;
  78. flex-wrap: wrap;
  79. .medal-item{
  80. width: 13.7%;
  81. height: 220px;
  82. border-radius: 8px;
  83. position: relative;
  84. margin: 0 12px 12px 0;
  85. background: #282828;
  86. display: flex;
  87. align-items: center;
  88. flex-direction: column;
  89. justify-content: center;
  90. &.medal-item:nth-child(7n) {
  91. margin-right: 0;
  92. }
  93. .icon-name{
  94. margin-top: 18px;
  95. position: relative;
  96. &::before{
  97. content: '';
  98. position: absolute;
  99. top: -16px;
  100. width: 60px;
  101. height: 5px;
  102. border-radius: 50%;
  103. background: rgba(204, 204, 204, 0.1);
  104. }
  105. }
  106. .btn{
  107. position: absolute;
  108. cursor: pointer;
  109. right: 8px;
  110. top: 8px;
  111. background: rgba(0, 0, 0, 0.6);
  112. border-radius: 4px;
  113. padding: 4px 8px;
  114. color: #FFD489;
  115. &.active{
  116. background:#FFD489;
  117. color: #000;
  118. }
  119. }
  120. }
  121. }
  122. }
  123. }
  124. .medal-popup {
  125. background: transparent;
  126. }
  127. </style>