messageReminder.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="aui-news-box">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <view class="headers dis a-c j-start ">
  6. <u-icon name="arrow-left" size="40" @tap="back"></u-icon>
  7. <text style="margin: auto;">掌柜秘书</text>
  8. </view>
  9. <view class="" style="padding: 98px 16px 16px 16px;">
  10. <view class="massage-data dis a-c j-s" v-for="(item,index) in lists" :key="index" @click="swipeClick(item)">
  11. <image :src="item.img" mode="" style="width: 46px;height: 41px;"></image>
  12. <view class="" style="width: 80%;">
  13. <view class="dis j-s a-c">
  14. <text>{{item.titleType}}</text>
  15. <text>{{item.time}}</text>
  16. </view>
  17. <view class="ellipsis">{{item.result.content}}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. lists: [{
  28. id: 1,
  29. titleType: "系统消息",
  30. time: "08:48",
  31. img: '/static/image/messageIcon/icon1.png',
  32. result: {}
  33. },
  34. {
  35. id: 2,
  36. titleType: "服务消息",
  37. time: "08:48",
  38. img: '/static/image/messageIcon/icon2.png',
  39. result: {}
  40. },
  41. {
  42. id: 3,
  43. titleType: "订单进度",
  44. time: "昨天",
  45. img: '/static/image/messageIcon/icon3.png',
  46. result: {}
  47. },
  48. {
  49. id: 4,
  50. titleType: "保单提醒",
  51. time: "星期六",
  52. img: '/static/image/messageIcon/icon4.png',
  53. result: {}
  54. },
  55. {
  56. id: 5,
  57. titleType: "佣金消息",
  58. time: "星期六",
  59. img: '/static/image/messageIcon/icon5.png',
  60. result: {}
  61. }, {
  62. id: 6,
  63. titleType: "增员服务",
  64. time: "星期五",
  65. img: '/static/image/messageIcon/icon6.png',
  66. result: {}
  67. }
  68. ],
  69. }
  70. },
  71. onShow() {
  72. this.getUserMessage();
  73. },
  74. onPullDownRefresh() {
  75. // 执行刷新逻辑
  76. this.getUserMessage();
  77. },
  78. methods: {
  79. //页面返回按钮
  80. back() {
  81. uni.navigateBack({
  82. delta: 1, // 返回的页面数,如果是1表示返回上一页
  83. success: function() {}
  84. });
  85. },
  86. async getUserMessage() {
  87. let res = await this.$http.get('/api/message/getUserMessage');
  88. if (res.code == '200') {
  89. res.data.map(val => {
  90. this.lists.map(ele => {
  91. if (val.msgType == ele.id) {
  92. ele.result = val;
  93. }
  94. })
  95. return val;
  96. })
  97. uni.stopPullDownRefresh();
  98. }
  99. },
  100. async swipeClick(item) {
  101. uni.navigateTo({
  102. url: "/pages/tools/messageReminder/details?msgType=" + item.result.msgType,
  103. })
  104. }
  105. }
  106. }
  107. </script>
  108. <style>
  109. .ellipsis {
  110. width: 100%;
  111. /* 设置一个固定宽度 */
  112. white-space: nowrap;
  113. /* 确保文本在一行显示 */
  114. overflow: hidden;
  115. /* 隐藏溢出的内容 */
  116. text-overflow: ellipsis;
  117. /* 使用省略号表示溢出的文本 */
  118. color: rgba(35, 40, 50, 0.6);
  119. font-size: 26rpx;
  120. }
  121. .headers {
  122. position: fixed;
  123. top: 0;
  124. left: 0;
  125. height: auto;
  126. width: 100%;
  127. z-index: 999999;
  128. padding: 16px;
  129. padding-top: 50px;
  130. background: #fff;
  131. background-image: url("/static/image/addStaff/bfg.png");
  132. background-size: 100% 100%;
  133. text {
  134. font-size: 18px;
  135. font-weight: bold;
  136. color: #000;
  137. }
  138. }
  139. .massage-data {
  140. padding: 16px 0;
  141. border-bottom: 1px solid #f2f2f2;
  142. text:nth-child(1) {
  143. color: #232832;
  144. font-size: 30rpx;
  145. }
  146. text:nth-child(2) {
  147. color: rgba(35, 40, 50, 0.6);
  148. font-size: 28rpx;
  149. }
  150. image {
  151. width: 46px;
  152. height: 41px;
  153. }
  154. }
  155. </style>