<template>
  <view class="container" @click="handleDetail">
		<view class="lef">
			<view class="dtim">时间：{{props.v.prescriptionTime}}</view>
			<view class="patie">
				<image class="faceu" aspectFill :src="props.v.faceurl?props.v.faceurl:'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/cat-1.png'" />
				<view class="pattt">
					<view class="patiin">
						<view class="name">{{props.v.name}}</view>
						<view class="seage">{{props.v.sex}}，{{v.age}}岁</view>
					</view>
					<view class="case">{{props.v.disName}}-{{props.v.symName}}</view>
					<view class="pres">当前处方状态： {{props.v.deployState}}</view>
				</view>
				
			</view>
		</view>
		<view class="rig">
			<view class="left">
				<view class="presno">处方号：{{props.v.preNo}}</view>
				<view class="presno">就诊科室：{{props.v.department}}</view>
				<view class="presno">
					处方信息：
					<text class="tips">
						{{props.v.dosageForm}}，{{props.v.number}}剂
					</text>
					</view>
				<view class="presno">处方金额：{{props.v.prescriptionSum}}元</view>
			</view>
			<view class="righ">
				<view class="source" :class="{'zy':props.v.preMzZy==='1'}">{{props.v.preMzZy==='1'?'门诊':'住院'}}</view>
			</view>
		</view>
  </view>
</template>

<script>
  export default {
    name: 'OrderCard'
  }
</script>

<script setup>
import { onMounted, ref } from 'vue'

const props = defineProps({
	v: {
		default: function() {
			return {}
		},
		type: Object
	},
	c: {
		default: 0,
		type: Number
	}
})

const handleDetail = ()=>{
	console.log("handleDetail", props.v, props.c)
	if(props.c===0){
		uni.navigateTo({
			url:"/pages/edit/edit"
		})
	} else {
		uni.navigateTo({
			url:"/pages/detail/detail"
		})
	}
	
}
onMounted(() => {

})

</script>

<style lang="scss">
.container{
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;
	width: 100%;
	margin-top: 10px;
	.lef{
		flex:1;
		display: flex;
		flex-direction: column;
		padding-left: 2px;
		.dtim{
			margin-bottom: 4px;
		}
		.patie{
			display: flex;
			.faceu{
				width: 70px;
				height:70px;
			}
			.pattt{
				margin-left: 12px;
				display: flex;
				flex-direction: column;
				.patiin{
					display: flex;
					.name{
						font-size: 20px;
						font-weight: 800;
					}
					.seage{
						margin-left: 12px;
						font-size: 18px;
						font-weight: 400;
						color: #cfcfcf;
					}
				}
				.case{
					font-size: 18px;
					font-weight: 400;
					color: #808184;
				}
				.pres{
					font-size: 18px;
					font-weight: 400;
					color: #cfcfcf;
				}
			}
			
		}
	}
	.rig{
		flex:1;
		display: flex;
		justify-content:space-between;
		margin-left: 200px;
		.left{
			display: flex;
			flex-direction: column;
			.presno{
				font-size: 18px;
				font-weight: 400;
				margin-bottom: 4px;
				color: #cfcfcf;
				.tips{
					color: #28292a;
				}
			}
		}
		.righ{
			
			.source{
				display: flex;
				align-items: center;
				justify-content: center;
				border-radius: 25px 0 0 25px;
				width: 80px;
				height: 50px;
				background-color: #808184;
				color: #fff;
			}
			.zy{
				background-color: #c6c8cd!important;
				color: #000!important;
			}
		}
	}
}
</style>