<template>
  <view class="total-page page-box task-bg">
    <Nav title="法案查询" :genre="1" :toBack="true" is_fixed></Nav>
    <view class="page-env-160">
      <!-- 身份认证start -->
      <view class="m-t20 m-lr30 text-color-12">

        <view class="sys-background-fff r-20 p-lr30 p-t30">

            <en-select v-model="propertyData.modelType" :local-data="typeOption" label="评估模型" placeholder="请选择评估模型"></en-select>
            <en-input v-model="propertyData.address" label="评估地址" placeholder="请输入评估地址"></en-input>
            <en-input v-model="propertyData.complexName" :label="'小区名称'" disabled="disabled" placeholder="请输入小区名称"> </en-input>
            <en-input  :value="propertyData.lng+','+propertyData.lat"  disabled="disabled" label="评估坐标" placeholder="地址经纬度"></en-input>
            <en-input v-model="propertyData.area" :label="'建筑面积'" placeholder="请输入建筑面积"> </en-input>
            <en-select v-model="propertyData.district" :local-data="districtOption" :label="'所属区域'" placeholder="请选择所属区域"> </en-select>
          </view>

        </view>

        <view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===1">
          <en-select v-model="propertyData.houseType" :local-data="houseTypeOption" label="房屋类型" placeholder="请选择房屋类型"></en-select>
        </view>
      <view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===2">
        <EnRadio v-model="propertyData.is_rent" label="是否出租" :list="statusOption"> </EnRadio>
        <EnRadio v-model="propertyData.is_morgaged" label="是否抵押" :list="statusOption"> </EnRadio>
        <EnRadio v-model="propertyData.is_occupied" label="是否占用" :list="statusOption"> </EnRadio>
        <EnRadio v-model="propertyData.is_seizured" label="是否查封" :list="statusOption"> </EnRadio>
      </view>
      <view class="sys-background-fff r-20 m-t20 p-lr30" v-if="propertyData.modelType===3">
        <en-select v-model="propertyData.level_id" :local-data="levelOption" :label="'土地等级'" placeholder="请选择土地等级"> </en-select>
        <en-select v-model="propertyData.transfer_method" :local-data="transferMethodOption" :label="'出让方式'" placeholder="请选择出让方式"> </en-select>
        <en-select v-model="propertyData.land_use" :local-data="landUseOption" :label="'土地用途'" placeholder="请选择土地用途"> </en-select>
        <en-select v-model="propertyData.land_source" :local-data="landSourceOption" :label="'土地来源'" placeholder="请选择土地来源"> </en-select>
        <en-input v-model="propertyData.age_limit" :label="'出让年限'" placeholder="请输入出让年限"> </en-input>
        <en-input v-model="propertyData.investment" :label="'投资强度'" placeholder="请输入投资强度"> </en-input>
        <en-input v-model="propertyData.plot_mix" :label="'最小容积'" placeholder="请输入最小容积率"> </en-input>
        <en-input v-model="propertyData.plot_max" :label="'最大容积'" placeholder="请输入最大容积率"> </en-input>
        <en-input v-model="propertyData.greening_mix" :label="'最小绿化'" placeholder="请输入最小绿化面积"> </en-input>
        <en-input v-model="propertyData.greening_max" :label="'最大绿化'" placeholder="请输入最大绿化面积"> </en-input>
        <en-input v-model="propertyData.height_mix" :label="'最小高度'" placeholder="请输入最小建筑高度"> </en-input>
        <en-input v-model="propertyData.height_max" :label="'最大高度'" placeholder="请输入最大建筑高度"> </en-input>
      </view>


    </view>
    <EnButton :text="'评估'" @onSubmit="onSubmit"></EnButton>
    <uni-popup ref="consentObj">
      <view class="iPhone-padding agreement-data sys-background-fff">

      </view>

    </uni-popup>
  </view>
</template>

<script>

import EnUpload from "@/components/en-from/en-upload/en-upload.vue";
import EnSelect from "@/components/en-from/en-select/en-select.vue";
import EnRadio from "@/components/en-from/en-radio/en-radio.vue";
import EnInput from "@/components/en-from/en-input/en-input.vue";
import AddIdentity from "@/page_task/identity_upload/add-identity.vue";


export default {
  components: {
    AddIdentity,
    EnInput,
    EnSelect,
    EnRadio,
    EnUpload,
  },
  data() {
    return {
      typeOption:[{id:1,name:'住宅模型'},{id:2,name:'公建模型'},{id:3,name:'土地模型'},{id:4,name:'工业模型'}],
      statusOption:[{id:1,name:'是'},{id:0,name:'否'}],
      houseTypeOption:[],
      levelOption:[],
      transferMethodOption:[],
      landUseOption:[],
      landSourceOption:[],
      districtOption:[{id:1,name:'甘井子区'},{id:2,name:'中山区'},{id:3,name:'西岗区'},{id:4,name:'沙河口区'},{id:5,name:'旅顺口区'},{id:6,name:'金州区'},{id:7,name:'瓦房店市'},{id:8,name:'庄河市'},{id:9,name:'普兰店区'}],
      propertyData:{
        level_id:1,
        transfer_method:1,
        land_use:1,
        land_source:1,
        investment:0,
        plot_mix:0,
        plot_max:0,
        height_mix:0,
        height_max:0,
        greening_mix:0,
        greening_max:0,
        age_limit:0,
        floor_area:0,
        lat:0,
        lng:0,
        is_sold:0,
        is_rent:0,
        is_morgaged:0,
        is_occupied:0,
        is_seizured:0,
        address:'',
        modelType:'',
        area:'',
        district:'',
        houseType:'',
        complexName:'',
      },
      propertyRes:{
        unit_price:'',
        predict_msg:'',
      }
    };
  },
  onLoad(options) {

  },
  onShow() {

  },
  watch: {

  },
  mounted() {
  },
  methods: {
    setLocation(res){
      console.log("收到监听",res)
      this.propertyData.address=res.address
      this.propertyData.lat=res.lat
      this.propertyData.lng=res.lng
      this.propertyData.complexName=res.complexName
      this.districtOption.forEach(item=>{
        if(res.districtName===item.name){
          this.propertyData.district=item.id
        }
      })
    },
    getValuationOption(){
      if(this.propertyData.houseType===""){
        this.propertyData.houseType=0
      }
      getValuationOption({"modelType":this.propertyData.modelType}).then(res=>{
        if(res.code===0){
          if(this.propertyData.modelType===1){
            this.houseTypeOption=res.data.houseTypeOption
          }else if(this.propertyData.modelType===3){
            this.levelOption=res.data.levelOption
            this.transferMethodOption=res.data.transferMethodOption
            this.landUseOption=res.data.landUseOption
            this.landSourceOption=res.data.landSourceOption
            this.propertyData.land_source=this.landSourceOption[0].id
          }
        }
      })
    },
    predictProperty(){
      console.log('aaaaaaaaaaaaaaaaaaa')
      predictProperty(this.propertyData).then(res=>{
        if(res.code===0){
          this.propertyRes=res.data
        }else {
          tools.error(res.msg)
        }
      })
    },
    async getMessage() {

    },


    getMemberInfo() {

    },

    getVerifiedCode() {

    },
    onSubmit() {

    }
  },
}
</script>

<style lang="scss" scoped>
.input-item:last-child {
  margin-top: 30rpx;
}

.input-send {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border-bottom: 1px solid #E5E5E5;

  .login-input {
    width: calc(100% - 150rpx);
  }

  .login-send {
    width: 100rpx;
    text-align: center;
    margin-left: 20rpx;
    border: 1rpx solid #0FB160;
    border-radius: 50rpx;
  }
}

.left-w {
  width: 210rpx;
  min-width: 210rpx;
  color: #333333;
}

.iconfont {
  font-size: 36rpx;
  color: #333333;
}

.class-c-6C6F93 {
  color: #0FB160;
}

.agreement-data {
  border-radius: 30rpx 30rpx 0 0;

  .data-title {
    width: 100%;
    border-radius: 30rpx 30rpx 0 0;
  }

  .data-content {
    padding: 20rpx 40rpx;

    .content-box {
      height: 600rpx;
    }
  }

  .data-but {
    height: 96rpx;
    line-height: 96rpx;
    text-align: center;
    margin: 0 75rpx;
  }
}
</style>
