xsydDeyuduiwu.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="dljt-page-box">
  3. <MtaNavbar></MtaNavbar>
  4. <view class="dljt-container-box">
  5. <view class="dljt-page-title">学生园地</view>
  6. <view class="dljt-page-content-box">
  7. <view class="dljt-breadcrumb-box">
  8. <view class="breadcrumb-text" @click="handleGo()">首页</view>
  9. <icon class="breadcrumb-jt"></icon>
  10. <view class="breadcrumb-text">学生园地</view>
  11. <icon class="breadcrumb-jt"></icon>
  12. <view class="breadcrumb-active">德育教育</view>
  13. </view>
  14. <MtaScrollViewVue :refreshFn="getList">
  15. <template v-slot="{ list }">
  16. <view class="list-item-box" v-for="item in list" :key="item.id" @click="handleClick(item)">
  17. <img class="list-img" :src="item.cover || default2" />
  18. <view class="list-time-box">
  19. <view class="time-data">{{formatDateToYearMonthDay(item.createTime)[1]}}</view>
  20. <view class="time-year">{{formatDateToYearMonthDay(item.createTime)[0]}}</view>
  21. </view>
  22. <view class="list-right-box">
  23. <view class="list-name">{{item.title}}</view>
  24. <view class="list-line"></view>
  25. <view class="list-content" v-html="getStringByHtml3(item.content)"> </view>
  26. </view>
  27. </view>
  28. </template>
  29. </MtaScrollViewVue>
  30. </view>
  31. <!-- 底部导航 -->
  32. <MtaFooter></MtaFooter>
  33. </view>
  34. </view>
  35. </template>
  36. <script setup>
  37. import {
  38. ref,
  39. reactive
  40. } from "vue";
  41. import {
  42. onLoad
  43. } from "@dcloudio/uni-app"
  44. import * as httpApi from "@/api/common.js"
  45. import MtaScrollViewVue from "@/components/MtaScrollView/MtaScrollView.vue";
  46. import {
  47. formatDateToYearMonthDay,
  48. getStringByHtml3
  49. } from "@/utils/common.js"
  50. import MtaFooter from "@/components/MtaFooter.vue"
  51. import default2 from '@/static/images/common/news-bj2.png'
  52. const data = reactive({
  53. list: '',
  54. total: '',
  55. page: 1,
  56. size: 5
  57. })
  58. function handleClick(data) {
  59. uni.navigateTo({
  60. url: `/pages/xsydDeyuduiwuInfo/xsydDeyuduiwuInfo?id=${data.id}`
  61. })
  62. }
  63. function getList(data) {
  64. return httpApi.getXueshengDeyuList(data)
  65. }
  66. function handleGo() {
  67. uni.navigateTo({
  68. url: '/pages/index/index'
  69. })
  70. }
  71. function pageInit() {
  72. httpApi.getXueshengDeyuList({
  73. page: data.page,
  74. size: data.size
  75. }).then(res => {
  76. data.list = res.data.data;
  77. data.total = res.data.total;
  78. })
  79. }
  80. </script>
  81. <style>
  82. </style>