<template>
  <auth-wrap class="usr-regist-info-container" ref="authWrap">
    <template slot="content">
      <view class="u-page" v-if="indexList&&indexList.length>0">
        <view class="apply-item" v-for="item in indexList" @click="()=>onContentClick(item)">
          <view class="apply-item-header">
            <view>{{ item.applyTypeName }}</view>
            <view>
              <u-tag
                  plain
                  :text="REVIEW_STATUS[item.reviewState].name"
                  :type="REVIEW_STATUS[item.reviewState].tag">
              </u-tag>
            </view>
          </view>
          <view class="apply-item-title overflow-hidden" style="height: 50px;line-height: 25px" v-if="item.contentTitle">{{ item.contentTitle }}</view>
          <view class="apply-item-footer">
            <view>参会人：{{ item.usrName }}</view>
            <view>{{ $u.timeFormat(item.createTime, 'yyyy-MM-dd hh:mm') }}</view>
          </view>
        </view>
      </view>
      <u-empty
          v-else
          mode="data"
          text="还没有报名，赶紧去报名吧！"
      >
      </u-empty>
    </template>
  </auth-wrap>
</template>

<script>
import { getUsrApplyInfo } from '@/common/api';
import { REVIEW_STATUS } from '@/common/EnumConst';
import AuthWrap from '@/components/AuthComp/index.vue';

export default {
  computed: {
    REVIEW_STATUS() {
      return REVIEW_STATUS;
    },
  },
  components: {
    AuthWrap,
  },
  data() {
    return {
      keyword: '',
      indexList: [],
    };
  },
  onLoad() {
    debugger
    this.$refs.authWrap.reloadPage();
    this.loadmore();
  },
  methods: {
    onContentClick(item) {
      uni.navigateTo({
        url: `/pasbrg/pages/regmeeting/index?id=${item.id}`,
      });
    },
    async loadmore() {
      const { data } = await getUsrApplyInfo();
      if (data) {
        this.indexList = data;
      }

    },
  },
  onShareAppMessage() {
    return {
      title: 'First UI组件库',
    };
  },
};
</script>

<style lang="scss" src="./index.scss" />
