<template>
	<view class="box">
		<view class="tabList">
		</view>

		<!-- 维修进度 -->

		<!-- 维修详情 -->
		<view class="InfoList">
			<view class="InfoMsg">
				<view class="InfoMsg_tit">基本信息</view>
				<view class="InfoMsg_info">联系人: <text>{{info.user_name}}</text> </view>
				<view class="InfoMsg_info">联系电话: <text>{{info.mobile}}</text> </view>
				<view class="InfoMsg_info">期望上门时间: <text>{{info.hope_order_time}}</text> </view>
			</view>
			<view class="InfoItem">
				<view class="InfoItem_tit">报修内容</view>

				<!-- <view class="InfoItem_msg"><text>故障描述</text>净水机不出水</view> -->
				<view class="InfoItem_msg"><text>故障小区</text> {{info.community.name}}/{{info.facility.name }}/{{info.room.name}}
				</view>
				<view class="InfoItem_msg"><text>报修内容</text>
					{{Info.details}}
				</view>
				<view class="InfoItem_msg"><text>故障图片</text>

					<view class="imgList">
						<image :src="item" mode='' v-for="(item, index) in imgList" @click="lookMore" :data-url="item" :key="index" />
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { request, picUrl, NavgateTo } from '../../utils';
	import {
		apiArr
	} from '../../api/community';
	export default {
		data() {
			return {
				id: "",
				info: "",
				imgList: []
			}
		},
		methods: {
			async init() {
				const res = await request(apiArr.getInfoById, 'POST', {
					feed_id: this.id
				});
				let imgList = []
				imgList = this.processApiData(res.photos);
				this.info = res;
				this.imgList = imgList;
			},
			
			
			lookMore(e) {
				uni.previewImage({
					urls: this.imgList,
					current: e.currentTarget.dataset.url
				})
			},

			processApiData(apiData) {
				let arr = apiData.split(',');
				console.log('123131  arr', arr);
				for (let index = 0; index < arr.length; index++) {
					arr[index] = picUrl + arr[index]
				}
				return arr
			},

		},

		onLoad(options) {
			this.id = Number(options.id);
			uni.setNavigationBarTitle({
				title: options.title,
			});
			this.init()
		},
	}
</script>

<style>
	@import url("./index.css");
</style>