tsg-app/pages/rainDetail/rainDetail.vue

102 lines
2.5 KiB
Vue

<template>
<view class="rain-detail-box">
<u-status-bar></u-status-bar>
<view class="nav-bar">
<u-icon name="arrow-left" color="#000" size="20" @click="backTo" style="margin-left:10px"></u-icon>
<view class="title">
{{stnm}}
<text style="font-size:12px;margin-left:5px">{{sta}}({{rain}})</text>
</view>
</view>
<view class="tab-bar" >
<view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}">
监测数据
</view>
<view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}">
统计数据
</view>
<view class="zbyq" @click="activeOne = 2" :class="{'active':activeOne == 2}">
周边雨情
</view>
</view>
<view class="rain-detail-content">
<Jcsj :stcd="stcd" v-if="activeOne == 0"/>
<Tjsj :stcd="stcd" v-else-if="activeOne == 1"/>
<Zbyq :stcd="stcd" v-else-if="activeOne == 2"/>
</view>
</view>
</template>
<script>
import Jcsj from "./jcsj/jcsj.vue"
import Tjsj from "./tjsj/tjsj.vue"
import Zbyq from "./zbyq/zbyq.vue"
const staType = {
MM: '气象站',PP: '雨量站',RR: '水库水文站',ZZ: '河道水位站',ZQ:"河道水文站"
}
const rainType = {'SH':'山洪','SW':'水文','QX':'气象','SK':'水库'}
export default {
data(){
return {
activeOne:0,
stcd:'',
stnm:'',
rainType:rainType,
staType:staType,
// sta:staType[sttp]
}
},
components:{
Jcsj,
Tjsj,
Zbyq
},
methods:{
backTo(){
uni.navigateBack({delta:1})
}
},
onLoad(option) {
this.stcd = option.stcd;
this.stnm = option.stnm;
this.sta = staType[option.sttp];
this.rain = rainType[option.source];
}
}
</script>
<style lang="scss" scoped>
.rain-detail-box{
height: 100vh;
overflow: hidden;
.nav-bar{
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 44px;
// margin-top: 30px;
// padding-top: 20px;
// padding-bottom: 10px;
border-bottom: 1px solid #dfdfdf;
// box-shadow: 0 5px 10px -8px #dfdfdf inset;
}
.title{
flex:1;
text-align: center;
font-size: 18px;
}
.tab-bar{
display: flex;
justify-content: space-between;
padding: 10px 30px;
border-bottom: 1px solid #dfdfdf;
}
.active{
color: #39a6ff;
}
.rain-detail-content{
padding: 10px;
}
}
</style>