matterAll.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view>
  3. <!-- <uni-list>
  4. <uni-list-item :title="item.title" v-for="(item,index) in dataList" @click="onclick(item)"></uni-list-item>
  5. </uni-list> -->
  6. <view class="list" @tap.stop="onclick(item)" v-for="(item, index) in dataList" :key="item.id">
  7. <span class="listTitle">{{ item.title }}</span>
  8. <view class="jlSj">
  9. <span class="jf">
  10. {{ item.updateTime || item.createTime }}
  11. <!-- <em class="iconfont icon-jifen"></em> -->
  12. </span>
  13. <!-- <view class="ck">
  14. <span>
  15. <em class="iconfont icon-chakan"></em>
  16. {{ item.watchNum }}
  17. </span>
  18. <span :class=" favoriteList.includes(item.id) ? 'favorite' : 'not-favorite' ">
  19. <em class="iconfont icon-shoucang" @click.stop="addFavorite(item)"></em>
  20. {{ currentFavoriteCount(item) }}
  21. </span>
  22. </view> -->
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. listMatters
  30. } from "@/api/handleAffairs/matter.js"
  31. export default {
  32. data() {
  33. return {
  34. queryForm:{
  35. pageNum: 1,
  36. pageSize: 10,
  37. },
  38. total:0,
  39. dataList: [],
  40. };
  41. },
  42. created() {
  43. },
  44. onLoad(option) {
  45. this.queryForm = Object.assign(uni.getStorageSync('data'), this.queryForm)
  46. this.getMatters()
  47. },
  48. onReachBottom(){
  49. let pageNum = this.queryForm.pageNum
  50. let pageSize = this.queryForm.pageSize
  51. let total = this.total
  52. if(pageNum * pageSize >= total){
  53. uni.showToast({
  54. title:'暂无更多数据'
  55. })
  56. return
  57. } else {
  58. this.queryForm.pageSize += 5;
  59. this.getMatters()
  60. }
  61. },
  62. methods: {
  63. onclick(data){//点击详情
  64. uni.setStorageSync('id', data.id);
  65. uni.navigateTo({
  66. url: '/pages/gridQuery/mattercontent',
  67. });
  68. },
  69. getMatters() {
  70. let _that = this
  71. listMatters(_that.queryForm).then(res => {
  72. _that.dataList = res.rows
  73. _that.total = res.total
  74. console.log(res)
  75. })
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss">
  81. @import './matterAll.css';
  82. .container{
  83. height: 100%;
  84. content: '\e633';
  85. }
  86. .favorite{
  87. .icon-shoucang:before{
  88. color: red;
  89. }
  90. }
  91. .not-favorite{
  92. }
  93. </style>