
<template>
  <div style="margin-top:10px;padding: 10px;" v-if="list.length > 0" >
    <el-table :data="list" :stripe="true" :show-overflow-tooltip="true">
      
      <el-table-column label="来源" align="center" prop="description" />
      <el-table-column label="增加身价" align="center" prop="variationValue" >
        <template #default="scope">
          {{ scope.row.variationValue }}
        </template>
      </el-table-column>
      <el-table-column label="时间" align="center" prop="createTime" >
        <template #default="scope">
          {{ formatDate(scope.row.createTime,"YYYY-MM-DD HH:mm") }}
        </template>
      </el-table-column>      
    </el-table>
    <!-- 分页 -->
    <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
      @pagination="getUserInfo" />
  </div>
  <div style="text-align: center;margin-top: 50px;font-size: 14px;" v-else>
    暂无身价记录
  </div>
</template>

<script setup>
  import { formatDate } from '@/utils/formatTime'
  import { pointsToPoint } from '@/utils'
  import * as UserApi from '@/api/member/user'


  // 列表的总页数
  const total = ref(0)
  const props = defineProps({
    userId: {
      type: Number,
      default: 0
    },
  });
  const list = ref([])
  const queryParams = reactive({
    pageNo: 1,
    pageSize: 10,
    userId:undefined
  })
  const getUserInfo = async () => {
    const res = await UserApi.getUserLevel(queryParams);
    list.value = res.list
    total.value = res.total
  };
  onMounted(() => {
    // props.userId
    queryParams.userId = props.userId;
    getUserInfo();
  });

  

</script>