<!--使用详情-->
<template>
    <view id="gasRecycle">
		<view class="title">{{form.storageVo.airName}}-{{form.storageVo.configName}}</view>
		<view class="register_li">
			<view class="register_li_min">
				<view>实验地点：</view>
				<input v-model="form.location" disabled  type="text" >
			</view>
			<view class="register_li_min" style="border: none;">
				<view>编号：</view>
				<input v-model="form.storageVo.airNumber" disabled  type="text" >
			</view>
		</view>
		<view class="register_li">
			<view class="register_li_min">
				<view>使用人：</view>
				<input v-model="form.contacts" disabled  type="text" >
			</view>
			<!-- 使用时间 -->
			<view class="register_li_min2">
				<view>使用时间:</view>
				<picker mode="date" disabled @change="startChange($event)">
					<input class="picker-text" v-model="form.useTimeApp" disabled  type="text"  placeholder="开始时间">
				</picker>
				<view>-</view>
				<picker mode="date" disabled @change="endChange($event)">
					<input class="picker-text2" v-model="form.backTimeApp" disabled  type="text"  placeholder="结束时间">
				</picker>
			</view>
			<view class="register_li_min">
				<view>使用量：</view>
				<view>{{form.amount+'Mpa'}}</view>
			</view>
			<view v-if="form.beforeUse" class="register_li_min">
				<view>使用前气压：</view>
				<view>{{form.beforeUse+'Mpa'}}</view>
			</view>
			<view v-if="form.beforeUsePic" class="meter_img" :style="!form.afterUse?'border:none;':''" @click="lookItem(form.beforeUsePic)">
				<view>气表照片：</view>
				<img :src="baseUrl+form.beforeUsePic" >
			</view>
			<view v-if="form.afterUse" class="register_li_min">
				<view>使用后气压：</view>
				<view>{{form.afterUse+'Mpa'}}</view>
			</view>
			<view v-if="form.afterUsePic" class="meter_img" style="border:0;" @click="lookItem(form.afterUsePic)">
				<view>气表照片：</view>
				<img :src="baseUrl+form.afterUsePic" >
			</view>
		</view>
	</view>
</template>

<script>
	import { useRecordDetail } from '@/api/apiDemo/index.js'
	import { config } from '@/api/request/config.js'
    export default {

        name: "gasRecycle",
        data() {
            return {
				baseUrl:config.base_url,
				pageType:0,
				//列表请求参数
				getData:{
				    pageNum:1,
					pageSize:20,

				},
				form:{
				},
                dataList:[],
				id:'',
				status:null,
            }
        },
        onLoad(option) {
			if(decodeURIComponent(option.item)){
				this.id=JSON.parse(decodeURIComponent(option.item)).id;
				this.status=JSON.parse(decodeURIComponent(option.item)).remark;
			}
        },
        onShow() {

        },

        methods: {
			lookItem(item){
				//查看图片
				wx.previewImage({
					urls: [config.base_url+item], //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
					current: '', // 当前显示图片的http链接，默认是第一个
					success: function(res) {},
					fail: function(res) {},
					complete: function(res) {},
				})
			},
			//获取详情
			async getInfo(){
			    let _this = this;
			    const {data} = await useRecordDetail(this.id)
			    if(data.code==200){
					let res=data.data
					_this.form=res;
			    }
			},
        },
		mounted(){
			this.getInfo();
		},
    }
</script>

<style lang="stylus" scoped>
    #gasRecycle {
        height: auto;
        width: 100%;
		flex :1;
        display flex;
        flex-direction column
        overflow hidden;
		.title{
			width: 750rpx;
			height: 100rpx;
			background: #FFFFFF;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 100rpx;
			padding-left: 40rpx;
		}
		.register_li{
			background #fff;
			border-radius:20rpx;
			margin:20rpx 20rpx 0;
			padding:20rpx 0;
			box-sizing: border-box;
			.register_li_min{
				margin:0 26rpx;
				display flex;
				align-items center;
				border-bottom: 1px solid #F5F5F5;
				.icon_img{
					width: 30rpx;
					height: 30rpx;
					margin-right: 12rpx;
				}
				view{
					//width:140rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					line-height: 100rpx;
				}
				>view:nth-child(2){
					flex: 1;
					text-align: right;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
				}
				>input{
					flex:1;
					text-align: right;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
				}



			}
			/* 时间 */
			.register_li_min2{
				margin:0 26rpx;
				border-bottom: 1px solid #f5f5f5;
				height: 100rpx;
				display: flex;
				justify-content: flex-start;
				align-items: center;
				>view:nth-child(1){
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					line-height: 100rpx;
					margin-right: 46rpx;
				}
				.picker-text{
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 100rpx;
					width: 240rpx;

				}
				>view:nth-child(2){
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 100rpx;
				}
				.picker-text2{
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 100rpx;
					width: 240rpx;
					text-align: right;
				}
			}

			.meter_img{
				margin:0 26rpx;
				display flex;
				justify-content: space-between;
				border-bottom: 1px solid #F5F5F5;
				view{
					//width:140rpx;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					line-height: 100rpx;
				}
				>img{
					width: 150rpx;
					height: 150rpx;
					border-radius: 10rpx;
					margin:42rpx 0 20rpx 0;
				}
			}
		}
	}
</style>
