index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="fireReport" style="background-color: #f7f7f7">
  3. <u-empty v-if="!dataRes" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
  4. <view class="reportContent" v-else>
  5. <view class="contentDom" v-for="(li, index) in dataList" :key="index">
  6. <view style="margin: auto 10px auto 0" @click="handleSelect()">
  7. <u-image src="@/static/images/fireReport/icon1.png" width="13px" height="13px"></u-image>
  8. </view>
  9. <view style="margin: 0 auto 0 0" @click="handleSelect()">
  10. <view>{{ li.title }}</view>
  11. </view>
  12. <view>
  13. <view style="color: #3c9cff; cursor: pointer" @click="handleDownload">下载报告</view>
  14. </view>
  15. </view>
  16. <u-loadmore :status="status" />
  17. </view>
  18. </view>
  19. </template>
  20. <script setup>
  21. import { onReady, onLoad, onShow, onReachBottom, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  22. import { ref, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance } from "vue";
  23. import publicStore from "@/store/modules/public";
  24. import {} from "@/api/business/mhxf/informationSelect";
  25. const { proxy } = getCurrentInstance();
  26. const publicStores = publicStore(); //全局公共Store
  27. const dataRes = ref(true);
  28. const dataList = ref([
  29. {
  30. value: 1,
  31. title: "2023年1月份单位消防报告",
  32. },
  33. {
  34. value: 2,
  35. title: "2023年2月份单位消防报告",
  36. },
  37. {
  38. value: 3,
  39. title: "2023年3月份单位消防报告",
  40. },
  41. {
  42. value: 4,
  43. title: "2023年4月份单位消防报告",
  44. },
  45. {
  46. value: 5,
  47. title: "2023年5月份单位消防报告",
  48. },
  49. {
  50. value: 6,
  51. title: "2023年6月份单位消防报告",
  52. },
  53. {
  54. value: 7,
  55. title: "2023年7月份单位消防报告",
  56. },
  57. {
  58. value: 8,
  59. title: "2023年8月份单位消防报告",
  60. },
  61. {
  62. value: 9,
  63. title: "2023年9月份单位消防报告",
  64. },
  65. {
  66. value: 10,
  67. title: "2023年10月份单位消防报告",
  68. },
  69. {
  70. value: 11,
  71. title: "2023年11月份单位消防报告",
  72. },
  73. {
  74. value: 11,
  75. title: "2023年11月份单位消防报告",
  76. },
  77. {
  78. value: 11,
  79. title: "2023年11月份单位消防报告",
  80. },
  81. {
  82. value: 11,
  83. title: "2023年11月份单位消防报告",
  84. },
  85. {
  86. value: 11,
  87. title: "2023年11月份单位消防报告",
  88. },
  89. {
  90. value: 11,
  91. title: "2023年11月份单位消防报告",
  92. },
  93. ]);
  94. const status = ref("loadmore");
  95. const list = ref(15);
  96. const page = ref(0);
  97. /**
  98. * @列表点击事件
  99. */
  100. function handleSelect() {
  101. proxy.$tab.navigateTo("/pages/business/mhxf/fireReport/components/detailed");
  102. // uni.navigateBack({
  103. // delta: 1,
  104. // });
  105. }
  106. function handleDownload() {
  107. proxy.$modal.loading("报告下载中,请耐心等待...");
  108. setTimeout(() => {
  109. proxy.$modal.closeLoading();
  110. }, 2000);
  111. }
  112. watchEffect(() => {});
  113. onReachBottom(() => {
  114. if (page.value >= 3) return;
  115. status.value = "loading";
  116. page.value = ++page.value;
  117. setTimeout(() => {
  118. list.value += 10;
  119. if (page.value >= 3) status.value = "nomore";
  120. else status.value = "loading";
  121. }, 2000);
  122. });
  123. // 自定义导航事件
  124. onNavigationBarButtonTap((e) => {
  125. if (e.float == "right") {
  126. uni.navigateTo({
  127. url: "/pages/business/mhxf/xunJian/collect/components/collectRecord",
  128. });
  129. } else {
  130. }
  131. });
  132. onLoad((options) => {});
  133. onReady(() => {});
  134. onMounted(() => {});
  135. </script>
  136. <style lang="scss">
  137. .fireReport {
  138. height: calc(100vh - 44px);
  139. background-color: #ffffff;
  140. .reportContent {
  141. .contentDom {
  142. display: flex;
  143. height: 45px;
  144. line-height: 45px;
  145. background: #fff;
  146. padding: 0 10px;
  147. }
  148. > uni-view {
  149. margin-bottom: 10px;
  150. }
  151. > uni-view:last-child {
  152. margin-bottom: 0px;
  153. }
  154. }
  155. }
  156. </style>
  157. <style scoped>
  158. uni-page-body,
  159. uni-page-refresh {
  160. background-color: #f5f6f7;
  161. }
  162. </style>