<template>
  <view class="view">
    <view class="emty">
      <image
        src="/static/images/emty.png"
        style="width: 79px; height: 79px"
        mode="widthFix"
      ></image>
      <text>暂无数据</text>
    </view>

    <cs-bottom-wrapper>
      <view class="operation">
        <button class="btn green" @tap="addEnterprise">新增企业</button>
      </view>
    </cs-bottom-wrapper>
  </view>
</template>

<script>
import { vertifyName } from '@/api/enterprise/index.js'
export default {
  data() {
    return {
      inviteId: '',
      list: []
    }
  },
  onLoad(res) {
    if (res.inviteId) {
      this.inviteId = res.inviteId
    }
    this.getList()
  },
  methods: {
    getList() {
      vertifyName({ enterpriseUserId: this.$store.getters.userId }).then(
        res => {
          this.list = res.list
        }
      )
    },
    addEnterprise() {
      uni.navigateTo({
        url: `/sub/invite/addEnterprise?inviteId=${this.inviteId}`
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.view {
  padding: 12px;
  display: flex;
  flex-flow: column nowrap;
  gap: 12px;
  overflow: hidden;
  overflow-y: scroll;
  max-height: 100vh;
  padding-bottom: 12vh;
}
.emty {
  border-radius: 8px;
  height: 550rpx;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  gap: 12px;
  color: #99a1b7;
}
.operation {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  .btn {
    flex: 1;
    border-radius: 8px;
    display: flex;
    padding: 12px 0;
    align-items: center;
    justify-content: center;
  }
  .green {
    background-color: $cs-color-main;
    color: #fff;
  }
}
</style>
