<template>
  <div class="order_page">
    <el-table
      :data="tableData.records"
      border
      style="width: 80%"
    >
      <el-table-column
        prop="username"
        label="收货人"
      />
      <el-table-column
        prop="phone"
        label="联系电话"
      /><el-table-column
        prop="address"
        label="地址"
      />
    </el-table>
    <pagination
      v-show="tableData.total > 0"
      :limit.sync="form.size"
      :page.sync="form.current"
      :total="Number(tableData.total)"
      @pagination="fetch"
    />
  </div>
</template>

<script>
import Pagination from '@/components/Pagination'
import Member from '@/api/Member'
export default {
  components: {
    Pagination
  },
  data() {
    return {
      form: {
        "current": 1,
        "map": {},
        "model": {
          "address": "",
          "area": "",
          "city": "",
          "cityInfo": "",
          "id": 0,
          "isDefault": true,
          "mid": 0,
          "phone": "",
          "province": "",
          "tag": "",
          "username": ""
        },
        "order": "descending",
        "size": 10,
        "sort": "id"
      },
      tableData: {}
    }
  },
  created() {
    this.getMemberAddress()
  },
  methods: {
    async getMemberAddress() {
      this.form.model.mid = this.$route.query.id
      const res = await Member.getMemberAddress(this.form)
      const resData = res.data
      if (resData.code === 0) {
        this.tableData = resData.data
      }
    },
    fetch() {
      this.getMemberAddress()
    }
  }
}
</script>

<style lang='less' scoped>
/deep/ .el-table {
  th {
      background: #EEF3FF;
      color:#333333;
      font-size:16px;
      font-weight: 400;
      border-color: #E0E5EB;
      text-align: center;
  }
  td {
    font-size: 14px;
    text-align: center;
    color: #666666;
  }
}
</style>
