toDoList.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <!-- 待办提醒 -->
  3. <view class="to-do-list">
  4. <view class="header">
  5. <view class="dflex acenter">
  6. <view class="wait-for">
  7. <view class="num-tips">
  8. <msgNum value="10"></msgNum>
  9. </view>
  10. <image
  11. src="@/static/images/home/to-do-list.png"
  12. class="h-icon"
  13. ></image>
  14. </view>
  15. <text class="title"> 待办提醒 </text>
  16. </view>
  17. <view class="nav-right" @click="goToAll">
  18. <text>全部</text>
  19. <u-icon
  20. class="arrow-right"
  21. name="arrow-right"
  22. size="12"
  23. ></u-icon>
  24. </view>
  25. </view>
  26. <c-scroll-paging :queryList="queryList">
  27. <view :key="item.id" v-for="item in rows" class="list-row">
  28. <view class="row-header">
  29. <view class="img-box">
  30. <image
  31. class="left-icon"
  32. :src="getIcon(item.type)"
  33. ></image>
  34. <text class="row-title">{{ item.title }}</text>
  35. </view>
  36. <text class="row-date">{{ item.date }}</text>
  37. </view>
  38. <view class="row-work-time">
  39. 加班时间:{{ item.workTime }}
  40. </view>
  41. </view>
  42. </c-scroll-paging>
  43. </view>
  44. </template>
  45. <script>
  46. import msgNum from '@/components/msgNum/index.vue';
  47. export default {
  48. name: 'toDoList',
  49. components: {
  50. msgNum,
  51. },
  52. data() {
  53. return {
  54. rows: [],
  55. };
  56. },
  57. methods: {
  58. goToAll() {
  59. uni.switchTab({ url: '/pages/waitHandle/index' });
  60. },
  61. getIcon(type) {
  62. const obj = {
  63. 0: 'jiaban',
  64. 1: 'buka',
  65. 2: 'qingjia',
  66. 3: 'chuchai',
  67. };
  68. return require(`@/static/images/home/waitFor/${obj[type]}.png`);
  69. },
  70. queryList(e) {
  71. console.log(e);
  72. return new Promise((resolve) => {
  73. const rows = [
  74. {
  75. id: '1',
  76. type: '0',
  77. title: '张三加班审批',
  78. date: '1分钟前',
  79. workTime: '3月10日 20:00-3月10日 22:00',
  80. },
  81. {
  82. id: '2',
  83. type: '1',
  84. title: '张三补卡审批',
  85. date: '1分钟前',
  86. workTime: '3月10日 20:00-3月10日 22:00',
  87. },
  88. {
  89. id: '3',
  90. type: '3',
  91. title: '张三补卡审批',
  92. date: '1分钟前',
  93. workTime: '3月10日 20:00-3月10日 22:00',
  94. },
  95. {
  96. id: '4',
  97. type: '3',
  98. title: '张三补卡审批',
  99. date: '1分钟前',
  100. workTime: '3月10日 20:00-3月10日 22:00',
  101. },
  102. {
  103. id: '5',
  104. type: '1',
  105. title: '张三补卡审批',
  106. date: '1分钟前',
  107. workTime: '3月10日 20:00-3月10日 22:00',
  108. },
  109. ];
  110. setTimeout(() => {
  111. resolve({
  112. rows,
  113. });
  114. this.rows = rows;
  115. }, 0);
  116. });
  117. },
  118. },
  119. };
  120. </script>
  121. <style scoped lang="scss">
  122. .to-do-list {
  123. display: flex;
  124. flex-direction: column;
  125. flex: 1;
  126. background-color: #fff;
  127. border-radius: 6px;
  128. padding: 32rpx;
  129. margin-top: 26rpx;
  130. margin-bottom: 26rpx;
  131. box-shadow: 0px 2px 10px 0px rgba(69, 66, 230, 0.08);
  132. .header {
  133. display: flex;
  134. align-items: center;
  135. justify-content: space-between;
  136. margin-bottom: 20rpx;
  137. .wait-for {
  138. position: relative;
  139. width: 24px;
  140. height: 24px;
  141. margin-right: 12rpx;
  142. .num-tips {
  143. position: absolute;
  144. right: 0;
  145. top: 0;
  146. transform: scale(0.8) translate(50%, -50%);
  147. z-index: 1;
  148. }
  149. .h-icon {
  150. width: 48rpx;
  151. height: 48rpx;
  152. margin-right: 12rpx;
  153. }
  154. }
  155. .nav-right {
  156. display: flex;
  157. align-items: center;
  158. font-size: 14px;
  159. color: #8c93a3;
  160. .arrow-right {
  161. margin-top: 6rpx;
  162. }
  163. }
  164. }
  165. .list-row {
  166. background: #f8f9fc;
  167. padding: 24rpx;
  168. font-size: 14px;
  169. line-height: 48rpx;
  170. margin-bottom: 20rpx;
  171. .row-header {
  172. display: flex;
  173. justify-content: space-between;
  174. .img-box {
  175. display: flex;
  176. align-items: center;
  177. .left-icon {
  178. width: 18px;
  179. height: 18px;
  180. margin-right: 10rpx;
  181. }
  182. }
  183. .row-date {
  184. color: #a2a8b8;
  185. font-size: 13px;
  186. }
  187. }
  188. .row-work-time {
  189. font-size: 13px;
  190. color: #7b7e8c;
  191. }
  192. }
  193. }
  194. </style>