notice.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <main>
  3. <TopVisual :className="className" :title="title" :navigation="navigation" />
  4. <section class="notice--section">
  5. <div class="sub--container type2">
  6. <div class="title--wrap">
  7. <h2 class="title">공지사항</h2>
  8. </div>
  9. <div class="search--wrap">
  10. <USelect v-model="searchValue" :items="searchItems" />
  11. <UInput v-model="searchKeyword" placeholder="검색어를 입력해주세요." />
  12. <UButton class="search--btn"></UButton>
  13. </div>
  14. <div class="notice--wrap">
  15. <div class="notice--list">
  16. <NuxtLink
  17. v-for="news in paginatedNews"
  18. :key="news.id"
  19. to="/contact/noticeView"
  20. class="notice"
  21. >
  22. <span class="news--index">{{ news.id }}</span>
  23. <h4>{{ news.title }}</h4>
  24. <span class="news--date">{{ news.date }}</span>
  25. </NuxtLink>
  26. </div>
  27. <div class="pagination--wrap">
  28. <UButton
  29. @click="prevPage"
  30. class="prev--btn"
  31. :disabled="currentPage === 1"
  32. ></UButton>
  33. <div class="numbs">
  34. <UButton
  35. v-for="page in totalPages"
  36. :key="page"
  37. @click="goToPage(page)"
  38. :class="{ active: currentPage === page }"
  39. >
  40. {{ page }}
  41. </UButton>
  42. </div>
  43. <UButton
  44. @click="nextPage"
  45. class="next--btn"
  46. :disabled="currentPage === totalPages"
  47. ></UButton>
  48. </div>
  49. </div>
  50. </div>
  51. </section>
  52. </main>
  53. </template>
  54. <script setup>
  55. import TopVisual from "~/components/topVisual.vue";
  56. const searchItems = ref(["제목"]);
  57. const searchValue = ref("선택");
  58. const searchKeyword = ref("");
  59. const className = ref("contact");
  60. const title = ref("Contact");
  61. const navigation = ref([
  62. {
  63. name: "Contact",
  64. link: "/contact/notice",
  65. gnbList: [
  66. { name: "Company", link: "/company/intro" },
  67. { name: "Product", link: "/products/materials" },
  68. { name: "Technology", link: "/technology/facilities" },
  69. { name: "Media", link: "/media/news" },
  70. { name: "Contact", link: "/contact/notice" },
  71. ],
  72. },
  73. {
  74. name: "공지사항",
  75. link: "/contact/notice",
  76. gnbList: [
  77. { name: "공지사항", link: "/contact/notice" },
  78. { name: "FAQ", link: "/contact/faq" },
  79. { name: "고객센터", link: "/contact/support" },
  80. { name: "오시는길", link: "/contact/location" },
  81. ],
  82. },
  83. ]);
  84. // 뉴스 데이터 배열 생성
  85. const newsData = ref([
  86. {
  87. id: 1,
  88. title: "그린플라스틱연합, ESG친환경대전서 '자원순환 탄소중립 GPA 컨퍼런스' 개최",
  89. date: "2025.07.11",
  90. image: "/img/img--news.png",
  91. link: "/",
  92. },
  93. {
  94. id: 2,
  95. title: "친환경 플라스틱 기술 개발 동향",
  96. date: "2025.07.10",
  97. image: "/img/img--cycle--center.png",
  98. link: "/",
  99. },
  100. {
  101. id: 3,
  102. title: "탄소중립 실현을 위한 플라스틱 재활용 기술",
  103. date: "2025.07.09",
  104. image: "/img/img--cycle--center.png",
  105. link: "/",
  106. },
  107. {
  108. id: 4,
  109. title: "바이오플라스틱 시장 전망과 기술 동향",
  110. date: "2025.07.08",
  111. image: "/img/img--cycle--center.png",
  112. link: "/",
  113. },
  114. {
  115. id: 5,
  116. title: "플라스틱 감축을 위한 정부 정책 변화",
  117. date: "2025.07.07",
  118. image: "/img/img--cycle--center.png",
  119. link: "/",
  120. },
  121. {
  122. id: 6,
  123. title: "순환경제와 플라스틱 재활용 산업",
  124. date: "2025.07.06",
  125. image: "/img/img--cycle--center.png",
  126. link: "/",
  127. },
  128. {
  129. id: 7,
  130. title: "해양 플라스틱 오염 해결을 위한 혁신 기술",
  131. date: "2025.07.05",
  132. image: "/img/img--cycle--center.png",
  133. link: "/",
  134. },
  135. {
  136. id: 8,
  137. title: "친환경 포장재 개발 현황",
  138. date: "2025.07.04",
  139. image: "/img/img--cycle--center.png",
  140. link: "/",
  141. },
  142. {
  143. id: 9,
  144. title: "플라스틱 대체재 소재 연구 동향",
  145. date: "2025.07.03",
  146. image: "/img/img--cycle--center.png",
  147. link: "/",
  148. },
  149. {
  150. id: 10,
  151. title: "ESG 경영과 플라스틱 감축 전략",
  152. date: "2025.07.02",
  153. image: "/img/img--cycle--center.png",
  154. link: "/",
  155. },
  156. {
  157. id: 11,
  158. title: "글로벌 플라스틱 규제 동향",
  159. date: "2025.07.01",
  160. image: "/img/img--cycle--center.png",
  161. link: "/",
  162. },
  163. {
  164. id: 12,
  165. title: "생분해성 플라스틱 상용화 전망",
  166. date: "2025.06.30",
  167. image: "/img/img--cycle--center.png",
  168. link: "/",
  169. },
  170. {
  171. id: 13,
  172. title: "플라스틱 없는 일주일 캠페인",
  173. date: "2025.06.29",
  174. image: "/img/img--cycle--center.png",
  175. link: "/",
  176. },
  177. {
  178. id: 14,
  179. title: "재활용 플라스틱 품질 향상 기술",
  180. date: "2025.06.28",
  181. image: "/img/img--cycle--center.png",
  182. link: "/",
  183. },
  184. {
  185. id: 15,
  186. title: "플라스틱 순환경제 구축 방안",
  187. date: "2025.06.27",
  188. image: "/img/img--cycle--center.png",
  189. link: "/",
  190. },
  191. {
  192. id: 16,
  193. title: "친환경 소재 개발 투자 확대",
  194. date: "2025.06.26",
  195. image: "/img/img--cycle--center.png",
  196. link: "/",
  197. },
  198. {
  199. id: 17,
  200. title: "마이크로플라스틱 저감 기술",
  201. date: "2025.06.25",
  202. image: "/img/img--cycle--center.png",
  203. link: "/",
  204. },
  205. {
  206. id: 18,
  207. title: "플라스틱 재활용률 제고 방안",
  208. date: "2025.06.24",
  209. image: "/img/img--cycle--center.png",
  210. link: "/",
  211. },
  212. {
  213. id: 19,
  214. title: "바이오매스 기반 플라스틱 개발",
  215. date: "2025.06.23",
  216. image: "/img/img--cycle--center.png",
  217. link: "/",
  218. },
  219. {
  220. id: 20,
  221. title: "환경친화적 플라스틱 산업 전망",
  222. date: "2025.06.22",
  223. image: "/img/img--cycle--center.png",
  224. link: "/",
  225. },
  226. {
  227. id: 21,
  228. title: "플라스틱 폐기물 감축 정책",
  229. date: "2025.06.21",
  230. image: "/img/img--cycle--center.png",
  231. link: "/",
  232. },
  233. {
  234. id: 22,
  235. title: "지속가능한 포장재 솔루션",
  236. date: "2025.06.20",
  237. image: "/img/img--cycle--center.png",
  238. link: "/",
  239. },
  240. {
  241. id: 23,
  242. title: "플라스틱 리사이클링 혁신 기술",
  243. date: "2025.06.19",
  244. image: "/img/img--cycle--center.png",
  245. link: "/",
  246. },
  247. {
  248. id: 24,
  249. title: "친환경 플라스틱 인증 시스템",
  250. date: "2025.06.18",
  251. image: "/img/img--cycle--center.png",
  252. link: "/",
  253. },
  254. {
  255. id: 25,
  256. title: "탄소 발자국 감축을 위한 플라스틱 대안",
  257. date: "2025.06.17",
  258. image: "/img/img--cycle--center.png",
  259. link: "/",
  260. },
  261. ]);
  262. // 페이지네이션 로직
  263. const currentPage = ref(1);
  264. const itemsPerPage = 10;
  265. const totalPages = computed(() => Math.ceil(newsData.value.length / itemsPerPage));
  266. const paginatedNews = computed(() => {
  267. const start = (currentPage.value - 1) * itemsPerPage;
  268. const end = start + itemsPerPage;
  269. return newsData.value.slice(start, end);
  270. });
  271. const goToPage = (page) => {
  272. if (page >= 1 && page <= totalPages.value) {
  273. currentPage.value = page;
  274. }
  275. };
  276. const nextPage = () => {
  277. if (currentPage.value < totalPages.value) {
  278. currentPage.value++;
  279. }
  280. };
  281. const prevPage = () => {
  282. if (currentPage.value > 1) {
  283. currentPage.value--;
  284. }
  285. };
  286. </script>