dqgzDangjiangongzuo.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view>
  3. <MtaScrollViewVue :refreshFn="getList">
  4. <template v-slot="{ list }">
  5. <div v-for="item in list" :key="item.id" @click="handleClick(item)">
  6. <image :src="item.cover"></image>
  7. <br>
  8. {{formatDateToYearMonthDay(item.createTime)}}
  9. <br>
  10. {{item.title}}
  11. </div>
  12. </template>
  13. </MtaScrollViewVue>
  14. </view>
  15. </template>
  16. <script setup>
  17. import {
  18. ref,
  19. reactive
  20. } from "vue";
  21. import {
  22. onLoad
  23. } from "@dcloudio/uni-app"
  24. import * as httpApi from "@/api/common.js"
  25. import MtaScrollViewVue from "@/components/MtaScrollView/MtaScrollView.vue";
  26. import {formatDateToYearMonthDay}from"@/utils/common.js"
  27. const data = reactive({
  28. list: '',
  29. total: '',
  30. page: 1,
  31. size: 5
  32. })
  33. onLoad(() => {
  34. })
  35. function handleClick(data) {
  36. console.log('data',data);
  37. uni.navigateTo({
  38. url: `/pages/dqgzDangjiangongzuoInfo/dqgzDangjiangongzuoInfo?id=${data.id}`
  39. })
  40. }
  41. function getList(data) {
  42. return httpApi.getDangjianGongzuoList(data)
  43. }
  44. function pageInit() {
  45. httpApi.getDangjianGongzuoList({page: data.page,size:data.size}).then(res => {
  46. data.list = res.data.data;
  47. data.total = res.data.total;
  48. })
  49. }
  50. </script>
  51. <style>
  52. </style>