| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450 | 
							- <template>
 
- 	<view class="content">
 
- 		<view>
 
- 			<u-navbar
 
- 				title="症状描述"
 
- 				@leftClick="leftClick"
 
- 			>
 
- 			</u-navbar>
 
- 		</view>
 
- 		<view class="main">
 
- 			<view class="status_bar" :style="{height: statusBarHeight}"></view>
 
- 			<u-alert fontSize="16"   description = "尊敬的用户,您好! 为了您的健康,请认真填写以下内容,以便更好地为您提供咨询建议"></u-alert>
 
- 			<view class="chose-patient">
 
- 				<view class="title-box" @click="addPatient()" v-if="patient==null">
 
- 					<text class="title">选择就诊人</text>
 
- 					<view class="right" >
 
- 						<text class="value">请点击添加</text>
 
- 						<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/arrow_gray.png" mode=""></image>
 
- 					</view>
 
- 				</view>
 
- 				<view class="patient" @click="addPatient()" v-if="patient!=null">
 
- 					<view  class="left">
 
- 						<view class="name">{{patient.patientName}}</view>
 
- 						<view class="info">
 
- 							<text class="text" v-if="patient.sex==1">男</text>
 
- 							<text class="text" v-if="patient.sex==2">女</text>
 
- 							<text class="text">{{$getAge(patient.birthday)}}岁</text>
 
- 							<text class="text">{{$parseIdCard(patient.idCard)}}</text>
 
- 						</view>
 
- 					</view>
 
- 					<view class="right" >
 
- 						<image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/arrow_gray.png" mode=""></image>
 
- 					</view>
 
- 				</view>
 
- 			</view>
 
- 			<view class="cont">
 
- 				<view class="title-box">
 
- 					<view class="red-dot">*</view>
 
- 					<view class="title">请描述您的病情</view>
 
- 					
 
- 				</view>
 
- 				<view style="margin: 15rpx 0rpx">
 
- 					<u--textarea maxlength="500"  v-model="title" placeholder="请输入内容" count ></u--textarea>
 
- 				</view>
 
- 				<view class="title-box">
 
- 					<view class="red-dot">*</view>
 
- 					<view class="title">本次患病多久了?</view>
 
- 				</view>
 
- 				<view style="margin: 15rpx 0rpx">
 
- 					<u-radio-group 
 
- 					    v-model="duration"
 
- 					    iconPlacement="left">
 
- 						<u-radio :customStyle="{marginRight: '5px'}"
 
- 						  v-for="(item, index) in durations"
 
- 						  :key="index"
 
- 						  :label="item.name"
 
- 						  :name="item.name" activeColor="#2583EB"  
 
- 						  ></u-radio>
 
- 					</u-radio-group>
 
- 				</view>
 
- 				<view class="title-box">
 
- 					<view class="red-dot">*</view>
 
- 					<view class="title">此次病情是否去医院就诊过?</view>
 
- 				</view>
 
- 				<view style="margin: 15rpx 0rpx">
 
- 					<u-radio-group 
 
- 					    v-model="isVisit"
 
- 					    iconPlacement="left">
 
- 						<u-radio :customStyle="{marginRight: '5px'}"
 
- 						  v-for="(item, index) in isVisits"
 
- 						  :key="index"
 
- 						  :label="item.name"
 
- 						  :name="item.name" activeColor="#2583EB"  
 
- 						  ></u-radio>
 
- 					</u-radio-group>
 
- 				</view>
 
- 				<view class="title-box">
 
- 					<view class="title">上传检测报告或患处照片?</view>
 
- 				</view>
 
- 				<view style="margin: 15rpx 0rpx">
 
- 				 
 
- 					<u-upload
 
- 						:fileList="fileList1"
 
- 						@afterRead="afterRead"
 
- 						@delete="deletePic"
 
- 						name="1"
 
- 						:maxCount="5"
 
- 					></u-upload>
 
- 				</view>
 
- 			</view>
 
- 		</view>
 
- 		<view class="btn-box">
 
- 		 	<view class="btn" @click="submitOrder()">提交订单</view>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import {create,confirm} from '@/api/inquiryOrder.js'
 
- 	export default {
 
- 		data() {
 
- 			return {
 
- 				statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
 
- 				orderKey:null,
 
- 				patient:null,
 
- 				durations: [
 
- 					{
 
- 						name: '一周内',
 
- 						disabled: false
 
- 					},
 
- 					{
 
- 					  name: '一个月内',
 
- 					  disabled: false
 
- 					},
 
- 					{
 
- 					  name: '半年内',
 
- 					  disabled: false
 
- 					}, {
 
- 					  name: '半年以上',
 
- 					  disabled: false
 
- 					}
 
- 				],
 
- 				isVisits: [
 
- 					{
 
- 						name: '未就诊',
 
- 						disabled: false
 
- 					},
 
- 					{
 
- 					  name: '就诊过',
 
- 					  disabled: false
 
- 					}
 
- 				],
 
- 				title:"",
 
- 				isVisit:"就诊过",
 
- 				duration:"一周内",
 
- 				inquiryType:null,
 
- 				orderType:null,
 
- 				doctorId:null,
 
- 				fileList1: [],
 
- 			}
 
- 		},
 
- 		onLoad(options) {
 
- 			this.inquiryType=options.inquiryType;
 
- 			this.orderType=options.orderType;
 
- 			this.doctorId=options.doctorId;
 
- 			console.log(this.inquiryType)
 
- 			console.log(this.orderType)
 
- 			console.log(this.doctorId)
 
- 			this.confirm();
 
- 		},
 
- 		onShow() {
 
- 			var that=this;
 
- 			uni.$on('refreshOrderPatient', (res) => {
 
- 				that.patient=res
 
- 			})
 
- 		},
 
- 		methods: {
 
- 			leftClick() {
 
- 				console.log('leftClick');
 
- 				uni.showModal({
 
- 				    title: '提示',
 
- 				    content: '确认关闭吗',
 
- 				    success: function (res) {
 
- 				        if (res.confirm) {
 
- 				            uni.navigateBack()
 
- 				        } else if (res.cancel) {
 
- 				        }
 
- 				    }
 
- 				});
 
- 			},
 
- 			submitOrder(){
 
- 				
 
- 				if(this.patient==null){
 
- 					uni.showToast({
 
- 						icon:'none',
 
- 						title: '请选择就诊人',
 
- 					});
 
- 					return;
 
- 				}
 
- 				if(this.isVisit=='未就诊'){
 
- 					uni.showToast({
 
- 						icon:'none',
 
- 						title: '仅支持复诊',
 
- 					});
 
- 					return;
 
- 				}
 
- 				if(this.orderKey==null){
 
- 					this.confirm();
 
- 				}
 
- 				var images=[];
 
- 				this.fileList1.forEach(function(element) {
 
- 					images.push(element.url)
 
- 				});
 
- 				var data={
 
- 					orderKey:this.orderKey,
 
- 					patientId:this.patient.patientId,
 
- 					title:this.title,
 
- 					isVisit:this.isVisit,
 
- 					duration:this.duration,
 
- 					inquiryType:this.inquiryType,
 
- 					orderType:this.orderType,
 
- 					doctorId:this.doctorId,
 
- 					reportImages:images.toString()
 
- 				}
 
- 				uni.showLoading({
 
- 					title: '正在处理中...'
 
- 				});
 
- 				create(data).then(
 
- 					res => {
 
- 						uni.hideLoading()
 
- 						if(res.code==200){
 
- 							var temps=['YyaBF62vH1GPKY0tume8C2C5UETxcKrVsaTKdBW5eok']
 
- 							uni.requestSubscribeMessage({
 
- 								tmplIds: temps,
 
- 								success(e) {
 
- 									 setTimeout(function(){
 
- 									 	uni.redirectTo({
 
- 									 		url: './inquiryPay?orderId='+res.order.orderId
 
- 									 	})
 
- 									 },200);
 
- 								},
 
- 								fail(e) {
 
- 									setTimeout(function(){
 
- 										uni.redirectTo({
 
- 											url: './inquiryPay?orderId='+res.order.orderId
 
- 										})
 
- 									},200);
 
- 								}
 
- 							})
 
- 							return;
 
- 						}
 
- 						else{
 
- 							uni.showToast({
 
- 								icon:'none',
 
- 								title: res.msg,
 
- 							});
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);
 
- 			},
 
- 			confirm(){
 
- 				let data = {};
 
- 				confirm(data).then(
 
- 					res => {
 
- 						if(res.code==200){
 
- 							this.orderKey=res.orderKey
 
- 						}
 
- 					},
 
- 					rej => {}
 
- 				);	
 
- 			},
 
- 			addPatient(){
 
- 				uni.navigateTo({
 
- 					url: '/pages_user/patient'
 
- 				})
 
- 			},
 
- 			deletePic(event) {
 
- 				this[`fileList${event.name}`].splice(event.index, 1)
 
- 			},
 
- 			async afterRead(event) {
 
- 				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
 
- 				let lists = [].concat(event.file)
 
- 				let fileListLen = this[`fileList${event.name}`].length
 
- 				lists.map((item) => {
 
- 					this[`fileList${event.name}`].push({
 
- 						...item,
 
- 						status: 'uploading',
 
- 						message: '上传中'
 
- 					})
 
- 				})
 
- 				for (let i = 0; i < lists.length; i++) {
 
- 					const result = await this.uploadFilePromise(lists[i].url)
 
- 					let item = this[`fileList${event.name}`][fileListLen]
 
- 					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
 
- 						status: 'success',
 
- 						message: '',
 
- 						url: result
 
- 					}))
 
- 					fileListLen++
 
- 				}
 
- 			},
 
- 			uploadFilePromise(url) {
 
- 				return new Promise((resolve, reject) => {
 
- 					let a = uni.uploadFile({
 
- 						url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', // 仅为示例,非真实的接口地址
 
- 						filePath: url,
 
- 						name: 'file',
 
- 						formData: {
 
- 							user: 'test'
 
- 						},
 
- 						success: (res) => {
 
- 							setTimeout(() => {
 
- 								console.log(JSON.parse(res.data).url)
 
- 								resolve(JSON.parse(res.data).url)
 
- 							}, 1000)
 
- 						}
 
- 					});
 
- 				})
 
- 			}
 
- 			 
 
- 			 
 
- 			 
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss">
 
- 	page{
 
- 		background: #f1f6fc;
 
- 	}
 
- </style>
 
- <style scoped lang="scss">
 
- 	.content{
 
- 		position: relative;
 
- 		.main{
 
- 			margin-top: 44px;
 
- 			padding-bottom: 140upx;
 
- 			.cont{
 
- 				margin: 15rpx;
 
- 				padding: 30rpx;
 
- 				box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
 
- 				background-color: #fff;
 
- 				border-radius: 15rpx;
 
- 				.title-box{
 
- 					display: flex;
 
- 					flex-direction: row;
 
- 					align-items: center;
 
- 					justify-content: flex-start;
 
- 					.title{
 
- 						font-size: 32upx;
 
- 						font-family: PingFang SC;
 
- 						font-weight: bold;
 
- 						color: #111111;
 
- 					}
 
- 					.line{
 
- 						margin-right: 15rpx;
 
- 						height: 30rpx;
 
- 						width: 6rpx;
 
- 						background-color: #2583EB;
 
- 						
 
- 					}
 
- 					.red-dot{
 
- 						margin-right: 5rpx;
 
- 						color:red;
 
- 					}
 
- 					 
 
- 				}
 
- 			}
 
- 			.chose-patient{
 
- 				margin: 15rpx 15rpx;
 
- 				padding: 30rpx 40rpx;
 
- 				box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
 
- 				background-color: #fff;
 
- 				border-radius: 15rpx;
 
- 				.title-box{
 
- 					display: flex;
 
- 					align-items: center;
 
- 					justify-content: space-between;
 
- 					.title{
 
- 						font-size: 32upx;
 
- 						font-family: PingFang SC;
 
- 						font-weight: bold;
 
- 						color: #111111;
 
- 					}
 
- 					.right{
 
- 						height: 100%;
 
- 						display: flex;
 
- 						align-items: center;
 
- 						justify-content: center;
 
- 						.value{
 
- 							font-size: 28upx;
 
- 							font-family: PingFang SC;
 
- 							color: #999;
 
- 							margin-right: 10rpx;
 
- 						}
 
- 						image{
 
- 							width: 15upx;
 
- 							height: 30upx;
 
- 						}
 
- 						 
 
- 					}
 
- 				}
 
- 				.patient{
 
- 					display: flex;
 
- 					align-items: center;
 
- 					justify-content: space-between;
 
- 					height: 110upx;
 
- 					.left{
 
- 						.name{
 
- 							font-size: 30upx;
 
- 							line-height: 1;
 
- 							font-family: PingFang SC;
 
- 							font-weight: bold;
 
- 							color: #111111;
 
- 						}
 
- 						.info{
 
- 							margin-top: 30rpx;
 
- 							display: flex;
 
- 							align-items: center;
 
- 							.text{
 
- 								font-size: 26upx;
 
- 								font-family: PingFang SC;
 
- 								line-height: 1;
 
- 								font-weight: 500;
 
- 								color: #999;
 
- 								margin-right: 19upx;
 
- 							}
 
- 							 
 
- 						}
 
- 					}
 
- 					.right{
 
- 						display: flex;
 
- 						align-items: center;
 
- 						image{
 
- 							width: 15upx;
 
- 							height: 30upx;
 
- 						}
 
- 					}
 
- 				}
 
- 			}
 
- 		}
 
- 		
 
- 		.btn-box{
 
- 		 	height: 140upx;
 
- 		 	z-index: 9999;
 
- 		 	width: 100%;
 
- 		 	padding: 0rpx 30upx;
 
- 		 	position: fixed;
 
- 		 	bottom: 0;
 
- 		 	left: 0;
 
- 		 	box-sizing: border-box;
 
- 		 	background-color: #ffffff;
 
- 		 	display: flex;
 
- 		 	align-items: center;
 
- 		 	justify-content: center;
 
- 		 	.btn{
 
- 		 		width: 100%;
 
- 		 		height: 88upx;
 
- 		 		line-height: 88upx;
 
- 		 		text-align: center;
 
- 		 		font-size: 34upx;
 
- 		 		font-family: PingFang SC;
 
- 		 		font-weight: 400;
 
- 		 		color: #FFFFFF;
 
- 		 		background: #2583EB;
 
- 		 		border-radius: 10upx;
 
- 		 	}
 
- 		 }
 
- 	}
 
- </style>
 
 
  |