index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <div class="hospital-overview-warp">
  3. <div class="hospital-overview-header">
  4. <el-image
  5. v-if="imgSrc"
  6. class="header-image"
  7. fit="fill"
  8. :src="imgSrc"
  9. ></el-image>
  10. <el-image
  11. v-else
  12. class="header-image"
  13. fit="fill"
  14. :src="require('@/assets/images/home/otherHeader.png')"
  15. ></el-image>
  16. </div>
  17. <div class="hospital-overview-content-warp">
  18. <div class="hospital-overview-content">
  19. <div class="content-right">
  20. <component
  21. :is="componentName"
  22. :title="currentTabsLabel"
  23. :searchTitle="contentTitle"
  24. :content="currentContent"
  25. :contentTitle="currentContentTitle"
  26. :dutyContent="currentDutyContent"
  27. @clickOverview="clickOverview"
  28. @backHome="backHome"
  29. :backBtn="true"
  30. :overviewFlag="true"
  31. :moreFlag="false"
  32. :limitNum="60"
  33. :total="currentTotal"
  34. :paginationFlag="false"
  35. @sizeCurrentChange="sizeCurrentChange"
  36. >
  37. </component>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="home-container-bottom-warp">
  42. <div class="home-container-bottom">
  43. <div class="bottom-links">
  44. <a href="#">网站地图</a> | <a href="#">版权申请</a> | <a href="#">交通路线</a> | <a href="#">联系我们</a>
  45. </div>
  46. <div class="bottom-info">
  47. <div class="info-item">
  48. <i class="el-icon-location"></i>
  49. <span>医院地址:江苏省宿迁沭阳县沭城镇苏州东路3号</span>
  50. </div>
  51. <div class="info-item">
  52. <i class="el-icon-time"></i>
  53. <span>门诊时间:08:00 —— 18:00</span>
  54. </div>
  55. <div class="info-item">
  56. <i class="el-icon-phone"></i>
  57. <span>免费热线:(0527) 8832 3979</span>
  58. </div>
  59. </div>
  60. <div class="qrcode-container">
  61. <div class="qrcode-box">
  62. <img src="@/assets/images/home/qrcode.png" alt="微信公众号" class="qrcode-img">
  63. <div class="qrcode-text">微信公众号</div>
  64. <div class="triangle"></div>
  65. </div>
  66. </div>
  67. <div class="copyright">
  68. <span>苏ICP 备10101461号-5 版权所有@沭阳铭和医院</span>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import introductionOne from '@/components/searchMoreDisplayColumn/index';
  76. import overview from '@/components/overview/index';
  77. import contentManagementAPI from "@/api/contentManagement";
  78. import advertisementAPI from "@/api/advertisement";
  79. import {getUploadFilePath} from '@/config/index';
  80. export default {
  81. name: "hospital-overview",
  82. components: {
  83. introductionOne,
  84. overview
  85. },
  86. watch: {
  87. '$route.query.contentTitle': {
  88. handler(newVal) {
  89. if (newVal) {
  90. this.contentTitle = newVal;
  91. this.currentPageSize = 10;
  92. this.currentCurrentPage = 1;
  93. this.backHome();
  94. this.getContentManagementList(this.contentTitle);
  95. }
  96. },
  97. immediate: true
  98. }
  99. },
  100. data() {
  101. return {
  102. imgSrc: '',
  103. currentTabs:"0",
  104. currentTotal: 0,
  105. currentPageSize: 10,
  106. currentCurrentPage: 1,
  107. currentTabsLabel:"搜索结果",
  108. originCurrentTabsLabel:"搜索结果",
  109. currentContent:[],
  110. currentContentTitle: "",
  111. currentDutyContent: "",
  112. leftTabs: [
  113. {
  114. label:"搜索结果",
  115. value:"0",
  116. componentName: "introductionOne"
  117. },
  118. ],
  119. componentName: "introductionOne",
  120. currentComponentName: "introductionOne",
  121. contentTitle: this.$route.query.contentTitle ?? "",
  122. }
  123. },
  124. methods: {
  125. clickOverview(value) {
  126. this.componentName = 'overview'
  127. this.getContentManagementById(value)
  128. },
  129. backHome() {
  130. this.componentName = this.currentComponentName
  131. this.currentTabsLabel = this.originCurrentTabsLabel
  132. },
  133. sizeCurrentChange(pageSize,currentPage) {
  134. this.currentPageSize = pageSize
  135. this.currentCurrentPage = currentPage
  136. this.getContentManagementList(this.contentTitle)
  137. },
  138. getContentManagementList(contentTitle) {
  139. // let param = { status: "1" , pageSize:this.currentPageSize, currentPage:this.currentCurrentPage, contentTitle:contentTitle }
  140. let param = { status: "1" , contentTitle:contentTitle }
  141. contentManagementAPI.getContentManagementList(param).then(res => {
  142. if (res.code === 1000) {
  143. // let tableData = res.data.list
  144. // this.currentTotal = res.data.total
  145. // this.currentContent = JSON.parse(JSON.stringify(tableData))
  146. let tableData = res.data
  147. this.currentTotal = res.data.length
  148. this.currentContent = JSON.parse(JSON.stringify(tableData))
  149. } else {
  150. this.$message.error("获取数据失败,请重试")
  151. }
  152. }).catch(err => {
  153. this.$message.error("网络异常,请重试")
  154. })
  155. },
  156. getContentManagementById(id) {
  157. let param = { id }
  158. contentManagementAPI.getContentManagementById(param).then(res => {
  159. if (res.code === 1000) {
  160. if(res.data.contentText) {
  161. this.currentContentTitle = res.data.contentTitle;
  162. this.currentDutyContent = res.data.contentText;
  163. }
  164. } else {
  165. this.$message.error("获取数据失败,请重试")
  166. }
  167. }).catch(err => {
  168. this.$message.error("网络异常,请重试")
  169. })
  170. },
  171. getFileList() {
  172. advertisementAPI
  173. .getAdvertisementList({imageType:"1"})
  174. .then((res) => {
  175. if (res.code === 1000 && res.data.length > 0) {
  176. let arrUp = [];
  177. res.data.forEach((item) => {
  178. arrUp.push(getUploadFilePath(item.imageFile));
  179. });
  180. this.imgSrc = arrUp[0]
  181. }
  182. })
  183. .catch((err) => {});
  184. },
  185. },
  186. mounted(){
  187. if(this.$route.query && (JSON.stringify(this.$route.query) !== '{}')) {
  188. let type = '0'
  189. this.currentContentTitle = ''
  190. this.currentDutyContent = ''
  191. this.currentTabs = this.leftTabs[type].value
  192. this.componentName = this.leftTabs[type].componentName
  193. this.currentComponentName = this.leftTabs[type].componentName
  194. this.currentTabsLabel = this.leftTabs[type].label
  195. this.originCurrentTabsLabel = this.leftTabs[type].label
  196. this.currentPageSize = 10
  197. this.currentCurrentPage = 1
  198. this.currentTotal = 0
  199. this.currentContent = []
  200. //类型(0:医保服务指南,1:医保政策解读,2、医院医保动态,3、医院动态,4、通知公告,5、健康园地,6、名医有约,7、人才招聘,8、就医指南)
  201. if(type === '0') {
  202. this.getContentManagementList(this.contentTitle)
  203. }
  204. if(this.$route.query.id) {
  205. this.componentName = 'overview'
  206. this.getContentManagementById(this.$route.query.id)
  207. }
  208. }else {
  209. this.getContentManagementList(this.contentTitle)
  210. }
  211. this.getFileList()
  212. }
  213. }
  214. </script>
  215. <style scoped lang="scss">
  216. .hospital-overview-warp {
  217. width: 100%;
  218. background-color: #f5f5f5;
  219. cursor: default;
  220. .hospital-overview-header {
  221. width: 100%;
  222. height: 150px;
  223. .header-image {
  224. width: 100%;
  225. height: 150px;
  226. }
  227. }
  228. .hospital-overview-content-warp {
  229. width: 100%;
  230. display: flex;
  231. justify-content: center;
  232. margin-top: 20px;
  233. .hospital-overview-content {
  234. width: 1168px;
  235. display: flex;
  236. justify-content: space-between;
  237. .content-right {
  238. width: 100%;
  239. min-height: 500px;
  240. margin-bottom: 20px;
  241. }
  242. }
  243. }
  244. .home-container-bottom-warp {
  245. width: 100%;
  246. height: 283px;
  247. background-color: #333;
  248. color: #fff;
  249. padding: 70px 0 20px;
  250. box-sizing: border-box;
  251. .home-container-bottom {
  252. width: 1200px;
  253. margin: 0 auto;
  254. position: relative;
  255. .bottom-links {
  256. text-align: left;
  257. margin-bottom: 13px;
  258. a {
  259. color: #fff;
  260. text-decoration: none;
  261. margin: 0 10px;
  262. font-size: 12px;
  263. line-height: 17px;
  264. &:hover {
  265. text-decoration: underline;
  266. }
  267. }
  268. }
  269. .bottom-info {
  270. display: flex;
  271. flex-direction: column;
  272. // align-items: center;
  273. margin-bottom: 20px;
  274. .info-item {
  275. margin-bottom: 15px;
  276. font-size: 12px;
  277. line-height: 17px;
  278. display: flex;
  279. align-items: center;
  280. i {
  281. margin-right: 10px;
  282. margin-left: 10px;
  283. font-size: 16px;
  284. line-height: 17px;
  285. }
  286. }
  287. }
  288. .qrcode-container {
  289. position: absolute;
  290. right: 0;
  291. top: 0;
  292. .qrcode-box {
  293. width: 120px;
  294. position: relative;
  295. text-align: center;
  296. .qrcode-img {
  297. width: 94px;
  298. height: 94px;
  299. background-color: #fff;
  300. padding: 6px;
  301. border-radius: 6px;
  302. }
  303. .qrcode-text {
  304. color: #fff;
  305. font-size: 12px;
  306. margin-top: 20px;
  307. }
  308. .triangle {
  309. width: 0;
  310. height: 0;
  311. border-left: 10px solid transparent;
  312. border-right: 10px solid transparent;
  313. border-top: 10px solid #fff;
  314. position: absolute;
  315. bottom: 30px;
  316. left: 50%;
  317. transform: translateX(-50%);
  318. }
  319. }
  320. }
  321. .copyright {
  322. text-align: center;
  323. font-size: 12px;
  324. color: rgba(255, 255, 255, 0.7);
  325. margin-top: 50px;
  326. a {
  327. color: rgba(255, 255, 255, 0.7);
  328. text-decoration: none;
  329. &:hover {
  330. text-decoration: underline;
  331. }
  332. }
  333. }
  334. }
  335. }
  336. }
  337. </style>