message.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="center">
  3. <view class="message">
  4. <view class="item" v-for="l in list">
  5. <view class="img">
  6. <image :src="l.image" mode=""></image>
  7. </view>
  8. <view class="right">
  9. <view class="top">
  10. <view class="title">{{ l.name }}</view><view class="time">{{ l.time }}</view>
  11. </view>
  12. <view class="bottom">
  13. <view class="concent clamp2">{{ l.last_message.detail }}</view><view class="icon" v-show="l.unwatch_message>0"></view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import { messageList } from '@/api/finance.js'
  22. export default {
  23. data(){
  24. return {
  25. list:[],
  26. }
  27. },
  28. onLoad() {
  29. this.loadData()
  30. },
  31. methods: {
  32. loadData() {
  33. messageList({page:1,limit:10}).then(({data}) =>{
  34. this.list = data
  35. console.log(data)
  36. })
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. .center,page {
  43. height: 100%;
  44. width: 100%;
  45. background: #F8F8F8;
  46. }
  47. .message {
  48. margin-top: 20rpx;
  49. font-family: PingFangSC-Medium;
  50. background-color: #fff;
  51. .item {
  52. display: flex;
  53. padding: 30rpx 0;
  54. margin: 0 30rpx;
  55. border-bottom: solid 1rpx #f8f8f8;
  56. .img {
  57. margin: auto 0;
  58. width: 110rpx;
  59. margin-left: 0rpx;
  60. image {
  61. width: 80rpx;
  62. height: 80rpx;
  63. }
  64. }
  65. .right {
  66. width: calc(100% - 110rpx);
  67. display: grid;
  68. align-content: space-between;
  69. .top {
  70. display: flex;
  71. justify-content: space-between;
  72. .title {
  73. color: #000;
  74. font-size: 30rpx;
  75. }
  76. .time {
  77. color: #999999;
  78. font-size: 25rpx;
  79. }
  80. }
  81. .bottom {
  82. display: flex;
  83. justify-content: space-between;
  84. .concent {
  85. width: calc(100% - 30rpx);
  86. color: #999999;
  87. font-size: 26rpx;
  88. }
  89. .icon {
  90. margin: auto 0;
  91. width: 10rpx;
  92. height: 10rpx;
  93. background-color: #FB555C;
  94. border-radius: 50%;
  95. }
  96. }
  97. }
  98. }
  99. }
  100. </style>