<template>
  <div class="combo">
    <div class="title"><span class="point"></span>请选择套餐</div>
   <!-- v-if="combos.type === '1'" -->
    <a-radio-group
      class="items-radios"
      v-model="chooseId"
      @change="onChange"
    >
      <ul class="items">
        <li class="item" v-for="item in reservedInfo.chooseList" :key="item.id">
          <a-radio :value="item.id">
            {{ item.servicecententName }}
          </a-radio>
        </li>
      </ul>
    </a-radio-group>

    <!-- <ul class="items">
      <li>
        <a-checkbox-group
          :options="combos2.items"
          v-model="chkvalue"
          @change="onChange"
        >
        </a-checkbox-group>
      </li>
    </ul> -->
  </div>
</template>

<script>
export default {
  name: "componentName",
  components: {},
  props: {
    id:{
      type:String | Number,
      default:''
    }
  },
  data() {
    return {
      chooseId: '',
      // chkvalue: [],
      // combos: {
      //   type: "2",
      //   items: [
      //     {
      //       id: 0,
      //       title: "21招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //     {
      //       id: 1,
      //       title: "22招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //     {
      //       id: 2,
      //       title: "23招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //     {
      //       id: 3,
      //       title: "24招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //   ],
      // },
      // combos2: {
      //   type: "1",
      //   items: [
      //     {
      //       value: 0,
      //       label: "21招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //     {
      //       value: 1,
      //       label: "22招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //     {
      //       value: 2,
      //       label: "23招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //     {
      //       value: 3,
      //       label: "24招商信诺-银保客户-豪华套餐女未婚",
      //     },
      //   ],
      // },
      reservedInfo:[]//可选择的体检套餐
    };
  },
  created(){
    //获取产品信息-可选体检套餐
    this.reservedInfo = JSON.parse(window.localStorage.getItem('reservedInfo'))
    this.chooseId = JSON.parse(window.localStorage.getItem('chooseList'))[0].id
    console.log('1111chooseId==',this.chooseId)
  },
  methods: {
    onChange(checkedValues) {
      const chooseList = []
      chooseList.push({
        id:this.chooseId
      })
      // 本地存储数据-选择的体检套餐
      window.localStorage.setItem('chooseList',JSON.stringify(chooseList))
      console.log("选择体检套餐chooseId===",this.chooseId)
      // 显示"下一步"
      this.$parent.next = true
    },
  },
};
</script>

<style lang="less" scoped>
.combo {
  .items-radios {
    margin-top: 20px;
  }
  .items {
    width: 700px;
    .item {
      background: #fafafa;
      border-radius: 2px;
      margin-top: 20px;
      height: 36px;
      line-height: 36px;
      font-size: 14px !important;
      padding-left: 10px;
      ::v-deep .ant-radio-wrapper {
        font-size: 14px;
      }
    }
  }
  ::v-deep .ant-checkbox-group-item {
    background: #fafafa;
    border-radius: 2px;
    width: 700px;
    margin-top: 20px;
    line-height: 58px;
    font-size: 14px !important;
    padding-left: 10px;
  }
  .point {
    display: inline-block;
    border-radius: 5px;
    width: 6px;
    height: 6px;
    background-color: #3f7ffb;
    margin-right: 6px;
    position: relative;
    top: -1px;
  }
}
</style>
