home.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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.setStorageSync('fromHome', '1');
  79. uni.switchTab({
  80. url: '/pages/platform/index',
  81. success: function(res) {}
  82. });
  83. },
  84. //获取当前用户管理的医疗机构
  85. getInstData() {
  86. this.$http('common.getInst', {}, '加载中', true).then((res) => {
  87. if (res.success == true) {
  88. if (res.success == true && res.data.length) {
  89. this.appData = res.data;
  90. this.setInst({
  91. spdId: res.data[0].spdId,
  92. spdName: res.data[0].spdName,
  93. orgId: res.data[0].orgId
  94. })
  95. }
  96. }
  97. })
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .home-wrap {
  104. width: 100%;
  105. height: 100%;
  106. background-color: #F5F5F5;
  107. .home-title {
  108. width: 100%;
  109. height: auto;
  110. .title-bac {
  111. width: 100%;
  112. height: 392rpx;
  113. border-radius: 0rpx 0rpx 40rpx 40rpx;
  114. 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%);
  115. padding: 20rpx;
  116. box-sizing: border-box;
  117. .roomt {
  118. width: 100%;
  119. height: 70rpx;
  120. display: flex;
  121. align-items: center;
  122. justify-content: space-between;
  123. .rom-spn {
  124. color: rgba(255, 255, 255, 0.9);
  125. font-size: 36rpx;
  126. text-align: left;
  127. font-family: PingFangSC-bold;
  128. }
  129. }
  130. .section-view {
  131. width: 97%;
  132. margin: 70rpx auto 40rpx auto;
  133. height: 210rpx;
  134. background-color: rgba(255, 255, 255, 1);
  135. box-shadow: -2rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.4);
  136. border-radius: 20rpx;
  137. padding: 20rpx;
  138. box-sizing: border-box;
  139. margin-top: 130rpx;
  140. .user-cont {
  141. width: 100%;
  142. height: 50rpx;
  143. .user-spn {
  144. color: rgba(0, 0, 0, 0.8);
  145. font-size: 36rpx;
  146. font-family: AlibabaPuHui-medium;
  147. }
  148. .spnr {
  149. margin-left: 20rpx;
  150. font-size: 35rpx;
  151. font-family: AlibabaPuHui-medium;
  152. }
  153. }
  154. .curent-cont {
  155. width: 100%;
  156. height: 100rpx;
  157. display: flex;
  158. align-items: center;
  159. .current-spn {
  160. font-size: 32rpx;
  161. color: #5AB7A5;
  162. }
  163. }
  164. .sec-data {
  165. width: 100%;
  166. height: 110rpx;
  167. display: flex;
  168. justify-content: space-around;
  169. margin-top: 60rpx;
  170. .sec-item {
  171. width: 130rpx;
  172. height: 100%;
  173. display: flex;
  174. flex-direction: column;
  175. align-items: center;
  176. justify-content: space-between;
  177. .item-spn {
  178. font-size: 32rpx;
  179. font-family: PingFangSC-bold;
  180. }
  181. .spnVal {
  182. color: rgba(7, 190, 167, 1);
  183. }
  184. }
  185. }
  186. }
  187. .app-view {
  188. width: 100%;
  189. height: 200rpx;
  190. display: flex;
  191. justify-content: space-between;
  192. .app-item {
  193. width: 48%;
  194. height: 100%;
  195. border-radius: 16rpx;
  196. background-color: rgba(255, 255, 255, 1);
  197. border: 2rpx solid rgba(187, 187, 187, 0.5);
  198. padding: 20rpx;
  199. box-sizing: border-box;
  200. .app-title {
  201. font-size: 32rpx;
  202. font-family: SourceHanSansSC-bold;
  203. color: rgba(0, 0, 0, 1);
  204. }
  205. .app-item-mut {
  206. width: 100%;
  207. height: 120rpx;
  208. display: flex;
  209. justify-content: space-between;
  210. align-items: center;
  211. .app-item-spn {
  212. color: rgba(154, 154, 154, 0.8);
  213. font-size: 20rpx;
  214. font-family: AlibabaPuHui-medium;
  215. width: 140rpx;
  216. height: 50rpx;
  217. }
  218. .app-item-img {
  219. width: 140rpx;
  220. height: 106.68rpx;
  221. background-size: 100% 100%;
  222. }
  223. .app-item-img-pan {
  224. width: 140rpx;
  225. height: 106.68rpx;
  226. background-size: 100% 100%;
  227. }
  228. }
  229. }
  230. }
  231. .message-view {
  232. width: 100%;
  233. margin-top: 20rpx;
  234. position: relative;
  235. padding-top: 20rpx;
  236. margin-bottom: 20rpx;
  237. .all-message {
  238. position: absolute;
  239. right: 0rpx;
  240. top: 5rpx;
  241. width: 117rpx;
  242. height: 20rpx;
  243. color: rgba(1, 169, 146, 1);
  244. font-size: 20rpx;
  245. font-family: AlibabaPuHui-regular;
  246. display: flex;
  247. align-items: center;
  248. }
  249. .message-item {
  250. margin-top: 20rpx;
  251. width: 100%;
  252. height: 50rpx;
  253. border-radius: 25rpx;
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. padding: 0 20rpx;
  258. box-sizing: border-box;
  259. color: rgba(0, 0, 0, 0.8);
  260. font-size: 20rpx;
  261. text-align: left;
  262. font-family: AlibabaPuHui-regular;
  263. background-color: rgba(255, 255, 255, 1);
  264. box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.4);
  265. .item-mesage {
  266. overflow: hidden;
  267. white-space: nowrap;
  268. text-overflow: ellipsis;
  269. }
  270. .fot-btn {
  271. width: 170rpx;
  272. margin-left: 20rpx;
  273. }
  274. }
  275. }
  276. .all-app {
  277. width: 100%;
  278. .all-title {
  279. width: 100%;
  280. height: 46rpx;
  281. color: rgba(0, 0, 0, 0.8);
  282. font-size: 32rpx;
  283. text-align: left;
  284. font-family: AlibabaPuHui-bold;
  285. }
  286. .all-app-view {
  287. margin-top: 20rpx;
  288. width: 100%;
  289. height: auto;
  290. background-color: #fff;
  291. border-radius: 20rpx;
  292. display: flex;
  293. flex-wrap: wrap;
  294. align-content: flex-start;
  295. padding-bottom: 50rpx;
  296. .app-view-item {
  297. width: 24%;
  298. margin-left: 7rpx;
  299. height: 150rpx;
  300. display: flex;
  301. flex-direction: column;
  302. align-items: center;
  303. margin-top: 30rpx;
  304. margin-bottom: 20rpx;
  305. justify-content: space-between;
  306. .app-item-img {
  307. width: 102rpx;
  308. height: 102rpx;
  309. border-radius: 20rpx;
  310. display: flex;
  311. align-items: center;
  312. justify-content: center;
  313. .app-item-svg {
  314. width: 80rpx;
  315. height: 80rpx;
  316. background-size: 100% 100%;
  317. }
  318. }
  319. .app-item-text {
  320. width: 100%;
  321. height: 34rpx;
  322. color: rgba(0, 0, 0, 0.8);
  323. font-size: 28rpx;
  324. text-align: center;
  325. font-family: AlibabaPuHui-bold;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. uni-page-body {
  334. width: 100%;
  335. height: 100%;
  336. }
  337. uni-page-wrapper {
  338. width: 100%;
  339. height: 100%;
  340. }
  341. uni-page {
  342. width: 100%;
  343. height: 100%;
  344. }
  345. </style>