home.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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>{{version}}</text>
  55. </view>
  56. <tm-tabbar :permission="nowPermission" />
  57. <tm-modal v-if="showJournal">
  58. <view class="journal">
  59. <view class="journal-title">
  60. <text>{{journalData.versionTitle}}</text>
  61. <text>{{journalData.versionDate}}</text>
  62. </view>
  63. <scroll-view scroll-y="true" class="journal-content">
  64. {{journalData.versionContent}}
  65. </scroll-view>
  66. <button class="journal-ok" @click="journalOk">确定</button>
  67. </view>
  68. </tm-modal>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. showJournal: false,
  76. version: '0.5.3',
  77. journalData: {
  78. versionId: '',
  79. versionTitle: '',
  80. versionDate: '',
  81. versionContent: ''
  82. },
  83. nowPermission: '', //用户当前第一权限
  84. nowPermissionName:'',//当前权限名
  85. code:'',//用户名
  86. name:'',//名字
  87. dep:'',//所属查核组
  88. depManager:'',//查核组组长
  89. hospName:'',//医院名
  90. totalTodo:0,//总待办数
  91. pemissionList:[
  92. {permission: 1, name: '管理员'},
  93. {permission: 2, name: '查核组长'},
  94. {permission: 3, name: '查核组员'},
  95. {permission: 4, name: '单位负责人'},
  96. {permission: 5, name: '改善者'}
  97. ]
  98. }
  99. },
  100. created: function() {
  101. this.$store.dispatch({
  102. type: 'home/commActions',
  103. payload: {
  104. key: 'getuser',
  105. }
  106. }).then((data) => {
  107. if (data) {
  108. uni.setStorageSync('permissions', data.permissions);
  109. uni.setStorageSync('nowPermission', data.nowPermission);
  110. this.code=data.code;
  111. this.name=data.name;
  112. this.nowPermission=data.nowPermission;
  113. this.dep=data.dep;
  114. this.depManager=data.depManager;
  115. this.hospName=data.hospName;
  116. let current=this.pemissionList.find(item => item.permission == data.nowPermission);
  117. this.nowPermissionName=current.name;
  118. this.totalTodo=data.permissions.reduce(function(total,currentValue){
  119. return total+currentValue.todoNum;
  120. },0);
  121. }
  122. });
  123. this.$store.dispatch({
  124. type: 'home/commActions',
  125. payload: {
  126. key: 'getVersionLog',
  127. data: {versionNo: this.version}
  128. }
  129. }).then((data) => {
  130. if (data) {
  131. this.showJournal = data.versionId ? true : false;
  132. this.journalData = data;
  133. }
  134. });
  135. },
  136. methods: {
  137. logOut() {
  138. this.$store.dispatch({
  139. type: 'home/commActions',
  140. payload: {
  141. key: 'logout',
  142. }
  143. }).then((data)=>{
  144. if(data){
  145. uni.redirectTo({
  146. url: `/pages/login/login?hospSign=${uni.getStorageSync('hospSign')}`
  147. });
  148. }
  149. });
  150. },
  151. switchRole() {
  152. uni.navigateTo({
  153. url: '/pages/role-switching/role-switching'
  154. });
  155. },
  156. journalOk() {
  157. this.showJournal = false;
  158. this.$store.dispatch({
  159. type: 'home/commActions',
  160. payload: {
  161. key: 'hadRead',
  162. data: {versionNo: this.version, versionId: this.journalData.versionId}
  163. }
  164. });
  165. }
  166. },
  167. computed:{
  168. isMsgShow(){
  169. return this.totalTodo<=0?false:true;
  170. }
  171. }
  172. }
  173. </script>
  174. <style lang="less">
  175. .journal {
  176. overflow: hidden;
  177. position: absolute;
  178. top: 50%;
  179. left: 50%;
  180. transform: translateX(-50%) translateY(-50%);
  181. border-radius: 15rpx;
  182. padding: 50rpx;
  183. width: 562.5rpx;
  184. height: 625rpx;
  185. font-size: 22.5rpx;
  186. line-height: 35rpx;
  187. background: #FFFFFF;
  188. .journal-title {
  189. display: flex;
  190. flex-direction: column;
  191. text {
  192. font-size: 35rpx;
  193. line-height: 52.5rpx;
  194. &:last-child {
  195. font-size: 22.5rpx;
  196. line-height: 33.75rpx;
  197. color: #666E80;
  198. }
  199. }
  200. }
  201. .journal-content {
  202. margin-top: 25rpx;
  203. height: 332.5rpx;
  204. }
  205. .journal-ok {
  206. position: fixed;
  207. left: 0;
  208. bottom: 0;
  209. border-radius: 0;
  210. border: 0;
  211. width: 100%;
  212. height: 75rpx;
  213. line-height: 75rpx;
  214. font-size: 22.5rpx;
  215. color: #fff;
  216. background-color: #3377FF;
  217. }
  218. }
  219. .home-page {
  220. height: 100%;
  221. .content-info {
  222. height: 596.25rpx;
  223. background-color: #FFFFFF;
  224. .top-box {
  225. position: relative;
  226. height: 350rpx;
  227. .bgpic {
  228. width: 750rpx;
  229. height: 350rpx;
  230. }
  231. .hosname {
  232. font-size: 45rpx;
  233. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  234. font-weight: 400;
  235. color: #FFFFFF;
  236. position: absolute;
  237. left: 50rpx;
  238. top: 92.5rpx;
  239. }
  240. }
  241. .info-box {
  242. width: 700rpx;
  243. height: 250rpx;
  244. border-radius: 15rpx;
  245. background-color: #FFFFFF;
  246. position: absolute;
  247. left: 25rpx;
  248. right: 25rpx;
  249. top: 226.25rpx;
  250. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  251. .head {
  252. margin-left: 37.5rpx;
  253. margin-top: 68.75rpx;
  254. .name {
  255. font-size: 35rpx;
  256. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  257. font-weight: 400;
  258. color: #17181A;
  259. }
  260. .gender {
  261. width: 25rpx;
  262. height: 25rpx;
  263. background: linear-gradient(135deg, #4DA6FF 0%, #4D88FF 100%);
  264. border-radius: 6.25rpx;
  265. margin-left: 15rpx;
  266. }
  267. .username {
  268. font-size: 25rpx;
  269. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  270. font-weight: 400;
  271. color: #17181A;
  272. margin-left: 55rpx;
  273. }
  274. }
  275. .row {
  276. margin-left: 37.5rpx;
  277. margin-top: 62.5rpx;
  278. .col {
  279. display: inline-block;
  280. margin-right: 25rpx;
  281. }
  282. }
  283. .text {
  284. font-size: 22.5rpx;
  285. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  286. font-weight: 400;
  287. color: #666E80;
  288. }
  289. }
  290. .avatar-box {
  291. width: 125rpx;
  292. height: 125rpx;
  293. position: absolute;
  294. right: 75rpx;
  295. top: 187.5rpx;
  296. background: #FFFFFF;
  297. z-index: 2;
  298. border-radius: 50%
  299. }
  300. .avatar {
  301. width: 112.5rpx;
  302. height: 112.5rpx;
  303. margin-left: 6.25rpx;
  304. margin-top: 6.25rpx;
  305. border-radius: 50%
  306. }
  307. .function-box {
  308. position: absolute;
  309. top: 496.25rpx;
  310. width: 750rpx;
  311. .role-switch {
  312. height: 100rpx;
  313. width: 725rpx;
  314. margin-left: 25rpx;
  315. background: #FFFFFF;
  316. border-bottom: 0.62rpx solid #DADEE6;
  317. .msg-box {
  318. width: 50rpx;
  319. height: 30rpx;
  320. float: left;
  321. margin-top: 35rpx;
  322. margin-left: 15rpx;
  323. position: relative;
  324. background: #FF4060;
  325. border-radius: 24px;
  326. text-align: center;
  327. .msg-text {
  328. font-size: 17.5rpx;
  329. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  330. font-weight: 400;
  331. color: #FFFFFF;
  332. line-height: 30rpx;
  333. }
  334. }
  335. .role {
  336. font-size: 22.5rpx;
  337. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  338. font-weight: 400;
  339. color: #7A8599;
  340. line-height: 100rpx;
  341. float: right;
  342. margin-right: 25rpx;
  343. }
  344. }
  345. // .sys-setting{
  346. // height: 100rpx;
  347. // width: 725rpx;
  348. // margin-left: 25rpx;
  349. // background: #FFFFFF;
  350. // }
  351. .func-text {
  352. font-size: 22.5rpx;
  353. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  354. font-weight: 500;
  355. color: #292C33;
  356. line-height: 100rpx;
  357. float: left;
  358. }
  359. .icon-more {
  360. width: 12.37rpx;
  361. height: 21.21rpx;
  362. line-height: 100rpx;
  363. float: right;
  364. margin-top: 39.37rpx;
  365. margin-right: 25rpx;
  366. }
  367. }
  368. }
  369. .logout-box {
  370. width: 750rpx;
  371. height: 100rpx;
  372. background-color: #FFFFFF;
  373. margin-top: 15rpx;
  374. .logout-text {
  375. font-size: 22.5rpx;
  376. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  377. font-weight: 500;
  378. color: #292C33;
  379. line-height: 100rpx;
  380. margin-left: 330rpx;
  381. }
  382. }
  383. .copyright {
  384. position: absolute;
  385. bottom: 90rpx;
  386. left: 0;
  387. display: flex;
  388. flex-direction: column;
  389. justify-content: center;
  390. align-items: center;
  391. width: 100%;
  392. color: #666E80;
  393. }
  394. }
  395. </style>