xytSk-App/pages/ylzList/index.vue

113 lines
2.0 KiB
Vue
Raw Normal View History

2024-09-14 09:22:12 +08:00
<template>
2024-11-05 17:48:27 +08:00
<view class="skinfo" @click="toDetail()">
2024-09-14 09:22:12 +08:00
<view class="title">
<view class="left">
2024-11-06 15:56:11 +08:00
<text>{{item.stnm}}</text>
2024-09-14 09:22:12 +08:00
</view>
<view class="right">
2024-11-06 15:56:11 +08:00
{{item.tm}}
2024-09-14 09:22:12 +08:00
</view>
</view>
<view class="content">
2024-11-07 10:48:41 +08:00
<view class="listItem" v-for="(v,k) of list" :style="{border:`1px solid ${getColor(item[k])}`}">
<view class="top" :style="'background-color:'+getColor(item[k])+';border-bottom: 1px solid '+getColor(item[k])+';'">
2024-09-14 09:22:12 +08:00
{{k}}
</view>
<view class="bottom">
2024-11-06 15:56:11 +08:00
{{item[k]}}
2024-09-14 09:22:12 +08:00
</view>
</view>
</view>
</view>
</template>
<script>
export default{
2024-11-06 15:56:11 +08:00
props:{
item:{
type: Object,
required: true,
},
},
2024-09-14 09:22:12 +08:00
data(){
return{
list:{
h1:0,
h3:0,
h6:0,
h12:22,
h24:35,
},
}
2024-11-05 17:48:27 +08:00
},
methods:{
2024-11-07 10:48:41 +08:00
getColor(v){
if(v>=0 && v<10){
return '#bdef9a'
}
if(v>=10 && v<25){ return '#bdef9a'}
if(v>=20 && v<50){return '#6ec1fb'}
if(v>=50 && v<100){return '#1d1bc7'}
if(v>=100 && v<250){return '#eb20f5'}
if(v>=250){return '#761e50'}
// #bdef9a 0-10,
// #bdef9a 10-25
// #6ec1fb 20-50
// #1d1bc7 50-100
// #eb20f5 100-250
// #761e50 >=250
},
2024-11-05 17:48:27 +08:00
toDetail(){
uni.navigateTo({
2024-11-14 17:54:35 +08:00
url:`/pages/ylzList/detail/index?stnm=${this.item.stnm}&stcd=${this.item.stcd}`
2024-11-05 17:48:27 +08:00
})
},
2024-11-06 15:55:25 +08:00
},
2024-09-14 09:22:12 +08:00
}
</script>
<style lang="scss" scoped>
.skinfo {
.title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
}
.content{
display: flex;
justify-content: space-between;
.listItem{
font-size: 13px;
border-radius: 5px;
color: #333333;
text-align: center;
width: 75px;
height: 50px;
margin: 5px;
.top{
height: 40%;
color: #fff;
}
.bottom{
height: 60%;
}
}
}
.bottomItem{
display: flex;
border-top: 1px solid #f0f0f0;
padding: 10px 0 0 0;
font-size: 14px;
}
}
.withd-2{
width: 50%;
text-align: center;
}
</style>