<template>
	<view>
		<navInfo :title="'微型消防站详情'"></navInfo>
		<view class="bgTopImg">
			<image slot="right" :src="`${urls}/navBg@2x.png`" class="bgTopImg"></image>
		</view>
		<view v-if="tableData != ''" class="container uni-container ">
			<view class="buju">
				<view class="buju">
					<text class="miaoshu">社区名称 :</text>
					<text>{{ tableData.microName }}</text>
				</view>
				<text class="miaoshu">所属区县 :</text>
				<text>{{ tableData.county }}</text>
			</view>
			<view class="buju">
				<text class="miaoshu">所属单位 :</text>
				<text>{{ tableData.orgName }}</text>
			</view>
			<view class="buju">
				<text class="miaoshu">详细地址 :</text>
				<text>{{ tableData.addr }}</text>
			</view>
			<view class="buju">
				<text class="miaoshu">控制室值班人员 :</text>
				<text>{{ tableData.dutyer }}</text>
				<button @click="goWorkNum" class="manyBtn">查看值班人</button>
			</view>
			<view class="buju">
				<text class="miaoshu">负责人 :</text>
				<text>{{ tableData.charger }}</text>
				<button @click="goBigNum" class="manyBtn">查看负责人</button>
			</view>
			<view class="buju">
				<text class="miaoshu">建站日期 :</text>
				<text>{{ tableData.builtOn }}</text>
			</view>
			<view class="buju">
				<text class="miaoshu">队员数量 :</text>
				<text>{{ tableData.members }}</text>
				<button @click="goPeopleMes" class="manyBtn">查看队员</button>
			</view>
			<view class="buju">
				<text class="miaoshu">报警电话 :</text>
				<text>{{ tableData.alarmTel }}</text>
			</view>
			<view class="buju"><text class="miaoshu">微型消防站车辆配备情况 :</text></view>
			<view class="buju">
				<view class="width100">
					<uni-table stripe border emptyText="暂无更多数据">
						<uni-tr class="uniTr">
							<uni-th align="center">水罐车</uni-th>
							<uni-td align="center">{{ tableData.waterTanker }}</uni-td>
						</uni-tr>
						<uni-tr class="uniTr">
							<uni-th align="center">泡沫车</uni-th>
							<uni-td align="center">{{ tableData.foamCar }}</uni-td>
						</uni-tr>
						<uni-tr class="uniTr">
							<uni-th align="center">消防摩托</uni-th>
							<uni-td align="center">{{ tableData.fireMoto }}</uni-td>
						</uni-tr>
						<uni-tr class="uniTr">
							<uni-th align="center">其它</uni-th>
							<uni-td align="center">{{ tableData.others }}</uni-td>
						</uni-tr>
					</uni-table>
				</view>
			</view>
			<u-button style="width:60%;margin-top:80rpx" @click="gotoEditStation(tableData)" shape="circle" size="large" color="#4cb2b6"
				text="修改信息"></u-button>
		</view>
	</view>
</template>
<script>
	var that = null;
	import config from '@/config'
	const baseUrlImg=config.baseUrlImg
	import navInfo from '@/pagesA/components/my-nav/nav'
	import {
		shijianc
	} from '@/utils/common.js'
	export default {
		components: {
			navInfo
		},
		data() {
			return {
				urls:baseUrlImg,
				tableData: {
					orgName: ''
				}
			};
		},
		onLoad: function(option) {
			that = this;
			var data = option.id;
			// 接收来自上个页面传递的参数
			const eventChannel = this.getOpenerEventChannel();
			eventChannel.on('acceptDataFromOpenerPage', function(val) {
				that.tableData = val;
				that.tableData.builtOn=val.builtOn
			});
		   
			this.tableData.orgName = option.orgName;
			console.log('option: ', that.tableData);
		},

		methods: {
			// 传递当前页面数据到 ‘修改信息’
			gotoEditStation(val) {
				uni.navigateTo({
					url: '/pagesA/fire/fire_station/edit_fireStation/edit_fireStation',
					events: {
						// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
						acceptDataFromOpenedPage: function(val) {
							this.tableData = val;
						}
					},
					success: function(res) {
						// 通过eventChannel向被打开页面传送数据
						res.eventChannel.emit('acceptDataFromOpenerPage', val);
					}
				});
			},
			// 值班
			goWorkNum(){
				uni.navigateTo({
					url:"/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=1"
				})
			},
			// 负责人
			goBigNum(){
				uni.navigateTo({
					url:"/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=2"
				})
			},
			// 普通人
			goPeopleMes(){
				uni.navigateTo({
					url:"/pagesA/fire/fire_station/people_fireStation/people_fireStation?addId=0"
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	page {
	background-color: #fff !important;
	}
	.buju {
		margin: 40rpx 0;
	}

	.container {
		border-radius: 30px 30px 0px 0px;
		background: #fff;
		/*#ifdef H5*/
		margin-top: 50rpx;
		/* #endif */
		/* #ifdef  MP-WEIXIN*/
		margin-top: 100rpx;
		/* #endif */
		z-index: 999999999999999999;
		position: relative;
	}

	.cont {}

	.weiwan {
		color: #d51a52;
		background: rgba(213, 26, 82, 0.2);
		padding: 5rpx 20rpx;
		border-radius: 2px;
		border: 1px solid #d51a52;
	}

	.yiwan {
		color: #4cb2b6;
		background: rgba(76, 178, 182, 0.2);
		padding: 5rpx 20rpx;
		border-radius: 2px;
		border: 1px solid #4cb2b6;
	}

	.miaoshu {
		margin-right: 20rpx;
		color: #274647;
		font-weight: 600;
	}

	/deep/.uni-table-tr,
	/deep/.table--stripe[data-v-6cd49106] .uni-table-tr:nth-child(2n + 3),
	/deep/.table--stripe.data-v-6cd49106 .uni-table-tr:nth-child(2n + 3),/deep/.table--stripe {
		background-color: #F2F4F6;
	}

	/deep/.table--border[data-v-511e81f9],
	/deep/.table--border.data-v-511e81f9,/deep/.table--border {
		border-right: 2px #E5E5E5 solid;
		border-top-left-radius: 10px !important;
		border-bottom-left-radius: 10px !important;
	}

	/deep/.table--border[data-v-321f8e79],
	/deep/.table--border.data-v-321f8e79,/deep/.table--borde{
		border-top-right-radius: 10px !important;
		border-bottom-right-radius: 10px !important;
	}

	/deep/ .uni-table {
		//这行代码为间隔效果！！！
		border-spacing: 0px 6px !important;
		background-color: #fff;
	}

	/deep/ .table--border {
		border: none;

	}
	.uniTr{
		background-color: #F2F4F6;
	}
	.manyBtn{
		display: inline-block;
		width: 100rpx;
		height: 40rpx;
		font-size: 20rpx;
		line-height: 40rpx;
		text-align: center;
		border-radius: 20rpx;
		background-color: #4DB1B6;
		color: white;
		margin-left: 10rpx;
	}
</style>
