<template>
  <div class="waybill-address">
    <div class="waybill-address-left" @click="handlePick">
      <div class="waybill-address-address">
        <span class="isDefault" v-if="address.isDefault">默认</span>
        {{address.address}}
      </div>
      <div class="waybill-address-contact">
        {{address.consigneeName}} {{address.consigneeMobile}}
      </div>
    </div>
    <!-- 编辑 -->
    <div class="waybill-address-right" @click="toEditor">
      <div class="icon-editor"></div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    address: Object,
    isManager: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    // 跳转到编辑页面
    toEditor () {
      this.$emit('on-edit', this.address)
    },
    async handlePick () {
      console.log('选择')
      this.$emit('on-pick', this.address)
    }
  }
}
</script>

<style lang="scss">
@import './waybill-address.scss';
</style>