index.vue 18 KB

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