<template>
  <div class="bg-white rounded-md pb-10 h-screen">
    <div class="flex w-1000px pl-40 py-10 justify-between">
      <h3 class="text-blue-500">详情</h3>
      <el-button type="primary" @click="backLink">返回</el-button>
    </div>
    <div
      style="height: calc(70% - 50px)"
      class="overflow-auto main text-black-600"
    >
      <div class="flex justify-between">
        <div><span>所属工作室：</span>{{ detailData.tm_gzsmc }}</div>
        <div><span>所属学科：</span> {{ detailData.tjzx_name }}</div>
      </div>
      <div class="flex justify-between">
        <div class="flex">
          <span>责任成员：</span>
          <div class="w-300px">
            <p v-for="(m, i) in zrcy" :key="i">{{ m.tmc_cyxm }}</p>
          </div>
        </div>
        <div><span>所属年级：</span>{{ detailData.tjzn_name }}</div>
      </div>
      <div class="flex">
        <span>课程封面图：</span>
        <img class="w-380px" v-if="detailData.tmk_img" :src="getFullUrl(detailData.tmk_img.split('|')[0]) " alt="" />
      </div>
      <div><span>课程名：</span>{{ detailData.tmk_kcm }}</div>
      <div class="flex">
        <div class="flex w-500px">
          <span>上传视频：</span> <div class="flex"><img class="w-26px h-26px" src="@/assets/image/file.png" alt="">
            <span v-if="detailData.tmk_video_file">{{ detailData.tmk_video_file.split('|')[1] }}</span></div> 
        </div>
        <span class="text-blue-500 cursor-pointer" @click="watchFile">查看</span>
      </div>
      <div><span>上传时间：</span>{{ detailData.create_dateline }}</div>
    </div>
  </div>
</template>
<script setup>
import { useRoute, useRouter } from "vue-router";
const route = useRoute();
const router = useRouter();
let https = window.GLOBAL_CONFIG.api;
console.log(route.query.id);
let detailData = $ref({});
let zrcy = $ref([]);
request({
  url: "/txwx/msgzs_ktyj/detail",
  data: {
    tmk_id: route.query.tmk_id,
  },
}).then((res) => {
  if (res.code == "1") {
    detailData = res.data.one_info;
    let z = res.data.one_info.tmk_zrcy_all;
    zrcy = JSON.parse(z);
  }
});
function watchFile(){
  window.open(detailData.tmk_video_file.split('|')[0], '_blank')
}
function backLink() {
  router.go(-1);
}
</script>
<style lang="scss" scoped>
.main {
  width: 720px;
  margin: 0 auto;
  font-size: 14px;
  padding-right: 120px;
  > div {
    min-height: 30px;
    margin: 10px 0;
  }
  span {
    display: inline-block;
    width: 110px;
    text-align: right;
  }
}
</style>