scene-list.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="scene-list">
  3. <div class="header">
  4. <p>场景列表({{ sceneList.length }})</p>
  5. <span class="icon" @click="emit('close')">
  6. <Icon type="cross@2x" />
  7. </span>
  8. </div>
  9. <div class="content">
  10. <div class="sign" v-for="scene in sceneList" :key="scene.id" @click="emit('changeScene', scene)">
  11. <div class="info">
  12. <img :src="scene.thumb">
  13. <p>{{ scene.sceneName }}</p>
  14. </div>
  15. <span class="icon">
  16. <Icon type="arrow@2x" />
  17. </span>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { sceneList } from '@/store/room'
  24. import Icon from '@/components/icon/index.vue'
  25. const emit = defineEmits(['close', 'changeScene']);
  26. </script>
  27. <style scoped lang="scss">
  28. .scene-list {
  29. max-height: 80%;
  30. background: rgba(0,0,0,0.8);
  31. border-radius: 10px 10px 0px 0px;
  32. bottom: 0;
  33. left: 0;
  34. right: 0;
  35. display: flex;
  36. flex-direction: column;
  37. z-index: 99999;
  38. position: absolute;
  39. }
  40. .header {
  41. flex: none;
  42. text-align: center;
  43. height: 46px;
  44. line-height: 46px;
  45. border-bottom: 1px solid rgba(255,255,255,.1);
  46. p {
  47. font-size: 16px;
  48. font-weight: 500;
  49. color: #FFFFFF;
  50. }
  51. .icon {
  52. position: absolute;
  53. right: 0;
  54. top: 0;
  55. font-size: 14px;
  56. padding: 0 20px;
  57. }
  58. }
  59. .content {
  60. flex: 1;
  61. overflow-y: auto;
  62. padding: 11px;
  63. .sign {
  64. height: 60px;
  65. display: flex;
  66. justify-content: space-between;
  67. align-items: center;
  68. margin-bottom: 18px;
  69. .info {
  70. flex: 1;
  71. display: flex;
  72. align-items: center;
  73. img {
  74. flex: none;
  75. width: 60px;
  76. height: 60px;
  77. border-radius: 4px;
  78. }
  79. p {
  80. font-size: 14px;
  81. font-weight: 400;
  82. color: #FFFFFF;
  83. line-height: 20px;
  84. margin-left: 10px;
  85. }
  86. }
  87. .icon {
  88. flex: none;
  89. font-size: 10px;
  90. margin-left: 20px;
  91. }
  92. }
  93. }
  94. </style>