<template>
  <view class="container">
    <view v-for="(item, index) in noticeList" :key="index">
      <view class="notice-item" @click="toNoticeDetail(item)">
        <image :src="item.image" class="notice-image"></image>
        <view class="notice-main">
          <view class="notice-title">{{ item.title }}</view>
          <view class="notice-content">{{ item.content }}</view>
          <view class="notice-date">
            <image
              src="http://localhost:8080/time.png"
              class="date-image"
            ></image>
            <view>{{ item.date }}</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import {
  request,
  picUrl,
  NavgateTo,
  menuButtonInfo,
} from "../../../utils/index";
export default {
  data() {
    return {
      noticeList: [
        {
          image: "http://localhost:8080/test.png",
          title: "公告标题1",
          content: "公告内容",
          date: "2023-01-01",
        },
        {
          image: "http://localhost:8080/test.png",
          title: "公告标题2",
          content: "公告内容",
          date: "2023-01-02",
        },
      ],
    };
  },
  methods: {
    toNoticeDetail(item) {
      NavgateTo("/packages/homeServer/noticeDetails/index");
    },
  },
};
</script>

<style>
@import url("./index.css");
</style>