wdsy.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div>
  3. <van-nav-bar title="我的声音" @click-left="back">
  4. <template #left>
  5. <van-icon name="arrow-left" color="#ffffff" size="18px" />
  6. </template>
  7. </van-nav-bar>
  8. <div class="px-20px">
  9. <div class="flex items-center p-4px box-border bg-hex-1A1B22 rounded-12px text-14px">
  10. <div class="type_item" :class="activeType==index?'active':''" v-for="(item, index) in typeData" :key="index" @click="handleClick(index)">{{item}}</div>
  11. </div>
  12. <div class="mt-15px grid grid-cols-2 gap-12px">
  13. <div class="" v-for="i in 6" :key="i">
  14. <img class="w-full" :src="voiceImg" alt="" />
  15. <div class="text-center text-white mb-10px">声音{{i}}</div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script setup>
  22. import voiceImg from "~/assets/wode/voice.png";
  23. const router = useRouter()
  24. function back() {
  25. router.back();
  26. }
  27. const typeData = $ref(["通过", "不通过", "待审核"]);
  28. let activeType = $ref("");
  29. handleClick(0);
  30. function handleClick(index) {
  31. activeType = index;
  32. }
  33. </script>
  34. <style lang="scss" scoped>
  35. .type_item {
  36. flex: 1;
  37. color: #808080;
  38. text-align: center;
  39. line-height: 40px;
  40. &.active {
  41. color: #fff;
  42. background: #db664d;
  43. border-radius: 8px;
  44. }
  45. }
  46. </style>