index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view style="height:100%;background-color:#f3f4f9;padding:20rpx" class="">
  3. <view v-for="item in ledgerList"
  4. style="background-color: #fff;border-radius: 20rpx;padding:20rpx;margin: 0rpx auto 20rpx;" class="">
  5. <view @click="detailInfo(item)" class="">
  6. <view style="display: inline-block" class="">
  7. <view style="line-height: 60rpx;font-size: 36rpx;font-weight: 700;" class="">
  8. {{item.title }}
  9. </view>
  10. <view style="line-height: 50rpx;color:#929292" class="">
  11. {{item.createTime}}
  12. </view>
  13. </view>
  14. <view style="float:right;margin-top:30rpx" class="">
  15. <view v-if="item.readStatus==1" style="color:limegreen" class="">
  16. 已读
  17. </view>
  18. <view v-if="item.readStatus==0" style="color:red" class="">
  19. 未读
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. msgList
  29. } from '@/api/work.js';
  30. import {
  31. useDict,
  32. paraseDict
  33. } from "@/utils/index";
  34. export default {
  35. data() {
  36. return {
  37. readColor: {
  38. 已撤回: "#fa3534",
  39. 已接收: "#2979ff",
  40. 待提交: "#2979ff",
  41. 备案中: "#2979ff",
  42. 已拒绝: "#fa3534",
  43. 勿备案: "#fa3534",
  44. 未备案: "#909399",
  45. 免备案: "#909399",
  46. 已退回: "#fa3534",
  47. },
  48. read: [], //备案字典
  49. queryParams: {
  50. pageNum: 1,
  51. pageSize: 10,
  52. },
  53. ledgerList: [],
  54. total: 0,
  55. current: 0,
  56. swiperDotIndex: 0,
  57. data: [{
  58. image: "/static/images/banner/banner01.jpg",
  59. },
  60. {
  61. image: "/static/images/banner/banner02.jpg",
  62. },
  63. {
  64. image: "/static/images/banner/banner03.jpg",
  65. },
  66. ],
  67. };
  68. },
  69. onLoad() {
  70. // useDict("read_status").then((res) => {
  71. // this.read = res;
  72. // });
  73. this.getList()
  74. uni.startPullDownRefresh();
  75. },
  76. onPullDownRefresh() {
  77. this.getList();
  78. console.log("refresh");
  79. setTimeout(function() {
  80. uni.stopPullDownRefresh();
  81. }, 800);
  82. },
  83. methods: {
  84. detailInfo(item) {
  85. uni.navigateTo({
  86. url: '/pages/work/detailInfo?contents=' + item.contents
  87. })
  88. },
  89. getList() {
  90. msgList({
  91. ...this.queryParams,
  92. }).then(({
  93. rows,
  94. total
  95. }) => {
  96. this.ledgerList = rows;
  97. this.total = total;
  98. });
  99. },
  100. onReachBottom() {
  101. //触底事件
  102. if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) {
  103. uni.showToast({
  104. title: "没有更多数据了",
  105. icon: "none",
  106. duration: 1000,
  107. });
  108. setTimeout(() => {
  109. uni.hideLoading();
  110. }, 500);
  111. } else {
  112. if (this.queryParams.pageNum <= this.queryParams.pageNum - 1) {
  113. setTimeout(() => {
  114. uni.hideLoading();
  115. }, 500);
  116. } else {
  117. uni.showLoading({
  118. title: "加载中",
  119. });
  120. this.queryParams.pageNum++;
  121. msgList({
  122. ...this.queryParams,
  123. }).then(({
  124. rows,
  125. total
  126. }) => {
  127. this.ledgerList = [...this.ledgerList, ...rows];
  128. this.total = total;
  129. });
  130. }
  131. setTimeout(() => {
  132. uni.hideLoading();
  133. }, 500);
  134. }
  135. },
  136. clickBannerItem(item) {
  137. console.info(item);
  138. },
  139. changeSwiper(e) {
  140. this.current = e.detail.current;
  141. },
  142. changeGrid(e) {
  143. this.$modal.showToast("模块建设中~");
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="scss">
  149. /* #ifndef APP-NVUE */
  150. page {
  151. display: flex;
  152. flex-direction: column;
  153. box-sizing: border-box;
  154. background-color: #fff;
  155. min-height: 100%;
  156. height: auto;
  157. }
  158. view {
  159. font-size: 14px;
  160. line-height: inherit;
  161. }
  162. /* #endif */
  163. .text {
  164. text-align: center;
  165. font-size: 26rpx;
  166. margin-top: 10rpx;
  167. }
  168. .grid-item-box {
  169. flex: 1;
  170. /* #ifndef APP-NVUE */
  171. display: flex;
  172. /* #endif */
  173. flex-direction: column;
  174. align-items: center;
  175. justify-content: center;
  176. padding: 15px 0;
  177. }
  178. .uni-margin-wrap {
  179. width: 690rpx;
  180. width: 100%;
  181. }
  182. .swiper {
  183. height: 300rpx;
  184. }
  185. .swiper-box {
  186. height: 150px;
  187. }
  188. .swiper-item {
  189. /* #ifndef APP-NVUE */
  190. display: flex;
  191. /* #endif */
  192. flex-direction: column;
  193. justify-content: center;
  194. align-items: center;
  195. color: #fff;
  196. height: 300rpx;
  197. line-height: 300rpx;
  198. }
  199. @media screen and (min-width: 500px) {
  200. .uni-swiper-dot-box {
  201. width: 400px;
  202. /* #ifndef APP-NVUE */
  203. margin: 0 auto;
  204. /* #endif */
  205. margin-top: 8px;
  206. }
  207. .image {
  208. width: 100%;
  209. }
  210. }
  211. </style>