index.vue 16 KB

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