xydtXiaowugongkai.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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/xydtXiaowugongkaiInfo/xydtXiaowugongkaiInfo?id=${data.id}`
  61. })
  62. }
  63. function getList(data) {
  64. return httpApi.getDongtaiXiaowuGongkaiList(data)
  65. }
  66. function handleGo() {
  67. uni.navigateTo({
  68. url: '/pages/index/index'
  69. })
  70. }
  71. function pageInit() {
  72. httpApi.getDongtaiXiaowuGongkaiList({page:data.page,size:data.size}).then(res => {
  73. data.list = res.data.data;
  74. data.total = res.data.total;
  75. })
  76. }
  77. </script>
  78. <style>
  79. </style>