<template>
  <div class="indexBackClass" id="stuwdkcDom">
    <div style="margin-top: 20px;">
        <span style="margin-left: 30px;font-size: 24px;font-weight: 600;">我的课程</span>
    </div>
    <div>
      <a-row>
        <a-col :xs="{ span: 24 }" :sm="{ span: 12 }" :lg="{ span: 6 }" style="padding: 0 10px;margin-bottom: 10px;"  v-for="(item,index2) in dataSource" :key="index2">
          <div style="border: 2px #eef1f2 solid;">
            <div>
              <div class="jtkcTitleClass"></div>
              <div style="width:100%;white-space:normal; word-break:break-all;overflow:hidden;padding: 15px;font-weight: 600;font-size: 16px;color: #a50a0a; height: 70px;">
                <span>{{ item.kcmc }}</span>
              </div>
            </div>
            <a-divider style="margin: 0px;color: #eef1f2;" />
            <div style="padding: 20px;font-weight: 600;">
              <a-row>
                <a-col :span="24">
                  <div style="font-size: 16px;margin-top: 0px; padding: 0px; height: 45px;color:#0e6393;">{{ item.skdd }}</div>
                </a-col>
                <a-col :span="24" style="text-align: center;">
                  <span style="font-size: 16px;margin-top: 0px; padding: 0px; height: 45px;width:50%;float:left;overflow: hidden;">{{ item.skjs }}</span>
                  <span style="font-size: 16px;margin-top: 0px; padding: 0px; height: 45px;width:50%;float:right;"><a-button type="primary" @click="openKecheng(item)">进入课程</a-button></span>
                </a-col>
              </a-row>
            </div>
          </div>
        </a-col>
      </a-row>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { defHttp } from '/@/utils/http/axios';
import { ref, onMounted  } from 'vue';
import { getSysConfig } from '/@/views/site/utils/index';

const dataSource = ref([]);
  //进入就加载
onMounted(() => {
  defHttp.get({ url: '/ktgl/kcKechengbiao/getStudentKclist',params:{pageSize:-1} }).then((res) => {
  console.log(`🚀 ~ defHttp.get ~ res:`, res)
  dataSource.value = res.records;
  console.log(`🚀 ~ defHttp.get ~ dataSource:`, dataSource)
  });
});

function openKecheng(record){
  var url = "/stuzy/studentMain?rwbh="+record.rwbh+"&xqxn="+record.xqxn;
  window.open(url,'_blank')
}

</script>

<style lang="less" scoped>
.indexBackClass{
  background: #fff;
  margin: 20px 0;
  padding-bottom: 20px;
}

.jtkcTitleClass{
  background-image:  linear-gradient(to right ,#1c84c6, #67b4e5);
  color: white;
  line-height: 30px;
  padding: 3px 0 0 10px;
  font-weight: 600;
  height: 30px;
}
</style>
