qy.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 ? '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 { bizMessageListPage, bizReadMessage } 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.bizMessageListPage();
  40. },
  41. onLoad() {
  42. (this.searchData.bizId = getUserLocalStorageInfo().biz.id),
  43. this.bizMessageListPage();
  44. // userId: getUserLocalStorageInfo().user.id,
  45. },
  46. methods: {
  47. async jumpPage(path, id) {
  48. let data = await bizReadMessage({ id });
  49. console.log(path);
  50. uni.navigateTo({
  51. url: path,
  52. fail: (fail) => {},
  53. });
  54. },
  55. async bizMessageListPage() {
  56. let { data } = await bizMessageListPage(this.searchData);
  57. if (this.list.length != data.total) {
  58. this.list.push(...data.list);
  59. }
  60. },
  61. },
  62. };
  63. </script>
  64. <style lang="scss">
  65. .noticeListsj {
  66. display: flex;
  67. flex-wrap: wrap;
  68. justify-content: center;
  69. .list-row {
  70. width: 606rpx;
  71. background: #ffffff;
  72. .fwbold {
  73. font-weight: bold;
  74. }
  75. .lefttext {
  76. margin-left: 12rpx;
  77. .text {
  78. width: 500rpx;
  79. font-weight: 400;
  80. font-size: 32rpx;
  81. color: #222222;
  82. }
  83. .text1 {
  84. font-weight: 400;
  85. font-size: 28rpx;
  86. color: #888888;
  87. margin-top: 12rpx;
  88. }
  89. }
  90. }
  91. }
  92. </style>