index.vue 15 KB

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