|
|
@@ -1,15 +1,27 @@
|
|
|
<template>
|
|
|
<div class="room">
|
|
|
<div class="room-title">
|
|
|
- 你的房间<span>4</span>
|
|
|
+ 你的房间: 4
|
|
|
</div>
|
|
|
<div class="room-content">
|
|
|
<template
|
|
|
v-for="(item, index) in roomList"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <div class="room-content-item">
|
|
|
- {{ index }}
|
|
|
+ <div
|
|
|
+ class="room-content-item"
|
|
|
+ @click="itemClick"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <p>客厅</p>
|
|
|
+ <div>
|
|
|
+ <Icon
|
|
|
+ name="10"
|
|
|
+ :size="20"
|
|
|
+ />
|
|
|
+ 4个设备
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -23,7 +35,9 @@
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import { ref } from 'vue'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
|
+const router = useRouter()
|
|
|
const roomList = ref([
|
|
|
{ 1: 1 },
|
|
|
{ 1: 1 },
|
|
|
@@ -34,6 +48,11 @@ const roomList = ref([
|
|
|
{ 1: 1 },
|
|
|
{ 1: 1 }
|
|
|
])
|
|
|
+
|
|
|
+function itemClick() {
|
|
|
+ console.log('跳转到设备list')
|
|
|
+ router.push('/create')
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.room {
|
|
|
@@ -43,14 +62,6 @@ const roomList = ref([
|
|
|
|
|
|
&-title {
|
|
|
font-size: 18px;
|
|
|
-
|
|
|
- &>span:last-child {
|
|
|
- font-size: 16px;
|
|
|
- background: red;
|
|
|
- border-radius: 10px;
|
|
|
- margin-left: 10px;
|
|
|
- padding: 0 10px;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
&-content {
|
|
|
@@ -68,11 +79,29 @@ const roomList = ref([
|
|
|
flex: 1 0 286px;
|
|
|
max-width: 100%;
|
|
|
height: 180px;
|
|
|
- background: #40464D;
|
|
|
+ padding: 10px 20px;
|
|
|
+ background: radial-gradient(circle at right, #40464d00, #40464d75 35%), url(./img/1.png) no-repeat right;
|
|
|
+ background-size: contain;
|
|
|
+ background-blend-mode: overlay;
|
|
|
box-shadow: 0px 4px 20px -2px rgba(50, 50, 71, 0.02), 0px 0px 5px 0px rgba(12, 26, 75, 0.04);
|
|
|
border-radius: 12px;
|
|
|
cursor: pointer;
|
|
|
overflow: hidden;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ &>div>div {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ svg {
|
|
|
+ margin-right: 5px;
|
|
|
+ color: var(--n-text-color);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ scale: 1.01;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|