home.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="content">
  3. <view id="top1" class="status_bar"></view>
  4. <view id="top2" class="user">
  5. <view class="image">
  6. <image :src="avatar" mode="widthFix"></image>
  7. </view>
  8. <view class="nick" @click="toUser">
  9. <text>{{nick}}</text>
  10. <text class="icon iconfont icon-right"></text>
  11. </view>
  12. </view>
  13. <scroll-view class="task" scroll-y :style="{height:menuHeight+'px'}">
  14. <view :class="isShowSplit?'public':''">
  15. <navigator class="menu" url="../task/task?type=today">
  16. <image src="../../static/images/today.png" mode="widthFix"></image>
  17. <text>今日任务</text>
  18. </navigator>
  19. <navigator class="menu" url="../task/task?type=important">
  20. <image src="../../static/images/important.png" mode="widthFix"></image>
  21. <text>重要</text>
  22. </navigator>
  23. <navigator class="menu" url="../task/task?type=plan">
  24. <image src="../../static/images/plan.png" mode="widthFix"></image>
  25. <text>计划内</text>
  26. </navigator>
  27. <!-- <navigator class="menu" url="../task/task?type=assigned">
  28. <image src="../../static/images/assigned.png" mode="widthFix"></image>
  29. <text>已分配给我</text>
  30. </navigator> -->
  31. <navigator class="menu" url="../task/task?type=task">
  32. <image src="../../static/images/tasks.png" mode="widthFix"></image>
  33. <text>任务</text>
  34. </navigator>
  35. <view class="menu" style="justify-content: space-between" @click="open">
  36. <view>
  37. <image src="../../static/images/report.png" mode="widthFix"></image>
  38. <text>汇报管理</text>
  39. </view>
  40. <text :class="isShowReportDetail?'icon iconfont icon-down':'icon iconfont icon-up'"
  41. style="margin-right: 50upx"></text>
  42. </view>
  43. <view v-if="isShowReportDetail" class="menu_detail">
  44. <navigator url="../dayreport/dayreport">
  45. <image src="../../static/images/huibao.png" mode="widthFix"></image>
  46. <text>个人日报</text>
  47. </navigator>
  48. <navigator url="../monthreport/monthreport">
  49. <image src="../../static/images/huibao.png" mode="widthFix"></image>
  50. <text>个人月报</text>
  51. </navigator>
  52. <navigator url="../dayreportform/dayreportform">
  53. <image src="../../static/images/baobiao.png" mode="widthFix"></image>
  54. <text>日汇报报表</text>
  55. </navigator>
  56. </view>
  57. </view>
  58. <view class="personal">
  59. <view v-for="item in menuList" :key="item.id">
  60. <view>{{item.name}}</view>
  61. </view>
  62. </view>
  63. </scroll-view>
  64. <view id="bottom" class="bottom_bar">
  65. <!-- <view>
  66. <image src="../../static/images/plus.png" mode="widthFix"></image>
  67. <text>新建列表</text>
  68. </view>
  69. <image src="../../static/images/gplus.png" mode="widthFix"></image> -->
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import Vue from 'vue'
  75. import auth from '../../utils/js/auth.js'
  76. export default {
  77. data() {
  78. return {
  79. nick:'',
  80. avatar:'',
  81. isShowSplit: false,
  82. isShowReportDetail: false,
  83. menuHeight: 0,
  84. menuList:[]
  85. }
  86. },
  87. onLoad() {
  88. if (!auth.getToken()) {
  89. uni.showModal({
  90. title: "未登录",
  91. content: "当前未登录,需要先登录才能继续",
  92. showCancel: false,
  93. success: (res) => {
  94. if (res.confirm) {
  95. uni.reLaunch({
  96. url: "../login/login"
  97. })
  98. }
  99. }
  100. })
  101. }else{
  102. this.nick=auth.getNick()||auth.getName()
  103. this.avatar=auth.getAvatar()
  104. }
  105. },
  106. onReady() {
  107. let that = this
  108. uni.getSystemInfo({
  109. success(res) {
  110. const w_height = res.windowHeight
  111. var query = uni.createSelectorQuery()
  112. query.select('#top1').boundingClientRect()
  113. query.select('#top2').boundingClientRect()
  114. query.select('#bottom').boundingClientRect()
  115. query.exec(function(res) {
  116. that.menuHeight = w_height - res[0].height - res[1].height - res[2].height
  117. })
  118. }
  119. })
  120. },
  121. methods: {
  122. toUser() {
  123. uni.navigateTo({
  124. url: "../user/user"
  125. })
  126. },
  127. open() {
  128. this.isShowReportDetail = !this.isShowReportDetail
  129. },
  130. }
  131. }
  132. </script>
  133. <style>
  134. @import url("../../utils/css/iconfont.css");
  135. .content {
  136. display: flex;
  137. flex-direction: column;
  138. align-items: center;
  139. justify-content: center;
  140. }
  141. .status_bar {
  142. width: 100%;
  143. height: calc(2*(var(--status-bar-height)));
  144. }
  145. .user {
  146. width: 100%;
  147. height: 50upx;
  148. display: flex;
  149. }
  150. .image {
  151. height: 50upx;
  152. width: 50upx;
  153. margin-left: 20upx;
  154. border-bottom: #C0C0C0 solid 1upx;
  155. }
  156. .image image {
  157. width: 100%;
  158. }
  159. .nick {
  160. height: 50upx;
  161. display: flex;
  162. align-items: center;
  163. border-bottom: #C0C0C0 solid 1upx;
  164. }
  165. .nick text {
  166. margin-left: 20upx;
  167. color: #999999;
  168. font-size: 25upx;
  169. }
  170. .task {
  171. margin-top: 50upx;
  172. }
  173. .public {
  174. border-bottom: #C0C0C0 solid 1upx;
  175. }
  176. .menu {
  177. height: 75upx;
  178. display: flex;
  179. align-items: center;
  180. }
  181. .menu view {
  182. height: 100%;
  183. display: flex;
  184. align-items: center;
  185. }
  186. .menu image {
  187. width: 45upx;
  188. margin-left: 20upx;
  189. }
  190. .menu text {
  191. margin-left: 50upx;
  192. font-size: 30upx;
  193. }
  194. .menu_detail {
  195. margin-left: 80upx;
  196. }
  197. .menu_detail navigator {
  198. height: 75upx;
  199. display: flex;
  200. align-items: center;
  201. }
  202. .menu_detail image {
  203. width: 45upx;
  204. }
  205. .menu_detail text {
  206. margin-left: 50upx;
  207. font-size: 30upx;
  208. }
  209. .bottom_bar {
  210. width: 100%;
  211. height: 70upx;
  212. position: absolute;
  213. left: 0upx;
  214. bottom: 0upx;
  215. display: flex;
  216. justify-content: space-between;
  217. align-items: center;
  218. }
  219. .bottom_bar view {
  220. height: 100%;
  221. display: flex;
  222. align-items: center;
  223. }
  224. .bottom_bar image {
  225. width: 50upx;
  226. margin-left: 20upx;
  227. margin-right: 20upx;
  228. }
  229. .bottom_bar text{
  230. color: #0f32d3;
  231. margin-left: -10upx;
  232. }
  233. .personal{
  234. width: 100%;
  235. }
  236. </style>