home.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="home-page">
  3. <view class="content-info">
  4. <view class="top-box">
  5. <image class="bgpic" src="/static/images/pcbg.png"></image>
  6. <text class="hosname">{{hospName}}</text>
  7. </view>
  8. <view class="avatar-box">
  9. <image class="avatar" src="/static/images/boy-avatar.png"></image>
  10. </view>
  11. <view class="info-box">
  12. <view class="head">
  13. <text class="name">
  14. {{name}}
  15. </text>
  16. <!-- <image class="gender" src="/static/images/boy.png"></image> -->
  17. <text class="username">{{code}}</text>
  18. </view>
  19. <!-- <view class="row">
  20. <text class="text">心血管内科</text>
  21. </view> -->
  22. <view class="row">
  23. <view class="col">
  24. <text class="text">主管:{{depManager}}</text>
  25. </view>
  26. <view class="col">
  27. <text class="text">|</text>
  28. </view>
  29. <view class="col">
  30. <text class="text">所属查核组:{{dep}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="function-box">
  35. <view class="role-switch" @click="switchRole">
  36. <text class="func-text">角色切换</text>
  37. <view class="msg-box" v-show="isMsgShow">
  38. <text class="msg-text">{{this.totalTodo}}</text>
  39. </view>
  40. <image class="icon-more" src="/static/images/icon-more.png"></image>
  41. <text class="role">{{nowPermissionName}}</text>
  42. </view>
  43. <!-- <view class="sys-setting">
  44. <text class="func-text">系统设置</text>
  45. <image class="icon-more" src="/static/images/icon-more.png"></image>
  46. </view> -->
  47. </view>
  48. </view>
  49. <view class="logout-box" @click="logOut">
  50. <text class="logout-text">退出登录</text>
  51. </view>
  52. <view class="copyright">
  53. <text>浙江新医智联信息科技有限公司</text>
  54. <text>0.5.3</text>
  55. </view>
  56. <tm-tabbar :permission="nowPermission" />
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. nowPermission: '', //用户当前第一权限
  64. nowPermissionName:'',//当前权限名
  65. code:'',//用户名
  66. name:'',//名字
  67. dep:'',//所属查核组
  68. depManager:'',//查核组组长
  69. hospName:'',//医院名
  70. totalTodo:0,//总待办数
  71. pemissionList:[
  72. {permission: 1, name: '管理员'},
  73. {permission: 2, name: '查核组长'},
  74. {permission: 3, name: '查核组员'},
  75. {permission: 4, name: '单位负责人'},
  76. {permission: 5, name: '改善者'}
  77. ]
  78. }
  79. },
  80. created: function() {
  81. this.$store.dispatch({
  82. type: 'home/commActions',
  83. payload: {
  84. key: 'getuser',
  85. }
  86. }).then((data) => {
  87. if (data) {
  88. uni.setStorageSync('permissions', data.permissions);
  89. uni.setStorageSync('nowPermission', data.nowPermission);
  90. this.code=data.code;
  91. this.name=data.name;
  92. this.nowPermission=data.nowPermission;
  93. this.dep=data.dep;
  94. this.depManager=data.depManager;
  95. this.hospName=data.hospName;
  96. let current=this.pemissionList.find(item => item.permission == data.nowPermission);
  97. this.nowPermissionName=current.name;
  98. this.totalTodo=data.permissions.reduce(function(total,currentValue){
  99. return total+currentValue.todoNum;
  100. },0);
  101. }
  102. });
  103. },
  104. methods: {
  105. logOut() {
  106. this.$store.dispatch({
  107. type: 'home/commActions',
  108. payload: {
  109. key: 'logout',
  110. }
  111. }).then((data)=>{
  112. if(data){
  113. uni.redirectTo({
  114. url: `/pages/login/login?hospSign=${uni.getStorageSync('hospSign')}`
  115. });
  116. }
  117. });
  118. },
  119. switchRole() {
  120. uni.navigateTo({
  121. url: '/pages/role-switching/role-switching'
  122. });
  123. }
  124. },
  125. computed:{
  126. isMsgShow(){
  127. return this.totalTodo<=0?false:true;
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="less">
  133. .home-page {
  134. height: 100%;
  135. .content-info {
  136. height: 596.25rpx;
  137. background-color: #FFFFFF;
  138. .top-box {
  139. position: relative;
  140. height: 350rpx;
  141. .bgpic {
  142. width: 750rpx;
  143. height: 350rpx;
  144. }
  145. .hosname {
  146. font-size: 45rpx;
  147. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  148. font-weight: 400;
  149. color: #FFFFFF;
  150. position: absolute;
  151. left: 50rpx;
  152. top: 92.5rpx;
  153. }
  154. }
  155. .info-box {
  156. width: 700rpx;
  157. height: 250rpx;
  158. border-radius: 15rpx;
  159. background-color: #FFFFFF;
  160. position: absolute;
  161. left: 25rpx;
  162. right: 25rpx;
  163. top: 226.25rpx;
  164. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  165. .head {
  166. margin-left: 37.5rpx;
  167. margin-top: 68.75rpx;
  168. .name {
  169. font-size: 35rpx;
  170. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  171. font-weight: 400;
  172. color: #17181A;
  173. }
  174. .gender {
  175. width: 25rpx;
  176. height: 25rpx;
  177. background: linear-gradient(135deg, #4DA6FF 0%, #4D88FF 100%);
  178. border-radius: 6.25rpx;
  179. margin-left: 15rpx;
  180. }
  181. .username {
  182. font-size: 25rpx;
  183. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  184. font-weight: 400;
  185. color: #17181A;
  186. margin-left: 55rpx;
  187. }
  188. }
  189. .row {
  190. margin-left: 37.5rpx;
  191. margin-top: 62.5rpx;
  192. .col {
  193. display: inline-block;
  194. margin-right: 25rpx;
  195. }
  196. }
  197. .text {
  198. font-size: 22.5rpx;
  199. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  200. font-weight: 400;
  201. color: #666E80;
  202. }
  203. }
  204. .avatar-box {
  205. width: 125rpx;
  206. height: 125rpx;
  207. position: absolute;
  208. right: 75rpx;
  209. top: 187.5rpx;
  210. background: #FFFFFF;
  211. z-index: 2;
  212. border-radius: 50%
  213. }
  214. .avatar {
  215. width: 112.5rpx;
  216. height: 112.5rpx;
  217. margin-left: 6.25rpx;
  218. margin-top: 6.25rpx;
  219. border-radius: 50%
  220. }
  221. .function-box {
  222. position: absolute;
  223. top: 496.25rpx;
  224. width: 750rpx;
  225. .role-switch {
  226. height: 100rpx;
  227. width: 725rpx;
  228. margin-left: 25rpx;
  229. background: #FFFFFF;
  230. border-bottom: 0.62rpx solid #DADEE6;
  231. .msg-box {
  232. width: 50rpx;
  233. height: 30rpx;
  234. float: left;
  235. margin-top: 35rpx;
  236. margin-left: 15rpx;
  237. position: relative;
  238. background: #FF4060;
  239. border-radius: 24px;
  240. text-align: center;
  241. .msg-text {
  242. font-size: 17.5rpx;
  243. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  244. font-weight: 400;
  245. color: #FFFFFF;
  246. line-height: 30rpx;
  247. }
  248. }
  249. .role {
  250. font-size: 22.5rpx;
  251. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  252. font-weight: 400;
  253. color: #7A8599;
  254. line-height: 100rpx;
  255. float: right;
  256. margin-right: 25rpx;
  257. }
  258. }
  259. // .sys-setting{
  260. // height: 100rpx;
  261. // width: 725rpx;
  262. // margin-left: 25rpx;
  263. // background: #FFFFFF;
  264. // }
  265. .func-text {
  266. font-size: 22.5rpx;
  267. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  268. font-weight: 500;
  269. color: #292C33;
  270. line-height: 100rpx;
  271. float: left;
  272. }
  273. .icon-more {
  274. width: 12.37rpx;
  275. height: 21.21rpx;
  276. line-height: 100rpx;
  277. float: right;
  278. margin-top: 39.37rpx;
  279. margin-right: 25rpx;
  280. }
  281. }
  282. }
  283. .logout-box {
  284. width: 750rpx;
  285. height: 100rpx;
  286. background-color: #FFFFFF;
  287. margin-top: 15rpx;
  288. .logout-text {
  289. font-size: 22.5rpx;
  290. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  291. font-weight: 500;
  292. color: #292C33;
  293. line-height: 100rpx;
  294. margin-left: 330rpx;
  295. }
  296. }
  297. .copyright {
  298. position: absolute;
  299. bottom: 90rpx;
  300. left: 0;
  301. display: flex;
  302. flex-direction: column;
  303. justify-content: center;
  304. align-items: center;
  305. width: 100%;
  306. color: #666E80;
  307. }
  308. }
  309. </style>