"use strict";var t=require("../common/vendor.js"),e=require("../store/index.js"),s=require("../uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js"),o=require("../api/inquiryOrder.js"),r=require("../api/common.js");require("../store/modules.js"),require("../store/modules/timStore.js"),require("../common/request.js");const i={mixins:[s.MescrollMixin],data:()=>({orderStatusOptions:[],orderTypeOptions:[],inquiryTypeOptions:[],tabs:[{id:2,name:"快速咨询"},{id:1,name:"专家咨询"},{id:3,name:"开药咨询"}],inquiryType:2,mescroll:null,downOption:{use:!0,auto:!1},upOption:{onScroll:!1,use:!0,page:{pae:0,size:10},noMoreSize:10,textNoMore:"已经到底了",empty:{icon:"https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png",tip:"暂无数据"}},dataList:[]}),onLoad(){this.getDictByKey("sys_inquiry_order_type"),this.getDictByKey("sys_inquiry_type"),this.getDictByKey("sys_inquiry_status");var e=this;t.index.$on("refreshInquiryOrder",(()=>{e.mescroll.resetUpScroll()})),t.index.$emit("refreshIM")},onShow(){},methods:{cancel(e){t.index.showModal({title:"提示",content:"确认取消订单吗?",showCancel:!0,cancelText:"取消",confirmText:"确定",success:s=>{if(s.confirm){var r={orderId:e.orderId};o.cancel(r).then((e=>{200==e.code?(this.mescroll.resetUpScroll(),t.index.showToast({icon:"success",title:"操作成功"})):t.index.showToast({icon:"none",title:e.msg})}),(t=>{}))}}})},ping(e){t.index.navigateTo({url:"/pages_order/pingOrder?orderId="+e.orderId})},pay(e){t.index.navigateTo({url:"/pages_order/inquiryPay?orderId="+e.orderId})},toIM(s){var o="C2CD-"+s.doctorId;e.store.commit("timStore/setType","startInquiry"),e.store.commit("timStore/setOrderType",s.orderType),e.store.commit("timStore/setImType",1),e.store.commit("timStore/setFollowId",0),e.store.commit("timStore/setOrderId",s.orderId),e.store.commit("timStore/setConversationID",o),t.index.$TUIKit.TUIConversationServer.setMessageRead(o),t.index.$TUIKit.TUIConversationServer.getConversationProfile(o).then((o=>{var r;const{conversation:i}=o.data;e.store.commit("timStore/setConversation",i);let a="/pages/TUIKit/TUIPages/TUIChat/index";i.userProfile,a=`${a}?conversationName=${(null==(r=i.userProfile.nick)?void 0:r.nick)||i.userProfile.userID}&orderId=`+s.orderId,t.index.redirectTo({url:a})})).catch((t=>{console.warn("获取 group profile 异常 = ",t)}))},getDictByKey(t){var e={key:t};r.getDictByKey(e).then((e=>{200==e.code&&("sys_inquiry_order_type"==t&&(this.orderTypeOptions=e.data),"sys_inquiry_type"==t&&(this.inquiryTypeOptions=e.data),"sys_inquiry_status"==t&&(this.orderStatusOptions=e.data))}),(t=>{}))},inquiryTypeChange(t){this.inquiryType=t.id,console.log(t),this.mescroll.resetUpScroll()},navTo(e){t.index.navigateTo({url:e})},mescrollInit(t){this.mescroll=t},downCallback(){this.mescroll.resetUpScroll()},upCallback(e){var s=this,r={inquiryType:this.inquiryType,pageNum:e.num,pageSize:e.size};o.getMyInquiryOrderList(r).then((o=>{200==o.code?(1==e.num?s.dataList=o.data.list:s.dataList=s.dataList.concat(o.data.list),s.mescroll.endBySize(o.data.list.length,o.data.total)):(t.index.showToast({icon:"none",title:"请求失败"}),s.dataList=null,s.mescroll.endErr())}))}}};if(!Array){(t.resolveComponent("u-tabs")+t.resolveComponent("mescroll-body"))()}Math||((()=>"../uni_modules/uview-plus/components/u-tabs/u-tabs.js")+(()=>"../uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.js"))();var a=t._export_sfc(i,[["render",function(e,s,o,r,i,a){return{a:t.o(a.inquiryTypeChange),b:t.p({scrollable:!1,list:i.tabs,lineColor:"#C39A58"}),c:t.f(i.dataList,((s,o,r)=>t.e({a:null!=s.doctorId},null!=s.doctorId?{b:s.avatar,c:t.t(s.doctorName),d:t.t(s.deptName)}:{},{e:2==s.inquiryType},2==s.inquiryType?t.e({f:1==s.status},(s.status,{}),{g:2==s.status},(s.status,{}),{h:-1==s.status},(s.status,{}),{i:-2==s.status},(s.status,{}),{j:-3==s.status},(s.status,{})):{},{k:1==s.status},1==s.status?{l:t.t(e.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{m:2==s.status},2==s.status?{n:t.t(e.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{o:3==s.status},3==s.status?{p:t.t(e.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{q:4==s.status},4==s.status?{r:t.t(e.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{s:s.status<0},s.status<0?{t:t.t(e.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{v:t.t(e.$getDictLabelName(i.inquiryTypeOptions,s.inquiryType)),w:t.t(e.$getDictLabelName(i.orderTypeOptions,s.orderType)),x:t.t(s.title),y:t.t(s.createTime),z:1==s.status},1==s.status?{A:t.o((t=>a.pay(s)))}:{},{B:2==s.status},2==s.status?{C:t.o((t=>a.cancel(s)))}:{},{D:4==s.status&&0==s.isPing},4==s.status&&0==s.isPing?{E:t.o((t=>a.ping(s)))}:{},{F:3==s.status},3==s.status?{G:t.o((t=>a.toIM(s)))}:{},{H:t.o((t=>a.navTo("./inquiryOrderDetails?orderId="+s.orderId)))}))),d:t.sr("mescrollRef","180dc527-1"),e:t.o(a.mescrollInit),f:t.o(a.downCallback),g:t.o(a.upCallback),h:t.p({top:"88rpx",bottom:"0",down:i.downOption,up:i.upOption})}}],["__scopeId","data-v-180dc527"]]);wx.createPage(a);
