<template>
  <view class="my-register">
    <view
      class="my-register-item"
      v-for="item in list"
      :key="item.id"
      @click="handleLookDetail(item.id)"
    >
      <view class="my-register-item-title">{{
        item.competitionChildName
      }}</view>
      <view class="my-register-item-params">
        <view class="my-register-item-params-label">提交时间</view>
        <view class="my-register-item-params-content">{{
          item.createTime
        }}</view>
      </view>
      <view class="my-register-item-params">
        <view class="my-register-item-params-label">参赛园所</view>
        <view class="my-register-item-params-content"
          >{{ item.totalSchool }}所</view
        >
      </view>
      <view class="my-register-item-params">
        <view class="my-register-item-params-label">承办人</view>
        <view class="my-register-item-params-content">{{
          item.unitPrincipal
        }}</view>
      </view>
      <image :src="staticImg.returnArrow" class="return-arrow" />
    </view>
    <view v-if="list.length === 0" class="noData">
      <image :src="staticImg.noData" />
      <view class="text">暂无内容</view>
    </view>
  </view>
</template>

<script>
const staticImg = {
  noData: require("@/static/image/noData.png"),
  returnArrow: require("@/static/image/right-arrow.png"),
};
export default {
  name: "my-register",
  props: {
    list: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      staticImg,
    };
  },
  methods: {
    handleLookDetail(id) {
      uni.navigateTo({
        url: `/pages/competition/myRegister?id=${id}`,
      });
    },
  },
};
</script>

<style lang="less" scoped>
.my-register {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .my-register-item {
    position: relative;
    padding: 40rpx;
    margin-top: 48rpx;
    width: 686rpx;
    min-height: 352rpx;
    background: #ffffff;
    border-radius: 20rpx;
    box-sizing: border-box;
    &-title {
      min-height: 44rpx;
      font-size: 40rpx;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #333333;
      line-height: 50rpx;
    }
    &-params {
      display: flex;
      margin-top: 30rpx;
      &-label {
        width: 172rpx;
        height: 44rpx;
        font-size: 30rpx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #777777;
        line-height: 44rpx;
      }
      &-content {
        height: 44rpx;
        font-size: 30rpx;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #333333;
        line-height: 44rpx;
      }
    }
    &-params:first-child {
      margin-top: 36rpx;
    }
    .return-arrow {
      position: absolute;
      right: 28rpx;
      top: 50%;
      width: 16rpx;
      height: 26rpx;
      object-fit: cover;
      transform: translate(0, -50%);
    }
  }
  .noData {
    image {
      margin: 300rpx auto 44rpx;
      width: 316rpx;
      height: 220rpx;
      object-fit: cover;
    }
    .text {
      margin: 0 auto;
      width: 120rpx;
      height: 44rpx;
      font-size: 30rpx;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #fff;
      line-height: 44rpx;
    }
  }
}
</style>