index.vue 16 KB

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