<template>
  <div style="margin-top: 10px;">
    <el-table :data="props.list" border style="width: 100%">
      <el-table-column prop="userId" align="center" label="会员ID" />
      <el-table-column prop="nickName" align="center" label="会员">
        <template v-slot="scope">
          <div style="display: flex;align-items: center;">
            <el-image style="width: 40px; height: 40px" :src="scope.row.headImg" fit="contain" />
            {{ scope.row.nickName }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="phone" align="center" label="手机号码" />
      <el-table-column prop="accountPoints" align="center" label="账户积分" />
      <el-table-column prop="lastPointsChangeTime" align="center" label="积分变动时间" />
      <el-table-column prop="lastFloatPoints" align="center" label="浮动积分" />
      <!-- <el-table-column label="操作" align="center">
        <template #default="scope">
          <el-button size="small" type="primary" link icon="Edit" @click="handleEdit(scope.row)">编辑</el-button>
          <el-button size="small" type="danger" link icon="Delete" style="color: #f89797;"
            @click="handleDelete(scope.$index, scope.row)"> 删除 </el-button>
        </template>
      </el-table-column> -->
    </el-table>
  </div>
</template>

<script setup>
const emit = defineEmits(['handleDelete', 'handleEdit'])
const props = defineProps({
  list: {
    type: Array,
    default: () => []
  }
})

function handleEdit(row) {
  emit('handleEdit', row)
}
function handleDelete(index, row) {
  emit('handleDelete', row.id)
}

</script>
