index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <!-- 消息 -->
  3. <view class="msg-container">
  4. <c-scroll-paging
  5. refresherBackground="#f8f8f8"
  6. :queryList="queryList"
  7. :refresher-enabled="isDropDown"
  8. >
  9. <uni-swipe-action-item
  10. :right-options="rOptions"
  11. @click="rowClick"
  12. :key="item.id"
  13. v-for="item in rows"
  14. class="swipe-item"
  15. >
  16. <view class="list-row">
  17. <view class="row-header">
  18. <view class="img-box">
  19. <image
  20. class="left-icon"
  21. :src="getIcon(item.type)"
  22. ></image>
  23. <text class="row-title">{{ item.title }}</text>
  24. </view>
  25. <text class="row-date">{{ item.date }}</text>
  26. </view>
  27. <view class="row-work-time">
  28. {{ item.remarks }}
  29. </view>
  30. </view>
  31. </uni-swipe-action-item>
  32. </c-scroll-paging>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. name: 'msgNotification',
  38. data() {
  39. return {
  40. isDropDown: true,
  41. rOptions: [
  42. {
  43. text: '删除',
  44. style: {
  45. backgroundColor: '#ee0a24',
  46. },
  47. },
  48. ],
  49. rows: [],
  50. };
  51. },
  52. methods: {
  53. rowClick() {
  54. console.log(111);
  55. },
  56. getIcon(type) {
  57. const obj = {
  58. 0: 'jiaban',
  59. 1: 'buka',
  60. 2: 'qingjia',
  61. 3: 'chuchai',
  62. };
  63. return require(`@/static/images/home/waitFor/${obj[type]}.png`);
  64. },
  65. queryList(e) {
  66. console.log(e);
  67. return new Promise((resolve) => {
  68. const rows = [
  69. {
  70. id: '1',
  71. type: '0',
  72. title: '您有一条待审批事项',
  73. date: '1分钟前',
  74. remarks: '张三提交了加班申请',
  75. },
  76. {
  77. id: '2',
  78. type: '1',
  79. title: '您的加班申请已通过',
  80. date: '1分钟前',
  81. remarks: '缺卡时间:3月10日 20:00上班打卡',
  82. },
  83. {
  84. id: '3',
  85. type: '3',
  86. title: '张三补卡审批',
  87. date: '1分钟前',
  88. remarks: '张三提交了加班申请',
  89. },
  90. {
  91. id: '4',
  92. type: '3',
  93. title: '张三补卡审批',
  94. date: '1分钟前',
  95. remarks: '缺卡时间:3月10日 20:00上班打卡',
  96. },
  97. {
  98. id: '25',
  99. type: '1',
  100. title: '张三补卡审批',
  101. date: '1分钟前',
  102. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  103. },
  104. {
  105. id: '15',
  106. type: '1',
  107. title: '张三补卡审批',
  108. date: '1分钟前',
  109. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  110. },
  111. {
  112. id: '5',
  113. type: '1',
  114. title: '张三补卡审批',
  115. date: '1分钟前',
  116. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  117. },
  118. {
  119. id: '35',
  120. type: '1',
  121. title: '张三补卡审批',
  122. date: '1分钟前',
  123. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  124. },
  125. {
  126. id: '45',
  127. type: '1',
  128. title: '张三补卡审批',
  129. date: '1分钟前',
  130. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  131. },
  132. {
  133. id: '55',
  134. type: '1',
  135. title: '张三补卡审批',
  136. date: '1分钟前',
  137. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  138. },
  139. {
  140. id: '65',
  141. type: '1',
  142. title: '张三补卡审批',
  143. date: '1分钟前',
  144. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  145. },
  146. {
  147. id: '75',
  148. type: '1',
  149. title: '张三补卡审批',
  150. date: '1分钟前',
  151. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  152. },
  153. {
  154. id: '10',
  155. type: '1',
  156. title: '张三补卡审批',
  157. date: '1分钟前',
  158. remarks: '缺卡时间:3月10日 20:00上班打卡 ',
  159. },
  160. ];
  161. setTimeout(() => {
  162. resolve({
  163. rows,
  164. });
  165. this.rows = rows;
  166. }, 0);
  167. });
  168. },
  169. },
  170. };
  171. </script>
  172. <style scoped lang="scss">
  173. .msg-container {
  174. padding: 28rpx;
  175. height: 100%;
  176. background-color: #f8f8f8;
  177. .swipe-item {
  178. background: #fff;
  179. margin-bottom: 20rpx;
  180. }
  181. .list-row {
  182. padding: 24rpx;
  183. font-size: 14px;
  184. line-height: 48rpx;
  185. .row-header {
  186. display: flex;
  187. justify-content: space-between;
  188. .img-box {
  189. display: flex;
  190. align-items: center;
  191. .left-icon {
  192. width: 18px;
  193. height: 18px;
  194. margin-right: 10rpx;
  195. }
  196. }
  197. .row-date {
  198. color: #a2a8b8;
  199. font-size: 13px;
  200. }
  201. }
  202. .row-work-time {
  203. font-size: 13px;
  204. color: #7b7e8c;
  205. }
  206. }
  207. }
  208. </style>