From e06cb77c1c4a2ab4e3542db024c10a6f3440136d Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Wed, 18 Oct 2023 18:47:46 +0800 Subject: [PATCH] gengx --- src/views/controller/index.vue | 35 ++++++++++++++++++++++------------ src/views/scene/index.vue | 2 ++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/views/controller/index.vue b/src/views/controller/index.vue index 78aa53c..66de7e6 100644 --- a/src/views/controller/index.vue +++ b/src/views/controller/index.vue @@ -4,12 +4,22 @@ import { ref } from "vue" import axios from "axios" const showIframe = ref(false) -const iframeSRC = ref("") +// const iframeSRC = ref("") if(!localStorage.getItem('order4')){ console.error('请到缓存设置指令: order1~4; ', '场景指令: scene--URI, 视频指令: mp4--URI', '例如: order1 secen--http://shop.lihai.cn/#/admin'); } +const orderList = ref([]); + +const loadOrderList = ()=>{ + axios.get('https://chat.lihaink.cn/index/demo1').then((res)=>{ + orderList.value = res.data.data; + console.log(orderList); + }) +} +loadOrderList() + const changeImg = (e: number)=>{ // switch(e){ // case 1: iframeSRC.value = "https://goview.lihaink.cn/#/chart/preview/62";break; @@ -18,12 +28,12 @@ const changeImg = (e: number)=>{ // case 4: iframeSRC.value = "https://goview.lihaink.cn/#/chart/preview/74";break; // } // showIframe.value = true; - switch(e){ - case 1: nowOrder.value = localStorage.getItem('order1');break; - case 2: nowOrder.value = localStorage.getItem('order2');break; - case 3: nowOrder.value = localStorage.getItem('order3');;break; - case 4: nowOrder.value = localStorage.getItem('order4');;break; - } + // switch(e){ + // case 1: nowOrder.value = localStorage.getItem('order1');break; + // case 2: nowOrder.value = localStorage.getItem('order2');break; + // case 3: nowOrder.value = localStorage.getItem('order3');;break; + // case 4: nowOrder.value = localStorage.getItem('order4');;break; + // } submitOrder(e) } @@ -31,7 +41,8 @@ const nowOrder = ref("") const url = ref("") const submitOrder = (e: number)=>{ - if(!nowOrder.value) return console.log('请到缓存设置指令: order'+e, '场景指令: scene--URI, 视频指令: mp4--URI'); + // if(!nowOrder.value) return console.log('请到缓存设置指令: order'+e, '场景指令: scene--URI, 视频指令: mp4--URI'); + nowOrder.value = `${orderList.value[e].type==1?'scene':'mp4'}--${orderList.value[e].uri}`; if(url.value==`https://chat.lihaink.cn/index/push?name=${nowOrder.value}`) return console.log('当前指令已经发送过,请切换其他指令'); url.value = `https://chat.lihaink.cn/index/push?name=${nowOrder.value}` axios.get(`https://chat.lihaink.cn/index/push?name=${btoa(nowOrder.value)}`).then(()=>{ @@ -56,19 +67,19 @@ const back = ()=>{
- +
- +
- +
- +
diff --git a/src/views/scene/index.vue b/src/views/scene/index.vue index ad23702..7f4a9eb 100644 --- a/src/views/scene/index.vue +++ b/src/views/scene/index.vue @@ -57,6 +57,8 @@ user_channel.on('message', (data: any) => { console.log(error); } + + })