index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <view class="main">
  3. <image src="https://chenglantimes.com/prod-api/profile/upload/2024/07/27/1722074138272.jpg" mode="widthFix" class="banner"></image>
  4. <!--通知公告-->
  5. <view class="notice">
  6. <u-notice-bar color="#545555" :text="noticeList" :step="true" direction="column" mode="link" bgColor="white" speed="300" url="/pages/notice/index"></u-notice-bar>
  7. </view>
  8. <!--卡片菜单-->
  9. <view class="flow">
  10. <view class="item" @click="go('/pages/doctor/index')">
  11. <view class="out">
  12. <view class="int" style="height: 217px; background-color: #d9e8fd">
  13. <view class="icon" style="color: #4687ed">&#xe62d;</view>
  14. <view class="title">
  15. <view>医生团队</view>
  16. <view class="desc">权威团队服务</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="item">
  22. <view class="out" @click="go('/pages/department/index')">
  23. <view class="int" style="height: 87px; background-color: #ddf8f3">
  24. <view class="icon" style="color: #22b789">&#xe606;</view>
  25. <view class="title">
  26. <view>科室介绍</view>
  27. <view class="desc">众多先进设备</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="out" @click="go('/pages/introduction/index')">
  32. <view class="int" style="height: 90px; background-color: #fff3e3">
  33. <view class="icon" style="color: #fe9b01">&#xe636;</view>
  34. <view class="title"></view>
  35. <view class="title">
  36. <view>医院指南</view>
  37. <view class="desc">医院简介</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!--健康知识-->
  44. <view class="tg" @click="go('/pages/knowledge/index')">
  45. <image src="https://chenglantimes.com/prod-api/profile/upload/2024/07/27/1722076102395.jpg" mode="widthFix"></image>
  46. <view class="tit">
  47. <view>知识课堂</view>
  48. <view class="desc">每天一个健康小知识</view>
  49. </view>
  50. </view>
  51. <!--权威专家-->
  52. <view class="bos" style="margin-top: 8px" v-if="expertList.length > 0">
  53. <view class="gg">
  54. <view class="title">权威专家</view>
  55. <view class="bor"></view>
  56. <view class="more" @click="go('/pages/doctor/index')">
  57. <text>更多</text>
  58. <text class="icon">&#xe62b;</text>
  59. </view>
  60. </view>
  61. <u-scroll-list :indicator="true" indicatorColor="#e0e0e0">
  62. <view class="doctor">
  63. <view class="item" v-for="(item, index) in expertList" :key="index" @click="go('/pages/doctor/detail?id=' + item.userId)">
  64. <image :src="ip + item.avatar" mode="scaleToFill" class="avatar"></image>
  65. <view class="title">{{ item.nickName }}</view>
  66. </view>
  67. </view>
  68. </u-scroll-list>
  69. </view>
  70. <!--健康知识-->
  71. <view class="bos">
  72. <view class="gg">
  73. <view class="title">健康知识</view>
  74. <view class="bor"></view>
  75. <view class="more" @click="go('/pages/knowledge/index')">
  76. <text>更多</text>
  77. <text class="icon">&#xe62b;</text>
  78. </view>
  79. </view>
  80. <view class="knowledgeList">
  81. <view class="item" v-for="(item, index) in knowledgeList" :key="index" @click="go('/pages/knowledge/detail?id=' + item.id)">
  82. <view class="title omit">
  83. <text class="icon" v-if="item.top === 1">&#xe61f;</text>
  84. <text>{{ item.title }}</text>
  85. </view>
  86. <view class="desc">
  87. <text>{{ item.type }}</text>
  88. <text>{{ item.createTime.substring(5, 10) }}</text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. export default {
  97. data() {
  98. return {
  99. ip: this.http.ip,
  100. noticeList: [],
  101. expertList: [],
  102. knowledgeList: []
  103. };
  104. },
  105. onLoad() {
  106. this.getData();
  107. },
  108. methods: {
  109. getData() {
  110. this.http.request({
  111. url: '/app/home/index',
  112. success: (res) => {
  113. this.knowledgeList = res.data.data.knowledgeList;
  114. this.expertList = res.data.data.expertList;
  115. this.noticeList = res.data.data.noticeList.map((item) => item.title);
  116. }
  117. });
  118. },
  119. go(url) {
  120. uni.navigateTo({ url: url });
  121. }
  122. }
  123. };
  124. </script>
  125. <style lang="scss">
  126. page {
  127. background-color: white;
  128. }
  129. .banner {
  130. width: 100%;
  131. border-radius: 7px;
  132. }
  133. .notice {
  134. margin-top: 5px;
  135. border-radius: 5px;
  136. overflow: hidden;
  137. }
  138. .flow {
  139. padding-top: 5px;
  140. margin-left: -5px;
  141. margin-right: -5px;
  142. overflow: hidden;
  143. .item {
  144. border-radius: 10px;
  145. float: left;
  146. width: 50%;
  147. .out {
  148. padding: 5px;
  149. .int {
  150. padding: 15px;
  151. background-color: white;
  152. overflow: hidden;
  153. border-radius: 9px;
  154. text-align: center;
  155. position: relative;
  156. .icon {
  157. margin: 0 auto;
  158. line-height: 39px;
  159. color: $main-color;
  160. font-size: 57px;
  161. position: absolute;
  162. right: 10px;
  163. bottom: 20px;
  164. }
  165. .title {
  166. padding-top: 8px;
  167. float: left;
  168. font-size: 18px;
  169. text-align: left;
  170. font-weight: bold;
  171. .desc {
  172. font-size: 14px;
  173. padding-top: 5px;
  174. color: $font-c;
  175. font-weight: normal;
  176. }
  177. }
  178. }
  179. }
  180. }
  181. }
  182. .tg {
  183. margin-top: 5px;
  184. overflow: hidden;
  185. image {
  186. width: 100%;
  187. border-radius: 50px;
  188. }
  189. .tit {
  190. text-align: left;
  191. float: left;
  192. margin-top: -60px;
  193. left: 116px;
  194. position: relative;
  195. font-weight: bold;
  196. color: white;
  197. font-size: 18px;
  198. .desc {
  199. font-size: 14px;
  200. font-weight: normal;
  201. }
  202. }
  203. }
  204. .bos {
  205. background-color: white;
  206. border-radius: 7px;
  207. overflow: hidden;
  208. padding: 12px 0px 0px 0px;
  209. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
  210. padding: 12px;
  211. margin-top: 12px;
  212. .gg {
  213. font-weight: bold;
  214. margin-bottom: 5px;
  215. overflow: hidden;
  216. .title {
  217. margin-left: 10px;
  218. }
  219. .bor {
  220. width: 5px;
  221. height: 12px;
  222. background-color: $main-color;
  223. border-radius: 20px;
  224. float: left;
  225. margin-top: -16px;
  226. }
  227. .more {
  228. float: right;
  229. font-size: 14px;
  230. font-weight: normal;
  231. margin-top: -20px;
  232. }
  233. }
  234. .doctor {
  235. display: flex;
  236. .item {
  237. padding-top: 10px;
  238. font-size: 15px;
  239. width: 105px;
  240. text-align: center;
  241. image {
  242. width: 80px;
  243. height: 105px;
  244. border-radius: 5px;
  245. }
  246. .title {
  247. padding-top: 3px;
  248. font-size: 14px;
  249. }
  250. }
  251. }
  252. .knowledgeList {
  253. .item {
  254. padding: 10px 0px 10px 0px;
  255. border-bottom: 1px solid $line;
  256. &:last-child {
  257. border: 0px;
  258. }
  259. .title {
  260. font-size: 15px;
  261. }
  262. .desc {
  263. font-size: 14px;
  264. padding-top: 5px;
  265. color: #909090;
  266. text {
  267. padding-right: 25px;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. </style>