message.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. type: ''
  16. };
  17. },
  18. onLoad(opt) {
  19. if (opt.type) {
  20. this.type = opt.type;
  21. uni.setNavigationBarTitle({
  22. title: opt.type == 1 ? '官方公告' : '拍品介绍'
  23. });
  24. }
  25. let obj = this;
  26. article({ page: 1, limit: 1000 }, this.type).then(({ data }) => {
  27. this.list = data;
  28. });
  29. },
  30. methods: {
  31. nav(url) {
  32. uni.navigateTo({
  33. url
  34. });
  35. }
  36. }
  37. };
  38. </script>
  39. <style lang="less">
  40. .center {
  41. background: #f3f3f3;
  42. }
  43. .massage {
  44. background: #ffffff;
  45. padding: 30rpx;
  46. border-bottom: 1px solid #e9e9e9;
  47. .title {
  48. font-size: 28rpx;
  49. font-family: PingFang SC;
  50. font-weight: 500;
  51. color: #333333;
  52. }
  53. .time {
  54. margin-top: 18rpx;
  55. font-size: 20rpx;
  56. font-family: PingFang SC;
  57. font-weight: 500;
  58. color: #999999;
  59. }
  60. }
  61. </style>