inquiryOrderDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  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">{{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_order/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. export default {
  292. data() {
  293. return {
  294. report:null,
  295. patient:null,
  296. hospital:null,
  297. department:null,
  298. doctor:null,
  299. order:null,
  300. orderId:null,
  301. orderStatusOptions:[],
  302. orderTypeOptions:[],
  303. inquiryTypeOptions:[],
  304. reportImages: [],
  305. tongueImages:[],
  306. faceImages:[],
  307. // forms:[],
  308. }
  309. },
  310. onLoad(options) {
  311. this.orderId=options.orderId;
  312. this.getDictByKey("sys_inquiry_order_type");
  313. this.getDictByKey("sys_inquiry_type");
  314. this.getDictByKey("sys_inquiry_status");
  315. },
  316. onShow() {
  317. this.getMyInquiryOrderById();
  318. },
  319. methods: {
  320. cancel(){
  321. var that=this;
  322. uni.showModal({
  323. title:"提示",
  324. content:"确认取消订单吗?",
  325. showCancel:true,
  326. cancelText:'取消',
  327. confirmText:'确定',
  328. success:res=>{
  329. if(res.confirm){
  330. // 用户点击确定
  331. var data={orderId:this.orderId}
  332. cancel(data).then(
  333. res => {
  334. if(res.code==200){
  335. that.getMyInquiryOrderById()
  336. uni.showToast({
  337. icon:'success',
  338. title: "操作成功",
  339. });
  340. }else{
  341. uni.showToast({
  342. icon:'none',
  343. title: res.msg,
  344. });
  345. }
  346. },
  347. rej => {}
  348. );
  349. }else{
  350. // 否则点击了取消
  351. }
  352. }
  353. })
  354. },
  355. ping(){
  356. uni.navigateTo({
  357. url: "/pages_order/pingOrder?orderId="+this.orderId+"&doctorId="+this.order.doctorId
  358. })
  359. },
  360. pay(){
  361. uni.navigateTo({
  362. url: "/pages_order/inquiryPay?orderId="+this.orderId
  363. })
  364. },
  365. toIM(){
  366. var that=this;
  367. var id="C2CD-"+this.doctor.doctorId;
  368. store.commit("timStore/setType","startInquiry");
  369. store.commit("timStore/setOrderType",this.order.orderType);
  370. store.commit("timStore/setOrderId",this.order.orderId);
  371. store.commit("timStore/setFollowId", 0);
  372. store.commit("timStore/setImType", 1);
  373. store.commit("timStore/setConversationID", id);
  374. uni.$TUIKit.TUIConversationServer.setMessageRead(id);
  375. uni.$TUIKit.TUIConversationServer.getConversationProfile(id)
  376. .then((res) => {
  377. uni.$TUIKit.TUIConversationServer.setConversationValue(id,that.orderId)
  378. .then((res) => {
  379. console.log("更新order")
  380. })
  381. .catch((err) => {
  382. });
  383. console.log(res)
  384. //通知 TUIChat 关闭当前会话
  385. const { conversation } = res.data;
  386. store.commit("timStore/setConversation", conversation);
  387. let url = "/pages/TUIKit/TUIPages/TUIChat/index";
  388. const { nick: name } = conversation.userProfile;
  389. url = `${url}?conversationName=${
  390. conversation.userProfile.nick?.nick ||
  391. conversation.userProfile.userID
  392. }`;
  393. uni.redirectTo({ url });
  394. })
  395. .catch((err) => {
  396. console.warn("获取 group profile 异常 = ", err);
  397. });
  398. },
  399. navTo(url){
  400. uni.navigateTo({
  401. url: url
  402. })
  403. },
  404. copyOrderSn() {
  405. uni.setClipboardData({
  406. data: this.order.orderSn,
  407. success: function () {
  408. uni.showToast({
  409. title:'复制成功',
  410. icon:'none'
  411. })
  412. }
  413. })
  414. },
  415. getMyInquiryOrderById(){
  416. var that=this;
  417. var data={orderId:this.orderId}
  418. getMyInquiryOrderById(data).then(
  419. res => {
  420. if(res.code==200){
  421. this.order=res.data.order;
  422. this.report=res.data.report;
  423. this.patient=JSON.parse(res.data.order.patientJson);
  424. // if(this.report!=null&&this.report.formJson!=null){
  425. // this.forms=JSON.parse(this.report.formJson)
  426. // }
  427. if(that.patient.reportImages!=null){
  428. that.reportImages=that.patient.reportImages.split(",");
  429. }
  430. if(that.patient.tongueImages!=null){
  431. that.tongueImages=that.patient.tongueImages.split(",");
  432. }
  433. if(that.patient.faceImages!=null){
  434. that.faceImages=that.patient.faceImages.split(",");
  435. }
  436. this.doctor=res.data.doctor;
  437. this.department=res.data.department;
  438. this.hospital=res.data.hospital;
  439. }
  440. },
  441. err => {
  442. }
  443. );
  444. },
  445. getDictByKey(key){
  446. var data={key:key}
  447. getDictByKey(data).then(
  448. res => {
  449. if(res.code==200){
  450. if(key=="sys_inquiry_order_type"){
  451. this.orderTypeOptions=res.data;
  452. }
  453. if(key=="sys_inquiry_type"){
  454. this.inquiryTypeOptions=res.data;
  455. }
  456. if(key=="sys_inquiry_status"){
  457. this.orderStatusOptions=res.data;
  458. }
  459. }
  460. },
  461. err => {
  462. }
  463. );
  464. },
  465. navTo(url){
  466. uni.navigateTo({
  467. url: url
  468. })
  469. }
  470. }
  471. }
  472. </script>
  473. <style lang="scss">
  474. page{
  475. background: #f6f6f6;
  476. }
  477. </style>
  478. <style scoped lang="scss">
  479. .content{
  480. position: relative;
  481. .cont{
  482. position: relative;
  483. padding: 0rpx 20rpx 120rpx;
  484. z-index: 999;
  485. width: 100%;
  486. display: flex;
  487. flex-direction: column;
  488. }
  489. .doc-box{
  490. margin: 20rpx 0rpx 0rpx;
  491. padding: 0rpx 30rpx;
  492. background-color: #fff;
  493. border-radius: 20upx;
  494. .title{
  495. height: 80upx;
  496. line-height: 80upx;
  497. font-size: 30upx;
  498. color: #000;
  499. font-weight: bold;
  500. border-bottom: 2upx solid #eeeeee;
  501. }
  502. .doc-name-box{
  503. margin-top: 15rpx;
  504. display: flex;
  505. align-items: center;
  506. justify-content: flex-start;
  507. .doc-name{
  508. font-size: 38rpx;
  509. font-weight: bold;
  510. }
  511. .doc-star{
  512. margin-left: 10rpx;
  513. }
  514. }
  515. .doc-dept-box{
  516. display: flex;
  517. align-items: center;
  518. justify-content: flex-start;
  519. margin-top: 15rpx;
  520. font-size: 28upx;
  521. font-family: PingFang SC;
  522. color: #2d2b36;
  523. }
  524. .doc-his-box{
  525. display: flex;
  526. align-items: center;
  527. justify-content: flex-start;
  528. margin-top: 15rpx;
  529. font-size: 28upx;
  530. font-family: PingFang SC;
  531. color: #9a9a9c;
  532. }
  533. .doc-spec-box{
  534. display: flex;
  535. align-items: center;
  536. justify-content: space-between;
  537. .left{
  538. display: flex;
  539. align-items: center;
  540. justify-content: flex-start;
  541. .title{
  542. font-size: 28upx;
  543. font-family: PingFang SC;
  544. color: #9a9a9c;
  545. }
  546. .spec{
  547. margin-left: 10rpx;
  548. font-size: 28upx;
  549. font-family: PingFang SC;
  550. color: #9a9a9c;
  551. }
  552. }
  553. .right{
  554. .btn{
  555. font-size: 28upx;
  556. font-family: PingFang SC;
  557. color: #C39A58;
  558. }
  559. }
  560. }
  561. }
  562. .other-info{
  563. margin-top: 20upx;
  564. background-color: #fff;
  565. border-radius: 20upx;
  566. padding: 0 30upx;
  567. .title{
  568. height: 80upx;
  569. line-height: 80upx;
  570. font-size: 30upx;
  571. color: #000;
  572. font-weight: bold;
  573. border-bottom: 2upx solid #eeeeee;
  574. }
  575. .item{
  576. min-height: 80upx;
  577. display: flex;
  578. align-items: center;
  579. justify-content: space-between;
  580. &:last-child{
  581. border-bottom: none;
  582. }
  583. .left{
  584. flex: 1;
  585. display: flex;
  586. align-items: center;
  587. .label{
  588. min-width: 140rpx;
  589. font-size: 28upx;
  590. color: #000;
  591. }
  592. .text{
  593. font-size: 28upx;
  594. color: #1b1b1b;
  595. }
  596. }
  597. .status{
  598. font-size: 28upx;
  599. font-family: PingFang SC;
  600. font-weight: bold;
  601. }
  602. .red{
  603. color: #db5053;
  604. }
  605. .green{
  606. color: #C39A58;
  607. }
  608. .gray{
  609. color: #9c9c9c;
  610. }
  611. .item-btn{
  612. max-width: 200rpx;
  613. padding: 0rpx 15rpx;
  614. height: 48upx;
  615. border-radius: 24upx;
  616. line-height: 48upx;
  617. font-size: 24upx;
  618. color: #000;
  619. border: 1upx solid #d8d8d8;
  620. display: flex;
  621. align-items: center;
  622. justify-content: center;
  623. }
  624. }
  625. }
  626. .btn-box{
  627. height: 100rpx;
  628. z-index: 9999;
  629. width: 100%;
  630. padding: 0rpx 30upx;
  631. position: fixed;
  632. bottom: 0;
  633. left: 0;
  634. box-sizing: border-box;
  635. background-color: #ffffff;
  636. display: flex;
  637. align-items: center;
  638. justify-content: flex-end;
  639. .btn{
  640. padding: 15rpx 30rpx;
  641. margin-left: 10rpx;
  642. text-align: center;
  643. font-size: 28upx;
  644. font-family: PingFang SC;
  645. color: #FFFFFF;
  646. background: #C39A58;
  647. border-radius: 45upx;
  648. }
  649. }
  650. }
  651. </style>