doctor_info.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <view class="main">
  3. <view class="u-skeleton">
  4. <view class="pr det-body">
  5. <image class="det-bg-img" mode="scaleToFill" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/doctorbanner.png"></image>
  6. <view class="det-head pr plr15 bdr8 m-bg-white mlr15 pt25 u-skeleton-fillet">
  7. <view class="m-xstart pr m-bottom-line pb25 margin-bottom-sm">
  8. <view class="m-flex overflow mr10">
  9. <view class="flex align-center">
  10. <text class="dpb fb f16">{{doctor.name||''}}</text>
  11. <text class="dpb f14 m-gray-small ml5" v-for="(itm,index) in doctor.label_texts" :key="index">{{itm.label_name||''}}</text>
  12. </view>
  13. <view class="dpb m-flex margin-top-sm">科室:{{doctor.office.name||'暂无'}} {{doctor.qualification.name||'暂无'}}</view>
  14. <view class="m-xend mt12">
  15. <view class="f12 m-gray-big">评分:<text class="m-theme">{{doctor.score}}</text>
  16. <text class="f11 margin-left-xs">分</text>
  17. </view>
  18. <view class="f12 ml15 m-gray-big">服务:<text class="m-theme">{{doctor.service_persons}}</text>
  19. <text class="f11">人</text>
  20. </view>
  21. <view class="m-flex ml15 text-sm">距离:<text class="text-sm">{{doctor.distance!='未知'?parseInt(doctor.distance/1000)+'km':'未知'}}</text></view>
  22. </view>
  23. </view>
  24. <view class="pr pt5">
  25. <view class="follow_style" @click="submitCollect" :data-index="index" :data-id="doctor.id" v-if="doctor.is_collect==0">
  26. 关注
  27. </view>
  28. <view class="follow_style" @click="submitCollect" :data-index="index" :data-id="doctor.id" style="background-color: #fff;color: rgb(208, 105, 150);border:2rpx solid rgb(208, 105, 150);"
  29. v-else>
  30. 已关注
  31. </view>
  32. <u-image shape="circle" width="120rpx" height="120rpx" :src="doctor.avatar"></u-image>
  33. </view>
  34. </view>
  35. <u-read-more :toggle="true" show-height="0" :shadow-style="shadowStyle" close-text=" " open-text=" ">
  36. <rich-text :nodes="doctor.intro"></rich-text>
  37. </u-read-more>
  38. </view>
  39. </view>
  40. <view class="gridstyle padding-sm margin-lr-sm u-skeleton-fillet">
  41. <u-grid :col="3" :border="false">
  42. <view @click="gotoxuanze" data-index="1" data-name="电话咨询" :data-istrue="doctor.is_phone">
  43. <u-grid-item :bg-color="barindex==1&&doctor.is_phone==1?'#efefef':'#fff'">
  44. <u-image width="120rpx" height="120rpx" :src="doctor.is_phone==1?'https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexphone.png':'/static/img/phone_gray.png'"
  45. shape="circle"></u-image>
  46. <view class="grid-text margin-top-sm" :style="doctor.is_phone==1?'color:black;':'color:rgb(219,219,219)'">电话咨询</view>
  47. </u-grid-item>
  48. </view>
  49. <view class="" @click="gotoxuanze" data-index="2" data-name="图文咨询" :data-istrue="doctor.is_chat">
  50. <u-grid-item :bg-color="barindex==2&&doctor.is_chat==1?'#efefef':'#fff'">
  51. <u-image width="120rpx" height="120rpx" :src="doctor.is_chat==1?'https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indextu.png':'/static/img/chat_gray.png'"
  52. shape="circle"></u-image>
  53. <view class="grid-text margin-top-sm" :style="doctor.is_chat==1?'color:black;':'color:rgb(219,219,219)'">图文咨询</view>
  54. </u-grid-item>
  55. </view>
  56. <view class="" @click="gotoxuanze" data-index="3" data-name="门诊预约" :data-istrue="doctor.is_appoint">
  57. <u-grid-item :bg-color="barindex==3&&doctor.is_appoint==1?'#efefef':'#fff'">
  58. <u-image width="120rpx" height="120rpx" :src="doctor.is_appoint==1?'https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexmen.png':'/static/img/yuyue_gray.png'"
  59. shape="circle"></u-image>
  60. <view class="grid-text margin-top-sm" :style="doctor.is_appoint==1?'color:black;':'color:rgb(219,219,219)'">门诊预约</view>
  61. </u-grid-item>
  62. </view>
  63. </u-grid>
  64. <u-line color="#efefef" :hair-line="true" />
  65. <view v-if="!isjigou" class="text-lg text-center margin-top-sm" style="color: rgb(238, 170, 63);">
  66. 平均回复低至1分钟
  67. </view>
  68. <view v-else class="text-lg margin-top-sm" style="color: rgb(238, 170, 63);border-bottom: 3rpx solid rgb(238, 170, 63); width: 530rpx;"
  69. @click="xuantime">
  70. 已选时间:{{daytime}}
  71. <u-picker mode="multiSelector" @confirm="callbacktime" v-model="show" :default-selector='[0, 1]' range-key="start_time_period"
  72. :range="multiSelector"></u-picker>
  73. </view>
  74. </view>
  75. <view v-if="isjigou" bindtap="goAdrPostion" class="pr pt10 pb10 margin-lr-sm margin-top-sm m-bg-white" style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  76. <view class="pr pt15 pb15">
  77. <view class="f18 fb plr15">机构地址</view>
  78. <view class="pr m-xcenter plr15 mt15">
  79. <image class="dpb" mode="scaleToFill" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAABx0lEQVQoU2WSP2gTcRTHv+/dH4IdmkVcFAvSgihNLi1SRKE4uNhek4I6iNLY5AQnB93dpHNBMEltIbgUc5pUF0F0cDBIk2twKiJBBAWHVgOl5u5+TxrINeCbvnz5Pnh8vo8wMBPOE8NXx6YIcpKJfu74Ox/aa9n9foT6IrFYtVjjMkHOHO7TV6Ww6JVm3x94vXBy4fkombGPUMEwEW+oMPRY44QAs0TcDfzwUms1Xe+FrXztJURsIdz0inPPkgsv4t5aZjd5u3qDGGUiqjeK9nmauLo+rOLmDyJuNQr2VMrZWBJR90DacrMwc9/K1+qAmvQDjNB4rnJcg/aN2Kg2ClcyqTuvP0nYnWQ2vM3CjGU5tQpE5gPfP03T0+/036OdLwBinT19bCjmn2JCPoBa6SreHtJpWwTdzvf2WO/mRM7NaqQ/BeFN92949/Oe3z57xBgxTe0xgMuhCm9trWTKfXSUcmquKJUGUQBgF0AcIroQvfKKtg2QRJyt7PpRMmKbosITEWfW2vD3zzVXr/2KOEfFOO4FFu0tRJnE+h8odbFRmmv912DfSObcB8zGI5HgerOYqQy+Q3TGofmQE7nx9FZp3h0MHuh/o0mz0Kcr4U0AAAAASUVORK5CYII="
  80. style="width: 10px; height: 12px;"></image>
  81. <view class="m-flex tl ml5">{{hospital||'无'}}</view>
  82. </view>
  83. <view class="pr m-xcenter plr15 mt10">
  84. <view class="m-flex tl m-gray-small f12 pl15 mr5">地址:{{address||'无'}}</view>
  85. <view class="pt2 pb2 plr10 f12 m-gray-small br-gray-letter bdr30" v-if="distance!='0'">
  86. {{distance||'暂无距离'}}km
  87. </view>
  88. <view class="pt2 pb2 plr10 f12 m-gray-small br-gray-letter bdr30" wx:else>暂无距离</view>
  89. <text class="dpb iconfont icon-arrow-right m-gray-letter f20"></text>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="margin-lr-sm mt15 bg-white u-skeleton-fillet" style="border-radius: 16rpx; box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);"
  94. v-if="doctor.evaluate.length!=0">
  95. <view class="f18 fb flex align-center plr15 pt15">患者评价 <text class="f12 m-gray-letter margin-left-xs">({{doctor.evaluate.length}})</text>
  96. </view>
  97. <view class="cu-list menu-avatar card-menu">
  98. <view class="cu-item" v-for="(item,index) in doctor.evaluate" :key="index">
  99. <view class="cu-avatar round lg" :style="'background-image:url('+item.user.avatar+');'"></view>
  100. <view class="content">
  101. <view class="text-grey margin-right-sm">
  102. {{item.user.nickname}}
  103. <u-rate :count="5" v-model="item.score" :disabled="true"></u-rate>
  104. </view>
  105. <view class="text-gray text-sm flex">
  106. <text class="text-cut">
  107. {{item.content}}
  108. </text>
  109. </view>
  110. </view>
  111. <view class="action" style="width: 124rpx;">
  112. <view class="text-grey text-xs">{{item.created_at}}</view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="cu-tabbar-height"></view>
  118. <view class="cu-tabbar-height"></view>
  119. </view>
  120. <view class="cu-bar bg-white tabbar border shop" style="position: fixed; bottom: 0; z-index: 99;width: 100%;">
  121. <button class="action text-orange" open-type="share" style="width: 200rpx;">
  122. <view class="cuIcon-share text-orange">
  123. </view>
  124. 分享
  125. </button>
  126. <button v-if="barindex==1" class="submit text-white" :disabled="isphone" @click="phonezixun" :style="!isphone?'background-color: rgb(11,115,186);font-size: 26rpx;':'font-size: 26rpx;color:gray'">电话咨询</button>
  127. <button v-else-if="barindex==2" class="submit text-white" :disabled="istuwen" @click="phonezixun" :style="!istuwen?'background-color: rgb(11,115,186);font-size: 26rpx;':'font-size: 26rpx;color:gray'">图文咨询</button>
  128. <button v-else class="submit text-white" @click="phonezixun" :disabled="ismenzhen" :style="!ismenzhen?'background-color: rgb(11,115,186);font-size: 26rpx;':'font-size: 26rpx;color:gray'">门诊预约</button>
  129. </view>
  130. <u-no-network></u-no-network>
  131. <u-skeleton :loading="loading" el-color="#ddd" :animation="true" bgColor="#FFF"></u-skeleton>
  132. </view>
  133. </template>
  134. <script>
  135. var user = require('../../common/user.js');
  136. export default {
  137. onLoad(options) {
  138. this.doctorid = options.id
  139. if (options.time != undefined) {
  140. this.daytime = options.time
  141. }
  142. this.barindex = options.index
  143. if (this.barindex == 3) {
  144. this.isjigou = true
  145. } else {
  146. this.isjigou = false
  147. }
  148. console.log(options)
  149. },
  150. onShow() {
  151. this.gettime()
  152. this.getdoctorInfo()
  153. },
  154. mounted() {
  155. },
  156. data() {
  157. return {
  158. doctorid: "",
  159. doctor: {},
  160. shadowStyle: {
  161. backgroundImage: "none"
  162. },
  163. isjigou: false,
  164. barindex: 1, //显示按钮
  165. daytime: "",
  166. multiSelector: [],
  167. show: false,
  168. istime: false,
  169. hospital: "",
  170. address: "",
  171. distance: "",
  172. jigouid: "",
  173. year: "",
  174. yearid: "",
  175. isphone: false,
  176. istuwen: false,
  177. ismenzhen: false,
  178. loading: true,
  179. }
  180. },
  181. methods: {
  182. getdoctorInfo: async function() {
  183. let res = await this.$request.post("/api/v1/docter/docterDetail", {
  184. docter_id: this.doctorid,
  185. latitude: uni.getStorageSync("latitude"),
  186. longitude: uni.getStorageSync("longitude")
  187. })
  188. console.log(res)
  189. if (res) {
  190. this.loading = false;
  191. }
  192. this.doctor = res
  193. this.doctor.is_chat != 0 ? this.istuwen = false : this.istuwen = true,
  194. this.doctor.is_phone != 0 ? this.isphone = false : this.isphone = true,
  195. this.doctor.is_appoint != 0 || this.multiSelector.length != 0 ? this.ismenzhen = false : this.ismenzhen = true
  196. },
  197. submitCollect: async function(e) {
  198. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  199. type: 1,
  200. relation_id: e.currentTarget.dataset.id
  201. })
  202. let status = user.islogin(res)
  203. if (status) {
  204. if (res.data.is_collect == 0) {
  205. uni.showToast({
  206. title: "取消成功",
  207. icon: "none"
  208. })
  209. this.doctor.is_collect = res.data.is_collect
  210. } else {
  211. uni.showToast({
  212. title: "关注成功",
  213. icon: "none"
  214. })
  215. this.doctor.is_collect = res.data.is_collect
  216. }
  217. }
  218. },
  219. gettime: async function() {
  220. this.multiSelector = []
  221. let res = await this.$request.post("/api/v1/docter/schedulePeriodList", {
  222. docter_id: this.doctorid
  223. })
  224. if (res.status == 0) {
  225. console.log(res)
  226. if (res.data.data.length != 0) {
  227. let nian = res.data.data.map(item => {
  228. return item.schedule_date
  229. })
  230. let time = res.data.data.map(item => {
  231. return item.schedule_period.map(itm => {
  232. return { ...itm.time_period,
  233. ...itm.organization
  234. }
  235. })
  236. })
  237. time[0].forEach(item => {
  238. item.start_time_period = item.start_time_period + '-' + item.end_time_period
  239. })
  240. this.multiSelector.push(nian)
  241. this.multiSelector.push(time[0])
  242. this.daytime = this.multiSelector[0][0] + " " + this.multiSelector[1][0].start_time_period
  243. this.hospital = this.multiSelector[1][0].name
  244. this.address = this.multiSelector[1][0].address
  245. this.jigouid = this.multiSelector[1][0].id
  246. this.year = this.multiSelector[0][0]
  247. console.log(this.year)
  248. this.yearid = this.multiSelector[1][0].id
  249. console.log(this.yearid)
  250. this.distance = parseInt(this.multiSelector[1][0].distance) / 1000
  251. }
  252. }
  253. },
  254. gotoxuanze(e) {
  255. if (e.currentTarget.dataset.istrue == 0) {
  256. uni.showToast({
  257. title: "该医生暂未开通服务",
  258. icon: "none",
  259. duration: 1500
  260. })
  261. return false
  262. }
  263. this.barindex = e.currentTarget.dataset.index
  264. if (this.barindex == 3) {
  265. this.isjigou = true
  266. } else {
  267. this.isjigou = false
  268. }
  269. },
  270. phonezixun() {
  271. uni.navigateTo({
  272. url: "info_write?doctor=" + JSON.stringify(this.doctor) + "&type=" + this.barindex + "&time=" + this.daytime +
  273. "&hospital=" + this.hospital + "&jigou=" + this.jigouid + "&year=" + this.year + "&yearid=" + this.yearid
  274. })
  275. },
  276. xuantime() {
  277. if (this.multiSelector.length != 0) {
  278. this.show = !this.show
  279. } else {
  280. uni.showToast({
  281. title: "该医生暂未排班",
  282. icon: "none"
  283. })
  284. }
  285. },
  286. callbacktime(arr) {
  287. this.daytime = this.multiSelector[0][arr[0]] + " " + this.multiSelector[1][arr[1]].start_time_period
  288. this.hospital = this.multiSelector[1][arr[1]].name
  289. this.address = this.multiSelector[1][arr[1]].address
  290. this.jigouid = this.multiSelector[1][arr[1]].id
  291. this.year = this.multiSelector[0][arr[0]]
  292. this.yearid = this.multiSelector[1][arr[1]].id
  293. this.distance = parseInt(this.multiSelector[1][arr[1]].distance) / 1000
  294. }
  295. }
  296. };
  297. </script>
  298. <style scoped>
  299. @import url("../index/mine.css");
  300. .gridstyle {
  301. height: 340rpx;
  302. background-color: #fff;
  303. border-radius: 16rpx;
  304. margin-top: 30rpx;
  305. box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
  306. }
  307. .det-body {
  308. z-index: 1;
  309. padding-top: 80rpx;
  310. }
  311. .det-bg-img {
  312. position: absolute;
  313. top: 0;
  314. left: 0;
  315. right: 0;
  316. z-index: 1;
  317. display: block;
  318. width: 100%;
  319. height: 267rpx;
  320. }
  321. .det-head {
  322. z-index: 2;
  323. box-shadow: 0 0 50rpx 0 rgba(248, 151, 164, 0.13);
  324. }
  325. .det-attention {
  326. position: absolute;
  327. display: block;
  328. bottom: -22rpx;
  329. right: 50%;
  330. z-index: 1;
  331. width: 128rpx;
  332. height: auto;
  333. margin-right: -64rpx;
  334. padding: 4rpx 0;
  335. background-color: #F897A1;
  336. box-sizing: border-box;
  337. }
  338. .det-attention.active {
  339. background-color: #E6E6E6;
  340. }
  341. .det-item {
  342. width: calc((100% - 120rpx) / 4);
  343. }
  344. .det-item.active {
  345. background-color: rgba(255, 123, 114, 0.24);
  346. }
  347. .det-item .text {
  348. color: rgba(0, 0, 0, 0.54);
  349. }
  350. .det-item .price {
  351. color: rgba(0, 0, 0, 0.40);
  352. }
  353. .det-item.active .text,
  354. .det-item.active .price {
  355. color: #FF979C;
  356. }
  357. .det-item.disabled .text,
  358. .det-item.disabled .price {
  359. color: rgba(0, 0, 0, 0.3);
  360. }
  361. .button-reset {
  362. height: 102rpx;
  363. background: none !important;
  364. color: rgba(0, 0, 0, 0.54) !important;
  365. }
  366. button::after {
  367. border: none;
  368. }
  369. .button-reset::after {
  370. border: none;
  371. }
  372. .package-list {
  373. width: 100%;
  374. height: 178rpx;
  375. overflow: hidden;
  376. }
  377. .package-list .warp {
  378. white-space: nowrap;
  379. overflow: scroll;
  380. }
  381. .package-list .warp .list {
  382. background: red;
  383. display: inline-block;
  384. font-size: 14px;
  385. width: 266rpx;
  386. height: 178rpx;
  387. background: linear-gradient(270deg, rgba(255, 100, 101, 1) 0%, rgba(255, 148, 133, 1) 100%);
  388. box-shadow: 0px 3px 5px 0px rgba(255, 110, 110, 0.5);
  389. border-radius: 8rpx;
  390. margin-right: 18rpx;
  391. padding: 30rpx 20rpx 24rpx 20rpx;
  392. overflow: hidden;
  393. }
  394. .package-list .warp .list:nth-child(3) {
  395. margin-right: 0;
  396. }
  397. .package-list .warp .list .name {
  398. font-size: 30rpx;
  399. font-weight: 500;
  400. color: rgba(255, 255, 255, 1);
  401. line-height: 30rpx;
  402. }
  403. .package-list .warp .list .desc {
  404. font-size: 24rpx;
  405. font-weight: 400;
  406. color: rgba(255, 255, 255, .87);
  407. margin-top: 16rpx;
  408. line-height: 24rpx;
  409. }
  410. .package-list .warp .list .price {
  411. font-size: 24rpx;
  412. font-weight: 500;
  413. color: rgba(255, 255, 255, 1);
  414. margin-top: 30rpx;
  415. line-height: 24rpx;
  416. }
  417. .det-desc {
  418. height: 40px;
  419. overflow: hidden;
  420. }
  421. .det-desc.active {
  422. height: auto;
  423. }
  424. .follow_style {
  425. position: absolute;
  426. bottom: -12rpx;
  427. left: 8rpx;
  428. z-index: 1;
  429. width: 106rpx;
  430. height: 40rpx;
  431. padding: 4rpx 0;
  432. background-color: rgb(208, 105, 150);
  433. box-sizing: border-box;
  434. color: #fff;
  435. text-align: center;
  436. border-radius: 60rpx;
  437. font-size: 24rpx;
  438. display: flex;
  439. justify-content: center;
  440. align-items: center;
  441. }
  442. </style>