<template>
  <div id="registeredUser">
    <table-list
      :tableSets="tableSet"
      :tableData="tableData"
      :navText="navText"
      :loading="loading"
    >
    </table-list>
    <pagination
      :total="total"
      :pageSize="pageSize"
      :currentPage="currentPage"
      @handleSizeChange="handleSizeChange"
      @handleCurrentChange="handleCurrentChange"
    />
  </div>
</template>

<script>
import searchBox from "@/components/searchBox";
import tableList from "@/components/tableList";
import pagination from "@/components/pagination";
export default {
  components: { searchBox, tableList, pagination },
  data() {
    return {
      loading: false, //当前表单加载是否加载动画
      navText: {
        title: "注册用户",
        index: 0,
        ch: "条",
        num: false,
        choice: true,
        tableHide:true,
        addHide: true,
        backFatherBtn: {
          status: false,
          title: "未定义",
        },
      },
      // 表单
      tableSet: [
        // {
        //   label: "用户编码",
        //   prop: "payWay",
        //   hidden: true,
        // },
        {
          label: "头像",
          prop: "oneInchPhotos",
          hidden: true,
          scope:"img"
        },
        {
          label: "昵称",
          prop: "nickname",
          hidden: true,
        },
        {
          label: "性别",
          prop: "sex",
          hidden: true,
          scope:"sex"
        },
        // {
        //   label: "年龄",
        //   prop: "payWay",
        //   hidden: true,
        // },
        {
          label: "姓名",
          prop: "realname",
          hidden: true,
        },
        {
          label: "身份证",
          prop: "idCard",
          hidden: true,
        },
        {
          label: "手机号码",
          prop: "telphone",
          hidden: true,
        },
        {
          label: "所在城市",
          prop1:"province",
          prop2: "city",
          prop3:"district",
          hidden: true,
          scope:"address"
        },
        {
          label: "注册时间",
          prop: "createTime",
          hidden: true,
          scope:"aTimeList"
        },
        {
          label: "归属来源",
          prop: "registerPlat",
          hidden: true,
          scope:"ptai"
        },
        // {
        //   label: "微信绑定",
        //   prop: "payWay",
        //   hidden: true,
        // },
        {
          label: "最后一次登录时间",
          prop: "lastLoginTime",
          hidden: true,
          scope:"aTimeList"
        },
      ],
      tableData: [], //表单数据
      total: 0, //一共多少条
      pageSize: 10, //每页多少条数据
      currentPage: 1, //当前页码
    };
  },
  mounted() {
    this.search();
  },
  methods: {
    search(v) {
      this.loading = true;
      var data = {
        status: "0,1",
        pageSize: this.pageSize,
        pageNum: this.currentPage,
      };
      console.log(this.$api)
      this.$api.inquireappuserlists(data).then((res) => {
        this.tableData = res.rows;
        this.total = res.total;
        this.navText.index = res.total;
      });
      this.loading = false;
    },
    init() {
      this.search();
    },
    handleSizeChange(v) {
      this.pageSize = v;
      this.currentPage = 1;
      this.search();
    },
    handleCurrentChange(v) {
      this.currentPage = v;
      this.search();
    },
  },
};
</script>

<style lang="less" scoped>
/deep/.el-button {
  border-radius: 8px;
}
/deep/.el-dialog {
  border-radius: 8px;
  .el-dialog__header {
    padding: 0;
    .hearders {
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0px 18px 0px 20px;
      border-bottom: 1px solid #e2e2e2;
      .leftTitle {
        font-size: 14px;
        font-weight: bold;
        color: #2f4378;
      }
      .rightBoxs {
        display: flex;
        align-items: center;
        img {
          width: 14px;
          height: 14px;
          margin-left: 13px;
          cursor: pointer;
        }
      }
    }
  }
  .el-dialog__footer {
    padding: 0;
    .dialog-footer {
      padding: 0px 40px;
      height: 70px;
      border-top: 1px solid #e2e2e2;
      display: flex;
      align-items: center;
      justify-content: flex-end;
    }
  }
}
.imgBox {
  width: 100%;
  // height: 210px;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 8px 8px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  .imgLabel {
    flex: 1;
    width: 100%;
    border: 1px dotted #e2e2e2;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    .msPhoto {
      display: flex;
      justify-content: center;
      align-items: center;
      max-width: 100%;
      max-height: 270px;
      img {
        max-width: 100%;
        max-height: 270px;
      }
    }
    .imgbbx {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      i {
        font-weight: bold;
        margin: 14px 0;
        font-size: 24px;
      }
    }
  }
  p {
    margin: 5px 0px;
  }
}
</style>

