| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 | <template>	<view class="content">		<view class="top-fixed">			 <u-tabs			  :scrollable="false"			  :list="tabs"  			  lineColor="#C39A58"			 @change="inquiryTypeChange">			 </u-tabs>		</view>		<mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit"    :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">		<view class="order-list">			<view class="order-item"  v-for="(item) in dataList" @click="navTo('./inquiryOrderDetails?orderId='+item.orderId)">				<view class="order-top"  >					<view class="left" v-if="item.doctorId!=null">						<image class="head" mode="aspectFill" :src="item.avatar"></image>						<view class="name">							{{item.doctorName}}						</view>						<view class="dept">							{{item.deptName}}						</view>					</view>					<view class="left" v-if="item.inquiryType==2">						<view class="title" v-if="item.status==1">							支付后为您安排医生接诊						</view>						<view class="title" v-if="item.status==2">							正在为您安排医生接诊						</view>						<view class="title" v-if="item.status==-1">							订单已取消						</view>						<view class="title" v-if="item.status==-2">							订单已退款						</view>						<view class="title" v-if="item.status==-3">							医生已拒单						</view>					</view>					<view class="status red" v-if="item.status==1">						{{$getDictLabelName(orderStatusOptions,item.status)}}					</view>					<view class="status red" v-if="item.status==2">						{{$getDictLabelName(orderStatusOptions,item.status)}}					</view>					<view class="status green" v-if="item.status==3">						{{$getDictLabelName(orderStatusOptions,item.status)}}					</view>					<view class="status green" v-if="item.status==4">						{{$getDictLabelName(orderStatusOptions,item.status)}}					</view>					<view class="status gray" v-if="item.status<0">						{{$getDictLabelName(orderStatusOptions,item.status)}}					</view>				</view>				<view class="order-cont">					<view class="order-type"  >						订单类型:						<text>{{$getDictLabelName(inquiryTypeOptions,item.inquiryType)}}</text>						<text>-{{$getDictLabelName(orderTypeOptions,item.orderType)}}</text>					</view>					<view class="order-desc">病情描述:{{item.title}}</view>					<view class="order-time-box">						<view class="order-time">							{{item.createTime}}						</view>						<view class="right">							<view class="btn"  @click.stop="navTo('./inquiryOrderDetails?orderId='+item.orderId)"  >查看</view>						</view>					</view>				</view>			</view>		</view>		</mescroll-body>	</view></template><script>	import store from "@/store";	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";	import {cancel,getCompanyUserInquiryOrderList} from '@/api/inquiryOrder.js'	import {getDictByKey} from '@/api/common.js'	export default {		mixins: [MescrollMixin], // 使用mixin		data() {			return {				orderStatusOptions:[],				orderTypeOptions:[],				inquiryTypeOptions:[],				tabs:[					{						id:2,						name:'快速问诊'					},					{						id:1,						name:'专家问诊'					},					{						id:3,						name:'开药问诊'					}					 				],				inquiryType:2,				mescroll:null,				downOption: {   //下拉刷新				 	use:true,					auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)				},				upOption: {					onScroll:false,					use: true, // 是否启用上拉加载; 默认true					page: {						pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始						size: 10 // 每页数据的数量,默认10					},					noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示					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 that=this;			uni.$on('refreshInquiryOrder', () => {				that.mescroll.resetUpScroll()			})		},		onShow() {		},		methods: {			cancel(item){				var that=this;				uni.showModal({					title:"提示",					content:"确认取消订单吗?",					showCancel:true,					cancelText:'取消',					confirmText:'确定',					success:res=>{						if(res.confirm){							// 用户点击确定							var data={orderId:item.orderId}							cancel(data).then(								res => {									if(res.code==200){										this.mescroll.resetUpScroll()										uni.showToast({										 	icon:'success',										 	title: "操作成功",										});									}else{										uni.showToast({											icon:'none',											title: res.msg,										});									}								},								rej => {}							);																				}else{							// 否则点击了取消  						}					}				})			},			ping(item){				uni.navigateTo({					url: "/pages_order/pingOrder?orderId="+item.orderId				})			},			pay(item){				uni.navigateTo({					url: "/pages_order/inquiryPay?orderId="+item.orderId				})			},			toIM(item){				var that=this;				var id="C2CD-"+item.doctorId;				console.log(uni.$TUIKit.TUIConversationServer)				store.commit("timStore/setConversationID", id);				//uni.$TUIKit.TUIChatServer.updateStore(conversationId)				uni.$TUIKit.TUIConversationServer.setMessageRead(id);				uni.$TUIKit.TUIConversationServer.getConversationProfile(id)				  .then((res) => {						store.commit("timStore/setImType", res.customData);						// uni.$TUIKit.TUIConversationServer.setConversationValue(id,item.orderId)						//   .then((res) => {						// 	console.log(res)						// })						// .catch((err) => {						     						// });						//通知 TUIChat 关闭当前会话						const { conversation } = res.data;						store.commit("timStore/setImType", 1);						store.commit("timStore/setConversation", conversation);						let url = "/pages/TUIKit/TUIPages/TUIChat/index";						const { nick: name } = conversation.userProfile;						url = `${url}?conversationName=${							conversation.userProfile.nick?.nick ||							conversation.userProfile.userID						}&orderId=`+item.orderId;						uni.redirectTo({ url });				})				.catch((err) => {				    console.warn("获取 group profile 异常 = ", err);				});			},			getDictByKey(key){				var data={key:key}				getDictByKey(data).then(					res => {						if(res.code==200){							if(key=="sys_inquiry_order_type"){								this.orderTypeOptions=res.data;							}							if(key=="sys_inquiry_type"){								this.inquiryTypeOptions=res.data;							}							if(key=="sys_inquiry_status"){								this.orderStatusOptions=res.data;							}						}					},					err => {					}				);							},			inquiryTypeChange(item){				this.inquiryType=item.id				console.log(item)				this.mescroll.resetUpScroll()			},			navTo(url){				uni.navigateTo({					url: url				})			},			mescrollInit(mescroll) {				this.mescroll = mescroll;			},			/*下拉刷新的回调 */			downCallback() {				this.mescroll.resetUpScroll()			},			/*上拉加载的回调*/			upCallback(page) {   				//联网加载数据				var that = this;				var data = {					inquiryType:this.inquiryType,					pageNum: page.num,					pageSize: page.size				};				getCompanyUserInquiryOrderList(data).then(res => {					if(res.code==200){						if (page.num == 1) {							that.dataList = res.data.list; 													} else {							that.dataList = that.dataList.concat(res.data.list);							 						}						that.mescroll.endBySize(res.data.list.length, res.data.total);											}else{						uni.showToast({							icon:'none',							title: "请求失败",						});						that.dataList = null;						that.mescroll.endErr();					}				});			},					}	}</script><style lang="scss">	page{				height: 100%;		background: #f6f6f6;	}</style><style scoped lang="scss">	.content{		height: 100%;		.top-fixed{			width: 100%;			position: fixed;			top: 0;			left: 0;			z-index: 10;			height: 88upx;			background-color: #fff;		}		.order-list{			width: 100%;			padding: 15rpx;			display: flex;			flex-direction: column;			align-items: flex-start;			justify-content: flex-start;			.order-item{				margin-bottom: 15rpx;				width: 100%;				padding: 15rpx;				box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);				background-color: #fff;				border-radius: 15rpx;				display: flex;				flex-direction: column;				align-items: flex-start;				justify-content: flex-start;				.order-top{					display: flex;					align-items: center;					justify-content: space-between;					width: 100%;					padding-bottom: 15rpx;					border-bottom: 1px solid #efefef;					.left{						display: flex;						align-items: center;						justify-content: flex-start;						image{							width:80rpx;							height:80rpx;							border-radius: 50%;						}						.title{							font-size: 32upx;							font-family: PingFang SC;							font-weight: bold;							color: #111111;						}						.name{							margin-left: 20rpx;							font-size: 32upx;							font-family: PingFang SC;							font-weight: bold;							color: #111111;						}						.dept{							margin-left: 15rpx;							font-size: 28upx;							font-family: PingFang SC;							color: #9a9a9c;						}						 					}					.status{						font-size: 28upx;						font-family: PingFang SC;					}					.red{						color: #db5053;					}					.green{						color: #C39A58;					}					.gray{						color: #9c9c9c;					}				}				.order-cont{					width: 100%;					margin-top: 15rpx;					.order-type{						font-size: 32upx;						font-family: PingFang SC;						// font-weight: bold;						color: #111111;					}					.order-desc{						margin-top: 15rpx;						font-size: 28upx;						font-family: PingFang SC;						// font-weight: bold;						color: #111111;					}					.order-time-box{						width: 100%;						margin-top: 15rpx;						display: flex;						align-items: center;						justify-content: space-between;						.order-time{							font-size: 32upx;							font-family: PingFang SC;							color: #9a9a9c;						}						.right{							.btn{								padding: 10rpx 30rpx;								border: 1rpx solid #C39A58;								color: #C39A58;								font-size: 28rpx;								border-radius: 30rpx;							}						}					}				}							}		} 			}	 </style>
 |