index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="more-box">
  3. <div class="title">{{ $t(`other.空间名称切换`) }}</div>
  4. <div class="light-bottom">
  5. <div
  6. @click="handlezChange(item)"
  7. class="item-box"
  8. :class="item.id ? 'light-box-active ' : ''"
  9. v-for="(item, index) in FORUMArr"
  10. >
  11. <div class="name">{{ item.roomName }}</div>
  12. <div style="width: 100rpx;">
  13. <SwitchButton />
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script setup>
  20. import SwitchButton from '@/components/switch-button/SwitchButton.vue';
  21. // 接收父组件传递的初始状态
  22. const props = defineProps({
  23. FORUMArr: {
  24. type: Array,
  25. default: () => {
  26. return []
  27. }
  28. }
  29. })
  30. </script>
  31. <style lang="scss" scoped>
  32. .more-box {
  33. .title {
  34. display: flex;
  35. justify-content: center;
  36. align-items: center;
  37. margin-bottom: 36px;
  38. height: 140px;
  39. font-family: PingFang SC;
  40. font-weight: 300;
  41. font-size: 24px;
  42. line-height: 100%;
  43. text-align: center;
  44. color: #001428;
  45. height: 140px;
  46. }
  47. .light-bottom {
  48. // margin-top: 36px;
  49. .item-box {
  50. display: flex;
  51. justify-content: space-between;
  52. align-items: center;
  53. width: 300px;
  54. height: 68px;
  55. box-sizing: border-box;
  56. padding: 20px 24px;
  57. border-radius: 24px 24px 44px 24px;
  58. background: rgba(255, 255, 255, 0.2);
  59. box-shadow: 0px 10px 20px 0px rgba(0, 20, 40, 0.05);
  60. margin-bottom: 12px;
  61. .name {
  62. //styleName: Chi/Body Regular;
  63. font-family: PingFang SC;
  64. font-size: 14px;
  65. font-weight: 400;
  66. line-height: 19px;
  67. letter-spacing: 0.02em;
  68. color: rgba(0, 20, 40, 1);
  69. }
  70. }
  71. .light-box-active {
  72. background: rgba(255, 255, 255, 0.6);
  73. }
  74. }
  75. }
  76. </style>