inquiryOrderDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <template>
  2. <view class="content">
  3. <view class="cont">
  4. <view class="other-info" v-if="order!=null">
  5. <view class="title">付款详情</view>
  6. <view class="item">
  7. <view class="left">
  8. <text class="label">订单类型:</text>
  9. <text class="text">{{$getDictLabelName(inquiryTypeOptions,order.inquiryType)}}</text>
  10. <text class="text">-{{$getDictLabelName(orderTypeOptions,order.orderType)}}</text>
  11. </view>
  12. <view class="status red" v-if="order.status==1">
  13. {{$getDictLabelName(orderStatusOptions,order.status)}}
  14. </view>
  15. <view class="status red" v-if="order.status==2">
  16. {{$getDictLabelName(orderStatusOptions,order.status)}}
  17. </view>
  18. <view class="status green" v-if="order.status==3">
  19. {{$getDictLabelName(orderStatusOptions,order.status)}}
  20. </view>
  21. <view class="status green" v-if="order.status==4">
  22. {{$getDictLabelName(orderStatusOptions,order.status)}}
  23. </view>
  24. <view class="status gray" v-if="order.status<0">
  25. {{$getDictLabelName(orderStatusOptions,order.status)}}
  26. </view>
  27. </view>
  28. </view>
  29. <view class="doc-box" v-if="doctor!=null">
  30. <view class="title">医生详情</view>
  31. <view class="doc-name-box">
  32. <view class="doc-name">
  33. {{doctor.doctorName}}
  34. </view>
  35. <view class="doc-star">
  36. <u-rate activeColor="#ffc603" count="5" readonly v-model="doctor.pingStar"></u-rate>
  37. </view>
  38. </view>
  39. <view class="doc-dept-box">
  40. {{department.deptName}}|{{doctor.position}}
  41. </view>
  42. <view class="doc-his-box">
  43. {{hospital.hospitalName}}
  44. </view>
  45. <view class="doc-spec-box">
  46. <view class="left">
  47. <view class="title">擅长:</view>
  48. <view class="spec textTwo">{{doctor.speciality}}</view>
  49. </view>
  50. <view class="right">
  51. <view class="btn" @click="navTo('/pages/doctor/doctorDetails?doctorId='+doctor.doctorId)" >详情</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="other-info" v-if="patient!=null&&order.inquiryType==1">
  56. <view class="title">咨询内容</view>
  57. <view class="item">
  58. <view class="left">
  59. <text class="label">患者信息:</text>
  60. <text class="text">{{patient.patientName}} {{patient.sex==1?"男":"女"}} {{patient.age}}岁</text>
  61. </view>
  62. </view>
  63. <view class="item">
  64. <view class="left">
  65. <text class="label">病情描述:</text>
  66. <text class="text">{{patient.title}}</text>
  67. </view>
  68. </view>
  69. <view class="item">
  70. <view class="left">
  71. <text class="label">患病时间:</text>
  72. <text class="text">{{patient.duration}}</text>
  73. </view>
  74. </view>
  75. <view class="item">
  76. <view class="left">
  77. <text class="label">就诊情况:</text>
  78. <text class="text">{{patient.isVisit}}</text>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="other-info" v-if="patient!=null&&order.inquiryType==2">
  83. <view class="title">咨询内容</view>
  84. <view class="item">
  85. <view class="left">
  86. <text class="label">患者信息:</text>
  87. <text class="text">{{patient.patientName}} {{patient.sex==1?"男":"女"}} {{patient.age}}岁</text>
  88. </view>
  89. </view>
  90. <!-- <view class="item">
  91. <view class="left">
  92. <text class="label">身高(CM):</text>
  93. <text class="text">{{patient.height}}</text>
  94. </view>
  95. </view>
  96. <view class="item">
  97. <view class="left">
  98. <text class="label">体重(KG):</text>
  99. <text class="text">{{patient.weight}}</text>
  100. </view>
  101. </view>
  102. <view class="item">
  103. <view class="left">
  104. <text class="label">联系电话:</text>
  105. <text class="text">{{patient.mobile}}</text>
  106. </view>
  107. </view> -->
  108. <!-- <view class="item">
  109. <view class="left">
  110. <text class="label">学习进度:</text>
  111. <text class="text">{{patient.study}}</text>
  112. </view>
  113. </view>
  114. <view class="item">
  115. <view class="left">
  116. <text class="label">用药情况:</text>
  117. <text class="text">{{patient.medication}}</text>
  118. </view>
  119. </view>
  120. <view class="item">
  121. <view class="left">
  122. <text class="label">期望会诊方式:</text>
  123. <text class="text">{{patient.usage}}</text>
  124. </view>
  125. </view> -->
  126. <view class="item">
  127. <view class="left">
  128. <text class="label">病情描述:</text>
  129. <text class="text">{{patient.title}}</text>
  130. </view>
  131. </view>
  132. <!-- <view class="item">
  133. <view class="left">
  134. <text class="label">正在服用药品:</text>
  135. <text class="text">{{patient.drugs}}</text>
  136. </view>
  137. </view>
  138. <view class="item">
  139. <view class="left">
  140. <text class="label">本次患病时间:</text>
  141. <text class="text">{{patient.duration}}</text>
  142. </view>
  143. </view> -->
  144. <view class="item">
  145. <view class="left">
  146. <text class="label">是否就诊过:</text>
  147. <text class="text">{{patient.isVisit}}</text>
  148. </view>
  149. </view>
  150. <!-- <view class="item">
  151. <view class="left">
  152. <text class="label">舌苔照片:</text>
  153. </view>
  154. </view>
  155. <view>
  156. <u-album :urls="tongueImages"></u-album>
  157. </view>
  158. <view class="item">
  159. <view class="left">
  160. <text class="label">面部照片:</text>
  161. </view>
  162. </view>
  163. <view>
  164. <u-album :urls="faceImages"></u-album>
  165. </view> -->
  166. <view class="item">
  167. <view class="left">
  168. <text class="label">检测报告或患处照片:</text>
  169. </view>
  170. </view>
  171. <view>
  172. <u-album :urls="reportImages"></u-album>
  173. </view>
  174. </view>
  175. <view class="other-info" v-if="patient!=null&&order.inquiryType==3">
  176. <view class="title">咨询内容</view>
  177. <view class="item">
  178. <view class="left">
  179. <text class="label">患者信息:</text>
  180. <text class="text">{{patient.patientName}} {{patient.sex==1?"男":"女"}} {{patient.age}}岁</text>
  181. </view>
  182. </view>
  183. <view class="item">
  184. <view class="left">
  185. <text class="label">病情描述:</text>
  186. <text class="text">{{patient.title}}</text>
  187. </view>
  188. </view>
  189. <view class="item">
  190. <view class="left">
  191. <text class="label">正在服用药品:</text>
  192. <text class="text">{{patient.drugs}}</text>
  193. </view>
  194. </view>
  195. <view class="item">
  196. <view class="left">
  197. <text class="label">本次患病时间:</text>
  198. <text class="text">{{patient.duration}}</text>
  199. </view>
  200. </view>
  201. <view class="item">
  202. <view class="left">
  203. <text class="label">是否就诊过:</text>
  204. <text class="text">{{patient.isVisit}}</text>
  205. </view>
  206. </view>
  207. <view class="item">
  208. <view class="left">
  209. <text class="label">检测报告或患处照片:</text>
  210. </view>
  211. </view>
  212. <view>
  213. <u-album :urls="reportImages"></u-album>
  214. </view>
  215. <view class="item">
  216. <view class="left">
  217. <text class="label">舌苔照片:</text>
  218. </view>
  219. </view>
  220. <view>
  221. <u-album :urls="tongueImages"></u-album>
  222. </view>
  223. <view class="item">
  224. <view class="left">
  225. <text class="label">面部照片:</text>
  226. </view>
  227. </view>
  228. <view>
  229. <u-album :urls="faceImages"></u-album>
  230. </view>
  231. </view>
  232. <!-- <view class="other-info" v-if="report!=null&&order.status>=3" >
  233. <view class="title">体检信息</view>
  234. <view class="item" v-for="(item) in forms">
  235. <view class="left">
  236. <text class="label">{{item.title}}:</text>
  237. <text class="text">
  238. <u-tag size="mini" plain type="success" style="margin-right: 5rpx;margin-bottom: 5rpx;" v-for="(tag) in item.option" :text="tag"></u-tag>
  239. </text>
  240. </view>
  241. </view>
  242. </view> -->
  243. <view class="other-info" v-if="order!=null">
  244. <view class="title">订单信息</view>
  245. <view class="item">
  246. <view class="left">
  247. <text class="label">订单号码:</text>
  248. <text class="text">{{order.orderSn}}</text>
  249. </view>
  250. <view class="item-btn" @click="copyOrderSn">复制</view>
  251. </view>
  252. <view class="item">
  253. <view class="left">
  254. <text class="label">下单时间:</text>
  255. <text class="text">{{order.createTime}}</text>
  256. </view>
  257. </view>
  258. <view class="item">
  259. <view class="left">
  260. <text class="label">订单金额:</text>
  261. <text class="text">{{order.money.toFixed(2)}}</text>
  262. </view>
  263. </view>
  264. <view class="item">
  265. <view class="left">
  266. <text class="label">优惠金额:</text>
  267. <text class="text">{{order.discountMoney.toFixed(2)}}</text>
  268. </view>
  269. </view>
  270. <view class="item">
  271. <view class="left">
  272. <text class="label">支付金额:</text>
  273. <text class="text">{{order.payMoney.toFixed(2)}}</text>
  274. </view>
  275. </view>
  276. </view>
  277. </view>
  278. <view class="btn-box" v-if="order!=null">
  279. <view class="btn" v-if="report!=null&&order.status>=3" @click="navTo('/pages/store/inquiryOrderReport?orderId='+order.orderId)" >查看报告</view>
  280. <view class="btn" v-if="order.status==3" @click="toIM()" >去问诊</view>
  281. <view class="btn" v-if="order.status==1" @click="pay()">去支付</view>
  282. <view class="btn" v-if="order.status==2" @click="cancel()">取消订单</view>
  283. <view class="btn" v-if="order.status==4&&order.isPing==0" @click="ping()">去评价</view>
  284. </view>
  285. </view>
  286. </template>
  287. <script >
  288. import store from "@/store";
  289. import {getMyInquiryOrderById,cancel} from '@/api/inquiryOrder.js'
  290. import {getDictByKey} from '@/api/common.js'
  291. import {navigateToDesignatedConversation,setConversation} from "@/pages_im/util/imCommon";
  292. import IMSDK, {SessionType} from "openim-uniapp-polyfill";
  293. export default {
  294. data() {
  295. return {
  296. report:null,
  297. patient:null,
  298. hospital:null,
  299. department:null,
  300. doctor:null,
  301. order:null,
  302. orderId:null,
  303. orderStatusOptions:[],
  304. orderTypeOptions:[],
  305. inquiryTypeOptions:[],
  306. reportImages: [],
  307. tongueImages:[],
  308. faceImages:[],
  309. // forms:[],
  310. }
  311. },
  312. onLoad(options) {
  313. this.orderId=options.orderId;
  314. this.getDictByKey("sys_inquiry_order_type");
  315. this.getDictByKey("sys_inquiry_type");
  316. this.getDictByKey("sys_inquiry_status");
  317. },
  318. onShow() {
  319. this.getMyInquiryOrderById();
  320. },
  321. methods: {
  322. cancel(){
  323. var that=this;
  324. uni.showModal({
  325. title:"提示",
  326. content:"确认取消订单吗?",
  327. showCancel:true,
  328. cancelText:'取消',
  329. confirmText:'确定',
  330. success:res=>{
  331. if(res.confirm){
  332. // 用户点击确定
  333. var data={orderId:this.orderId}
  334. cancel(data).then(
  335. res => {
  336. if(res.code==200){
  337. that.getMyInquiryOrderById()
  338. uni.showToast({
  339. icon:'success',
  340. title: "操作成功",
  341. });
  342. }else{
  343. uni.showToast({
  344. icon:'none',
  345. title: res.msg,
  346. });
  347. }
  348. },
  349. rej => {}
  350. );
  351. }else{
  352. // 否则点击了取消
  353. }
  354. }
  355. })
  356. },
  357. ping(){
  358. uni.navigateTo({
  359. url: "/pages/store/pingOrd="+this.orderId+"&doctorId="+this.order.doctorId
  360. })
  361. },
  362. pay(){
  363. uni.navigateTo({
  364. url: "/pages/store/inquiryPay?orderId="+this.orderId
  365. })
  366. },
  367. toIM(){
  368. if(this.$companyUserIsLogin()){
  369. uni.showToast({
  370. icon:'none',
  371. title: "当前登录的销售IM账号,暂不支持问诊",
  372. });
  373. return;
  374. }
  375. var that=this;
  376. var user = JSON.parse(uni.getStorageSync('userInfo'));
  377. var did='D' + this.doctor.doctorId;
  378. var conversationID=`si_D${this.doctor.doctorId}_U${user.userId}`;
  379. var ex={imType:1,orderId:this.order.orderId,orderType:this.order.orderType,type:"startInquiry"}
  380. this.$store.commit("timStore/setType","startInquiry");
  381. this.$store.commit("timStore/setOrderType",this.order.orderType);
  382. this.$store.commit("timStore/setOrderId",this.order.orderId);
  383. this.$store.commit("timStore/setFollowId", 0);
  384. this.$store.commit("timStore/setImType", 1);
  385. this.$store.commit("timStore/setConversationID", conversationID);
  386. navigateToDesignatedConversation(did,SessionType.Single,false).then((res) => {
  387. setConversation(conversationID,JSON.stringify(ex)).then(() => {
  388. }).catch(() => {});
  389. }).catch(() => uni.$u.toast("操作失败") );
  390. },
  391. navTo(url){
  392. uni.navigateTo({
  393. url: url
  394. })
  395. },
  396. copyOrderSn() {
  397. uni.setClipboardData({
  398. data: this.order.orderSn,
  399. success: function () {
  400. uni.showToast({
  401. title:'复制成功',
  402. icon:'none'
  403. })
  404. }
  405. })
  406. },
  407. getMyInquiryOrderById(){
  408. var that=this;
  409. var data={orderId:this.orderId}
  410. getMyInquiryOrderById(data).then(
  411. res => {
  412. if(res.code==200){
  413. this.order=res.data.order;
  414. this.report=res.data.report;
  415. this.patient=JSON.parse(res.data.order.patientJson);
  416. // if(this.report!=null&&this.report.formJson!=null){
  417. // this.forms=JSON.parse(this.report.formJson)
  418. // }
  419. if(that.patient.reportImages!=null){
  420. that.reportImages=that.patient.reportImages.split(",");
  421. }
  422. if(that.patient.tongueImages!=null){
  423. that.tongueImages=that.patient.tongueImages.split(",");
  424. }
  425. if(that.patient.faceImages!=null){
  426. that.faceImages=that.patient.faceImages.split(",");
  427. }
  428. this.doctor=res.data.doctor;
  429. this.department=res.data.department;
  430. this.hospital=res.data.hospital;
  431. }
  432. },
  433. err => {
  434. }
  435. );
  436. },
  437. getDictByKey(key){
  438. var data={key:key}
  439. getDictByKey(data).then(
  440. res => {
  441. if(res.code==200){
  442. if(key=="sys_inquiry_order_type"){
  443. this.orderTypeOptions=res.data;
  444. }
  445. if(key=="sys_inquiry_type"){
  446. this.inquiryTypeOptions=res.data;
  447. }
  448. if(key=="sys_inquiry_status"){
  449. this.orderStatusOptions=res.data;
  450. }
  451. }
  452. },
  453. err => {
  454. }
  455. );
  456. },
  457. navTo(url){
  458. uni.navigateTo({
  459. url: url
  460. })
  461. }
  462. }
  463. }
  464. </script>
  465. <style lang="scss">
  466. page{
  467. background: #f6f6f6;
  468. }
  469. </style>
  470. <style scoped lang="scss">
  471. .content{
  472. position: relative;
  473. .cont{
  474. position: relative;
  475. padding: 0rpx 20rpx 120rpx;
  476. z-index: 999;
  477. width: 100%;
  478. display: flex;
  479. flex-direction: column;
  480. }
  481. .doc-box{
  482. margin: 20rpx 0rpx 0rpx;
  483. padding: 0rpx 30rpx;
  484. background-color: #fff;
  485. border-radius: 20upx;
  486. .title{
  487. height: 80upx;
  488. line-height: 80upx;
  489. font-size: 30upx;
  490. color: #000;
  491. font-weight: bold;
  492. border-bottom: 2upx solid #eeeeee;
  493. }
  494. .doc-name-box{
  495. margin-top: 15rpx;
  496. display: flex;
  497. align-items: center;
  498. justify-content: flex-start;
  499. .doc-name{
  500. font-size: 38rpx;
  501. font-weight: bold;
  502. }
  503. .doc-star{
  504. margin-left: 10rpx;
  505. }
  506. }
  507. .doc-dept-box{
  508. display: flex;
  509. align-items: center;
  510. justify-content: flex-start;
  511. margin-top: 15rpx;
  512. font-size: 28upx;
  513. font-family: PingFang SC;
  514. color: #2d2b36;
  515. }
  516. .doc-his-box{
  517. display: flex;
  518. align-items: center;
  519. justify-content: flex-start;
  520. margin-top: 15rpx;
  521. font-size: 28upx;
  522. font-family: PingFang SC;
  523. color: #9a9a9c;
  524. }
  525. .doc-spec-box{
  526. display: flex;
  527. align-items: flex-end;
  528. justify-content: space-between;
  529. .left{
  530. display: flex;
  531. align-items: flex-start;
  532. justify-content: flex-start;
  533. .title{
  534. flex-shrink: 0;
  535. font-size: 28upx;
  536. font-family: PingFang SC;
  537. color: #9a9a9c;
  538. line-height: normal;
  539. border-bottom: none;
  540. }
  541. .spec{
  542. margin-left: 10rpx;
  543. font-size: 28upx;
  544. font-family: PingFang SC;
  545. color: #9a9a9c;
  546. }
  547. }
  548. .right{
  549. flex-shrink: 0;
  550. .btn{
  551. font-size: 28upx;
  552. font-family: PingFang SC;
  553. color: #2583EB;
  554. }
  555. }
  556. }
  557. }
  558. .other-info{
  559. margin-top: 20upx;
  560. background-color: #fff;
  561. border-radius: 20upx;
  562. padding: 0 30upx;
  563. .title{
  564. height: 80upx;
  565. line-height: 80upx;
  566. font-size: 30upx;
  567. color: #000;
  568. font-weight: bold;
  569. border-bottom: 2upx solid #eeeeee;
  570. }
  571. .item{
  572. min-height: 80upx;
  573. display: flex;
  574. align-items: center;
  575. justify-content: space-between;
  576. &:last-child{
  577. border-bottom: none;
  578. }
  579. .left{
  580. flex: 1;
  581. display: flex;
  582. align-items: center;
  583. .label{
  584. min-width: 140rpx;
  585. font-size: 28upx;
  586. color: #000;
  587. }
  588. .text{
  589. font-size: 28upx;
  590. color: #1b1b1b;
  591. }
  592. }
  593. .status{
  594. font-size: 28upx;
  595. font-family: PingFang SC;
  596. font-weight: bold;
  597. }
  598. .red{
  599. color: #db5053;
  600. }
  601. .green{
  602. color: #2583EB;
  603. }
  604. .gray{
  605. color: #9c9c9c;
  606. }
  607. .item-btn{
  608. max-width: 200rpx;
  609. padding: 0rpx 15rpx;
  610. height: 48upx;
  611. border-radius: 24upx;
  612. line-height: 48upx;
  613. font-size: 24upx;
  614. color: #000;
  615. border: 1upx solid #d8d8d8;
  616. display: flex;
  617. align-items: center;
  618. justify-content: center;
  619. }
  620. }
  621. }
  622. .btn-box{
  623. height: 100rpx;
  624. z-index: 9999;
  625. width: 100%;
  626. padding: 0rpx 30upx;
  627. position: fixed;
  628. bottom: 0;
  629. left: 0;
  630. box-sizing: border-box;
  631. background-color: #ffffff;
  632. display: flex;
  633. align-items: center;
  634. justify-content: flex-end;
  635. .btn{
  636. padding: 15rpx 30rpx;
  637. margin-left: 10rpx;
  638. text-align: center;
  639. font-size: 28upx;
  640. font-family: PingFang SC;
  641. color: #FFFFFF;
  642. background: #2583EB;
  643. border-radius: 45upx;
  644. }
  645. }
  646. }
  647. </style>