microHome.vue 19KB

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