qy.vue 2.1 KB

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