5.3 居家养老web端控制台

news/2024/10/13 0:32:00

基于vue3+ElementPlus做的一个居家养老静态界面,内容准备后期实现

以下是效果图 特别声明用到了百度地图JS API进行位置展示与iV Cam模拟实时监控

 以下是代码部分

<script setup>
import { onMounted, onBeforeUnmount } from 'vue'
import { ref } from 'vue'
const videoRef = ref(null)
let stream = null
function loadJScript() {const script = document.createElement('script')script.type = 'text/javascript'script.src ='//api.map.baidu.com/api?type=webgl&v=1.0&ak=llEL7o82KutbtrUpWu5GEz6y8HJ6mzQO&callback=init'document.body.appendChild(script)
}function init() {const container = document.getElementById('container')if (!container) returnconst map = new window.BMapGL.Map(container) // 创建Map实例const point = new window.BMapGL.Point(116.404, 39.915) // 创建点坐标map.centerAndZoom(point, 10)map.enableScrollWheelZoom() // 启用滚轮放大缩小var marker = new window.BMapGL.Marker(point, {enableDragging: true})map.addOverlay(marker)
}
onMounted(async () => {loadJScript()try {// 获取媒体设备(通常是前置或后置摄像头)stream = await navigator.mediaDevices.getUserMedia({video: true,audio: false // 如果需要音频,设置为true
    })// 将视频流绑定到video元素if (videoRef.value) {videoRef.value.srcObject = stream}} catch (error) {console.error('Error accessing camera:', error)}
})onBeforeUnmount(() => {// 组件卸载时记得关闭视频流if (stream) {stream.getTracks().forEach((track) => track.stop())}
})
if (typeof window !== 'undefined') {window.init = init
}
</script><template><div class="common-layout"><el-container><el-header><div class="logo-container"><span style="font-weight: bold; font-size: 25px" class="logo-text">智慧助老控制台</span></div></el-header><el-container><!----------------------------------------------- aside --><el-aside width="250px"><div><div class="as"><el-col style="height: 100%"><divstyle="
                    width: 90%;background-color: aqua;border-radius: 10px;margin: auto;padding-top: 10px;padding-bottom: 20px;"
                ><h1 style="text-align: center">信息卡片</h1><el-row style="margin-top: 30px; margin-left: 40px"><el-avatarsrc="https://b0.bdstatic.com/e002551e53878af3bbe5b7d1a2c7e73d.jpg@h_1280"/><h1 style="margin-left: 30px">ikun</h1></el-row><el-divider style="width: 80%; margin-left: 8%" /><el-row style="margin-left: 45px"> 性别:男 </el-row><el-divider style="width: 80%; margin-left: 10%" /><el-row style="margin-left: 45px"> 年龄:2.5岁 </el-row><el-divider style="width: 80%; margin-left: 10%" /><el-row style="margin-left: 45px"> 生肖:鸡 </el-row><el-divider style="width: 80%; margin-left: 10%" /><el-row style="margin-left: 45px"> 爱好:唱跳rap篮球 </el-row></div><divclass="ad-text"style="
                    background-color: yellow;width: 90%;margin: auto;height: 35vh;border-radius: 10px;margin-top: 10px;"
                ><span>广告位招租。。。。</span><br /><br /><span>广告位招租。。。。</span><br /><br /><span>广告位招租。。。。</span><br /><br /><span>广告位招租。。。。</span><br /><br /><span>广告位招租。。。。</span></div></el-col></div></div></el-aside><el-container><!-- main ------------------------------------------------><el-main><el-col style="width: 100%; height: 100vh"><div style="display: flex; flex-wrap: nowrap"><videostyle="border-radius: 10px"ref="videoRef"autoplaymutedwidth="400"height="300"></video><divstyle="
                    width: 350px;background-color: white;height: 300px;border-radius: 10px;margin-left: 80px;margin-right: 30px;"
                ><div style="display: flex; flex-wrap: nowrap"><imgstyle="
                        margin-left: 40px;margin-top: 30px;width: 30px;height: 35px;"
                      src="../../assets/heart-rate.png"/><h1style="
                        margin-left: 10px;font-weight: 200;color: red;margin-top: 40px;"
                    >心率</h1></div><h1style="font-size: 50px; margin-left: 14%; font-weight: 300">79 次/分钟</h1></div><divstyle="
                    width: 350px;background-color: white;height: 300px;border-radius: 10px;margin: auto;"
                ><div style="display: flex; flex-wrap: nowrap"><imgstyle="
                        margin-left: 40px;margin-top: 30px;width: 30px;height: 35px;"
                      src="src\assets\aawater.png"/><h1style="
                        margin-left: 10px;font-weight: 200;color: red;margin-top: 40px;"
                    >血压</h1></div><h1style="font-size: 50px; margin-left: 14%; font-weight: 300">100 mmhg</h1></div></div><div style="display: flex; flex-wrap: nowrap"><div style="width: 400px; height: 400px; margin-top: 40px"><divstyle="
                      width: 100%;background-color: white;border-radius: 10px;height: 180px;display: flex;flex-wrap: nowrap;"
                  ><div style="height: 100%; width: 50%"><h1style="
                          font-weight: 300;color: #c4c4c4;margin-left: 15px;margin-top: 20px;font-size: 20px;"
                      >uv</h1><el-progressstyle="
                          width: 180px;margin-left: 10px;margin-top: 30px;"
                        :text-inside="true":stroke-width="20":percentage="80"color="#ff6600"status="exception"><span></span></el-progress><h1style="
                          font-weight: 300;color: #333333;margin-left: 15px;font-weight: 500;font-size: 30px;margin-top: 20px;"
                      ></h1></div><div><h1style="
                          font-size: 25px;margin-left: 70px;margin-top: 25px;margin-bottom: 0px;"
                      >PA++</h1><h2style="
                          color: #bbbbbb;margin-left: 85px;margin-top: 10px;margin-bottom: 1px;"
                      >SPF</h2><spanstyle="
                          font-size: 45px;font-weight: 800;color: #ff6600;margin-left: 75px;margin-top: 0px;"
                        >20</span></div></div><divstyle="
                      width: 100%;display: flex;flex-wrap: nowrap;background-color: white;border-radius: 10px;height: 180px;margin-top: 40px;"
                  ><div style="width: 50%; height: 100%"><divstyle="
                          font-size: 25px;color: #bbbbbb;margin-left: 25px;margin-top: 25px;"
                      >PM2.5</div><divstyle="
                          font-size: 80px;color: lightgreen;margin-left: 17px;margin-top: 5px;"
                      >32</div></div><div><div style="margin-left: 30px; margin-top: 25px"><span style="font-size: 20px">峰值</span><el-text tag="ins" style="font-size: 20px">21:00</el-text></div><div style="display: flex; flex-wrap: nowrap"><imgstyle="
                            width: 40px;margin-top: 50px;margin-left: 30px;"
                          src="src\assets\平均值_average.png"/><div style="margin-left: 10px; margin-top: 65px"><el-texttag="ins"style="font-size: 20px; margin-left: 15px">71</el-text></div></div></div></div></div><divstyle="
                    background-color: white;width: 60%;margin-left: 80px;border-radius: 20px;margin-top: 40px;"
                ><divid="container"style="
                      overflow: hidden;width: 100%;height: 100%;margin: 0;border-radius: 20px;"
                  ></div></div></div></el-col></el-main></el-container></el-container></el-container></div>
</template><style lang="scss" scoped>
.ad-text {font-weight: 800;font-size: 24px;width: 200px;height: 50px;overflow: hidden;position: relative;text-align: center;
}.ad-text > span {position: absolute;width: 100%;animation:changeColor 1s infinite alternate,slideToLeft 5s linear infinite;white-space: nowrap;color: red; /* 初始颜色,动画会改变它 */
}@keyframes changeColor {0% {color: red;}10% {color: blue;}20% {color: green;}30% {color: red;}40% {color: blue;}50% {color: green;}60% {color: red;}70% {color: blue;}80% {color: green;}90% {color: red;}100% {color: blue;}
}@keyframes slideToLeft {0% {left: 100%;}100% {left: -100%;}
}.demo-pagination-block + .demo-pagination-block {margin-top: 10px;
}
.demo-pagination-block .demonstration {margin-bottom: 16px;
}
.common-layout {height: 100vh;width: 100%;.el-header {background-color: #fff;display: flex; // 使用flex布局来放置Logo和文本align-items: center; // 垂直居中justify-content: center;padding: 10px; // 可以添加一些内边距
.logo-container {display: flex; // Logo和文本也使用flex布局align-items: center; // 垂直居中
.logo-image {height: 30px; // 根据你的Logo大小调整
        width: auto;margin-right: 10px; // Logo和文本之间的间距
      }.logo-text {font-size: 16px; // 根据需要调整文本大小
      }}}.el-aside {background-color: #fff;height: 100vh;}
}
</style>

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/27167.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

Python深入理解*和**含义和应用

本文源代码:https://gitee.com/obullxl/PythonCS/tree/master/CS-CY2405 Python中*和**很常见 禅师在阅读Python代码过程中,经常看到一个函数或方法的入参是*args和**kwargs(如:def func(*args, **kwargs)等)形式,或者在调用函数或方法时,在入参的元组和列表前面增加1个…

设置border后,子元素和父容器存在间隙

下方也出现了间隙网上找了一圈,全是说inline-block的,但是我调整a标签为block还是有间隙。 问题代码 <!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=…

python教程3.1:数据类型:字符串+列表list

一、字符串 字符串是⼀个有序的字符的集合,⽤于在计算机⾥存储和表示⽂本信息 常用操作二、列表list []内以逗号分隔,按照索引,存放各种数据类型,每个位置代表⼀个元素 特征 1、增加操作追加,数据会追加到尾部 2、删除操作3、修改操作 4、查找操作 如果不知道元素在列表哪…

WPF上位机 - 轴运动控制

最近学习WPF,写了一个WPF上位机使用S7.NETPlus 库与西门子1500TPLC,控制西门子伺服的通用上位机界面。分享在写上位机过程中踩的一些坑和使用体验。 上位机介绍可以看到上位机分为3个区域轴选择,使能区域 控制参数设置区域 诊断区域选择使能区域 选择区域读取TIA中组态的轴工…

系统管理之Linux启动流程

1.系统初始化进程SysV风格: init centos5 配置文件:/etc/inittabUpstart风格: init centos6 配置文件:/etc/init.d/,/etc/inittabSystemd风格: systemd centos7 配置文件:/usr/lib/systemd/system/,/etc/systemd/system/ systemctl是一个systemd管理工具2.Systemd 服务…

提高安全性,优雅实现拷贝与交换:C++中的Copy-and-Swap惯用法

概述:拷贝并交换(Copy-and-Swap)是C++编程中的惯用法,用于实现赋值操作符和确保异常安全的拷贝构造函数。其核心思想是通过拷贝构造函数创建临时副本,再通过交换确保操作的异常安全性。这种方法在C++11之前和之后都适用,但在C++11中,移动语义和右值引用的引入使得实现可…

【排课小工具】排课程序设计与实现

本文记录了排课小工具的程序设计与实现过程,值得一提的是,在程序设计的过程中我几乎没有用到上一篇文章提到的有关领域模型的东西,而是大量沿用了原型软件的诸多设计,或许这个一工具并不适合面向对象的分析方式,更多的,我觉得还是自己对这一领域的认识太过肤浅,缺乏开发…

Linux下ffmpeg库的编译链接

Linux下ffmpeg库的链接。/usr/bin/ld: /usr/local/ffmpeg/lib/libavformat.a(aviobuf.o): in function `ff_crc04C11DB7_update:/home/ann/FFmpeg/ffmpeg/libavformat/aviobuf.c:568: undefined reference to `av_crc_get_table/usr/bin/ld: /home/ann/FFmpeg/ffmpeg/libavform…