index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <template>
  2. <view class="main">
  3. <view class="">
  4. <u-search :clearabled="true" shape="round" search-icon-color="#EEAA3F" @custom="searchvalue" :show-action="true"
  5. placeholder="搜索医生、医院、服务包" v-model="keyword"></u-search>
  6. </view>
  7. <view class="margin-top-sm margin-bottom-sm">
  8. <official-account></official-account>
  9. </view>
  10. <view class="indexswiper" style="margin-top: 10rpx;">
  11. <u-swiper :list="ordinary" :imghos="imghos" mode="dot"></u-swiper>
  12. </view>
  13. <view class="tltleStyle">
  14. <u-section title="精选服务" font-size="40" line-color="#0B73BA" :bold="true" :right="false"></u-section>
  15. </view>
  16. <view class="gridstyle">
  17. <u-grid :col="3" :border="false">
  18. <view @click="gotoxuanze(item)" data-index="1" v-for="(item,index) in icons" :key="index">
  19. <u-grid-item>
  20. <u-image width="120rpx" height="120rpx" :src="item.image" shape="circle"></u-image>
  21. <view class="grid-text">{{item.name}}</view>
  22. </u-grid-item>
  23. </view>
  24. <!-- <view class="" @click="gotoxuanze" data-index="2">
  25. <u-grid-item>
  26. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indextu.png"
  27. shape="circle"></u-image>
  28. <view class="grid-text">图文咨询</view>
  29. </u-grid-item>
  30. </view> -->
  31. <!-- <view class="" @click="gotoxuanze" data-index="3">
  32. <u-grid-item>
  33. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexmen.png"
  34. shape="circle"></u-image>
  35. <view class="grid-text">门诊预约</view>
  36. </u-grid-item>
  37. </view> -->
  38. <!-- <view class="" @click="vaccines">
  39. <u-grid-item>
  40. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexyimiao.png"
  41. shape="circle"></u-image>
  42. <view class="grid-text">疫苗接种</view>
  43. </u-grid-item>
  44. </view> -->
  45. <!-- <view class="" @click="childcare">
  46. <u-grid-item>
  47. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexerbao.png"
  48. shape="circle"></u-image>
  49. <view class="grid-text">儿保预约</view>
  50. </u-grid-item>
  51. </view> -->
  52. <!-- <view class="" @click="servicepacks">
  53. <u-grid-item>
  54. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexservice.png"
  55. shape="circle"></u-image>
  56. <view class="grid-text">服务包</view>
  57. </u-grid-item>
  58. </view> -->
  59. </u-grid>
  60. </view>
  61. <view class="margin-top-sm">
  62. <u-notice-bar type="error" bg-color="white" color="black" border-radius="15" :list="configInfo.notices" mode="vertical"></u-notice-bar>
  63. </view>
  64. <view class="tltleStyle">
  65. <u-section title="热门推荐" font-size="40" line-color="#0B73BA" :bold="true" :right="false"></u-section>
  66. </view>
  67. <view class="cu-card case" style="margin-top: 20rpx;background-color: transparent;border-radius: 16rpx;position: relative;">
  68. <swiper @change="swiperChange" :indicator-dots="false" style="height: 426rpx;border-radius:16rpx;background-color: transparent;"
  69. :autoplay="true" :interval="3000" :duration="1000" :current="itemcurrent">
  70. <swiper-item style="background-color: transparent;" v-for="(item,index) in hotlist" :key="index">
  71. <view class="cu-item shadow" style="margin: 0;background-color: transparent;height: 100%;">
  72. <view class="image">
  73. <image :src="imghos+item.image" style="height: 426rpx;" mode="heightFix"></image>
  74. <!-- <view class="cu-bar bg-shadeBottom" style="background-image: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0));bottom:44rpx ;">
  75. <text class="text-cut">我已天理为凭,踏入这片荒芜,不再受凡人的枷锁遏制。我已天理为凭,踏入这片荒芜,不再受凡人的枷锁遏制。</text>
  76. </view> -->
  77. </view>
  78. </view>
  79. </swiper-item>
  80. </swiper>
  81. <view class="dots">
  82. <view :class="index==itemcurrent?'dot active':'dot'" v-for="(item,index) in hotlist" :key="index"></view>
  83. </view>
  84. </view>
  85. <view class="tltleStyle">
  86. <u-section title="推荐医生" font-size="40" line-color="#0B73BA" :bold="true" :right="false"></u-section>
  87. </view>
  88. <view style="width: 100%;">
  89. <view class="recommendstyle margin-top-sm" v-for="(item,index) in doctorList" :key="index">
  90. <view class="base_item">
  91. <view class="base_item_zi" @click.stop="gotoinfo" :data-id="item.id">
  92. <view class="base_item_zi_items">
  93. <view class="base_item_zi_content" style="height: 241rpx;background-color:#FBFBFB;">
  94. <image style="width: 120rpx;height: 120rpx;border-radius: 50%;" :src="item.avatar">
  95. </image>
  96. <view class="follow_style" @click.stop="submitCollect" :data-index="index" :data-id="item.id" v-if="item.is_collect==0">
  97. 关注
  98. </view>
  99. <view class="follow_style" @click.stop="submitCollect" :data-index="index" :data-id="item.id" style="background-color: #fff;color: rgb(208, 105, 150);border:2rpx solid rgb(208, 105, 150);"
  100. v-else>
  101. 已关注
  102. </view>
  103. <view class="content_right">
  104. <view class="" style="display: flex;align-items: center;">
  105. <text style="font-size: 32rpx; font-weight: bold;">{{item.name}}</text>
  106. <text class="text_style" v-for="(itm,index) in item.label_texts" :key="index">{{itm.label_name}}</text>
  107. </view>
  108. <view class="m_gray_small">
  109. 科室:<text style="color:#333333;">{{item.office.name||'暂无'}} {{item.qualification.name||'暂无'}}</text>
  110. </view>
  111. <view class="flex justify-start align-center flex-wrap" style="position: relative;">
  112. <u-tag bg-color="#F2F2F2" color="#666666" border-color="#F2F2F2" v-if="item.is_chat==1" style="margin-top:20rpx ; margin-right: 20rpx;"
  113. text="图文" shape="circle" />
  114. <u-tag bg-color="#F2F2F2" color="#666666" border-color="#F2F2F2" v-if="item.is_phone==1" style="margin-top:20rpx ; margin-right: 20rpx;"
  115. text="电话" shape="circle" />
  116. <u-tag bg-color="#F2F2F2" color="#666666" border-color="#F2F2F2" v-if="item.is_appoint==1" style="margin-top:20rpx ; margin-right: 20rpx;"
  117. text="门诊" shape="circle" />
  118. </view>
  119. </view>
  120. </view>
  121. <view class="foot_juli padding-sm">
  122. <u-line color="#f6f6f6" />
  123. <view class="flex justify-center margin-top-sm" style="color: rgba(0,0,0,0.54);">
  124. <view class="text-sm" style="flex: 1; text-align: left;">
  125. 评分:
  126. <text style="color: #FF7B72;">{{item.score}}</text>
  127. </view>
  128. <view class="text-sm" style="flex: 1; text-align: center;">
  129. 服务:
  130. <text style="color: #FF7B72;">{{item.service_persons}}</text>
  131. </view>
  132. <view class="text-sm" style="flex: 1; text-align: right;">
  133. 距离:
  134. <text style="color: #FF7B72;">{{item.distance!='未知'?parseInt(item.distance/1000)+'km':'未知'}}</text>
  135. </view>
  136. </view>
  137. <view class="doctor_style margin-top-sm">
  138. <view class="doctor_style_item">
  139. {{item.intro}}
  140. </view>
  141. <view class="text-black flex justify-between align-center margin-top-sm" style="font-size: 30rpx;">
  142. <view class="jisu flex align-center">
  143. <image src="../../static/img/speed.png" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;margin-top: 6rpx;"
  144. mode=""></image>急速响应
  145. </view>
  146. <view class="">
  147. 服务
  148. <text class="text-red text-bold text-xl" style="margin-right: 10rpx;">¥{{item.phone_price/100}}</text>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. <view class="margin-tb padding-tb-xs">
  159. <u-loadmore :status="nomore" :load-text="loadText" :icon-type="flower" />
  160. </view>
  161. <u-back-top :scroll-top="scrollTop" bottom="80" top="400"></u-back-top>
  162. <u-no-network></u-no-network>
  163. </view>
  164. </template>
  165. <script>
  166. import {
  167. getLocation
  168. } from "../../common/authorize.js"
  169. var user = require('../../common/user.js');
  170. import {
  171. mapState,
  172. mapMutations,
  173. mapGetters,
  174. mapActions
  175. } from 'vuex';
  176. import store from '@/store'
  177. export default {
  178. computed: {
  179. ...mapGetters({
  180. hasLogin: 'verifyJwt'
  181. }),
  182. ...mapState(['user'])
  183. },
  184. onShow() {
  185. this.GetCurrentAddress()
  186. this.getDoctorList()
  187. this.getindexImg()
  188. this.hasLogin = store.getters['verifyJwt']
  189. },
  190. onLoad(options) {
  191. this.getconfigData()
  192. this.imghos = this.$imgHost
  193. },
  194. data() {
  195. return {
  196. itemcurrent: 0,
  197. scrollTop: 0,
  198. keyword: "",
  199. loadText: {
  200. nomore: '暂无更多医生推荐'
  201. },
  202. doctorList: [],
  203. latitude: 0,
  204. longitude: 0,
  205. pageindex: 1,
  206. configInfo: {},
  207. icons: [],
  208. imghos: "",
  209. hotlist: [],
  210. ordinary: []
  211. }
  212. },
  213. onHide() {
  214. this.pageindex = 1
  215. this.doctorList = []
  216. },
  217. onReachBottom() {
  218. this.getDoctorList()
  219. },
  220. onShareAppMessage() {
  221. return {
  222. title: "熙宝健康",
  223. success: res => {
  224. console.log(res)
  225. }
  226. }
  227. },
  228. methods: {
  229. getindexImg: async function() {
  230. let res = await this.$request.post("/api/v1/common/icons", {
  231. type: 1
  232. })
  233. if (res.status == 200) {
  234. this.icons = res.data
  235. }
  236. },
  237. swiperChange(e) {
  238. this.itemcurrent = e.detail.current
  239. },
  240. catchTouchMove() {
  241. return false
  242. },
  243. //监听滚动
  244. onPageScroll(e) {
  245. this.scrollTop = e.scrollTop;
  246. },
  247. gotoxuanze(item) {
  248. if (this.hasLogin) {
  249. if (item.id == 4) {
  250. uni.navigateTo({
  251. url: "../vaccines/vaccines_info"
  252. })
  253. return false
  254. }
  255. if (item.id == 5) {
  256. uni.navigateTo({
  257. url: "../childcare/child_care"
  258. })
  259. return false
  260. }
  261. if (item.id == 6) {
  262. uni.navigateTo({
  263. url: "../service_packs/introduce"
  264. })
  265. return false
  266. }
  267. uni.navigateTo({
  268. url: '../doctor_related/select_doctor?index=' + item.id
  269. })
  270. } else {
  271. uni.showModal({
  272. title: "提示",
  273. content: "暂未登录,请前往登录",
  274. success: (res) => {
  275. if (res.confirm) {
  276. uni.navigateTo({
  277. url: "../login/login"
  278. })
  279. }
  280. }
  281. })
  282. }
  283. },
  284. gotoinfo(e) {
  285. if (this.hasLogin) {
  286. uni.navigateTo({
  287. url: "../doctor_related/doctor_info?id=" + e.currentTarget.dataset.id + "&index=1"
  288. })
  289. } else {
  290. uni.showModal({
  291. title: "提示",
  292. content: "暂未登录,请前往登录",
  293. success: (res) => {
  294. if (res.confirm) {
  295. uni.navigateTo({
  296. url: "../login/login"
  297. })
  298. }
  299. }
  300. })
  301. }
  302. },
  303. getDoctorList: async function() {
  304. let res = await this.$request.post("/api/v1/docter/docterList", {
  305. page: this.pageindex,
  306. latitude: this.latitude,
  307. longitude: this.longitude
  308. }, false)
  309. let status = user.islogin(res)
  310. if (status) {
  311. // this.doctorList = res.data.data
  312. if (this.pageindex > res.data.last_page) {
  313. } else {
  314. this.doctorList = this.doctorList.concat(res.data.data)
  315. this.pageindex++
  316. }
  317. }
  318. },
  319. submitCollect: async function(e) {
  320. if (this.hasLogin) {
  321. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  322. type: 1,
  323. relation_id: e.currentTarget.dataset.id
  324. }, false)
  325. if (res.status == 0) {
  326. if (res.data.is_collect == 0) {
  327. uni.showToast({
  328. title: "取消成功",
  329. icon: "none"
  330. })
  331. this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  332. } else {
  333. uni.showToast({
  334. title: "关注成功",
  335. icon: "none"
  336. })
  337. this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  338. }
  339. }
  340. } else {
  341. uni.showModal({
  342. title: "提示",
  343. content: "暂未登录,请前往登录",
  344. success: (res) => {
  345. if (res.confirm) {
  346. uni.navigateTo({
  347. url: "../login/login"
  348. })
  349. }
  350. }
  351. })
  352. }
  353. },
  354. servicepacks() {
  355. uni.navigateTo({
  356. url: "../service_packs/introduce"
  357. })
  358. },
  359. searchvalue(value) {
  360. uni.navigateTo({
  361. url: "../doctor_related/select_doctor?value=" + value
  362. })
  363. },
  364. childcare() {
  365. if (this.hasLogin) {
  366. uni.navigateTo({
  367. url: "../childcare/child_care"
  368. })
  369. } else {
  370. uni.showModal({
  371. title: "提示",
  372. content: "暂未登录,请前往登录",
  373. success: (res) => {
  374. if (res.confirm) {
  375. uni.navigateTo({
  376. url: "../login/login"
  377. })
  378. }
  379. }
  380. })
  381. }
  382. },
  383. vaccines() {
  384. if (this.hasLogin) {
  385. uni.navigateTo({
  386. url: "../vaccines/vaccines_info"
  387. })
  388. } else {
  389. uni.showModal({
  390. title: "提示",
  391. content: "暂未登录,请前往登录",
  392. success: (res) => {
  393. if (res.confirm) {
  394. uni.navigateTo({
  395. url: "../login/login"
  396. })
  397. }
  398. }
  399. })
  400. }
  401. },
  402. getconfigData: async function() {
  403. let res = await this.$request.post("/api/v1/common/configList", {}, false)
  404. console.log(res)
  405. if (res.status == 0) {
  406. this.configInfo = res.data
  407. this.hotlist = res.data.banners.filter(item => item.type == 1)
  408. this.ordinary = res.data.banners.filter(item => item.type == 2)
  409. }
  410. },
  411. //获取当前地址
  412. GetCurrentAddress() {
  413. getLocation().then(res => {
  414. this.latitude = res.latitude
  415. this.longitude = res.longitude
  416. uni.setStorageSync("latitude", res.latitude)
  417. uni.setStorageSync("longitude", res.longitude)
  418. }).catch(res => {
  419. })
  420. },
  421. }
  422. };
  423. </script>
  424. <style scoped lang="scss">
  425. .main {
  426. padding-top: 10rpx;
  427. padding-left: 20rpx;
  428. padding-right: 20rpx;
  429. }
  430. .dots {
  431. position: absolute;
  432. left: 0;
  433. right: 0;
  434. bottom: 30rpx;
  435. display: flex;
  436. justify-content: center;
  437. }
  438. .dots .dot {
  439. margin: 0 8rpx;
  440. width: 10rpx;
  441. height: 10rpx;
  442. background: rgba(0, 0, 0, .3);
  443. border-radius: 8rpx;
  444. transition: all .6s;
  445. }
  446. .dots .dot.active {
  447. width: 24rpx;
  448. height: 10rpx;
  449. background: #fff;
  450. }
  451. .gridstyle {
  452. height: 450rpx;
  453. background-color: #fff;
  454. border-radius: 15rpx;
  455. display: flex;
  456. align-items: center;
  457. box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
  458. margin-top: 20rpx;
  459. }
  460. .doctor_style {
  461. color: rgba(0, 0, 0, 0.54);
  462. }
  463. .doctor_style_item {
  464. overflow: hidden;
  465. text-overflow: ellipsis;
  466. display: -webkit-box;
  467. -webkit-line-clamp: 2;
  468. -webkit-box-orient: vertical;
  469. }
  470. .jisu {
  471. color: rgb(238, 170, 63);
  472. }
  473. .follow_style {
  474. position: absolute;
  475. bottom: 76rpx;
  476. left: 37rpx;
  477. z-index: 1;
  478. width: 106rpx;
  479. height: 40rpx;
  480. padding: 4rpx 0;
  481. background-color: rgb(208, 105, 150);
  482. box-sizing: border-box;
  483. color: #fff;
  484. text-align: center;
  485. border-radius: 60rpx;
  486. font-size: 24rpx;
  487. display: flex;
  488. justify-content: center;
  489. align-items: center;
  490. }
  491. .base_item {
  492. // position: absolute;
  493. // top: 0;
  494. // left: 0;
  495. // right: 0;
  496. // z-index: 1;
  497. width: 100%;
  498. height: auto;
  499. box-sizing: border-box;
  500. }
  501. .base_item_zi {
  502. // padding-top: 20rpx;
  503. // margin: 20rpx 20rpx;
  504. position: relative;
  505. box-sizing: border-box;
  506. }
  507. .base_item_zi_items {
  508. box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
  509. background-color: #fff;
  510. position: relative;
  511. border-radius: 8rpx;
  512. box-sizing: border-box;
  513. }
  514. .base_item_zi_content {
  515. display: flex;
  516. justify-content: center;
  517. padding: 30rpx 30rpx;
  518. overflow: hidden;
  519. position: relative;
  520. width: 100%;
  521. box-sizing: border-box;
  522. }
  523. .text_style {
  524. display: flex;
  525. justify-content: center;
  526. align-items: center;
  527. font-weight: 400;
  528. margin-left: 15rpx;
  529. background-color: #E5F5FF;
  530. color: #0B73B9;
  531. width: 100rpx;
  532. height: 28rpx;
  533. font-size: 20rpx;
  534. border-radius: 10rpx;
  535. }
  536. .m_gray_small {
  537. white-space: nowrap;
  538. overflow: hidden;
  539. text-overflow: ellipsis;
  540. color: rgba(0, 0, 0, 0.54);
  541. margin-top: 20rpx;
  542. font-size: 28rpx;
  543. }
  544. .content_right {
  545. flex: 1;
  546. margin-left: 20rpx;
  547. overflow: hidden;
  548. position: relative;
  549. box-sizing: border-box;
  550. }
  551. .foot_item {
  552. background-color: #F7F7F7;
  553. box-sizing: border-box;
  554. }
  555. .grid-text {
  556. font-size: 28rpx;
  557. margin-top: 4rpx;
  558. color: $u-type-info;
  559. }
  560. .tltleStyle {
  561. padding: 30rpx 30rpx 15rpx 15rpx;
  562. // font-weight: bold;
  563. // font-size: 40rpx;
  564. }
  565. </style>