index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. },
  75. methods: {
  76. detailInfo(item) {
  77. uni.navigateTo({
  78. url: '/pages/work/detailInfo?contents=' + item.contents
  79. })
  80. },
  81. getList() {
  82. msgList({
  83. ...this.queryParams,
  84. }).then(({
  85. rows,
  86. total
  87. }) => {
  88. this.ledgerList = rows;
  89. this.total = total;
  90. });
  91. },
  92. onReachBottom() {
  93. //触底事件
  94. if (this.queryParams.pageNum * this.queryParams.pageSize >= this.total) {
  95. uni.showToast({
  96. title: "没有更多数据了",
  97. icon: "none",
  98. duration: 1000,
  99. });
  100. setTimeout(() => {
  101. uni.hideLoading();
  102. }, 500);
  103. } else {
  104. if (this.queryParams.pageNum <= this.queryParams.pageNum - 1) {
  105. setTimeout(() => {
  106. uni.hideLoading();
  107. }, 500);
  108. } else {
  109. uni.showLoading({
  110. title: "加载中",
  111. });
  112. this.queryParams.pageNum++;
  113. msgList({
  114. ...this.queryParams,
  115. }).then(({
  116. rows,
  117. total
  118. }) => {
  119. this.ledgerList = [...this.ledgerList, ...rows];
  120. this.total = total;
  121. });
  122. }
  123. setTimeout(() => {
  124. uni.hideLoading();
  125. }, 500);
  126. }
  127. },
  128. clickBannerItem(item) {
  129. console.info(item);
  130. },
  131. changeSwiper(e) {
  132. this.current = e.detail.current;
  133. },
  134. changeGrid(e) {
  135. this.$modal.showToast("模块建设中~");
  136. },
  137. },
  138. };
  139. </script>
  140. <style lang="scss">
  141. /* #ifndef APP-NVUE */
  142. page {
  143. display: flex;
  144. flex-direction: column;
  145. box-sizing: border-box;
  146. background-color: #fff;
  147. min-height: 100%;
  148. height: auto;
  149. }
  150. view {
  151. font-size: 14px;
  152. line-height: inherit;
  153. }
  154. /* #endif */
  155. .text {
  156. text-align: center;
  157. font-size: 26rpx;
  158. margin-top: 10rpx;
  159. }
  160. .grid-item-box {
  161. flex: 1;
  162. /* #ifndef APP-NVUE */
  163. display: flex;
  164. /* #endif */
  165. flex-direction: column;
  166. align-items: center;
  167. justify-content: center;
  168. padding: 15px 0;
  169. }
  170. .uni-margin-wrap {
  171. width: 690rpx;
  172. width: 100%;
  173. }
  174. .swiper {
  175. height: 300rpx;
  176. }
  177. .swiper-box {
  178. height: 150px;
  179. }
  180. .swiper-item {
  181. /* #ifndef APP-NVUE */
  182. display: flex;
  183. /* #endif */
  184. flex-direction: column;
  185. justify-content: center;
  186. align-items: center;
  187. color: #fff;
  188. height: 300rpx;
  189. line-height: 300rpx;
  190. }
  191. @media screen and (min-width: 500px) {
  192. .uni-swiper-dot-box {
  193. width: 400px;
  194. /* #ifndef APP-NVUE */
  195. margin: 0 auto;
  196. /* #endif */
  197. margin-top: 8px;
  198. }
  199. .image {
  200. width: 100%;
  201. }
  202. }
  203. </style>