home.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view class="home-wrap">
  3. <view class="home-title">
  4. <view class="title-bac">
  5. <view class="section-view">
  6. <view class="user-cont">
  7. <span class="user-spn">欢迎</span>
  8. <span class="user-spn spnr">{{userData.userName}}</span>
  9. </view>
  10. <view class="curent-cont">
  11. <span class="current-spn">当前所在机构:</span>
  12. <span class="user-spn spnr">{{instData.spdName}}</span>
  13. </view>
  14. </view>
  15. <view class="all-app">
  16. <view class="all-title">
  17. 请选择医疗机构
  18. </view>
  19. <view class="all-app-view">
  20. <view class="app-view-item" v-for="(item,index) in appData" :key="index">
  21. <view class="app-item-img" :style="{background: appDataSty.bgColor}"
  22. @click.stop="appView(item)">
  23. <image class="app-item-svg" :src="appDataSty.iconUrl">
  24. </image>
  25. </view>
  26. <view class="app-item-text">
  27. {{item.spdName}}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. mapState,
  39. mapMutations,
  40. mapActions
  41. } from 'vuex';
  42. export default {
  43. components: {},
  44. computed: {
  45. ...mapState(['instData', 'userData']),
  46. },
  47. data() {
  48. return {
  49. listData: [],
  50. msData: [],
  51. outRoom: "请选择仓库",
  52. romDetData: {
  53. acpCnt: '待验收',
  54. groundCnt: '待上架',
  55. stooutCnt: "待出库",
  56. stostrCnt: "待配送"
  57. },
  58. appData: [],
  59. appDataSty: {
  60. iconUrl: "../../../static/pandian.svg",
  61. bgColor: "#2CE4BF",
  62. }
  63. }
  64. },
  65. onLoad() {
  66. },
  67. mounted() {
  68. this.getUserData();
  69. this.getInstData();
  70. },
  71. watch: {},
  72. methods: {
  73. ...mapActions(['getUserData']),
  74. ...mapMutations(['setHouseName', 'setInst']),
  75. //跳转页面
  76. appView(item) {
  77. this.setInst({...item});
  78. uni.switchTab({
  79. url: '/pages/platform/index',
  80. success: function(res) {}
  81. });
  82. },
  83. //获取当前用户管理的医疗机构
  84. getInstData() {
  85. this.$http('common.getInst', {}, '加载中', true).then((res) => {
  86. if (res.success == true) {
  87. if (res.success == true && res.data.length) {
  88. this.appData = res.data;
  89. this.setInst({
  90. spdId: res.data[0].spdId,
  91. spdName: res.data[0].spdName,
  92. orgId: res.data[0].orgId
  93. })
  94. }
  95. }
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .home-wrap {
  103. width: 100%;
  104. height: 100%;
  105. background-color: #F5F5F5;
  106. .home-title {
  107. width: 100%;
  108. height: auto;
  109. .title-bac {
  110. width: 100%;
  111. height: 392rpx;
  112. border-radius: 0rpx 0rpx 40rpx 40rpx;
  113. background: linear-gradient(180deg, rgba(1, 169, 146, 1) 0%, rgba(1, 176, 164, 0.54) 46%, rgba(2, 181, 176, 0.24) 100%, rgba(2, 185, 185, 0) 100%);
  114. padding: 20rpx;
  115. box-sizing: border-box;
  116. .roomt {
  117. width: 100%;
  118. height: 70rpx;
  119. display: flex;
  120. align-items: center;
  121. justify-content: space-between;
  122. .rom-spn {
  123. color: rgba(255, 255, 255, 0.9);
  124. font-size: 36rpx;
  125. text-align: left;
  126. font-family: PingFangSC-bold;
  127. }
  128. }
  129. .section-view {
  130. width: 97%;
  131. margin: 70rpx auto 40rpx auto;
  132. height: 210rpx;
  133. background-color: rgba(255, 255, 255, 1);
  134. box-shadow: -2rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.4);
  135. border-radius: 20rpx;
  136. padding: 20rpx;
  137. box-sizing: border-box;
  138. margin-top: 130rpx;
  139. .user-cont {
  140. width: 100%;
  141. height: 50rpx;
  142. .user-spn {
  143. color: rgba(0, 0, 0, 0.8);
  144. font-size: 36rpx;
  145. font-family: AlibabaPuHui-medium;
  146. }
  147. .spnr {
  148. margin-left: 20rpx;
  149. font-size: 35rpx;
  150. font-family: AlibabaPuHui-medium;
  151. }
  152. }
  153. .curent-cont {
  154. width: 100%;
  155. height: 100rpx;
  156. display: flex;
  157. align-items: center;
  158. .current-spn {
  159. font-size: 32rpx;
  160. color: #5AB7A5;
  161. }
  162. }
  163. .sec-data {
  164. width: 100%;
  165. height: 110rpx;
  166. display: flex;
  167. justify-content: space-around;
  168. margin-top: 60rpx;
  169. .sec-item {
  170. width: 130rpx;
  171. height: 100%;
  172. display: flex;
  173. flex-direction: column;
  174. align-items: center;
  175. justify-content: space-between;
  176. .item-spn {
  177. font-size: 32rpx;
  178. font-family: PingFangSC-bold;
  179. }
  180. .spnVal {
  181. color: rgba(7, 190, 167, 1);
  182. }
  183. }
  184. }
  185. }
  186. .app-view {
  187. width: 100%;
  188. height: 200rpx;
  189. display: flex;
  190. justify-content: space-between;
  191. .app-item {
  192. width: 48%;
  193. height: 100%;
  194. border-radius: 16rpx;
  195. background-color: rgba(255, 255, 255, 1);
  196. border: 2rpx solid rgba(187, 187, 187, 0.5);
  197. padding: 20rpx;
  198. box-sizing: border-box;
  199. .app-title {
  200. font-size: 32rpx;
  201. font-family: SourceHanSansSC-bold;
  202. color: rgba(0, 0, 0, 1);
  203. }
  204. .app-item-mut {
  205. width: 100%;
  206. height: 120rpx;
  207. display: flex;
  208. justify-content: space-between;
  209. align-items: center;
  210. .app-item-spn {
  211. color: rgba(154, 154, 154, 0.8);
  212. font-size: 20rpx;
  213. font-family: AlibabaPuHui-medium;
  214. width: 140rpx;
  215. height: 50rpx;
  216. }
  217. .app-item-img {
  218. width: 140rpx;
  219. height: 106.68rpx;
  220. background-size: 100% 100%;
  221. }
  222. .app-item-img-pan {
  223. width: 140rpx;
  224. height: 106.68rpx;
  225. background-size: 100% 100%;
  226. }
  227. }
  228. }
  229. }
  230. .message-view {
  231. width: 100%;
  232. margin-top: 20rpx;
  233. position: relative;
  234. padding-top: 20rpx;
  235. margin-bottom: 20rpx;
  236. .all-message {
  237. position: absolute;
  238. right: 0rpx;
  239. top: 5rpx;
  240. width: 117rpx;
  241. height: 20rpx;
  242. color: rgba(1, 169, 146, 1);
  243. font-size: 20rpx;
  244. font-family: AlibabaPuHui-regular;
  245. display: flex;
  246. align-items: center;
  247. }
  248. .message-item {
  249. margin-top: 20rpx;
  250. width: 100%;
  251. height: 50rpx;
  252. border-radius: 25rpx;
  253. display: flex;
  254. justify-content: space-between;
  255. align-items: center;
  256. padding: 0 20rpx;
  257. box-sizing: border-box;
  258. color: rgba(0, 0, 0, 0.8);
  259. font-size: 20rpx;
  260. text-align: left;
  261. font-family: AlibabaPuHui-regular;
  262. background-color: rgba(255, 255, 255, 1);
  263. box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.4);
  264. .item-mesage {
  265. overflow: hidden;
  266. white-space: nowrap;
  267. text-overflow: ellipsis;
  268. }
  269. .fot-btn {
  270. width: 170rpx;
  271. margin-left: 20rpx;
  272. }
  273. }
  274. }
  275. .all-app {
  276. width: 100%;
  277. .all-title {
  278. width: 100%;
  279. height: 46rpx;
  280. color: rgba(0, 0, 0, 0.8);
  281. font-size: 32rpx;
  282. text-align: left;
  283. font-family: AlibabaPuHui-bold;
  284. }
  285. .all-app-view {
  286. margin-top: 20rpx;
  287. width: 100%;
  288. height: auto;
  289. background-color: #fff;
  290. border-radius: 20rpx;
  291. display: flex;
  292. flex-wrap: wrap;
  293. align-content: flex-start;
  294. padding-bottom: 50rpx;
  295. .app-view-item {
  296. width: 24%;
  297. margin-left: 7rpx;
  298. height: 150rpx;
  299. display: flex;
  300. flex-direction: column;
  301. align-items: center;
  302. margin-top: 30rpx;
  303. margin-bottom: 20rpx;
  304. justify-content: space-between;
  305. .app-item-img {
  306. width: 102rpx;
  307. height: 102rpx;
  308. border-radius: 20rpx;
  309. display: flex;
  310. align-items: center;
  311. justify-content: center;
  312. .app-item-svg {
  313. width: 80rpx;
  314. height: 80rpx;
  315. background-size: 100% 100%;
  316. }
  317. }
  318. .app-item-text {
  319. width: 100%;
  320. height: 34rpx;
  321. color: rgba(0, 0, 0, 0.8);
  322. font-size: 28rpx;
  323. text-align: center;
  324. font-family: AlibabaPuHui-bold;
  325. }
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. uni-page-body {
  333. width: 100%;
  334. height: 100%;
  335. }
  336. uni-page-wrapper {
  337. width: 100%;
  338. height: 100%;
  339. }
  340. uni-page {
  341. width: 100%;
  342. height: 100%;
  343. }
  344. </style>