sj.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="noticeListsj">
  3. <div
  4. v-for="item in list"
  5. class="list-row"
  6. @click="
  7. jumpPage(
  8. '/pages/subPackages/sj_history/detail?id=' + item.formId,
  9. item.id
  10. )
  11. "
  12. >
  13. <img src="./1.png" alt="" style="width: 80rpx; height: 80rpx" />
  14. <div class="lefttext">
  15. <div :class="item.userReadStatus == 1 ? 'text' : 'text fwbold'">
  16. {{ item.messageContent }}
  17. </div>
  18. <div class="text1">{{ item.createTime }}</div>
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import { driverMessageListPage, driverReadMessage } from "@/js_sdk/noticeList";
  25. import { getUserLocalStorageInfo } from "@/js_sdk/localUserInfo.js";
  26. export default {
  27. data() {
  28. return {
  29. searchData: {
  30. pageNum: 1,
  31. pageSize: 10,
  32. },
  33. list: [],
  34. };
  35. },
  36. onReachBottom() {
  37. // 触底加载更多
  38. this.searchData.pageNum += 1;
  39. this.driverMessageListPage();
  40. },
  41. onShow() {
  42. this.searchData.userId = getUserLocalStorageInfo().user.id;
  43. this.driverMessageListPage();
  44. // userId: getUserLocalStorageInfo().user.id,
  45. },
  46. methods: {
  47. async jumpPage(path, id) {
  48. let data = await driverReadMessage({ id });
  49. // return;
  50. console.log(path);
  51. uni.navigateTo({
  52. url: path,
  53. fail: (fail) => {},
  54. });
  55. },
  56. async driverMessageListPage() {
  57. let { data } = await driverMessageListPage(this.searchData);
  58. if (this.list.length != data.total) {
  59. this.list.push(...data.list);
  60. }
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="scss">
  66. .noticeListsj {
  67. display: flex;
  68. flex-wrap: wrap;
  69. justify-content: center;
  70. .list-row {
  71. width: 606rpx;
  72. background: #ffffff;
  73. .fwbold {
  74. font-weight: bold !important;
  75. }
  76. .lefttext {
  77. margin-left: 12rpx;
  78. .text {
  79. width: 500rpx;
  80. font-weight: 400;
  81. font-size: 32rpx;
  82. color: #222222;
  83. }
  84. .text1 {
  85. font-weight: 400;
  86. font-size: 28rpx;
  87. color: #888888;
  88. margin-top: 12rpx;
  89. }
  90. }
  91. }
  92. }
  93. </style>