<template>
  <div class="platform">
    <h2 class="platform-title">全域数字农业产业管理平台</h2>
    <div class="platform-panel">
      <div class="platform-panel-item">
        <div class="icon"><img src="https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/main/icon-zw.png" /></div>
        <b>农业产业政务服务平台</b>
        <ul class="entry">
          <li v-for="item in rightApps" :key="item.name" @click="gotoPage(item)">
            <span class="entry-icon">
              <img :src="getAssetsFile(item.icon)" />
            </span>
            <span class="entry-name">{{ item.title }} </span>
          </li>
        </ul>
      </div>
      <div class="platform-panel-item">
        <div class="icon"><img src="https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/main/icon-yy.png" /></div>
        <b>农业产业运营服务平台</b>
        <ul class="entry">
          <li v-for="item in leftApps" :key="item.name" @click="gotoPage(item)">
            <span class="entry-icon">
              <img :src="getAssetsFile(item.icon)" />
            </span>
            <span class="entry-name">{{ item.title }} </span>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script setup>
import { leftApps, rightApps } from '@/micro/app';
import { getAssetsFile } from '@/utils';

const gotoPage = (row) => {
  // window.history.pushState({}, row.name, row.activeRule);
  if (row.name == 'sub-app1') {
    // 政务app
    // window.location.href = 'https://www.pgyer.com/MXd3uUrO';
    window.location.href = row.activeRule;
  } else if (row.name == 'sub-app2') {
    // 运营app
    // window.location.href = 'https://www.pgyer.com/4SVVtpob';
    window.location.href = row.activeRule;
  } else {
    window.location.href = row.activeRule;
  }
};
</script>
<style lang="scss" scoped>
.platform {
  width: 100%;
  min-height: 100%;
  background-image: url('https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/main/bg.jpg');
  background-size: cover;
  .platform-title {
    height: 156px;
    line-height: 50px;
    width: 98%;
    font-size: 100px;
    text-align: center;
    color: #fff;
    transform: skewX(-10deg); /* 沿X轴倾斜-15度 */
    display: inline-block; /* 需要设置为inline-block或block */
    letter-spacing: 5px;
  }

  &-title {
    width: 1200px;
    height: 156px;
    margin: 0 auto 20px;
    padding-top: 120px;
    // text-indent: -999rem;
    // background-image: url('@/assets/images/platform/title.png');
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
  }

  &-panel {
    width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    @include flex-row();
    align-items: center;
    justify-content: space-between;

    &-item {
      width: 480px;
      margin: 0 40px;
      text-align: center;
      @include flex-column();

      .icon {
        width: 280px;
        height: 280px;
        margin: 0 auto 24px;

        img {
          width: 100%;
        }
      }

      b {
        line-height: 48px;
        color: #fff;
        font-size: 40px;
        font-weight: normal;
      }

      .entry {
        width: 100%;
        height: 140px;
        border-radius: 20px;
        margin-top: 44px;
        background-color: rgba(255, 255, 255, 0.3);
        border: 2px solid rgba(255, 255, 255, 1);
        color: #fff;
        @include flex-row();
        align-items: center;

        &-icon {
          width: 48px;
          height: 48px;
          margin: 0 auto 24px;

          img {
            width: 100%;
          }
        }

        &-name {
          font-size: 20px;
        }

        li {
          @include flex-column();
          flex: 1;
          justify-content: center;
          cursor: pointer;
        }
      }
    }
  }

  /* 屏幕宽度≤1360px 或 高度≤768px 时的样式 */
  @media screen and (max-width: 1360px), screen and (max-height: 768px) {
    .platform-title {
      font-size: 80px;
      height: 100px;
      line-height: 40px;
      padding-top: 80px;
      margin-bottom: 0;
    }
    .platform-panel-item .icon {
      width: 200px;
      height: 200px;
    }
  }

  /* 屏幕宽度≤1280px 或 高度≤600px 时的样式（更小设备的覆盖样式） */
  @media screen and (max-width: 1280px), screen and (max-height: 600px) {
    .platform-title {
      font-size: 70px;
      height: 80px;
      line-height: 40px;
      padding-top: 60px;
    }
    .platform-panel-item {
      .icon {
        width: 180px;
        height: 180px;
      }
      b {
        line-height: 40px;
        font-size: 36px;
      }
    }
    .platform-panel-item .entry {
      margin-top: 20px;
      height: 120px;
      &-icon {
        margin: 0 auto 14px;
      }
    }
  }
}
</style>
