<template>
  <div class="real-pages">
    <div>
      <div class="real-info">
        <div class="title">{{ dataInfo.announcementTitle }}</div>
        <div class="time">{{ dataInfo.createTime }}</div>
        <div class="real-html" v-html="dataInfo.announcementContent"></div>
      </div>
    </div>

    <div class="real-shop">
      <div class="shop-head flex-row-start">
        <div class="head1">为您推荐</div>
        <div class="head2">热门流行商品推荐</div>
      </div>
      <div class="data-bos">
        <div v-for="(item, index) in 9" :key="index" class="data-list">
          <img class="data-img" src="@/assets/images/login-background.jpg" alt="" />
          <div class="data-title">格力KFR-72LW/定频冷暖空调柜机3P</div>
          <div class="money">
            <span class="money1">¥1,299</span>
            <span class="money2">¥1,899</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onPath } from '@/utils/siteConfig';
import { getYouYzXunInfo } from '@/api/plan/index';
const id = ref<any>(null);
const dataInfo = ref<any>({});
const route = useRoute();
onMounted(() => {
  id.value = route.query.id;
  getInfo();
});

const getInfo = () => {
  getYouYzXunInfo(id.value).then((res) => {
    if (res.code == 200) {
      dataInfo.value = res.data;
    }
  });
};
</script>

<style lang="scss" scoped>
.real-pages {
  width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0 20px;
  padding-bottom: 50px;
  .real-info {
    width: 715px;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    .title {
      font-size: 20px;
      color: #101828;
    }
    .time {
      font-size: 14px;
      color: #364153;
      margin: 10px 0 18px 0;
    }
    .real-html {
      width: 679px;
      :deep(img) {
        max-width: 100%;
        height: auto;
      }
    }
    .img {
      width: 679px;
      height: 351px;
      border-radius: 10px;
    }
    .head {
      font-weight: 600;
      font-size: 14px;
      color: #101828;
      margin: 10px 0 18px 0;
    }
    .info {
      font-size: 14px;
      color: #364153;
      margin-bottom: 15px;
    }
  }
  .real-shop {
    flex: 1;
    .head1 {
      font-weight: 600;
      font-size: 20px;
      color: #101828;
    }
    .head2 {
      font-size: 14px;
      color: #364153;
      margin-left: 10px;
    }
    //数据
    .data-bos {
      display: flex;
      gap: 17px;
      flex-wrap: wrap;
      margin-top: 10px;
      width: 100%;
      .data-list {
        width: 224px;
        background: #ffffff;
        border-radius: 10px;
        padding: 20px 20px 22px 20px;
        cursor: pointer;
        .data-img {
          width: 184px;
          height: 184px;
          border-radius: 10px;
        }
        .data-title {
          margin-top: 4px;
          font-size: 14px;
          color: #101828;
          height: 40px;
        }
        .money {
          margin-top: 4px;
          .money1 {
            font-size: 16px;
            color: #e7000b;
          }
          .money2 {
            font-size: 12px;
            color: #99a1af;
            text-decoration: line-through;
            padding-left: 6px;
          }
        }
        .data-cat {
          width: 86px;
          height: 26px;
          background: #e7000b;
          border-radius: 2px;
          font-size: 14px;
          color: #ffffff;
          line-height: 26px;
          text-align: center;
          margin-top: 16px;
        }
      }
    }
  }
}
</style>
