doctor_info.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <view class="main">
  3. <view>
  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">
  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" :key="index">{{itm}}</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="f14 m-gray-big">评分:<text class="m-theme">{{doctor.score}}</text>
  16. <text class="f11 margin-left-xs">分</text>
  17. </view>
  18. <view class="f14 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">距离:{{parseInt(doctor.distance/1000)}}km</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">
  41. <u-grid :col="3" :border="false">
  42. <view @click="gotoxuanze" data-index="1">
  43. <u-grid-item>
  44. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexphone.png"
  45. shape="circle"></u-image>
  46. <view class="grid-text margin-top-sm">电话咨询</view>
  47. </u-grid-item>
  48. </view>
  49. <view class="" @click="gotoxuanze" data-index="2">
  50. <u-grid-item>
  51. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indextu.png"
  52. shape="circle"></u-image>
  53. <view class="grid-text margin-top-sm">图文咨询</view>
  54. </u-grid-item>
  55. </view>
  56. <view class="" @click="gotoxuanze" data-index="3">
  57. <u-grid-item>
  58. <u-image width="120rpx" height="120rpx" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/indexmen.png"
  59. shape="circle"></u-image>
  60. <view class="grid-text margin-top-sm">门诊预约</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: 410rpx;"
  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">xxxxxxxxxxxxxxxxxxxxxx</view>
  82. </view>
  83. <view class="pr m-xcenter plr15 mt10">
  84. <view class="m-flex tl m-gray-small f12 pl15 mr5">地址:xxxxxxxxxxxxxxxxxx</view>
  85. <view class="pt2 pb2 plr10 f12 m-gray-small br-gray-letter bdr30" v-if="true">
  86. {{0}}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" 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. <view v-if="barindex==1" class="submit text-white" @click="phonezixun" style="background-color: rgb(11,115,186);">电话咨询</view>
  127. <view v-else-if="barindex==2" class="submit text-white" @click="phonezixun" style="background-color: rgb(11,115,186)">图文咨询</view>
  128. <view v-else class="submit text-white" @click="phonezixun" style="background-color: rgb(11,115,186)">门诊预约</view>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. export default {
  134. onLoad(options) {
  135. this.doctorid = options.id
  136. this.daytime = options.time
  137. console.log(options)
  138. },
  139. mounted() {
  140. this.getdoctorInfo()
  141. this.gettime()
  142. },
  143. data() {
  144. return {
  145. doctorid: "",
  146. doctor: {},
  147. shadowStyle: {
  148. backgroundImage: "none"
  149. },
  150. isjigou: false,
  151. barindex: 1, //显示按钮
  152. daytime: "",
  153. multiSelector: [],
  154. params: {
  155. year: false,
  156. month: true,
  157. day: true,
  158. hour: true,
  159. minute: true,
  160. second: false
  161. },
  162. show: false,
  163. istime: false,
  164. }
  165. },
  166. methods: {
  167. getdoctorInfo: async function() {
  168. let res = await this.$request.post("/api/v1/docter/docterDetail", {
  169. docter_id: this.doctorid,
  170. latitude: uni.getStorageSync("latitude"),
  171. longitude: uni.getStorageSync("longitude")
  172. })
  173. this.doctor = res
  174. console.log(res)
  175. },
  176. submitCollect: async function(e) {
  177. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  178. type: 1,
  179. relation_id: e.currentTarget.dataset.id
  180. })
  181. if (res.status == 0) {
  182. if (res.data.is_collect == 0) {
  183. uni.showToast({
  184. title: "取消成功",
  185. icon: "none"
  186. })
  187. this.doctor.is_collect = res.data.is_collect
  188. } else {
  189. uni.showToast({
  190. title: "关注成功",
  191. icon: "none"
  192. })
  193. this.doctor.is_collect = res.data.is_collect
  194. }
  195. }
  196. },
  197. gettime: async function() {
  198. let res = await this.$request.post("/api/v1/docter/schedulePeriodList", {
  199. docter_id: this.doctorid
  200. })
  201. console.log(res)
  202. if (res.status == 0) {
  203. // res.data.list.forEach(item => {
  204. // item.start_time_period = item.start_time_period + '-' + item.end_time_period
  205. // })
  206. // this.multiSelector.push(res.data.dates)
  207. // this.multiSelector.push(res.data.list)
  208. // this.showtime = res.data.dates[0] + ' ' + res.data.list[0].start_time_period
  209. }
  210. },
  211. gotoxuanze(e) {
  212. this.barindex = e.currentTarget.dataset.index
  213. if (e.currentTarget.dataset.index == 3) {
  214. this.isjigou = true
  215. } else {
  216. this.isjigou = false
  217. }
  218. },
  219. phonezixun() {
  220. uni.navigateTo({
  221. url: "info_write?doctor=" + JSON.stringify(this.doctor) + "&type=" + this.barindex + "&time=" + this.daytime
  222. })
  223. },
  224. xuantime() {
  225. this.show = !this.show
  226. },
  227. }
  228. };
  229. </script>
  230. <style scoped>
  231. @import url("../index/mine.css");
  232. .gridstyle {
  233. height: 340rpx;
  234. background-color: #fff;
  235. border-radius: 16rpx;
  236. margin-top: 30rpx;
  237. box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);
  238. }
  239. .det-body {
  240. z-index: 1;
  241. padding-top: 80rpx;
  242. }
  243. .det-bg-img {
  244. position: absolute;
  245. top: 0;
  246. left: 0;
  247. right: 0;
  248. z-index: 1;
  249. display: block;
  250. width: 100%;
  251. height: 267rpx;
  252. }
  253. .det-head {
  254. z-index: 2;
  255. box-shadow: 0 0 50rpx 0 rgba(248, 151, 164, 0.13);
  256. }
  257. .det-attention {
  258. position: absolute;
  259. display: block;
  260. bottom: -22rpx;
  261. right: 50%;
  262. z-index: 1;
  263. width: 128rpx;
  264. height: auto;
  265. margin-right: -64rpx;
  266. padding: 4rpx 0;
  267. background-color: #F897A1;
  268. box-sizing: border-box;
  269. }
  270. .det-attention.active {
  271. background-color: #E6E6E6;
  272. }
  273. .det-item {
  274. width: calc((100% - 120rpx) / 4);
  275. }
  276. .det-item.active {
  277. background-color: rgba(255, 123, 114, 0.24);
  278. }
  279. .det-item .text {
  280. color: rgba(0, 0, 0, 0.54);
  281. }
  282. .det-item .price {
  283. color: rgba(0, 0, 0, 0.40);
  284. }
  285. .det-item.active .text,
  286. .det-item.active .price {
  287. color: #FF979C;
  288. }
  289. .det-item.disabled .text,
  290. .det-item.disabled .price {
  291. color: rgba(0, 0, 0, 0.3);
  292. }
  293. .button-reset {
  294. height: 102rpx;
  295. background: none !important;
  296. color: rgba(0, 0, 0, 0.54) !important;
  297. }
  298. button::after {
  299. border: none;
  300. }
  301. .button-reset::after {
  302. border: none;
  303. }
  304. .package-list {
  305. width: 100%;
  306. height: 178rpx;
  307. overflow: hidden;
  308. }
  309. .package-list .warp {
  310. white-space: nowrap;
  311. overflow: scroll;
  312. }
  313. .package-list .warp .list {
  314. background: red;
  315. display: inline-block;
  316. font-size: 14px;
  317. width: 266rpx;
  318. height: 178rpx;
  319. background: linear-gradient(270deg, rgba(255, 100, 101, 1) 0%, rgba(255, 148, 133, 1) 100%);
  320. box-shadow: 0px 3px 5px 0px rgba(255, 110, 110, 0.5);
  321. border-radius: 8rpx;
  322. margin-right: 18rpx;
  323. padding: 30rpx 20rpx 24rpx 20rpx;
  324. overflow: hidden;
  325. }
  326. .package-list .warp .list:nth-child(3) {
  327. margin-right: 0;
  328. }
  329. .package-list .warp .list .name {
  330. font-size: 30rpx;
  331. font-weight: 500;
  332. color: rgba(255, 255, 255, 1);
  333. line-height: 30rpx;
  334. }
  335. .package-list .warp .list .desc {
  336. font-size: 24rpx;
  337. font-weight: 400;
  338. color: rgba(255, 255, 255, .87);
  339. margin-top: 16rpx;
  340. line-height: 24rpx;
  341. }
  342. .package-list .warp .list .price {
  343. font-size: 24rpx;
  344. font-weight: 500;
  345. color: rgba(255, 255, 255, 1);
  346. margin-top: 30rpx;
  347. line-height: 24rpx;
  348. }
  349. .det-desc {
  350. height: 40px;
  351. overflow: hidden;
  352. }
  353. .det-desc.active {
  354. height: auto;
  355. }
  356. .follow_style {
  357. position: absolute;
  358. bottom: -12rpx;
  359. left: 8rpx;
  360. z-index: 1;
  361. width: 106rpx;
  362. height: 40rpx;
  363. padding: 4rpx 0;
  364. background-color: rgb(208, 105, 150);
  365. box-sizing: border-box;
  366. color: #fff;
  367. text-align: center;
  368. border-radius: 60rpx;
  369. font-size: 24rpx;
  370. display: flex;
  371. justify-content: center;
  372. align-items: center;
  373. }
  374. </style>