mineMessage.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class="mineMessage">
  3. <div class="msgItem" v-for="item in msgList">
  4. <div class="msgItemLeft">
  5. <img src="./image/msgIcon.png" class="msgIcon">
  6. <div class="redDoll" v-show="item.isNew"></div>
  7. </div>
  8. <div class="msgItemRight">
  9. <div class="msgItemName">您有一条最新政策待查看!</div>
  10. <div class="msgItemTime">2024-06-18 19:34:06</div>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import { getMsgList,getUserLocalStorageInfo } from "@/js_sdk/http";
  17. export default {
  18. name: "mineMessage",
  19. data(){
  20. return{
  21. msgList:[
  22. // {name:'您有一条最新政策待查看',isNew:false},
  23. // {name:'您有一条最新政策待查看',isNew:true},
  24. // {name:'您有一条最新政策待查看',isNew:false},
  25. ],
  26. requestParam: {
  27. userId: getUserLocalStorageInfo().userId,
  28. pageNum: 1,
  29. pageSize: 10
  30. },
  31. total:0
  32. }
  33. },
  34. mounted(){
  35. this.getList()
  36. },
  37. methods:{
  38. getList(){
  39. getMsgList(this.requestParam).then(res=>{
  40. res.rows.forEach(element => {
  41. this.msgList.push(element)
  42. })
  43. this.total = res.total
  44. })
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. .mineMessage{
  51. padding:32rpx;
  52. .msgItem{
  53. width: 686rpx;
  54. height: 162rpx;
  55. background: white;
  56. box-sizing: border-box;
  57. border-radius: 16rpx;
  58. display: flex;
  59. align-items: center;
  60. padding-left: 32rpx;
  61. margin-bottom: 24rpx;
  62. .msgItemLeft{
  63. position: relative;
  64. .msgIcon{
  65. width: 80rpx;
  66. height: 80rpx;
  67. }
  68. .redDoll {
  69. position: absolute;
  70. right: 0;
  71. top: 0;
  72. width: 16rpx;
  73. height: 16rpx;
  74. background: #f25551;
  75. border-radius: 50%;
  76. }
  77. }
  78. .msgItemRight{
  79. display: flex;
  80. flex-direction: column;
  81. justify-content: center;
  82. margin-left: 16rpx;
  83. .msgItemTime{
  84. color: #888888;
  85. font-size: 28rpx;
  86. margin-top: 8rpx;
  87. }
  88. .msgItemName{
  89. font-size: 32rpx;
  90. color: #222222;
  91. }
  92. }
  93. }
  94. }
  95. </style>