notice.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="notice-page">
  3. <page-scroll
  4. url="/token/message/mymsg"
  5. :immediate="true"
  6. @updateList="handleUpdateList"
  7. ref="pageScroll"
  8. slotEmpty
  9. emptyText="暂无消息"
  10. >
  11. <!-- 时间分割线 -->
  12. <view class="notice-bar" v-for="(item, index) in noticeList" :key="index">
  13. <view class="time-divider">{{ item.createTime }}</view>
  14. <!-- 消息列表 -->
  15. <view class="notice-item flex-d">
  16. <!-- 通知图标 -->
  17. <view class="flex-a notice-header">
  18. <image src="../static/notice.png" style="width: 44rpx; height: 44rpx"></image>
  19. <view class="notice-title">通知</view>
  20. </view>
  21. <!-- 通知内容 -->
  22. <view class="notice-content">
  23. <view class="notice-text">
  24. <text>{{ item.messageInfo }}</text>
  25. <!-- <text>\n您也可以随时在</text>
  26. <text class="notice-link" @click="goToOrder">【我的订单】</text>
  27. <text>中查看订单状态</text> -->
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </page-scroll>
  33. </view>
  34. </template>
  35. <script>
  36. import pageScroll from "@/components/pageScroll/index.vue";
  37. export default {
  38. components: {
  39. pageScroll,
  40. },
  41. data() {
  42. return {
  43. noticeList: [],
  44. };
  45. },
  46. methods: {
  47. // 处理列表更新
  48. handleUpdateList(list = []) {
  49. this.noticeList = list;
  50. },
  51. // 格式化时间
  52. formatTime(time) {
  53. if (!time) return "";
  54. return time.replace("T", " ").substring(0, 19);
  55. },
  56. // 跳转到订单页面
  57. goToOrder() {
  58. uni.navigateTo({
  59. url: "/pages-mine/pages/order-page",
  60. });
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="scss" scoped>
  66. .notice-page {
  67. min-height: 100vh;
  68. background-color: #f5f5f5;
  69. padding: 20rpx 0;
  70. .time-divider {
  71. text-align: center;
  72. font-family: PingFang SC;
  73. font-weight: 500;
  74. font-size: 26rpx;
  75. color: #333333;
  76. padding: 20rpx 0;
  77. }
  78. .notice-item {
  79. margin: 0 20rpx;
  80. padding: 30rpx;
  81. background: #ffffff;
  82. border-radius: 12rpx;
  83. .notice-icon {
  84. margin-right: 20rpx;
  85. padding-top: 6rpx;
  86. }
  87. .notice-header {
  88. border-bottom: 1px solid #f8f8f8;
  89. padding-bottom: 14rpx;
  90. }
  91. .notice-title {
  92. font-size: 30rpx;
  93. font-weight: bold;
  94. color: #333333;
  95. padding-left: 10rpx;
  96. font-family: PingFang SC;
  97. }
  98. .notice-content {
  99. padding-top: 14rpx;
  100. flex: 1;
  101. .notice-text {
  102. font-size: 28rpx;
  103. color: #666666;
  104. line-height: 1.6;
  105. .notice-link {
  106. color: #38c148;
  107. padding: 0 4rpx;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. </style>