<template>
  <ai-detail>
    <template slot="title">
      <ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
      </ai-title>
    </template>
    <template slot="content">
      <ai-card title="基本信息">
        <template #content>
          <ai-wrapper>
            <ai-info-item label="姓名" isLine :value="info.name"></ai-info-item>
            <ai-info-item label="联系电话" isLine :value="info.phone"></ai-info-item>
            <ai-info-item label="网格名称" isLine :value="info.girdName"></ai-info-item>
          </ai-wrapper>
        </template>
      </ai-card>
    </template>
  </ai-detail>
</template>

<script>
  export default {
    name: 'ApplyDetail',

    props: {
      instance: Function,
      dict: Object,
      params: Object
    },

    data () {
      return {
        info: {},
        id: ''
      }
    },

    created () {
      if (this.params && this.params.id) {
        this.id = this.params.id
        this.getInfo(this.params.id)
      }
    },

    methods: {
      getInfo (id) {
        this.instance.post(`/app/appgirdmemberapply/queryDetailById?id=${id}`).then(res => {
          if (res.code === 0) {
            this.info = res.data
          }
        })
      },

      cancel (isRefresh) {
        this.$emit('change', {
          type: 'ApplyList',
          isRefresh: !!isRefresh
        })
      }
    }
  }
</script>

<style scoped lang="scss">
</style>
