Newer
Older
KaiFengPC / src / views / sponeScreen / longYW / PromotionTraining.vue
@zhangdeliang zhangdeliang on 7 Nov 3 KB update
<template>
  <div class="longYW">
    <div class="partTitleHM">宣传培训</div>
    <div class="ConstrucClass" v-loading="loading">
      <div class="PublicityContent" v-for="item in tableData" @click="zpClck(item)">
        <div class="PublicityContentZP">
          <img v-if="item.filelist.length > 0" :src="item.filelist[0].url" alt="" class="zp" />
          <p v-else>暂无照片</p>
        </div>
        <div class="PublicityContentlR">
          <div class="PublicityContentXM" :title="item.title">
            <span>{{ item.title }}</span>
          </div>
          <div class="PublicityContentTime">
            <span>发布时间</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <span>{{ item.trainTime }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { specialNavPage } from '@/api/publicService/index';
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const loading = ref(true);
const allData = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
  },
});
const { queryParams } = toRefs(allData);
// 照片点击
function zpClck(val) {
  if (val.linkUrl != '') {
    window.open(val.linkUrl);
  } else {
    proxy.$modal.msgWarning('请添加链接地址');
  }
}

/** 获取搜索数据列表 */
function getDataList() {
  loading.value = true;
  specialNavPage({ pageNum: 1, pageSize: 10 }).then(response => {
    tableData.value = response.data || [];
    loading.value = false;
  });
}
onMounted(() => {
  getDataList();
});
</script>

<style lang="scss" scoped>
.longYW {
  margin-top: 10px;
  width: 460px;
  height: 30%;

  .ConstrucClass {
    height: calc(100% - 15%);
    background: #004565;
    overflow-y: auto;
    margin-top: -3px;
    // background: red;
    .scroll {
      margin-top: 5px;
      width: 95%;
      height: calc(100% - 10%);
      overflow: hidden;
      display: inline-block;
    }
  }
  .PublicityContent {
    margin: 5px;
    width: 97%;
    height: 90px;
    background: #035c8a;
    opacity: 0.8;
    position: relative;
    display: flex;
    cursor: pointer;
    .PublicityContentZP {
      width: 25%;
      height: 90px;
      // background: red;
      display: flex;
      align-items: center; /* 垂直居中 */
      justify-content: center; /* 水平居中 */
      .zp {
        width: 100px;
        height: 80px;
      }
    }
    .PublicityContentlR {
      width: 75%;
      height: 90px;
      margin-left: 5px;
      // background: yellow;
      .PublicityContentXM {
        width: 100%;
        height: 60%;
        display: flex;
        align-items: center;
        span {
          height: 60%;
          font-size: 16px;
          color: #fff;
          overflow: hidden;
          white-space: nowrap; /* 防止文字换行 */
          text-overflow: ellipsis; /* 超出部分显示省略号 */
        }
      }
      .PublicityContentTime {
        width: 100%;
        height: 40%;
        font-family: Source Han Sans CN;
        font-weight: 400;
        font-size: 14px;
        color: #3afff8;
      }
    }
  }
}
</style>