<template>
  <div class="base_box">
    <div class="base top_border" v-if="baseData">
      <img v-if="baseData.coverList.length > 0" :src="baseData.coverList[0].cover_url" alt="" />
      <div class="center">
        <p class="basename">{{ baseData.baseName }}</p>
        <p class="address">
          <van-icon name="location-o" />{{ baseData.city }}{{ baseData.area}}{{ baseData.address }}
        </p>
        <p class="tag">{{ baseData.baseLabel.join("/") }}</p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['baseId'],
  data () {
    return {
      baseData: "", //基地信息
    }
  },
  mounted () {
    this.GetOneBase()
  },
  methods: {
    // 获取单个基地
    GetOneBase (baseId) {
      this.mgop({
        api: 'mgop.sz.hswsy.GetOneBase', // 必须
        host: 'https://mapi.zjzwfw.gov.cn/',
        dataType: 'JSON',
        type: 'GET',
        appKey: 'fuxgnukl+2001895516+edccpx', // 必须
        headers: {
          //   'isTestUrl': '1'
        },
        data: {
          "id": baseId,
        },
        onSuccess: res => {
          if (res.data.data) {
            this.baseData = res.data.data;
          }
        },
        onFail: err => {
          console.log('err', err)
        }
      });
    },
  }
}
</script>