浏览代码

feat: 增加icon字段

珍珍 2 月之前
父节点
当前提交
02d67b90b0
共有 1 个文件被更改,包括 71 次插入75 次删除
  1. 71 75
      src/views/envmonitor/taiguv1/index.vue

+ 71 - 75
src/views/envmonitor/taiguv1/index.vue

@@ -159,18 +159,18 @@
 </template>
 
 <script>
-import { defineComponent, reactive, toRefs, onMounted, onBeforeUnmount } from "vue";
-import { useRoute } from "vue-router";
-import Air from "./components/Air/index.vue";
-import Screen from "./components/Screen/index.vue";
-import Volumn from "./components/Volumn/index.vue";
-import Lamp from "./components/Lamp/index.vue";
-import Curtain from "./components/Curtain/index.vue";
-import LightMore from "./components/Lamp/LightMore.vue";
+import { defineComponent, reactive, toRefs, onMounted, onBeforeUnmount } from 'vue'
+import { useRoute } from 'vue-router'
+import Air from './components/Air/index.vue'
+import Screen from './components/Screen/index.vue'
+import Volumn from './components/Volumn/index.vue'
+import Lamp from './components/Lamp/index.vue'
+import Curtain from './components/Curtain/index.vue'
+import LightMore from './components/Lamp/LightMore.vue'
 
-import { parseImgUrl } from "@/utils";
+import { parseImgUrl } from '@/utils'
 // import "vue3-video-play/dist/style.css";
-import { videoPlay } from "vue-video-play";
+import { videoPlay } from 'vue-video-play'
 
 export default defineComponent({
   components: {
@@ -186,119 +186,119 @@ export default defineComponent({
   setup() {
     const proxyData = reactive({
       parseImgUrl: parseImgUrl,
-      type: "zh",
+      type: 'zh',
       lanageArr: [
         {
-          type: "zh",
-          text: "中",
+          type: 'zh',
+          text: '中',
         },
         {
-          type: "en",
-          text: "EN",
+          type: 'en',
+          text: 'EN',
         },
       ],
       checkLanage(item) {
-        proxyData.type = item.type;
-        console.log("被点击了");
+        proxyData.type = item.type
+        console.log('被点击了')
       },
-      boxLine: require("@/assets/taiguv1/svg/box_line.png"),
+      boxLine: require('@/assets/taiguv1/svg/box_line.png'),
       roomData: [
         {
-          id: "room1",
-          name: "ROOM EOS",
+          id: 'room1',
+          name: 'ROOM EOS',
           modeBg:
-            "linear-gradient(113.73deg, rgba(47, 36, 28, 0.4) 17.26%, rgba(47, 36, 28, 0.8) 55.71%)",
-          bg:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room1.png",
+            'linear-gradient(113.73deg, rgba(47, 36, 28, 0.4) 17.26%, rgba(47, 36, 28, 0.8) 55.71%)',
+          bg: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room1.png',
+          icon: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/room_eos.svg',
           video:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video1.mov",
+            'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video1.mov',
         },
         {
-          id: "room2",
-          name: "ROOM METIS",
+          id: 'room2',
+          name: 'ROOM METIS',
           modeBg:
-            "linear-gradient(113.73deg, rgba(37, 21, 8, 0.4) 17.26%, rgba(37, 21, 8, 0.8) 55.71%)",
-          bg:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room2.png",
+            'linear-gradient(113.73deg, rgba(37, 21, 8, 0.4) 17.26%, rgba(37, 21, 8, 0.8) 55.71%)',
+          bg: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room2.png',
+          icon: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/room_metis.svg',
           video:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video2.mp4",
+            'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video2.mp4',
         },
         {
-          id: "room3",
-          name: "ROOM NAIAD",
+          id: 'room3',
+          name: 'ROOM NAIAD',
+          icon: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/room_naiad.svg',
           modeBg:
-            "linear-gradient(113.73deg, rgba(8, 14, 37, 0.4) 17.26%, rgba(10, 15, 33, 0.9) 55.71%)",
-          bg:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room3.png",
+            'linear-gradient(113.73deg, rgba(8, 14, 37, 0.4) 17.26%, rgba(10, 15, 33, 0.9) 55.71%)',
+          bg: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room3.png',
           video:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video3.mov",
+            'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video3.mov',
         },
         {
-          id: "room4",
-          name: "ROOM HELIOS",
+          id: 'room4',
+          name: 'ROOM HELIOS',
+          icon: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/room_helios.svg',
           modeBg:
-            "linear-gradient(113.73deg, rgba(32, 5, 5, 0.4) 17.26%, rgba(28, 7, 7, 0.8) 55.71%)",
-          bg:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room4.png",
+            'linear-gradient(113.73deg, rgba(32, 5, 5, 0.4) 17.26%, rgba(28, 7, 7, 0.8) 55.71%)',
+          bg: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room4.png',
           video:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video4.mp4",
+            'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video4.mp4',
         },
         {
-          id: "room5",
-          name: "ROOM GAIA",
+          id: 'room5',
+          name: 'ROOM GAIA',
+          icon: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/room_gaia.svg',
           modeBg:
-            "linear-gradient(113.73deg, rgba(21, 32, 26, 0.5) 17.26%, rgba(14, 30, 21, 0.8) 55.71%)",
-          bg:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room5.png",
+            'linear-gradient(113.73deg, rgba(21, 32, 26, 0.5) 17.26%, rgba(14, 30, 21, 0.8) 55.71%)',
+          bg: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room5.png',
           video:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video5.mp4",
+            'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video5.mp4',
         },
         {
-          id: "room6",
-          name: "ROOM AURA",
+          id: 'room6',
+          name: 'ROOM AURA',
+          icon: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/room_aura.svg',
           modeBg:
-            "linear-gradient(113.73deg, rgba(4, 18, 32, 0.5) 17.26%, rgba(6, 18, 32, 0.8) 55.71%)",
-          bg:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room6.png",
+            'linear-gradient(113.73deg, rgba(4, 18, 32, 0.5) 17.26%, rgba(6, 18, 32, 0.8) 55.71%)',
+          bg: 'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room6.png',
           video:
-            "https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video6.mov",
+            'https://terra-h5.tenants.link/static/WeChat/page-taiguv1/page-pad/pad_room_video6.mov',
         },
       ],
-      roomInfo: "",
+      roomInfo: '',
       modeType: 1,
       checkModel(type) {
-        proxyData.modeType = type;
+        proxyData.modeType = type
       },
       airStatus: false,
       getStatus(flag) {
-        proxyData.airStatus = flag;
+        proxyData.airStatus = flag
       },
       isLightColorFlag: false,
       lightData: [],
 
       showMore(lightData) {
-        proxyData.isLightColorFlag = true;
+        proxyData.isLightColorFlag = true
       },
-    });
-    onBeforeUnmount(() => {});
+    })
+    onBeforeUnmount(() => {})
     onMounted(() => {
-      let route = useRoute();
-      let roomId = route.query.id;
-      proxyData.roomInfo = proxyData.roomData[0];
+      let route = useRoute()
+      let roomId = route.query.id
+      proxyData.roomInfo = proxyData.roomData[0]
       proxyData.roomData.map((item) => {
         if (item.id == roomId) {
-          proxyData.roomInfo = item;
+          proxyData.roomInfo = item
         }
-      });
+      })
 
-      proxyData.roomInfo.logo = require("@/assets/taiguv1/svg/meting_icon.svg");
-      proxyData.roomInfo.location = "3F";
-    });
+      proxyData.roomInfo.logo = require('@/assets/taiguv1/svg/meting_icon.svg')
+      proxyData.roomInfo.location = '3F'
+    })
     return {
       ...toRefs(proxyData),
-    };
+    }
   },
-});
+})
 </script>
 <style lang="scss">
 .main {
@@ -564,10 +564,6 @@ export default defineComponent({
 </style>
 <style scoped>
 .van-overlay {
-  background: linear-gradient(
-    113.73deg,
-    rgba(37, 21, 8, 0.4) 17.26%,
-    rgba(37, 21, 8, 0.8) 55.71%
-  );
+  background: linear-gradient(113.73deg, rgba(37, 21, 8, 0.4) 17.26%, rgba(37, 21, 8, 0.8) 55.71%);
 }
 </style>