<template>
  <view class="switch-roles">
    <nav-bar title="选择公司规模" color="#000"></nav-bar>
    <view class="roles-content">
      <view class="content">
        <view class="progress-num"> <text>2</text>/8 </view>
        <view class="title">公司发展阶段</view>
        <view class="desc">
          公司融资状态是公司阶段的重要体现之一，使企业形象更加丰富和全面
        </view>
        <view class="check-box">
          <view
            class="check-item"
            v-for="(item, index) in checkList"
            :key="index"
            @click="checkItem(index)"
          >
            <view
              class="check-icon"
              :class="{ 'check-icon-active': check == index }"
            >
            <u-icon name="checkmark" color="#fff" size="28" v-if="check == index"></u-icon>
            </view>
            <view class="check-txt">{{ item }}</view>
          </view>
        </view>
      </view>
    </view>

    <view class="submit-btn" @click="goJobPostingSecond">下一步</view>
  </view>
</template>
<script>
import navBar from "@/components/nav-bar/index.vue";
export default {
  data() {
    return {
      checkList: [
        "未融资",
        "天使轮",
        "A轮",
        "B轮",
        "C轮",
        "D轮及以上",
        "已上市",
        "不需要融资",
      ],
      check: null,
	    companyData:{}
    };
  },
  components: {
    navBar,
  },
  onLoad(options) {
    if (options.companyData) {
      this.companyData = JSON.parse(options.companyData);
    }
  },
  methods: {
    checkItem(index) {
      this.check = index;
    },
    goJobPostingSecond(){
		const companyData = this.companyData
		companyData.companyDevelop=this.checkList[this.check]
		console.log(companyData);
        uni.navigateTo({ url: "/my/renzheng/companyFund?companyData=" +
          encodeURIComponent(JSON.stringify(companyData))})
    }
  },
};
</script>
<style lang="scss" scoped>
.switch-roles {
  background-color: #fff;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;

  .roles-content {
    width: 100%;
    flex: 1;
    overflow: hidden;
    overflow-y: auto;

    .content {
      padding: 40rpx;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      .progress-num {
        color: #016bf6;
        font-family: DM Sans;
        font-size: 24rpx;
        font-weight: 500;
        width: 100%;
        padding-bottom: 20rpx;
        box-sizing: border-box;
        text {
          font-size: 48rpx;
          font-weight: 700;
        }
      }
      .title {
        color: #333;
        width: 100%;
        font-family: DM Sans;
        font-size: 48rpx;
        font-weight: 700;
      }

      .desc {
        color: rgba(102, 102, 102, 1);
        width: 100%;
        font-family: DM Sans;
        font-size: 24rpx;
        font-weight: 400;
        line-height: 32rpx;
        letter-spacing: 0.5%;
        text-align: left;
        padding: 20rpx 0;
        box-sizing: border-box;
      }
      .check-box {
        width: 100%;
        .check-item {
          padding: 24rpx 32rpx;
          box-sizing: border-box;
          border-radius: 100rpx;
          border: 2rpx solid rgba(227, 231, 236, 1);
          display: flex;
          align-items: center;
          gap: 32rpx;
          margin-bottom: 20rpx;
          .check-icon {
            width: 48rpx;
            height: 48rpx;
            border-radius: 50%;
            border: 2rpx solid rgba(227, 231, 236, 1);
            display: flex;
            justify-content: center;
            align-items: center;
          }
          .check-icon-active {
            background-color: #016bf6;
            border-color: #016bf6;
          }
          .check-txt {
            color: rgba(23, 23, 37, 1);
            font-family: DM Sans;
            font-size: 28rpx;
            font-weight: 400;
            line-height: 48rpx;
          }
        }
      }
    }
  }

  .submit-btn {
    flex-shrink: 0;
    border-radius: 999px;
    background: #ff6600;
    color: rgba(255, 255, 255, 1);
    font-family: DM Sans;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 48rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16rpx 32rpx;
    box-sizing: border-box;
    margin: 60rpx 62rpx;
  }
}
</style>
