<template>
	<view class="contain" style="padding-bottom: 0;">
		<view class="main" style="padding: 0;">
			<view class="baoxiu"><span></span>报修信息</view>
			<u-cell-group>
				<u-cell title="报修时间" :value="details.shijian">
				</u-cell>
				<u-cell title="报修位置" :value="details.weizhi">
				</u-cell>
				<u-cell title="报修区域" :value="details.quyu">
				</u-cell>
				<u-cell title="报修类型" :value="details.leixing">
				</u-cell>
				<u-cell title="联系人" :value="details.lxr">
				</u-cell>
				<u-cell title="联系电话" :value="details.lxdh">
					
				</u-cell>
				<u--form labelPosition="left" >
				<u-form-item labelWidth='180' style="padding:0 32rpx;" label="故障描述:">
				</u-form-item>
				<u-form-item labelWidth='180' borderBottom style="padding:0 32rpx;">
					<view style="width:100%;padding: 0 20rpx;height:80px">{{details.gzms}}</view>
				</u-form-item>
				<u-form-item labelWidth='180' label="故障照片" style="padding:0 32rpx;">
				</u-form-item>
				<u-form-item labelWidth='180' borderBottom style="padding:0 32rpx;">
					<view class="uploadPart">
						<view class="allimg" v-for="img in details.gzimg">
							<image :src="img" mode="aspectFill" class="newimg"></image>
						</view>
					</view>
				</u-form-item>
				</u--form>
			</u-cell-group>

			<view class="baoxiu"><span></span>维修信息</view>
			<u-cell-group>
				<u-cell title="紧急程度" :value="details.jinji">
				</u-cell>
				<u-cell title="维修人员" :value="details.weixiury">
				</u-cell>
				<u-cell title="联系电话" :value="details.weixiudh">
				</u-cell>
				<u-cell title="完成时间" :value="details.repairFinishTime">
				</u-cell>
			</u-cell-group>
		</view>
		<!--确定弹窗-->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				companyOrgId: '',
				details: {
					shijian: '',
					weizhi: '',
					quyu: '',
					leixing: '',
					lxr: '',
					lxdh: '',
					gzms: '',
					gzimg: [],
					repairFinishTime: '',
					jinji: '',
					weixiury: '',
					weixiudh: ''
				},

			}
		},
		onReady() {},
		onLoad(options) {
			this.companyOrgId = options.id;
			this.getdata();
		},
		methods: {
			getdata() {
				this.$api.get('/repairorder/' + this.companyOrgId, {})
					.then(res => {
						this.details.shijian = res.data.data.createDate;
						this.details.weizhi = res.data.data.repairPosition;
						this.details.lxr = res.data.data.contactPerson;
						this.details.lxdh = res.data.data.contactPhone;
						this.details.gzms = res.data.data.faultDes;
						this.details.weixiury = res.data.data.repairPersonName;
						this.details.repairFinishTime = res.data.data.repairFinishTime;
						res.data.data.faultPics = res.data.data.faultPics.split(",");
						this.details.gzimg = res.data.data.faultPics;
						if (res.data.data.repairRegion == 1) {
							this.details.quyu = '公共区域';
						} else if (res.data.data.repairRegion == 2) {
							this.details.quyu = '室内';
						}
						if (res.data.data.repairType == 1) {
							this.details.leixing = '水';
						} else if (res.data.data.repairType == 2) {
							this.details.leixing = '电';
						} else if (res.data.data.repairType == 3) {
							this.details.leixing = '其他';
						}

						if (res.data.data.urgency == 1) {
							this.details.jinji = '非常紧急';
						} else if (res.data.data.urgency == 2) {
							this.details.jinji = '紧急';
						} else if (res.data.data.urgency == 3) {
							this.details.jinji = '普通';
						}
					})
			},
		}
	}
</script>

<style lang="scss">
	.baoxiu {
		padding: 18rpx 32rpx;
		font-size: 36rpx;
	
		span {
			display: inline-block;
			margin-right: 16rpx;
			width: 8rpx;
			height: 32rpx;
			background-color: #5776E6;
			border-radius: 5rpx;
		}
	}
	.uploadPart {
		display: flex;
		justify-content: center;
		width: 100%;
	
		.uploadBtn {
			width: 160rpx;
			height: 160rpx;
			background-color: #ECF0FF;
			text-align: center;
			border-radius: 4rpx;
			display: flex;
			align-items: center;
			justify-content: center;
		}
	
		.allimg {
			position: relative;
		}
	
		.newimg {
			width: 160rpx;
			height: 160rpx;
			margin-right: 10rpx;
			border: 1px solid #eee;
		}
	}
</style>