index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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: 170px; background-color: #e8f3fe">
  13. <image src="https://chenglantimes.com/prod-api/profile/upload/2024/08/23/1724382299288.jpg" mode="widthFix"></image>
  14. <view class="title" style="color: #8fb5d7">
  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: 65px; background-color: rgb(239 248 255)">
  24. <view class="icon" style="color: #88a8d5">&#xe630;</view>
  25. <view class="title" style="color: #88a8d5">
  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: 65px; background-color: #f6f4fe">
  33. <view class="icon" style="color: #cdccfe">&#xec7d;</view>
  34. <view class="title"></view>
  35. <view class="title" style="color: #a294e2">
  36. <view>医院指南</view>
  37. <view class="desc" style="color: #a294e2">医院简介</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!--健康知识-->
  44. <view class="tg" @click="tb('/pages/follow/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, login = false) {
  120. if (login) {
  121. if (this.hasLogin()) {
  122. uni.navigateTo({ url: url });
  123. } else {
  124. uni.navigateTo({ url: '/pages/user/login' });
  125. }
  126. } else {
  127. uni.navigateTo({ url: url });
  128. }
  129. },
  130. tb(url) {
  131. if (this.hasLogin()) {
  132. if (this.getUser().userId) {
  133. uni.navigateTo({ url: '/pages/follow/doctor/index?type=1' });
  134. } else {
  135. uni.navigateTo({ url: url });
  136. }
  137. } else {
  138. uni.navigateTo({ url: '/pages/user/login' });
  139. }
  140. }
  141. }
  142. };
  143. </script>
  144. <style lang="scss">
  145. page {
  146. background-color: white;
  147. }
  148. .banner {
  149. width: 100%;
  150. height: 140px;
  151. border-radius: 7px;
  152. }
  153. .notice {
  154. margin-top: 5px;
  155. border-radius: 5px;
  156. overflow: hidden;
  157. }
  158. .flow {
  159. padding-top: 5px;
  160. margin-left: -5px;
  161. margin-right: -5px;
  162. overflow: hidden;
  163. .item {
  164. border-radius: 10px;
  165. float: left;
  166. width: 50%;
  167. .out {
  168. padding: 5px;
  169. .int {
  170. padding: 15px;
  171. background-color: white;
  172. overflow: hidden;
  173. border-radius: 9px;
  174. text-align: center;
  175. position: relative;
  176. animation: bounceIn 1s;
  177. .icon {
  178. margin: 0 auto;
  179. line-height: 39px;
  180. color: $main-color;
  181. font-size: 45px;
  182. position: absolute;
  183. right: 10px;
  184. bottom: 20px;
  185. }
  186. image {
  187. position: absolute;
  188. width: 200px;
  189. height: 100px;
  190. bottom: 0px;
  191. right: 0px;
  192. }
  193. .title {
  194. float: left;
  195. font-size: 18px;
  196. text-align: left;
  197. font-weight: bold;
  198. .desc {
  199. font-size: 14px;
  200. padding-top: 5px;
  201. font-weight: normal;
  202. }
  203. }
  204. }
  205. }
  206. }
  207. }
  208. .tg {
  209. margin-top: 5px;
  210. overflow: hidden;
  211. image {
  212. width: 100%;
  213. border-radius: 50px;
  214. animation: bounceIn 1s;
  215. height: 66px;
  216. }
  217. .tit {
  218. text-align: left;
  219. float: left;
  220. margin-top: -60px;
  221. left: 116px;
  222. position: relative;
  223. font-weight: bold;
  224. color: white;
  225. font-size: 18px;
  226. .desc {
  227. font-size: 14px;
  228. font-weight: normal;
  229. }
  230. }
  231. }
  232. .bos {
  233. background-color: white;
  234. border-radius: 7px;
  235. overflow: hidden;
  236. padding: 12px 0px 0px 0px;
  237. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
  238. padding: 12px;
  239. margin-top: 12px;
  240. .gg {
  241. font-weight: bold;
  242. margin-bottom: 5px;
  243. overflow: hidden;
  244. .title {
  245. margin-left: 10px;
  246. }
  247. .bor {
  248. width: 5px;
  249. height: 12px;
  250. background-color: $main-color;
  251. border-radius: 20px;
  252. float: left;
  253. margin-top: -16px;
  254. }
  255. .more {
  256. float: right;
  257. font-size: 14px;
  258. font-weight: normal;
  259. margin-top: -20px;
  260. }
  261. }
  262. .doctor {
  263. display: flex;
  264. .item {
  265. padding-top: 10px;
  266. font-size: 15px;
  267. width: 105px;
  268. text-align: center;
  269. image {
  270. width: 80px;
  271. height: 105px;
  272. border-radius: 5px;
  273. background-color: aliceblue;
  274. }
  275. .title {
  276. padding-top: 3px;
  277. font-size: 14px;
  278. }
  279. }
  280. }
  281. .knowledgeList {
  282. .item {
  283. padding: 10px 0px 10px 0px;
  284. border-bottom: 1px solid $line;
  285. &:last-child {
  286. border: 0px;
  287. }
  288. .title {
  289. font-size: 15px;
  290. }
  291. .desc {
  292. font-size: 14px;
  293. padding-top: 5px;
  294. color: #909090;
  295. text {
  296. padding-right: 25px;
  297. }
  298. }
  299. }
  300. }
  301. }
  302. </style>