microHome.vue 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. <template>
  2. <div class="page_home">
  3. <div class="swiper-slide">
  4. <div v-for="item in this.patientModels" :key="item.id">
  5. <!-- 轮播图 -->
  6. <div class="banner" v-if="item.mode_type == 1">
  7. <div class="swiper-container bannerSwiper">
  8. <div class="swiper-wrapper">
  9. <div class="swiper-slide" v-for="it in item.PatientEditpiclink" :key="it.id">
  10. <a :href="it.linkaddress.length > 0 ? it.linkaddress: 'javascript:;'">
  11. <img class="imgtwo" :src="it.images" />
  12. </a>
  13. </div>
  14. </div>
  15. <!-- 如果需要分页器 -->
  16. <div class="swiper-pagination"></div>
  17. </div>
  18. </div>
  19. <!-- 魔方导航 -->
  20. <div class="btnList" v-if="item.mode_type== 8">
  21. <div
  22. class="btnOne"
  23. v-for="it in item.Editmargin"
  24. :key="it.id"
  25. @click="NavigationClick(it.margtitle,it.marginaddress,it.user_org_id)"
  26. >
  27. <div>
  28. <img :src="it.margimage" alt />
  29. </div>
  30. <div>
  31. <p class="title">{{it.margtitle}}</p>
  32. </div>
  33. </div>
  34. </div>
  35. <!-- 文章列表 -->
  36. <div class="dynamic" v-if="item.mode_type == 6">
  37. <div class="common_title">
  38. <div class="one"></div>
  39. <div class="dynamicTxt">{{item.title}}</div>
  40. <div class="more" @click="articlemore(item.id,item.user_org_id)">
  41. <p>
  42. 查看更多
  43. <i class="iconfont">&#xe632;</i>
  44. </p>
  45. </div>
  46. </div>
  47. <div class="content" @click="articlemore(item.id,item.user_org_id)">
  48. <div class="contentOne" v-for="it in Articlelist" :key="it.id">
  49. <div class="img">
  50. <img :src="it.imgs" style="width:100%;height:100%" alt />
  51. </div>
  52. <div class="detail" v-if="it.title !=''">
  53. <p class="detailTitle">{{it.title}}</p>
  54. <!-- <p class="detailMessage">{{it.content}}</p> -->
  55. </div>
  56. <div class="detail" v-else-if="it.title ==''">
  57. <div class="noImg">
  58. <img src="../../../static/images/none2.png" alt />
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <!-- 医院介绍 -->
  65. <div class="common" v-if="item.mode_type == 2">
  66. <div class="common_title">
  67. <div class="one"></div>
  68. <div class="dynamicTxt">{{item.title}}</div>
  69. <div class="more" @click="hispitalmore(item.id,item.user_org_id)">
  70. <p>
  71. 查看更多
  72. <i class="iconfont">&#xe632;</i>
  73. </p>
  74. </div>
  75. </div>
  76. <div class="commonBox">
  77. <div class="commonMessage" v-html="item.Hospitals.introduction" v-if="item.Hospitals.introduction!=''"></div>
  78. <div class="noImg" v-else-if="item.Hospitals.introduction == ''">
  79. <img src="../../../static/images/none2.png" alt />
  80. </div>
  81. </div>
  82. </div>
  83. <!-- 科室介绍 -->
  84. <div class="common" v-if="item.mode_type == 3">
  85. <div class="common_title">
  86. <div class="one"></div>
  87. <div class="dynamicTxt">{{item.title}}</div>
  88. <div class="more" @click="officemore(item.id,item.user_org_id)">
  89. <p>
  90. 查看更多
  91. <i class="iconfont">&#xe632;</i>
  92. </p>
  93. </div>
  94. </div>
  95. <div class="commonBox">
  96. <!-- <div class="commonImg">
  97. <img src="static\images\img2.png" alt />
  98. </div>-->
  99. <div class="commonMessage" v-html="item.Offices.introduction" v-if="item.Offices.introduction != ''"></div>
  100. <div class="noImg" v-else-if="item.Offices.introduction == ''">
  101. <img src="../../../static/images/none2.png" alt />
  102. </div>
  103. </div>
  104. </div>
  105. <!-- 医护团队 -->
  106. <div class="dynamic" v-if="item.mode_type == 4">
  107. <div class="common_title">
  108. <div class="one"></div>
  109. <div class="dynamicTxt">{{item.title}}</div>
  110. <div class="more" @click="docmore(item.id,item.user_org_id)">
  111. <p>
  112. 查看更多
  113. <i class="iconfont">&#xe632;</i>
  114. </p>
  115. </div>
  116. </div>
  117. <div class="content" @click="docmore(item.id,item.user_org_id)">
  118. <div class="contentOne" v-for="doc in item.Editdoctor" :key="doc.id">
  119. <div class="img">
  120. <img :src="doc.dochead" style="width:100%;height:100%" alt />
  121. </div>
  122. <div class="detail" v-if="doc.docintroduction != ''">
  123. <p class="detailTitle">{{doc.doc_name}}</p>
  124. <p class="detailMessage" v-html="doc.docintroduction"></p>
  125. </div>
  126. <div class="detail" v-else-if="doc.docintroduction ==''">
  127. <div class="noImg">
  128. <img src="../../../static/images/none2.png" alt />
  129. </div>
  130. </div>
  131. </div>
  132. <!-- <div class="contentOne">
  133. <div class="img">
  134. <img src="static\images\img1.jpg" alt />
  135. </div>
  136. <div class="detail">
  137. <p class="detailTitle">欧巧漫</p>
  138. <p class="detailMessage">苏安,女,主任医师,教授,妇产科主任,湖南省医学会理事、湖南省肿瘤学会委员瘤学肿瘤学会员......</p>
  139. </div>
  140. </div>-->
  141. </div>
  142. </div>
  143. <!-- 科室环境 -->
  144. <div class="dynamic" v-if="item.mode_type == 5">
  145. <div class="common_title">
  146. <div class="one"></div>
  147. <div class="dynamicTxt">{{item.title}}</div>
  148. <div class="more" @click="EnviromentClick(item.id,item.user_org_id)">
  149. <p>
  150. 查看更多
  151. <i class="iconfont">&#xe632;</i>
  152. </p>
  153. </div>
  154. </div>
  155. <div class="imgs">
  156. <div class="swiper-container imgSwiper">
  157. <div class="swiper-wrapper">
  158. <div class="swiper-slide carousel" v-for="itms in item.Enviroimages" :key="itms.id">
  159. <img class="img" :src="itms.enviroimages" :preview="itms.modeid" />
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. <!-- 医院活动 -->
  166. <div class="dynamic bottom" v-if="item.mode_type == 7">
  167. <div class="common_title">
  168. <div class="one"></div>
  169. <div class="dynamicTxt">{{item.title}}</div>
  170. <div class="more" @click="Activitiesmore(item.id,item.user_org_id)">
  171. <p>
  172. 查看更多
  173. <i class="iconfont">&#xe632;</i>
  174. </p>
  175. </div>
  176. </div>
  177. <div class="content" @click="Activitiesmore(item.id,item.user_org_id)">
  178. <div class="contentOne" v-for="it in Activitieslist" :key="it.id">
  179. <div class="img">
  180. <img :src="it.poster_photo" style="widht:100%;height:100%" alt />
  181. </div>
  182. <div class="detail" v-if="it.title != ''">
  183. <p class="detailTitle">{{it.title}}</p>
  184. </div>
  185. <div class="detail" v-else-if="it.title ==''">
  186. <div class="noImg">
  187. <img src="../../../static/images/none2.png" alt />
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <!-- tab切换 -->
  196. <div class="tabs">
  197. <ul class="tabList">
  198. <li
  199. class="tabOne"
  200. v-for="item in this.navigationdata"
  201. :key="item.id"
  202. @click="CallPhone(item.linktype,item.navaddress,item.user_org_id)"
  203. >
  204. <img :src="item.nonavimages" alt />
  205. <span>{{item.navtitle}}</span>
  206. </li>
  207. </ul>
  208. </div>
  209. </div>
  210. </template>
  211. <script>
  212. import Swiper from "swiper";
  213. import $ from "jquery";
  214. import {
  215. getHospitaldata,
  216. getArticlelist,
  217. getActivities,
  218. getDefalutNavigationData,
  219. getData
  220. } from "@/api/micro/micro";
  221. import { link } from "fs";
  222. export default {
  223. data() {
  224. return {
  225. bannerList: [],
  226. patientModels: [],
  227. Articlelist: [],
  228. navigationdata: []
  229. };
  230. },
  231. methods: {
  232. initSwiper() {
  233. var mySwiper1 = new Swiper(".bannerSwiper", {
  234. loop: true, // 循环模式选项
  235. // 如果需要分页器
  236. pagination: {
  237. el: ".swiper-pagination"
  238. },
  239. autoplay: {
  240. disableOnInteraction: false
  241. }
  242. });
  243. var mySwiper2 = new Swiper(".imgSwiper", {
  244. slidesPerView: 2
  245. });
  246. },
  247. getHospitaldata(orgid) {
  248. getHospitaldata(orgid).then(response => {
  249. if (response.data.state == 1) {
  250. this.patientModels = response.data.data.patientModels;
  251. console.log("数据是什么", this.patientModels);
  252. }
  253. });
  254. },
  255. getArticlelist(orgid) {
  256. getArticlelist(orgid, this.Articlelist).then(response => {
  257. if (response.data.state == 1) {
  258. var articlelist = response.data.data.articlelists;
  259. this.Articlelist = response.data.data.articlelists;
  260. console.log("文章列表", this.Articlelist);
  261. }
  262. });
  263. },
  264. getActivities(orgid) {
  265. getActivities(orgid, this.Activitieslist).then(response => {
  266. if (response.data.state == 1) {
  267. var activity = response.data.data.activity;
  268. this.Activitieslist = response.data.data.activity;
  269. console.log(this.Activitieslist);
  270. }
  271. });
  272. },
  273. hispitalmore(id, orgid) {
  274. this.$router.push({
  275. path: "/hospitalIntroduction",
  276. query: {
  277. id: id,
  278. orgid: orgid
  279. }
  280. });
  281. },
  282. officemore(id, orgid) {
  283. this.$router.push({
  284. path: "/officeIntroduction",
  285. query: {
  286. id: id,
  287. orgid: orgid
  288. }
  289. });
  290. },
  291. docmore(id, orgid) {
  292. this.$router.push({
  293. path: "/medicalTeam",
  294. query: {
  295. id: id,
  296. orgid: orgid
  297. }
  298. });
  299. },
  300. articlemore(id, orgid) {
  301. console.log("orgid", orgid);
  302. this.$router.push({
  303. path: "/news",
  304. query: {
  305. id: id,
  306. orgid: orgid
  307. }
  308. });
  309. },
  310. Activitiesmore(id, orgid) {
  311. this.$router.push({
  312. path: "/activity",
  313. query: {
  314. id: id,
  315. orgid: orgid
  316. }
  317. });
  318. },
  319. EnviromentClick(id,orgid){
  320. this.$router.push({
  321. path:"/departmentEnvironment",
  322. query:{
  323. id:id,
  324. orgid: orgid,
  325. }
  326. })
  327. },
  328. getDefalutNavigationData(orgid) {
  329. getDefalutNavigationData(orgid).then(response => {
  330. if (response.data.state == 1) {
  331. var navigation = response.data.data.navigation;
  332. for (let index = 0; index < navigation.length; index++) {
  333. navigation[0].nonavimages =
  334. "https://images.shengws.com/2089_o_1571990714383.png";
  335. }
  336. console.log("navigation是什么", navigation);
  337. this.navigationdata = navigation;
  338. }
  339. });
  340. },
  341. NavigationClick(title, address, orgid) {
  342. console.log("orgid", orgid);
  343. // debugger
  344. if (title == "加入会员") {
  345. // window.location.href =
  346. // "http://wx.kuyicloud.com/weixin/membershipagree/" + orgid;
  347. this.$router.push({
  348. path: "/card",
  349. query: {
  350. orgid: orgid
  351. }
  352. });
  353. } else if (title == "联系我们") {
  354. this.$router.push({
  355. path: "/contact",
  356. query: {
  357. orgid: orgid
  358. }
  359. });
  360. } else if (title == "咨询客服") {
  361. // window.location.href = "http://wx.kuyicloud.com/weixin/im/"+orgid;
  362. this.$router.push({
  363. path: "/custom",
  364. query: {
  365. orgid: orgid
  366. }
  367. });
  368. } else {
  369. window.location.href = address;
  370. }
  371. },
  372. CallPhone(linktype, address, orgid) {
  373. if (linktype == "2") {
  374. this.$router.push({
  375. // path: "/contactus",
  376. path:"/custom",
  377. query: {
  378. orgid: orgid
  379. }
  380. });
  381. }
  382. if (linktype == "3") {
  383. window.location.href = "tel://" + address + "";
  384. }
  385. if (linktype == "4") {
  386. // window.location.href = address;
  387. this.$router.push({
  388. path:"/contactus",
  389. query:{
  390. orgid:orgid,
  391. }
  392. });
  393. }
  394. },
  395. getData(orgid) {
  396. getData(orgid).then(response => {
  397. if (response.data.state == 1) {
  398. this.patientModels = response.data.data.patientModels;
  399. console.log("数据是什么", this.patientModels);
  400. }
  401. });
  402. },
  403. },
  404. created() {
  405. const orgid = this.$route.query.orgid;
  406. console.log("机构id是什么", orgid);
  407. this.getHospitaldata(orgid);
  408. this.getArticlelist(orgid);
  409. this.getActivities(orgid);
  410. this.getDefalutNavigationData(orgid);
  411. // this.getData(orgid);
  412. },
  413. mounted() {
  414. this.initSwiper();
  415. },
  416. updated() {
  417. this.initSwiper();
  418. this.$previewRefresh();
  419. }
  420. };
  421. </script>
  422. <style lang="scss" scoped>
  423. @import "../../assets/styles/mixin.scss";
  424. .page_home {
  425. overflow: hidden;
  426. display: flex;
  427. flex-direction: column;
  428. height: 100%;
  429. > div:first-child {
  430. flex: 1;
  431. overflow: auto;
  432. }
  433. > div:first-child::-webkit-scrollbar {
  434. width: 0;
  435. }
  436. // border:solid 1px red;
  437. }
  438. // .bugone{
  439. // border: solid 1px red;
  440. // }
  441. .banner {
  442. height: 9.4375rem;
  443. // border:solid 1px red;
  444. }
  445. .swiper-container {
  446. height: 100%;
  447. }
  448. .swiper-wrapper {
  449. margin: 0 auto;
  450. width: 100%;
  451. height: 100%;
  452. // width: 334px;
  453. }
  454. .img {
  455. width: 100px;
  456. height: 100px;
  457. }
  458. .imgtwo {
  459. width: 100%;
  460. height: 100%;
  461. border-radius: 0.75rem;
  462. }
  463. .btnList {
  464. display: flex;
  465. justify-content: space-around;
  466. align-items: center;
  467. flex-wrap: wrap;
  468. width: 100%;
  469. height: 200px;
  470. margin-top: 1.25rem;
  471. // border:solid 1px yellow;
  472. }
  473. .btnOne {
  474. display: block;
  475. width: 25%;
  476. text-align: center;
  477. height: 5rem;
  478. > div:first-child {
  479. height: 3.375rem;
  480. }
  481. img {
  482. margin-bottom: 0.3125rem;
  483. text-align: center;
  484. width: 3.125rem;
  485. height: 3.125rem;
  486. // background: linear-gradient(
  487. // 0deg,
  488. // rgba(255, 201, 115, 1),
  489. // rgba(254, 207, 57, 1)
  490. // );
  491. // box-shadow: 0px 3px 12px 0px rgba(254, 206, 64, 0.25);
  492. border-radius: 50%;
  493. }
  494. .title {
  495. width: 100%;
  496. height: 1.125rem;
  497. line-height: 1.125rem;
  498. font-size: 0.875rem;
  499. text-align: center;
  500. }
  501. }
  502. .dynamic {
  503. margin-top: 2.1875rem;
  504. // border: solid 1px red;
  505. }
  506. .common_title {
  507. width: 20.9375rem;
  508. height: 1.125rem;
  509. margin: 0 auto;
  510. }
  511. .dynamicTxt {
  512. float: left;
  513. width: 6.5rem;
  514. height: 1.125rem;
  515. line-height: 1.125rem;
  516. font-size: 1.125rem;
  517. font-weight: 600;
  518. color: rgba(7, 18, 40, 1);
  519. }
  520. .one {
  521. margin-top: 0.125rem;
  522. margin-right: 0.375rem;
  523. float: left;
  524. width: 0.125rem;
  525. height: 0.875rem;
  526. background: linear-gradient(
  527. 0deg,
  528. rgba(114, 182, 253, 1),
  529. rgba(52, 119, 254, 1)
  530. );
  531. box-shadow: 0px 3px 12px 0px rgba(60, 127, 254, 0.2);
  532. border-radius: 3px;
  533. }
  534. .more {
  535. float: right;
  536. p {
  537. color: #b6bac1;
  538. height: 1.125rem;
  539. line-height: 1.125rem;
  540. }
  541. }
  542. .contentOne {
  543. margin: auto;
  544. margin-top: 1.125rem;
  545. width: 20.875rem;
  546. height: 7.4375rem;
  547. background: rgba(255, 255, 255, 1);
  548. box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.05);
  549. border-radius: 0.5rem;
  550. padding-left: 1rem;
  551. padding-top: 1.125rem;
  552. box-sizing: border-box;
  553. .img {
  554. float: left;
  555. width: 5rem;
  556. height: 5rem;
  557. img {
  558. border-radius: 0.3125rem;
  559. }
  560. }
  561. .detail {
  562. float: left;
  563. margin-left: 0.8125rem;
  564. width: 13.125rem;
  565. .detailTitle {
  566. margin-top: 8px;
  567. font-size: 15px;
  568. margin-top: 0.5rem;
  569. width: 12.6875rem;
  570. height: 1rem;
  571. line-height: 1rem;
  572. font-size: 0.9375rem;
  573. font-weight: 600;
  574. color: rgba(7, 18, 40, 1);
  575. overflow: hidden;
  576. text-overflow: ellipsis;
  577. display: -webkit-box;
  578. -webkit-line-clamp: 1;
  579. -webkit-box-orient: vertical;
  580. }
  581. .detailMessage {
  582. margin-top: 0.25rem;
  583. width: 13.25rem;
  584. height: 3.3rem;
  585. font-size: 0.75rem;
  586. font-weight: 400;
  587. color: rgba(155, 155, 155, 1);
  588. line-height: 1.125rem;
  589. overflow: hidden;
  590. text-overflow: ellipsis;
  591. display: -webkit-box;
  592. -webkit-line-clamp: 1;
  593. -webkit-box-orient: vertical;
  594. // border: solid 1px red;
  595. }
  596. }
  597. // border: solid 1px red;
  598. }
  599. .common {
  600. margin-top: 2.1875rem;
  601. .commonBox {
  602. margin: auto;
  603. margin-top: 1.25rem;
  604. width: 20.875rem;
  605. // height: 20.3125rem;
  606. background: rgba(255, 255, 255, 1);
  607. box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.05);
  608. border-radius: 16px;
  609. padding: 1.125rem 1.3125rem 1.3125rem 1.3125rem;
  610. overflow: hidden;
  611. text-overflow: ellipsis;
  612. // border: 1px solid #000;
  613. .noImg {
  614. width: 6.25rem;
  615. height: 6.25rem;
  616. margin: 0 auto;
  617. img {
  618. width: 6.25rem;
  619. height: 6.25rem;
  620. }
  621. }
  622. }
  623. .commonImg {
  624. width: 18.4375rem;
  625. height: 10.5625rem;
  626. border-radius: 10px;
  627. }
  628. .commonMessage {
  629. // margin-top: 1.375rem;
  630. width: 17.75rem;
  631. height: 16.25rem;
  632. font-size: 0.875rem;
  633. color: rgba(60, 60, 60, 1);
  634. line-height: 1.375rem;
  635. overflow: hidden;
  636. // border: solid 1px red;
  637. display: -webkit-box;
  638. -webkit-line-clamp: 8;
  639. -webkit-box-orient: vertical;
  640. p {
  641. height: 100%;
  642. line-height: 1.375rem;
  643. }
  644. }
  645. // border:solid 1px red;
  646. }
  647. .imgs {
  648. margin-top: 1.875rem;
  649. overflow-x: hidden;
  650. margin-left: 1.25rem;
  651. img {
  652. width: 10.75rem;
  653. height: 7.8125rem;
  654. border-radius: 10px;
  655. }
  656. .carousel {
  657. width: 100%;
  658. height: 100%;
  659. float: left;
  660. padding-right: 1rem;
  661. }
  662. }
  663. .detail {
  664. height: 100%;
  665. .noImg {
  666. width: 3.125rem;
  667. height: 3.125rem;
  668. margin: 1.25rem auto 0;
  669. img {
  670. width: 3.125rem;
  671. height: 3.125rem;
  672. }
  673. }
  674. }
  675. .detailBox {
  676. margin-top: 0.625rem;
  677. .activityTime {
  678. float: left;
  679. width: 7.375rem;
  680. height: 2.1875rem;
  681. font-size: 0.8125rem;
  682. color: rgba(155, 155, 155, 1);
  683. line-height: 1.5rem;
  684. }
  685. .people {
  686. margin-top: 1rem;
  687. float: left;
  688. width: 5.375rem;
  689. height: 1.875rem;
  690. background: rgba(57, 124, 254, 0.1);
  691. border-radius: 30px;
  692. p {
  693. margin: auto;
  694. text-align: center;
  695. width: 4.375rem;
  696. height: 0.75rem;
  697. font-size: 0.75rem;
  698. color: rgba(57, 124, 254, 1);
  699. line-height: 1.875rem;
  700. }
  701. }
  702. }
  703. .bottom {
  704. margin-bottom: 1.25rem;
  705. }
  706. .tabs {
  707. @include border-top;
  708. width: 100%;
  709. height: 3.125rem;
  710. box-sizing: border-box;
  711. }
  712. .tabList {
  713. display: flex;
  714. justify-content: space-around;
  715. height: 100%;
  716. .tabOne {
  717. display: flex;
  718. flex-direction: column;
  719. justify-content: center;
  720. align-items: center;
  721. img {
  722. // margin-top: 0.5rem;
  723. width: 1.875rem;
  724. height: 1.875rem;
  725. }
  726. span {
  727. font-size: 0.75rem;
  728. color: #999;
  729. // line-height: 1.3125rem;
  730. }
  731. }
  732. }
  733. </style>