medalPage.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 5" :key="index" @click="handleMedal">
  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. <Popup v-model:show="showPopup" class="medal-popup" overlay-class="medal-overlay" closeable>
  21. <div class="btn" :class="{ active: false }">设为置顶</div>
  22. <img class="medal" src="@/assets/images/more/medal-popup.png" alt="" />
  23. <div class="icon-name">水源洁净</div>
  24. <div class="desc">
  25. 评分规则评分规则评分规则评分规则评分规则评分规则评分规则评分规则评分规则评分规则评分规则评分规则
  26. </div>
  27. </Popup>
  28. </template>
  29. <script setup>
  30. import fnHeader from "@/components/fnHeader.vue";
  31. import { ref } from "vue";
  32. import { Popup } from "vant";
  33. import { useRouter } from "vue-router";
  34. const router = useRouter();
  35. const list = ref([
  36. {
  37. isDefalut: 1,
  38. },
  39. ]);
  40. const showPopup = ref(false);
  41. const handleMedal = () => {
  42. showPopup.value = true;
  43. };
  44. const goBack = () => {
  45. router.go("-1");
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .base-container {
  50. width: 100%;
  51. height: 100vh;
  52. color: #fff;
  53. box-sizing: border-box;
  54. background: #000;
  55. .content {
  56. width: 100%;
  57. height: 100%;
  58. height: calc(100% - 74px);
  59. padding: 16px 20px 0 20px;
  60. box-sizing: border-box;
  61. .tool {
  62. padding-bottom: 24px;
  63. border-bottom: 1px solid #444444;
  64. margin-bottom: 24px;
  65. display: flex;
  66. align-items: center;
  67. justify-content: space-between;
  68. .button {
  69. display: flex;
  70. align-items: center;
  71. justify-content: center;
  72. border: 1px solid rgba(255, 255, 255, 0.78);
  73. border-radius: 4px;
  74. padding: 9px;
  75. width: 104px;
  76. cursor: pointer;
  77. img {
  78. width: 14px;
  79. margin-right: 5px;
  80. }
  81. }
  82. }
  83. .medal-list {
  84. width: 100%;
  85. height: calc(100% - 65px - 24px);
  86. overflow-y: auto;
  87. display: flex;
  88. align-content: flex-start;
  89. flex-wrap: wrap;
  90. .medal-item {
  91. width: 13.7%;
  92. height: 220px;
  93. border-radius: 8px;
  94. position: relative;
  95. margin: 0 12px 12px 0;
  96. background: #282828;
  97. display: flex;
  98. align-items: center;
  99. flex-direction: column;
  100. justify-content: center;
  101. cursor: pointer;
  102. &.medal-item:nth-child(7n) {
  103. margin-right: 0;
  104. }
  105. .icon-name {
  106. margin-top: 18px;
  107. position: relative;
  108. &::before {
  109. content: "";
  110. position: absolute;
  111. top: -16px;
  112. width: 60px;
  113. height: 5px;
  114. border-radius: 50%;
  115. background: rgba(204, 204, 204, 0.1);
  116. }
  117. }
  118. // .btn {
  119. // position: absolute;
  120. // cursor: pointer;
  121. // right: 8px;
  122. // top: 8px;
  123. // background: rgba(0, 0, 0, 0.6);
  124. // border-radius: 4px;
  125. // padding: 4px 8px;
  126. // color: #ffd489;
  127. // &.active {
  128. // background: #ffd489;
  129. // color: #000;
  130. // }
  131. // }
  132. }
  133. }
  134. }
  135. }
  136. .btn {
  137. position: absolute;
  138. cursor: pointer;
  139. right: 8px;
  140. top: 8px;
  141. background: rgba(0, 0, 0, 0.6);
  142. border-radius: 4px;
  143. padding: 4px 8px;
  144. color: #ffd489;
  145. &.active {
  146. background: #ffd489;
  147. color: #000;
  148. }
  149. }
  150. // .medal-overlay {
  151. // background: rgba(0, 0, 0, 0.8);
  152. // }
  153. .medal-popup {
  154. background: rgba(255, 255, 255, 0.2);
  155. padding: 70px 24px 24px 24px;
  156. border-radius: 5px;
  157. display: flex;
  158. align-items: center;
  159. flex-direction: column;
  160. .btn {
  161. position: absolute;
  162. left: 24px;
  163. top: 24px;
  164. right: auto;
  165. font-size: 16px;
  166. padding: 8px 16px;
  167. }
  168. .medal {
  169. width: 180px;
  170. height: 180px;
  171. }
  172. .icon-name {
  173. margin-top: 40px;
  174. font-size: 28px;
  175. color: #fff;
  176. position: relative;
  177. &::before {
  178. content: "";
  179. position: absolute;
  180. top: -28px;
  181. left: -18px;
  182. width: 155px;
  183. height: 14px;
  184. border-radius: 50%;
  185. background: rgba(204, 204, 204, 0.1);
  186. }
  187. }
  188. .desc {
  189. margin-top: 34px;
  190. width: 500px;
  191. font-size: 19px;
  192. color: rgba(255, 255, 255, 0.6);
  193. text-align: center;
  194. }
  195. }
  196. </style>