"use strict";var e=require("../common/vendor.js"),t=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 t=this;e.index.$on("refreshInquiryOrder",(()=>{t.mescroll.resetUpScroll()}))},onShow(){},methods:{cancel(t){e.index.showModal({title:"提示",content:"确认取消订单吗?",showCancel:!0,cancelText:"取消",confirmText:"确定",success:s=>{if(s.confirm){var r={orderId:t.orderId};o.cancel(r).then((t=>{200==t.code?(this.mescroll.resetUpScroll(),e.index.showToast({icon:"success",title:"操作成功"})):e.index.showToast({icon:"none",title:t.msg})}),(e=>{}))}}})},ping(t){e.index.navigateTo({url:"/pages_order/pingOrder?orderId="+t.orderId})},pay(t){e.index.navigateTo({url:"/pages_order/inquiryPay?orderId="+t.orderId})},toIM(s){var o="C2CD-"+s.doctorId;console.log(e.index.$TUIKit.TUIConversationServer),t.store.commit("timStore/setConversationID",o),e.index.$TUIKit.TUIConversationServer.setMessageRead(o),e.index.$TUIKit.TUIConversationServer.getConversationProfile(o).then((o=>{var r;t.store.commit("timStore/setImType",o.customData);const{conversation:i}=o.data;t.store.commit("timStore/setImType",1),t.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,e.index.redirectTo({url:a})})).catch((e=>{console.warn("获取 group profile 异常 = ",e)}))},getDictByKey(e){var t={key:e};r.getDictByKey(t).then((t=>{200==t.code&&("sys_inquiry_order_type"==e&&(this.orderTypeOptions=t.data),"sys_inquiry_type"==e&&(this.inquiryTypeOptions=t.data),"sys_inquiry_status"==e&&(this.orderStatusOptions=t.data))}),(e=>{}))},inquiryTypeChange(e){this.inquiryType=e.id,console.log(e),this.mescroll.resetUpScroll()},navTo(t){e.index.navigateTo({url:t})},mescrollInit(e){this.mescroll=e},downCallback(){this.mescroll.resetUpScroll()},upCallback(t){var s=this,r={inquiryType:this.inquiryType,pageNum:t.num,pageSize:t.size};o.getCompanyUserInquiryOrderList(r).then((o=>{200==o.code?(1==t.num?s.dataList=o.data.list:s.dataList=s.dataList.concat(o.data.list),s.mescroll.endBySize(o.data.list.length,o.data.total)):(e.index.showToast({icon:"none",title:"请求失败"}),s.dataList=null,s.mescroll.endErr())}))}}};if(!Array){(e.resolveComponent("u-tabs")+e.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=e._export_sfc(i,[["render",function(t,s,o,r,i,a){return{a:e.o(a.inquiryTypeChange),b:e.p({scrollable:!1,list:i.tabs,lineColor:"#C39A58"}),c:e.f(i.dataList,((s,o,r)=>e.e({a:null!=s.doctorId},null!=s.doctorId?{b:s.avatar,c:e.t(s.doctorName),d:e.t(s.deptName)}:{},{e:2==s.inquiryType},2==s.inquiryType?e.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:e.t(t.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{m:2==s.status},2==s.status?{n:e.t(t.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{o:3==s.status},3==s.status?{p:e.t(t.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{q:4==s.status},4==s.status?{r:e.t(t.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{s:s.status<0},s.status<0?{t:e.t(t.$getDictLabelName(i.orderStatusOptions,s.status))}:{},{v:e.t(t.$getDictLabelName(i.inquiryTypeOptions,s.inquiryType)),w:e.t(t.$getDictLabelName(i.orderTypeOptions,s.orderType)),x:e.t(s.title),y:e.t(s.createTime),z:e.o((e=>a.navTo("./inquiryOrderDetails?orderId="+s.orderId))),A:e.o((e=>a.navTo("./inquiryOrderDetails?orderId="+s.orderId)))}))),d:e.sr("mescrollRef","46cc2541-1"),e:e.o(a.mescrollInit),f:e.o(a.downCallback),g:e.o(a.upCallback),h:e.p({top:"88rpx",bottom:"0",down:i.downOption,up:i.upOption})}}],["__scopeId","data-v-46cc2541"]]);wx.createPage(a);
