123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <template>
- <div class="scene-list">
- <div class="header">
- <p>场景列表({{ sceneList.length }})</p>
- <span class="icon" @click="emit('close')">
- <Icon type="cross@2x" />
- </span>
- </div>
- <div class="content">
- <div
- class="sign"
- v-for="scene in sceneList"
- :key="scene.id"
- @click="emit('changeScene', scene)"
- :class="{ active: currentScene === scene }"
- >
- <div class="info">
- <img :src="scene.thumb" />
- <p>{{ scene.sceneName }}</p>
- </div>
- <span class="icon">
- <Icon type="arrow@2x" v-if="currentScene !== scene" />
- </span>
- </div>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { unref } from "vue";
- import Icon from "/@/components/basic/icon/index.vue";
- import { useRoom } from "/@/hooks/useRoom";
- // import { currentScene } from "@/store/room";
- const { currentScene, sceneList } = useRoom();
- console.log("sceneList", unref(sceneList));
- const emit = defineEmits(["close", "changeScene"]);
- </script>
- <style scoped lang="scss">
- .scene-list {
- max-height: 80%;
- background: rgba(0, 0, 0, 0.8);
- border-radius: 10px 10px 0px 0px;
- bottom: 0;
- left: 0;
- right: 0;
- display: flex;
- flex-direction: column;
- z-index: 99999;
- position: absolute;
- }
- .header {
- flex: none;
- text-align: center;
- height: 46px;
- line-height: 46px;
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
- p {
- font-size: 16px;
- font-weight: 500;
- color: #ffffff;
- }
- .icon {
- position: absolute;
- right: 0;
- top: 0;
- font-size: 14px;
- padding: 0 20px;
- }
- }
- .content {
- flex: 1;
- overflow-y: auto;
- padding: 11px;
- .sign {
- height: 60px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 18px;
- .info {
- flex: 1;
- display: flex;
- align-items: center;
- img {
- flex: none;
- width: 60px;
- height: 60px;
- border-radius: 4px;
- }
- p {
- font-size: 14px;
- font-weight: 400;
- color: #ffffff;
- line-height: 20px;
- margin-left: 10px;
- }
- }
- &.active .info p {
- color: #ed6155;
- }
- .icon {
- flex: none;
- font-size: 10px;
- margin-left: 20px;
- }
- }
- }
- </style>
|