index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  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="configInfo.banners" 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 configInfo.banners" :key="index">
  71. <view class="cu-item shadow" style="margin: 0;background-color: transparent;height: 100%;">
  72. <view class="image">
  73. <image :src="item" 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 configInfo.banners" :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. },
  193. data() {
  194. return {
  195. itemcurrent: 0,
  196. scrollTop: 0,
  197. keyword: "",
  198. loadText: {
  199. nomore: '暂无更多医生推荐'
  200. },
  201. doctorList: [],
  202. latitude: 0,
  203. longitude: 0,
  204. pageindex: 1,
  205. configInfo: {},
  206. icons: []
  207. }
  208. },
  209. onHide() {
  210. this.pageindex = 1
  211. this.doctorList = []
  212. },
  213. onReachBottom() {
  214. this.getDoctorList()
  215. },
  216. onShareAppMessage() {
  217. return {
  218. title: "熙宝健康",
  219. success: res => {
  220. console.log(res)
  221. }
  222. }
  223. },
  224. methods: {
  225. getindexImg: async function() {
  226. let res = await this.$request.post("/api/v1/common/icons", {
  227. type: 1
  228. })
  229. if (res.status == 200) {
  230. this.icons = res.data
  231. }
  232. },
  233. swiperChange(e) {
  234. this.itemcurrent = e.detail.current
  235. },
  236. catchTouchMove() {
  237. return false
  238. },
  239. //监听滚动
  240. onPageScroll(e) {
  241. this.scrollTop = e.scrollTop;
  242. },
  243. gotoxuanze(item) {
  244. if (this.hasLogin) {
  245. if (item.id == 4) {
  246. uni.navigateTo({
  247. url: "../vaccines/vaccines_info"
  248. })
  249. return false
  250. }
  251. if (item.id == 5) {
  252. uni.navigateTo({
  253. url: "../childcare/child_care"
  254. })
  255. return false
  256. }
  257. if (item.id == 6) {
  258. uni.navigateTo({
  259. url: "../service_packs/introduce"
  260. })
  261. return false
  262. }
  263. uni.navigateTo({
  264. url: '../doctor_related/select_doctor?index=' + item.id
  265. })
  266. } else {
  267. uni.showModal({
  268. title: "提示",
  269. content: "暂未登录,请前往登录",
  270. success: (res) => {
  271. if (res.confirm) {
  272. uni.navigateTo({
  273. url: "../login/login"
  274. })
  275. }
  276. }
  277. })
  278. }
  279. },
  280. gotoinfo(e) {
  281. if (this.hasLogin) {
  282. uni.navigateTo({
  283. url: "../doctor_related/doctor_info?id=" + e.currentTarget.dataset.id + "&index=1"
  284. })
  285. } else {
  286. uni.showModal({
  287. title: "提示",
  288. content: "暂未登录,请前往登录",
  289. success: (res) => {
  290. if (res.confirm) {
  291. uni.navigateTo({
  292. url: "../login/login"
  293. })
  294. }
  295. }
  296. })
  297. }
  298. },
  299. getDoctorList: async function() {
  300. let res = await this.$request.post("/api/v1/docter/docterList", {
  301. page: this.pageindex,
  302. latitude: this.latitude,
  303. longitude: this.longitude
  304. }, false)
  305. let status = user.islogin(res)
  306. if (status) {
  307. // this.doctorList = res.data.data
  308. if (this.pageindex > res.data.last_page) {
  309. } else {
  310. this.doctorList = this.doctorList.concat(res.data.data)
  311. this.pageindex++
  312. }
  313. }
  314. },
  315. submitCollect: async function(e) {
  316. if (this.hasLogin) {
  317. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  318. type: 1,
  319. relation_id: e.currentTarget.dataset.id
  320. }, false)
  321. if (res.status == 0) {
  322. if (res.data.is_collect == 0) {
  323. uni.showToast({
  324. title: "取消成功",
  325. icon: "none"
  326. })
  327. this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  328. } else {
  329. uni.showToast({
  330. title: "关注成功",
  331. icon: "none"
  332. })
  333. this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  334. }
  335. }
  336. } else {
  337. uni.showModal({
  338. title: "提示",
  339. content: "暂未登录,请前往登录",
  340. success: (res) => {
  341. if (res.confirm) {
  342. uni.navigateTo({
  343. url: "../login/login"
  344. })
  345. }
  346. }
  347. })
  348. }
  349. },
  350. servicepacks() {
  351. uni.navigateTo({
  352. url: "../service_packs/introduce"
  353. })
  354. },
  355. searchvalue(value) {
  356. uni.navigateTo({
  357. url: "../doctor_related/select_doctor?value=" + value
  358. })
  359. },
  360. childcare() {
  361. if (this.hasLogin) {
  362. uni.navigateTo({
  363. url: "../childcare/child_care"
  364. })
  365. } else {
  366. uni.showModal({
  367. title: "提示",
  368. content: "暂未登录,请前往登录",
  369. success: (res) => {
  370. if (res.confirm) {
  371. uni.navigateTo({
  372. url: "../login/login"
  373. })
  374. }
  375. }
  376. })
  377. }
  378. },
  379. vaccines() {
  380. if (this.hasLogin) {
  381. uni.navigateTo({
  382. url: "../vaccines/vaccines_info"
  383. })
  384. } else {
  385. uni.showModal({
  386. title: "提示",
  387. content: "暂未登录,请前往登录",
  388. success: (res) => {
  389. if (res.confirm) {
  390. uni.navigateTo({
  391. url: "../login/login"
  392. })
  393. }
  394. }
  395. })
  396. }
  397. },
  398. getconfigData: async function() {
  399. let res = await this.$request.post("/api/v1/common/configList", {}, false)
  400. console.log(res)
  401. if (res.status == 0) {
  402. this.configInfo = res.data
  403. }
  404. },
  405. //获取当前地址
  406. GetCurrentAddress() {
  407. getLocation().then(res => {
  408. this.latitude = res.latitude
  409. this.longitude = res.longitude
  410. uni.setStorageSync("latitude", res.latitude)
  411. uni.setStorageSync("longitude", res.longitude)
  412. }).catch(res => {
  413. })
  414. },
  415. }
  416. };
  417. </script>
  418. <style scoped lang="scss">
  419. .main {
  420. padding-top: 10rpx;
  421. padding-left: 20rpx;
  422. padding-right: 20rpx;
  423. }
  424. .dots {
  425. position: absolute;
  426. left: 0;
  427. right: 0;
  428. bottom: 30rpx;
  429. display: flex;
  430. justify-content: center;
  431. }
  432. .dots .dot {
  433. margin: 0 8rpx;
  434. width: 10rpx;
  435. height: 10rpx;
  436. background: rgba(0, 0, 0, .3);
  437. border-radius: 8rpx;
  438. transition: all .6s;
  439. }
  440. .dots .dot.active {
  441. width: 24rpx;
  442. height: 10rpx;
  443. background: #fff;
  444. }
  445. .gridstyle {
  446. height: 450rpx;
  447. background-color: #fff;
  448. border-radius: 15rpx;
  449. display: flex;
  450. align-items: center;
  451. box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
  452. margin-top: 20rpx;
  453. }
  454. .doctor_style {
  455. color: rgba(0, 0, 0, 0.54);
  456. }
  457. .doctor_style_item {
  458. overflow: hidden;
  459. text-overflow: ellipsis;
  460. display: -webkit-box;
  461. -webkit-line-clamp: 2;
  462. -webkit-box-orient: vertical;
  463. }
  464. .jisu {
  465. color: rgb(238, 170, 63);
  466. }
  467. .follow_style {
  468. position: absolute;
  469. bottom: 76rpx;
  470. left: 37rpx;
  471. z-index: 1;
  472. width: 106rpx;
  473. height: 40rpx;
  474. padding: 4rpx 0;
  475. background-color: rgb(208, 105, 150);
  476. box-sizing: border-box;
  477. color: #fff;
  478. text-align: center;
  479. border-radius: 60rpx;
  480. font-size: 24rpx;
  481. display: flex;
  482. justify-content: center;
  483. align-items: center;
  484. }
  485. .base_item {
  486. // position: absolute;
  487. // top: 0;
  488. // left: 0;
  489. // right: 0;
  490. // z-index: 1;
  491. width: 100%;
  492. height: auto;
  493. box-sizing: border-box;
  494. }
  495. .base_item_zi {
  496. // padding-top: 20rpx;
  497. // margin: 20rpx 20rpx;
  498. position: relative;
  499. box-sizing: border-box;
  500. }
  501. .base_item_zi_items {
  502. box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
  503. background-color: #fff;
  504. position: relative;
  505. border-radius: 8rpx;
  506. box-sizing: border-box;
  507. }
  508. .base_item_zi_content {
  509. display: flex;
  510. justify-content: center;
  511. padding: 30rpx 30rpx;
  512. overflow: hidden;
  513. position: relative;
  514. width: 100%;
  515. box-sizing: border-box;
  516. }
  517. .text_style {
  518. display: flex;
  519. justify-content: center;
  520. align-items: center;
  521. font-weight: 400;
  522. margin-left: 15rpx;
  523. background-color: #E5F5FF;
  524. color: #0B73B9;
  525. width: 100rpx;
  526. height: 28rpx;
  527. font-size: 20rpx;
  528. border-radius: 10rpx;
  529. }
  530. .m_gray_small {
  531. white-space: nowrap;
  532. overflow: hidden;
  533. text-overflow: ellipsis;
  534. color: rgba(0, 0, 0, 0.54);
  535. margin-top: 20rpx;
  536. font-size: 28rpx;
  537. }
  538. .content_right {
  539. flex: 1;
  540. margin-left: 20rpx;
  541. overflow: hidden;
  542. position: relative;
  543. box-sizing: border-box;
  544. }
  545. .foot_item {
  546. background-color: #F7F7F7;
  547. box-sizing: border-box;
  548. }
  549. .grid-text {
  550. font-size: 28rpx;
  551. margin-top: 4rpx;
  552. color: $u-type-info;
  553. }
  554. .tltleStyle {
  555. padding: 30rpx 30rpx 15rpx 15rpx;
  556. // font-weight: bold;
  557. // font-size: 40rpx;
  558. }
  559. </style>