message.vue 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="center">
  3. <view class="massage" v-for="(item, index) in list" :key="index" @click="nav('/pages/index/messageInfo?id=' + item.id)">
  4. <view class="title">{{ item.title }}</view>
  5. <view class="time">{{ item.add_time }}</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import { article } from '@/api/user.js';
  11. export default {
  12. data() {
  13. return {
  14. list: []
  15. };
  16. },
  17. onLoad(opt) {
  18. let obj = this;
  19. article({ page: 1, limit: 1000 }, 1).then(({ data }) => {
  20. this.list = data;
  21. });
  22. },
  23. methods: {
  24. nav(url) {
  25. uni.navigateTo({
  26. url
  27. });
  28. }
  29. }
  30. };
  31. </script>
  32. <style lang="less">
  33. .center {
  34. background: #f3f3f3;
  35. }
  36. .massage {
  37. background: #ffffff;
  38. padding: 30rpx;
  39. border-bottom: 1px solid #e9e9e9;
  40. .title {
  41. font-size: 28rpx;
  42. font-family: PingFang SC;
  43. font-weight: 500;
  44. color: #333333;
  45. }
  46. .time {
  47. margin-top: 18rpx;
  48. font-size: 20rpx;
  49. font-family: PingFang SC;
  50. font-weight: 500;
  51. color: #999999;
  52. }
  53. }
  54. </style>