维基小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

90 lines
1.9 KiB

<template>
<!-- 校园轨迹组件 -->
<view class="card radius shadow-warp bg-white">
<view class="card-head solid-bottom">
<view class="card-head-avatar bg-green">
<view class="iconfont icon-wenduji_thermometer"></view>
</view>
<view class="card-head-title">健康上报</view>
<!-- <view class="card-head-action">icon</view> -->
</view>
<view class="card-content">
<view class="data-wrap">
<view :key="index" class="data-item" v-for="(item, index) in shoolSignNumber">
<view :class="[generateColor(item.name)]" class="data-text">{{ item.number }}</view>
<view class="data-title">{{ item.name }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { mapState } from 'vuex';
export default {
name: 'HealthData',
data() {
return {};
},
computed: mapState('statistics', ['shoolSignNumber']),
methods: {
/**
* 生成文本的颜色
* @param {string} name 类目名称
* @returns {string} color 颜色string
*/
generateColor(name) {
let color = 'text-green';
switch (name) {
case '发烧':
color = 'text-red';
break;
case '其他':
color = 'text-purple';
break;
case '未上报':
color = 'text-orange';
break;
default:
color = 'text-green';
break;
}
return color;
},
},
};
</script>
<style lang="scss" scoped>
.data-wrap {
display: flex;
align-items: center;
justify-content: space-around;
padding: 40rpx 0;
.data-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
.data-text {
font-size: 18px;
font-weight: 600;
margin-bottom: 4px;
}
.data-title {
font-size: 13px;
color: $grey;
}
}
}
.icon-wenduji_thermometer {
font-size: 14px;
}
</style>