microHome.vue 18KB

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