<template>
	<view>
		<u-navbar
		 :title="title" 
		 title-color="#fff" 
		 :custom-back="customBack" 
		 :border-bottom="false" 
		 back-icon-color="#CCE8FF" 
		 :background="{background: 'linear-gradient(99deg, #7A4398 0%, #5A5DB9 100%)' }"></u-navbar>
		<view class="base-info">
			<view class="base-info-item u-flex u-row-between">
				<view class=""><b>路段/停车场：</b>{{pageData.roadName}}</view>
			</view>
			<view class="base-info-item">
				<view class=""><b>问题描述：</b>{{pageData.exceprionDes}}</view>
			</view>
			<view class="base-info-item">
				<view class="">
					<b>图片：</b>
					<view class="img-list">
						<image class="img" v-for="(item,index) in pageData.imgList" @click="previewImage(index)" :src="item" mode="widthFix" :key="index"></image>
					</view>
				</view>
			</view>
		</view>

		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				title:'其他问题',
				pageData:[],
				id:'',
				dataList:[],
			}
		},
		onLoad(page){
			this.id = page.id;
		},
		onShow(){
			this.getReportDetail();
		},
		mounted() {
		},
		onReady() {
			// this.$refs.uForm.setRules(this.rules);
		},
		methods:{
			customBack(){
				uni.navigateBack()
			},
			getReportDetail(){
				this.$u.api.reportDetail({id:this.id}).then(res=>{
					if(res.code==200){
						this.pageData = res.data;
						// console.log('reportDetail',res);
					}else{
						uni.showToast({
							icon:'none',
							title:res.msg
						})
					}
					console.log('res',res);
				}).catch(err=>{
					console.log('err',err);
				})
			},
			previewImage(index){
				uni.previewImage({
					current: index,
					urls: this.pageData.imgList
				});
			}
		}
	}
</script>
<style>
	page{background: #F3F3F3;}
</style>
<style lang="scss" scoped>
@import  '../report.scss'
</style>
