<template>
	<view class="content-box">
		<view class="item-list">
		  <view class="term">
				<view class="term-name">业主:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.owner || "-" }}</p>
				</view>
		   </view>
		   <view class="term">
					<view class="term-name">项目名称:</view>
					<view class="term-value-group">
					  <p  class="term-value-item">{{ itemObj.name || "-" }}</p>
					</view>
		    </view>
			<view class="term">
					<view class="term-name">入库情况:</view>
					<view class="term-value-group">
					  <p  class="term-value-item">{{ storeType[itemObj.store_status] || "-" }}</p>
					</view>
			 </view>
			 <view class="term">
					<view class="term-name">建设性质:</view>
					<view class="term-value-group">
					  <p  class="term-value-item">{{ constructType[itemObj.character] || "-" }}</p>
					</view>
			  </view>
			<view class="term">
					<view class="term-name">工业技改:</view>
					<view class="term-value-group">
					  <p  class="term-value-item">{{ industryType[itemObj.status] || "-" }}</p>
					</view>
			 </view>
		     <view class="term">
					<view class="term-name">入库时间:</view>
					<view class="term-value-group">
					  <p  class="term-value-item">{{ itemObj.store_date || "-" }}</p>
					</view>
		     </view>
		     <view class="term">
				<view class="term-name">建设规模及主要建设内容:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.content || "-" }}</p>
				</view>
		      </view>
		 <view class="term">
				<view class="term-name">主要经济社会效益:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.effect || "-" }}</p>
				</view>
		  </view>
		<view class="term">
				<view class="term-name">建设地址:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.address || "-" }}</p>
				</view>
		 </view>
		 <view class="term">
				<view class="term-name">总用地面积（亩）:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.area || "-" }}</p>
				</view>
		  </view>
		<view class="term">
				<view class="term-name">建设起止年限:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">
				  {{ itemObj.construct_start_date || "-" }}  - {{itemObj.construct_end_date || "-" }}
				  </p>
				</view>
		 </view>
		 <view class="term">
				<view class="term-name">总投资（万元）:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.investment_count || "-" }}</p>
				</view>
		  </view>
		 <view class="term">
				<view class="term-name">年度计划投资（万元）:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.investment_year || "-" }}</p>
				</view>
		  </view>
		<view class="term">
				<view class="term-name">已到位资金额（万元）:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.investment_finish || "-" }}</p>
				</view>
		 </view>
		 <view class="term">
				<view class="term-name">投资方式:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ investmentType[itemObj.investment_type] || "-" }}</p>
				</view>
		  </view>
		 <view class="term">
				<view class="term-name">年度主要建设内容及年底前形象进度:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.process || "-" }}</p>
				</view>
		  </view>
		<view class="term">
				<view class="term-name">重点级别:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.importent_level || "-" }}</p>
				</view>
		 </view>
		 <view class="term">
				<view class="term-name">备注:</view>
				<view class="term-value-group">
				  <p  class="term-value-item">{{ itemObj.remark || "-" }}</p>
				</view>
		  </view>							
		</view>
	</view>
</template>

<script>
	import md5 from "@/common/md5.js";
	export default {
	  data() {
		  return{
			  itemObj:{},
			  storeType:{
				  '0':'在库',
				  '1':'未入库'
			  },
			  constructType:{
				  '0':'新建',
				  '1':'续建'
			  },
			  industryType:{
				  '0':'否',
				  '1':'是'
			  },
			  investmentType:{
				 // '0':'是',
				  '1':'社会投资',
				  '2':'政府投资'
			  }
		 }
	  },
	  onLoad(option) {
		console.log(option)
		this.getProjectDetail(option.id)
	  },
	  methods:{
		  getProjectDetail(ids){
		  	let md5Sign = md5(
		  	  "method=" +
		  	    "stat" +
		  	    "&timestamp=" +
		  	    getApp().globalData.globalTimestamp +
		  	    "&secret=" +
		  	    getApp().globalData.secret
		  	);
		  	let url =
		  	  getApp().globalData.shareUrl +
		  	  "api/api.php" +
		  	  "?method=stat&action=project_by_id&timestamp=" +
		  	  getApp().globalData.globalTimestamp +
		  	  "&sign=" +
		  	  md5Sign;
		  	uni.request({
		  	  url: url,
		  	  method: "POST",
		  	  header: {
		  	    "content-type": "application/x-www-form-urlencoded",
		  	  },
		  	  data: {
		  		id : ids
		  	  },
		  	  success: (res) => {
		  	    if (res.data.code === 200) {
		            this.itemObj = res.data.data;
		  	    }
		  	  },
		  	  fail: () => {
		  	    console.log("连接失败");
		  	  },
		  	});
		  },
	  }
	};
</script>

<style lang="scss">
	.content-box {
		display: flex;
		flex-direction: column;
		flex: 1;
	}
	.item-list {
	  margin-left: 20rpx;
	  display: flex;
	  flex-direction: column;
	  .term {
	    display: flex;
	    .term-name {
	      font-size: 28rpx;
	      width: 30%;
	      display: flex;
	      margin: 20rpx;
	      color: #7f7f7f;
	    }
	    .term-value-group {
	      flex: 1;
	      display: flex;
	      flex-direction: column;
	      font-size: 28rpx;
	      .term-value-item {
	        margin: 20rpx;
	      }
	      .flex_i {
	        display: flex;
	        flex-flow: row;
	        justify-content: space-around;
	      }
	    }
	  }
	}
</style>
