messageReminder.vue 3.6 KB

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