|
|
@@ -0,0 +1,126 @@
|
|
|
+<template>
|
|
|
+ <view>
|
|
|
+ <view class="codeBox" :class="{ 'bg-red': healthCode.color=='red', 'bg-blue': healthCode.color=='green'}" >
|
|
|
+ <view class="timeBar">{{name}}</view>
|
|
|
+ <view class="timeBar">{{nowStr}}</view>
|
|
|
+ <image class="code" :src="healthCode.code"></image>
|
|
|
+ <view v-if="healthCode.color=='green'" class="timeBar" style="height: 250rpx;letter-spacing: 20rpx;">
|
|
|
+ <icon type="success" size="45"/>
|
|
|
+ 未见异常
|
|
|
+ </view>
|
|
|
+ <view v-if="healthCode.color=='red'" class="timeBar" style="height: 250rpx;letter-spacing: 20rpx;">
|
|
|
+ <icon type="warn" size="45"/>
|
|
|
+ 体温异常
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="tips">{{tips}}</view>
|
|
|
+ <view class="link" @click="navigate('/pages/index/staff-temperature/list')"> 测温记录</view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import util from "@/utils/util.js"
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ personInfo: {
|
|
|
+ name: "*",
|
|
|
+ idNumber: "*"
|
|
|
+ },
|
|
|
+ timer: '',
|
|
|
+ nowStr: "",
|
|
|
+ healthCode: {
|
|
|
+ code: "http://120.92.153.151:3000/public/recog_images/2021-01-09/06d56a9f7fca42c6",
|
|
|
+ color: "green"
|
|
|
+ },
|
|
|
+ tips: "按照目前掌握的防疫相关数据,暂未发现您存在与防疫相关异常健康状况。防疫相关数据会随着疫情发展及时更新。此次查询并不会排除您的防疫相关健康风险。"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async onLoad() {
|
|
|
+ //获取员工是信息
|
|
|
+ let phone = uni.getStorageSync("phone");
|
|
|
+ let staffRes=await this.$api.enterprisestaff.page({phone});
|
|
|
+ this.personInfo.name = staffRes.data.records[0].realName;
|
|
|
+ this.personInfo.idNumber = staffRes.data.records[0].idcard;
|
|
|
+ //获取实时时间
|
|
|
+ this.getDateStr();
|
|
|
+
|
|
|
+ //获取健康码
|
|
|
+ let codeRes=await this.$api.healthCode.getCode({idCardNumber: this.personInfo.idNumber,userName: this.personInfo.name});
|
|
|
+ this.healthCode.code = codeRes.data.code;
|
|
|
+ this.healthCode.color = codeRes.data.color;
|
|
|
+
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ name(){
|
|
|
+ let chars = this.personInfo.name.split("");
|
|
|
+ return "**"+ chars[chars.length-1]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getDateStr(){this.timer = setInterval(()=>{
|
|
|
+ this.nowStr = util.dateFormat(new Date(),"yyyy-MM-dd hh:mm:ss");
|
|
|
+ },1000);
|
|
|
+ },
|
|
|
+ navigate(path){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:path
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .timeBar{
|
|
|
+ width: 400rpx;
|
|
|
+ height: 100rpx;
|
|
|
+ color: white;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 40rpx;
|
|
|
+ /* background-color: rgba(255,255,255,0.5); */
|
|
|
+ }
|
|
|
+ .code{
|
|
|
+ background: white;
|
|
|
+ border-radius: 15rpx;
|
|
|
+ padding: 5rpx;
|
|
|
+ width: 400rpx;
|
|
|
+ height: 400rpx;
|
|
|
+ }
|
|
|
+ .codeBox{
|
|
|
+ width: 100%;
|
|
|
+ height: 1000rpx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-radius: 5rpx;
|
|
|
+ }
|
|
|
+ .tips{
|
|
|
+ height: 300rpx;
|
|
|
+ width: 90%;
|
|
|
+ text-indent: 2em;
|
|
|
+ margin: auto;
|
|
|
+ color: gray;
|
|
|
+ /* background: #18B566; */
|
|
|
+ font-size: 30rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .link{
|
|
|
+ height: 100rpx;
|
|
|
+ width: 100%;
|
|
|
+ color: #007AFF;
|
|
|
+ display: flex;
|
|
|
+ text-decoration: underline;
|
|
|
+ font-style: italic;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+</style>
|