index.vue 16 KB

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