dqgzDangjiangongzuo.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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"></view>
  9. <icon class="breadcrumb-jt"></icon>
  10. <view class="breadcrumb-active"></view>
  11. </view>
  12. <MtaScrollViewVue :refreshFn="getList">
  13. <template v-slot="{ list }">
  14. <view class="list-item-box" v-for="item in list" :key="item.id" @click="handleClick(item)">
  15. <img class="list-img" :src="item.cover"/>
  16. <view class="list-time-box" >
  17. <view class="time-data">{{formatDateToYearMonthDay(item.createTime)[1]}}</view>
  18. <view class="time-year">{{formatDateToYearMonthDay(item.createTime)[0]}}</view>
  19. </view>
  20. <view class="list-right-box">
  21. <view class="list-name">{{item.title}}</view>
  22. <view class="list-line"></view>
  23. <view class="list-content" v-html="getStringByHtml3(item.content)"> </view>
  24. </view>
  25. </view>
  26. </template>
  27. </MtaScrollViewVue>
  28. </view>
  29. </view>
  30. <!-- 底部导航 -->
  31. <MtaFooter></MtaFooter>
  32. <MtaTabBar></MtaTabBar>
  33. </view>
  34. </template>
  35. <script setup>
  36. import {
  37. ref,
  38. reactive
  39. } from "vue";
  40. import {
  41. onLoad
  42. } from "@dcloudio/uni-app"
  43. import * as httpApi from "@/api/common.js"
  44. import MtaScrollViewVue from "@/components/MtaScrollView/MtaScrollView.vue";
  45. import {formatDateToYearMonthDay}from"@/utils/common.js"
  46. import MtaFooter from "@/components/MtaFooter.vue"
  47. import MtaTabBar from "@/components/MtaTabBar/MtaTabBar.vue";
  48. const data = reactive({
  49. list: '',
  50. total: '',
  51. page: 1,
  52. size: 5
  53. })
  54. onLoad(() => {
  55. })
  56. function handleClick(data) {
  57. console.log('data',data);
  58. uni.navigateTo({
  59. url: `/pages/dqgzDangjiangongzuoInfo/dqgzDangjiangongzuoInfo?id=${data.id}`
  60. })
  61. }
  62. function getList(data) {
  63. return httpApi.getDangjianGongzuoList(data)
  64. }
  65. function pageInit() {
  66. httpApi.getDangjianGongzuoList({page: data.page,size:data.size}).then(res => {
  67. data.list = res.data.data;
  68. data.total = res.data.total;
  69. })
  70. }
  71. </script>
  72. <style>
  73. </style>