<template>
|
<view class="gird-container">
|
<u-grid :border="false" :col="gridList.length">
|
<u-grid-item @click="gridClick(item)" v-for="(item,index) in gridList" :key="index">
|
<view style="display: flex;flex-direction: column;width: 100%;align-items: center;justify-content: space-evenly;
|
height: 100rpx;"
|
:class="(index==0 && useBgImg=='0') ?'first_blue':(index==0 && useBgImg==1)?'first_yellow':useBgImg==0?('remain'):'yellowReMain'">
|
<view class="up">
|
<text class="text">{{item.value}}</text>
|
</view>
|
<view class="down">
|
<text class="text">{{item.label}}</text>
|
</view>
|
</view>
|
</u-grid-item>
|
</u-grid>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
props: {
|
gridList: {
|
type: Array,
|
},
|
//背景图片颜色不同的判断 0,1 0为蓝色背景图片 1为黄色背景图片 默认为0
|
useBgImg: {
|
type: String,
|
default: "0"
|
}
|
},
|
data() {
|
return {}
|
},
|
created() {
|
|
},
|
mounted() {
|
|
},
|
onLoad(option) {
|
|
},
|
onShow() {
|
|
},
|
methods: {
|
gridClick(item) {
|
|
if (item.label == "水库" || item.label == "已监测" || item.label == "超汛限") {
|
let url = "/subPackage/realtimeMonitor/realtimeMonitor/index"
|
this.$u.func.globalNavigator(url, "navTo", "实时监控")
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.gird-container {
|
border-radius: 20rpx;
|
box-shadow: 0 0 8rpx #f0f0f0;
|
|
.first_yellow {
|
background-image: url("https://sk.hubeishuiyi.cn/business/xcxImg/homeImg/gird-background-yellow.png") !important;
|
background-position: center !important;
|
background-size: cover !important;
|
background-repeat: no-repeat !important;
|
|
.up {
|
.text {
|
width: 86rpx;
|
height: 28rpx;
|
font-size: 36rpx;
|
font-family: PingFang SC;
|
font-weight: bold;
|
color: #FFFFFF;
|
line-height: 28rpx;
|
}
|
}
|
|
.down {
|
font-size: 0;
|
|
.text {
|
width: 46rpx;
|
height: 24rpx;
|
font-size: 24rpx;
|
font-family: PingFang SC;
|
font-weight: 500;
|
color: #FFFFFF;
|
line-height: 28rpx;
|
}
|
|
}
|
}
|
|
.first_blue {
|
background-image: url("https://sk.hubeishuiyi.cn/business/xcxImg/homeImg/gird-background.png") !important;
|
background-position: center !important;
|
background-size: cover !important;
|
background-repeat: no-repeat !important;
|
|
|
.up {
|
.text {
|
width: 86rpx;
|
height: 28rpx;
|
font-size: 36rpx;
|
font-family: PingFang SC;
|
font-weight: bold;
|
color: #FFFFFF;
|
line-height: 28rpx;
|
}
|
}
|
|
.down {
|
font-size: 0;
|
|
.text {
|
width: 46rpx;
|
height: 24rpx;
|
font-size: 24rpx;
|
font-family: PingFang SC;
|
font-weight: 500;
|
color: #FFFFFF;
|
line-height: 28rpx;
|
}
|
|
}
|
}
|
|
.remain {
|
.up {
|
.text {
|
width: 86rpx;
|
height: 28rpx;
|
font-size: 36rpx;
|
font-family: PingFang SC;
|
font-weight: bold;
|
color: #333333;
|
line-height: 28rpx;
|
}
|
|
}
|
|
.down {
|
font-size: 0;
|
|
.text {
|
width: 68rpx;
|
height: 22rpx;
|
font-size: 24rpx;
|
font-family: PingFang SC;
|
font-weight: 500;
|
color: #6096F9;
|
line-height: 28rpx;
|
}
|
|
}
|
}
|
|
.yellowReMain {
|
.up {
|
.text {
|
width: 86rpx;
|
height: 28rpx;
|
font-size: 36rpx;
|
font-family: PingFang SC;
|
font-weight: bold;
|
color: #333333;
|
line-height: 28rpx;
|
}
|
|
}
|
|
.down {
|
font-size: 0;
|
|
.text {
|
width: 68rpx;
|
height: 22rpx;
|
font-size: 24rpx;
|
font-family: PingFang SC;
|
font-weight: 500;
|
color: #FFB507;
|
line-height: 28rpx;
|
}
|
|
}
|
}
|
}
|
</style>
|