TabulateStatisticsList.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view>
  3. <text class="u-demo-block__title" style="display: flex; align-items: center; justify-content: center; font-size: 20px; margin-top: 10px; font-weight: bold;">
  4. 各村垃圾清运汇总统计表
  5. </text>
  6. <u-divider
  7. text=""
  8. textColor="#2979ff"
  9. lineColor="#2979ff"
  10. ></u-divider>
  11. <u-list
  12. @scrolltolower="loadmore"
  13. >
  14. <u-list-item
  15. v-for="(item, index) in dataList"
  16. :key="index"
  17. >
  18. <u-cell @click="detail(item.id)"
  19. :title="`${item.name}`"
  20. :value="`详情>`"
  21. >
  22. </u-cell>
  23. </u-list-item>
  24. </u-list>
  25. </view>
  26. </template>
  27. <script>
  28. import officeService from "@/api/sys/officeService";
  29. export default {
  30. data() {
  31. return {
  32. status: 'loadmore',
  33. searchForm: {
  34. title: ''
  35. },
  36. dataList: [],
  37. loading: false,
  38. }
  39. },created() {
  40. this.loadmore()
  41. },
  42. methods: {
  43. loadmore() {
  44. //联网加载数据
  45. this.status = 'loading';
  46. officeService.villageLevelList().then((data)=>{
  47. console.log('获取村级数据信息:',data)
  48. //追加新数据
  49. this.dataList=this.dataList.concat(data);
  50. })
  51. },
  52. detail(id){
  53. console.log('查看详情',id)
  54. uni.navigateTo({
  55. url: `/pages/edt/TabulateStatisticsDetail?id=${id}`,
  56. success: function(res) {
  57. // 跳转成功后的处理
  58. console.log('跳转成功');
  59. },
  60. fail: function(err) {
  61. // 跳转失败后的处理
  62. console.log('跳转失败', err);
  63. },
  64. complete: function() {
  65. // 无论跳转成功还是失败都会执行
  66. console.log('跳转完成');
  67. }
  68. })
  69. }
  70. }
  71. }
  72. </script>