<template>
	<view class="border-box">
		<view class="content">
			<view class="top-box">
				<view class="back-box x-f">
					<image src="/static/image/device/back_icon32.png"></image>
					<view @click="goBack()">返回</view>
				</view>
				<view class="title">体质辨识</view>
				<view class="select" @click="onOpenList">
					<view class="date x-bc">
						<image src="/static/image/device/user_icon32.png"></image>
						<text class="text">
							{{selectUser!==null?selectUser.nickName:'选择用户'}}
						</text>
						<image src="/static/image/device/arrow_icon16.png"></image>
					</view>
				</view>  
			</view>
			
			<view class="list">
				<view class="tab-box">
					<view class="tabs">
						<view class="item active">
							<image src="/static/image/device/tongue_on_icon68.png"></image>
							<view class="title">舌面诊</view>
						</view>
						<view class="item" @click="navTo('/pages/device/pulse/index')">
							<image src="/static/image/device/pulse_diagnosis_icon68.png"></image>
							<view class="title">脉诊</view>
						</view>
					</view>
					<view class="test-box">
						<view class="note">请按照图片指识，点击上传相应的清晰照片为获取准确的结果</view>
						<view class="note1">请您在光线充足环境下测试，尽量拉近面部与屏幕距离</view>
						<view class="img-box" :class="{ 'flex-box': width < height }">
							<view class="left" @click="goCamera">
								<view class="bg"
									:style="{backgroundImage:leftImg==null?'url(/static/image/device/tongue_photo_img.png)':''}">
									<image v-if="leftImg==null" src="/static/image/device/add_icon68.png"></image>
								</view>
								<view v-if="leftImg!==null" class="delImg" @click.stop="delImg('left')">
									<image src="/static/image/device/close_icon33.png"></image>
								</view>
								<view v-if="leftImg!==null" class="upImg">
									<image :src='leftImg' mode="aspectFill"></image>
								</view>
								<view v-if="leftImg==null" class="btn">
									添加舌面照
								</view>
							</view>
							<view class="right" @click="goCameraFace">
								<view class="bg"
									:style="{backgroundImage:rightImg==null?'url(/static/image/device/facial_photo_img.png)':''}">
									<image v-if="rightImg==null" src="/static/image/device/add_icon68.png"></image>
								</view>
								<view v-if="rightImg!==null" class="delImg" @click.stop="delImg('right')">
									<image src="/static/image/device/close_icon33.png"></image>
								</view>
								<view v-if="rightImg!==null" class="upImg">
									<image :src='rightImg' mode="aspectFill"></image>
								</view>
								<view v-if="rightImg==null" class="btn">
									添加面部照
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view v-if="isResult" class="mask">
				<view class="popup-container2">
					<view class="title-t">上传成功</view>
					<view v-if="isIndex==0" class="title-r">请继续进行面诊检测</view>
					<view v-if="isIndex==1" class="title-r">请继续进行脉诊检测</view>
					<!-- <view class="title-r">{{isIndex==0?'舌诊':'面诊'}}结果请下载芳华未来APP查看</view> -->
					<view class="btn-r" @click="closeP">确认</view>
				</view>
			</view>
			<view v-if="showList" class="mask">
				<!-- 弹窗内容 -->
				<view class="popup-container">
					<!-- 弹窗头部 -->
					<view class="popup-header">
						<text class="popup-title">选择用户</text>
						<view class="close-btn" @click="onCloseList">
							<image src="/static/image/device/close_icon32.png"></image>
						</view>
					</view>
					<!-- 弹窗主体内容 -->
					<view class="popup-content">
						<view class="search-cont">
							<input type="text" v-model="keyword" class="form-input" placeholder="请输入用户姓名或者手机号"
								placeholder-class="text-input" />
							<view class="search-btn" @click="doSearch">
								<image src="/static/image/device/search_icon24.png"></image>
								<text>搜索</text>
							</view>
						</view>
						<view class="userList-box">
						<view class="userList" v-if="dataList.length>0">
							<view class="item" v-for="(item,index) in dataList" :key="index">
								<view class="title">{{item.nickName||''}}-{{item.phone||''}}</view>
								<view class="right-box">
									<view class="rest" @click="onOpenDetail(item)">
										查看
									</view>
									<view class="rest" @click="editDetail(item)">
										编辑
									</view>
									<view :class="item.userId==aIndex?'select active':'select'" @click="select(item)">
										选择
									</view>
								</view>
							</view>
						</view>
						</view>
						<view v-if="dataList.length==0" class="isNull">暂无数据</view>
					</view>

					<!-- 弹窗底部按钮 -->
					<view class="popup-footer">
						<view class="btn2 confirm-btn" @click="onOpen">
							<image src="/static/image/device/add_icon32.png"></image>
							<text>新建用户</text>
						</view>
					</view>
				</view>
			</view>
			<user-card :show="show" :initial-form="initData" @close="onClose" @confirm="onConfirm" @update="onEdit"></user-card>
			<view v-if="showDetail" class="mask">
				<!-- 弹窗内容 -->
				<view class="popup-container">
					<!-- 弹窗头部 -->
					<view class="popup-header">
						<view class="goback" @click="onOpenList">返回</view>
						<text class="popup-title">选择用户</text>
						<view class="close-btn" @click="onCloseDetail">
							<image src="/static/image/device/close_icon32.png"></image>
						</view>
					</view>
					<!-- 弹窗主体内容 -->
					<view class="popup-content">
						<view class="userDetail">
							<view class="item">
								<view class="label">姓名：</view>
								<text>{{detail.username||'-'}}</text>
							</view>
							<view class="item">
								<view class="label">手机号：</view>
								<text>{{detail.phone||'-'}}</text>
							</view>
							<view class="item">
								<view class="label">性别：</view>
								<text>{{detail.sex==1?"男":"女"}}</text>
							</view>
							<view class="item">
								<view class="label">年龄：</view>
								<text>{{detail.age||'-'}}岁</text>
							</view>
							<view class="item">
								<view class="label">身高：</view>
								<text>{{detail.height||'-'}}cm</text>
							</view>
							<view class="item">
								<view class="label">体重：</view>
								<text>{{detail.weight||'-'}}kg</text>
							</view>
							
							<view class="item" >
								<view class="label">既往病史：</view>
								<text>{{detail.previousMedicalHistory||'-'}}</text>
						    </view>
						<view class="item" >
							<view class="label">过敏史：</view>
							<text>{{detail.historyOfAllergies||'-'}}</text>
						</view>
						<view v-if="detail.habitList.length>0" class="item" v-for="item in detail.habitList" :key="item.optionId">
							<view class="label">{{item.typeName ||'-'}}：</view>
							<text>{{item.optionName||'-'}}</text>
						</view>
						</view>
					</view>

					<!-- 弹窗底部按钮 -->
					<view class="popup-footer">
						<view class="btn2 confirm-btn" @click="selectBtn(detail)">
							<text>选择该用户</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		selectUsernameOrPhoneOrTime,
		addUser,
		editUser,
		selectQueryFsUser
	} from '@/api/user.js'
	import {getCount,add,addFace} from '@/api/healthTongue.js'
	import {
		getDictByKey
	} from '@/api/common.js'
	import {
		el,
		tr
	} from "date-fns/locale";
	import userCard from "@/components/userCard.vue"
	export default {
		components: {
			userCard
		},
		data() {
			return {
				height: uni.getSystemInfoSync().screenHeight,
				width: uni.getSystemInfoSync().screenWidth,
				isIndex:0,
				isResult:false,
				msgType: 'success',
				selectedDate: "",
				selectUser: null,
				show: false,
				showList: false,
				showDetail: false,
				total: 0,
				aIndex: '',
				createTimes: null,
				keyword: '',
				type: 0,
				leftImg: null,
				rightImg: null,
				dataList: [],
				detail: {},
				agree: false,
				flag:true,
				errMsg:"",
				form: {
					sex: 1
				},
				initData:{}
			}
		},
		onLoad(options) {
			this.userId = options.userId
			this.selectUser=uni.getStorageSync('selectUser')||null;
			this.leftImg=null
			this.rightImg=null
			let left=options.leftUrl
			let right=options.rightUrl
			console.log('===',options.leftUrl,options.rightUrl)
			if(left){
				this.leftImg=left
				this.startDetection()
			}
			if(right){
				this.rightImg=right
				this.startDetectionFace()
			}
			
		},
		onShow(){
			//this.leftImg=null;
			//this.rightImg=null;
		},
		methods: {
			goBack() {
				uni.navigateBack({
				  delta:1
				})
			},
			doSearch() {
				console.log(this.keyword, '---')
				// if(this.keyword!==''){
				this.selectUsernameOrPhoneOrTime()
				// }
			},
			select(item) {
				this.aIndex = item.userId
				this.selectUser = item
				uni.setStorageSync("selectUser",item)
				this.showList = false
			},
			selectBtn(item) {
				if(item.id==null){
					uni.showToast({
						title: '请先完善用户基本信息',
						icon: 'none'
					});
					return;
				}
				this.selectUser = this.dataList.find(it => it.userId === item.fsUserId);
				uni.setStorageSync("selectUser", this.selectUser)
				this.show = false
				this.showList = false
				this.showDetail = false
			},
			createTimesChange(e) {
				this.selectedDate = e.detail.value; // 例如："2025-09-17"
				this.form.birthday = this.selectedDate.replace(/-/g, ""); // 去除 "-"
			},
			genderChange(type) {
				this.form.sex = type
			},
			onOpen() {
				this.show = true
				this.showList = false
			},
			onOpenList() {
				this.selectUsernameOrPhoneOrTime()
				this.showList = true
				this.showDetail = false
			},
			onOpenDetail(item) {
				this.showDetail = true
				this.showList = false
				this.detail={}
				this.selectQueryFsUser(item.userId)
			},
			editDetail(item){
				this.show = true
				this.showList = false
				this.selectQueryFsUser(item.userId,'edit')
			},
			// 关闭弹窗
			onClose() {
				this.show = false
			},
			onCloseList() {
				this.showList = false
				this.keyword=''
			},
			onCloseDetail() {
				this.showDetail = false
			},
			closeP(){
				this.isResult=false
				this.leftImg=null
				this.rightImg=null
				this.flag = true
			},
			// 点击确认按钮
			onConfirm(data) {
				// var data = form
				uni.showLoading({
					title:"处理中...",
					mask:true
				})
				addUser(data).then(res => {
						if (res.code == 200) {
							setTimeout(()=>{
								uni.showToast({
									icon: 'success',
									title: "创建成功",
								});
							},200)
							uni.hideLoading();
							this.show = false
							this.showList=true
							this.form = {
								sex: 0
							}
							this.selectUsernameOrPhoneOrTime()
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
						}
					},
					rej => {}
				);
			},
			// 点击确认按钮
			onEdit(data) {
				// var data=this.form
				//var data = this.form
				uni.showLoading({
					title: "处理中...",
					mask: true
				})
				data.userId=this.initData.userId
				data.fsUserId=this.initData.userId
				editUser(data).then(res => {
						if (res.code == 200) {
							setTimeout(() => {
								uni.showToast({
									icon: 'success',
									title: "修改成功",
								});
							}, 200)
							uni.hideLoading();
							this.show = false
							this.showList = true
							this.form = {
								sex: 1
							}
							this.selectUsernameOrPhoneOrTime()
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
						}
					},
					rej => {}
				);
			},
			selectUsernameOrPhoneOrTime() {
				var data = {
					nickName: this.keyword,
					phone: this.keyword
				}
				uni.showLoading({
					title:"加载中..."
				})
				// var user=uni.getStorageSync('userInfo');
				selectUsernameOrPhoneOrTime(data).then(res => {
						if (res.code == 200) {
							uni.hideLoading();
							this.dataList = res.data
							this.total = res.data.total || 0
						} else {
							uni.hideLoading();
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
						}
					},
					rej => {}
				);
			},
			selectQueryFsUser(id,val) {
				selectQueryFsUser({
					userId: id
				}).then(res => {
						if (res.code == 200) {
							this.detail = res.data
							if(val=='edit'){
								this.initData=res.data
								this.initData.userId=id
							}
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
						}
					},
					rej => {}
				);
			},
			goCamera(){
				var that = this;
				if(this.$isEmpty(this.selectUser)){
					uni.showToast({
						title: '请先选择就诊人',
						icon: 'none'
					});
					return;
				}
				uni.navigateTo({
					url:"/pages/device/tongue/indexOld"
				});
				
			},
			goCameraFace(){
				var that = this;
				if(this.$isEmpty(this.selectUser)){
					uni.showToast({
						title: '请先选择就诊人',
						icon: 'none'
					});
					return;
				}
				uni.navigateTo({
					url:"/pages/device/tongue/facePhoto"
				})
				
			},
			// 选择上传的图片
			chooseImage(val) {
				// console.log('图片')
				var that = this;
				if(this.selectUser==null||this.selectUser==''){
					uni.showToast({
						icon:'none',
						title: "请选择就诊人",
					});
					return;
				}
				uni.showActionSheet({
					itemList: ['相册', '拍照'],
					success: function(res) {
						if (res.tapIndex == 0) {
							//从相册选择
							that.chooseImageFunction('album', val)
							
						} else if (res.tapIndex == 1) {
							//拍照
							that.chooseImageFunction('camera', val)
							// uni.navigateTo({
							// 	url:"/pages/device/tongue/indexOld"
							// });
						}
					},
					fail: function(res) {

					}
				});
			},
			chooseImageFunction: function(type, val) {
				var that = this;
				uni.chooseImage({
					count: 1, // 默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: [type],
					success: (res) => {
						uni.showLoading({
							title: '图片上传中'
						})
						uni.uploadFile({
							url: uni.getStorageSync('requestPath') +
							'/app/common/uploadOSS', //仅为示例，非真实的接口地址
							filePath: res.tempFilePaths[0],
							name: 'file',
							formData: {
								'user': 'test' // 上传附带参数
							},
							success: (uploadFileRes) => {
								uni.hideLoading();
								console.log('图片',uploadFileRes)
								// if (val == 1) {
								// 	// uni.setStorageSync("tongueUrl",res.tempFilePaths[0])
								// 	this.leftImg = res.tempFilePaths[0]
								// 	//JSON.parse(uploadFileRes.data).url
								// 	this.startDetection()
								// } else {
								    this.rightImg = res.tempFilePaths[0]
									this.startDetectionFace()
								// }
							},
							fail: (err) => {
								uni.hideLoading();
								uni.showToast({
									title: '上传失败，请重试',
									icon: 'none'
								});
								console.error('上传失败：', err);
							}
						});

					}
				});
			},
			// 查看图片
			viewImage(e) {
				uni.previewImage({
					urls: this.imgList,
					current: e.currentTarget.dataset.url
				});
			},
			// 删除上传的图片
			delImg(e) {
				if (e == 'left') {
					this.leftImg = null
				} else if (e == 'right') {
					this.rightImg = null
				}

				// var that = this;
				// uni.showModal({
				// 	title: '提示',
				// 	content: '确定要删除照片吗？',
				// 	cancelText: '取消',
				// 	confirmText: '确定',
				// 	success: res => {
				// 		if (res.confirm) {
				// 			that.imgList.splice(e.currentTarget.dataset.index, 1)
				// 			this.photos.splice(e.currentTarget.dataset.index, 1);
				// 		}
				// 	},
				// })
			},
			//舌诊
			startDetection(){
				this.isIndex=0
				if(!this.flag){
					if(!this.$isEmpty(this.errMsg)){
						uni.showToast({icon:'none',title: this.errMsg});
					}
					return;
				}
				this.flag=false;
				
				uni.uploadFile({
					url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例，非真实的接口地址
					filePath: this.leftImg,
					name: 'file',
					formData: {
						'user': 'test'  // 上传附带参数
					},
					success: (uploadFileRes) => {
						console.log('---',uploadFileRes)
						// console.log('---',JSON.parse(uploadFileRes.data).url)
						var data={
							userId:this.selectUser.userId,
							patientId:this.selectUser.userId,
							sex:this.selectUser.sex,
							name:this.selectUser.nickName,
							tongueUrl:JSON.parse(uploadFileRes.data).url,
						}
						uni.showLoading({
							title:"处理中...",
							mask:true
						})
						add(data).then(res => {
							console.log('zaizz',data,res)
								if(res.code==200){
									uni.hideLoading();
									// uni.setStorageSync("tongueResult",JSON.stringify(res.data))
								    this.isResult=true
								}else{
									uni.hideLoading();
									this.errMsg= res.msg;
									// this.leftImg=null;
									uni.showToast({
										icon:'none',
										title: res.msg,
									});
								}
							},
							rej => {}
						);
					},fail: (err) => {
								uni.showToast({
									title: '上传失败，请重试',
									icon: 'none'
								});
								uni.hideLoading();
								console.error('上传失败：', err);
							}
				});
			},
			//面诊
			startDetectionFace(){
				this.isIndex=1
				console.log('333')
				if(!this.flag){
					if(!this.$isEmpty(this.errMsg)){
						uni.showToast({icon:'none',title: this.errMsg});
					}
					return;
				}
				if(this.selectUser==null||this.selectUser==''){
					uni.showToast({
						icon:'none',
						title: "请选择就诊人",
					});
					return;
				}
				this.flag=false;
				uni.uploadFile({
					url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例，非真实的接口地址
					filePath: this.rightImg,
					name: 'file',
					formData: {
						'user': 'test'  // 上传附带参数
					},
					success: (uploadFileRes) => {
						console.log('---',uploadFileRes)
						// console.log('---',JSON.parse(uploadFileRes.data).url)
						var data={
							userId:this.selectUser.userId,
							sex:this.selectUser.sex,
							name:this.selectUser.nickName,
							surfaceUrl:JSON.parse(uploadFileRes.data).url,
						}
						uni.showLoading({
							title:"处理中...",
							mask:true
						})
						addFace(data).then(res => {
							    console.log('zaiFC',data,res)
								if(res.code==200){
									uni.hideLoading();
									// uni.setStorageSync("tongueResult",JSON.stringify(res.data))
								    this.isResult=true
									// uni.redirectTo({
									// 	url:"/pages/device/tongue/report?id="+res.data.id
									// });
								}else{
									uni.hideLoading();
									this.errMsg= res.msg;
									// this.rightImg=null;
									uni.showToast({
										icon:'none',
										title: res.msg,
									});
								}
							},
							rej => {}
						);
					},fail: (err) => {
								uni.hideLoading();
								uni.showToast({
									title: '上传失败，请重试',
									icon: 'none'
								});
								console.error('上传失败：', err);
							}
				});
			},
			getDictByKey(key) {
				var data = {
					key: key
				}
				getDictByKey(data).then(
					res => {
						if (res.code == 200) {
							if (key == "sys_hospital_level") {
								this.hosLevelOptions = res.data;
							}
						}
					},
					err => {}
				);

			},
			navTo(url) {
				uni.redirectTo({
				  url: url + '?userId=' + this.userId
				})
			},
			

		}
	}
</script>

<style lang="scss" scoped>
	page {

		height: 100%;
		background: #f6f6f6;
	}
</style>
<style scoped lang="scss">
	.border-box {
		width: 100vw;
		height: 100vh;
		background-image: url(/static/image/device/ipad_yjf_boder.png);
		background-repeat: no-repeat;
		position: relative;
		background-size: 100% 100%;
		box-sizing: border-box;
		padding: 12px;
	}

	.content {
		// height: 100%;
		width: 100%;
		height: 100%;
		background-image: url(/static/image/device/inner_page_bg.png);
		background-repeat: no-repeat;
		background-size: 100% 100%;
		position: relative;
		padding: 30px;
		.top-box {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-bottom: 30px;
			.title {
				font-family: Source Han Serif CN, Source Han Serif CN;
				font-weight: bold;
				font-size:30px;
				color: #8F6726;
				text-align: center;
			}

			.back-box {
				width: 102px;
				height: 47px;
				background: #FFFFFF;
				border-radius: 6px 6px 6px 6px;
				border: 1px solid #8F6726;
				// padding: 12px 8px;
				justify-content: center;
				view {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 18px;
					color: #8F6726;
					text-align: center;
					margin-left: 10px;
				}
				// position: absolute;
				// left: 30px;
				image {
					width: 24px;
					height: 24px;
				}
			}

			.select {
				min-width: 160px;
				height: 47px;
				background: #FFFFFF;
				border-radius: 6px 6px 6px 6px;
				border: 1px solid #8F6726;
				padding: 12px;
				display: flex;
				align-items: center;
				justify-content: center;
				image {
					width: 24px;
					height: 24px;
					&:last-child {
						width: 12px;
						height:12px;
					}
				}
				
				.date {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: space-between;
				}

				.text {
					margin-left: 10px;
					margin-right: 10px;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 18px;
					color: #8F6726;
					text-align: center;
				}
			}
		}

		.list {
			width: 100%;
			height: calc(100% - 76px);
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.tab-box {
			width: 100%;
			height: 100%;
			// margin-top: 40px;
			display: flex;
			align-items: center;
			// justify-content: center;
			.tabs {
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: flex-start;

				.item {
					// padding:40px;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					width: 113px;
					height: 163px;
					background: #FBF4EE;
					border-radius: 18px 0px 0px 18px;
					border: 2px solid rgba(143, 103, 38, 0.3);

					&:last-child {
						margin-top: 30px;
					}

					image {
						width: 50px;
						height: 50px;
						margin-bottom: 12px;
					}

					.title {
						font-family: PingFang SC, PingFang SC;
						font-weight: 600;
						font-size: 24px;
						color: #8F6726;
						text-align: center;
					}

					&.active {
						background: linear-gradient(180deg, #E3B379 0%, #8F6726 100%);
						border: 2px solid #8F6726;

						.title {
							color: #fff;
						}
					}
				}
			}
		}

		.test-box {
			flex: 1;
			height: 100%;
			// width: 1460px;
			// height: 862px;
			border-radius: 15px;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			padding: 80px 20px;
			background: #FFFFFF;
			border: 2px solid #8F6726;
			.note,.note1 {
				width: 100%;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 18px;
				color: #8F6726;
				text-align: center;
				margin-bottom: 10px;
			}
			
			.note1 {
				margin-bottom: 40px;
			}

			.img-box {
				display: flex;
				align-items: center;
				justify-content: center;
				&.flex-box{
					flex-direction: column;
					.left{
						margin-right: 0;
						margin-bottom: 44rpx;
					}
				}
			}

			.left {
				width: 237px;
				height: 296px;
				background: #FBF4EE;
				border-radius: 16px;
				border: 1px solid #8F6726;
				// overflow: hidden;
				margin-right: 44px;
				position: relative;
				.delImg {
					top: -30px;
					right: -20px;
					position: absolute;
					z-index: 999;
					width: 40px;
					height: 40px;
					display: flex;
					align-items: center;
					justify-content: center;
					background: #8F6726;
					border-radius: 50%;
					image{
						width: 24px;
						height: 24px;
						transform: rotate(90deg);
					}
				}

				.upImg {
					top: 0;
					left: 0;
					position: absolute;
					z-index: 99;
					width: 100%;
					height: 100%;
                    border-radius: 12px;
					overflow: hidden;
					image {
						width: 100%;
						height: 100%;
					}
				}

				.bg {
					width: 100%;
					height: 237px;
					border-radius: 12px 12px 0 0;
					// background-image: url(/static/image/device/tongue_photo_img.png);
					background-repeat: no-repeat;
					background-size: 100% 100%;
					display: flex;
					align-items: center;
					justify-content: center;

					image {
						width: 50px;
						height: 50px;
					}
				}

				.btn {
					width: 100%;
					line-height: 60px;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 18px;
					color: #8F6726;
					text-align: center;
				}
			}

			.right {
				width: 237px;
				height: 296px;
				background: #FBF4EE;
				border-radius: 16px;
				// overflow: hidden;
				border: 1px solid #8F6726;
				position: relative;
				.delImg {
					top: -30px;
					right: -20px;
					position: absolute;
					z-index: 999;
					width: 40px;
					height: 40px;
					display: flex;
					align-items: center;
					justify-content: center;
					background: #8F6726;
					border-radius: 50%;
					image{
						width: 24px;
						height: 24px;
						transform: rotate(90deg);
					}
				}

				.upImg {
					top: 0;
					left: 0;
					position: absolute;
					z-index: 99;
					width: 100%;
					height: 100%;
					overflow: hidden;
                    border-radius: 12px;
					image {
						width: 100%;
						height: 100%;
					}
				}

				.bg {
					width: 100%;
					height: 237px;
					border-radius: 12px 12px 0 0;
					// background-image: url(/static/image/device/facial_photo_img.png);
					background-repeat: no-repeat;
					background-size: 100% 100%;
					display: flex;
					align-items: center;
					justify-content: center;

					image {
						width: 50px;
						height: 50px;
					}
				}

				.btn {
					line-height: 60px;
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 18px;
					color: #8F6726;
					text-align: center;
				}
			}
		}
	}


	/* 遮罩层样式 */
	.mask {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		justify-content: center;
		align-items: center;
		z-index: 999;
		animation: fadeIn 0.3s ease;
	}

	/* 弹窗容器样式 */
	.popup-container2 {
		//width: 50%;
		height: 250px;
		background: #FBF4EE;
		border-radius: 12px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
		animation: scaleIn 0.3s ease;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-between;
		padding: 30px 50px;

		.title-t {
			font-size: 24px;
			font-weight: bold;
			color: #8F6726;
			text-align: center;
		}

		.title-r {
			font-size: 20px;
			color: #8F6726;
			text-align: center;
		}

		.btn-r {
			text-align: center;
			background: #8F6726;
			font-size: 20px;
			color: #FBF4EE;
			border-radius: 12px;
			width: 60%;
			height: 50px;
			line-height: 50px;
		}
	}

	/* 弹窗容器样式 */
	.popup-container {
		width: 80%;
		// min-width: 840px;
		background: #FBF4EE;
		border-radius: 12px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
		animation: scaleIn 0.3s ease;
		overflow: hidden;
	}

	/* 弹窗头部样式 */
	.popup-header {
		padding: 20px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #E9DDCD;

		.goback {
			background: #FFFFFF;
			border-radius: 4px;
			border: 1px solid #8F6726;
			padding: 8px 16px;
			font-size: 16px;
			color: #8F6726;
			text-align: center;
		}
	}

	.popup-title {
		flex: 1;
		font-family: Source Han Serif CN, Source Han Serif CN;
		font-weight: bold;
		font-size: 24px;
		color: #8F6726;
		text-align: center;
	}

	.close-btn {
		display: flex;
		justify-content: center;
		align-items: center;
		transition: all 0.2s ease;

		image {
			width: 24px;
			height: 24px;
		}
	}

	/* 弹窗内容样式 */
	.popup-content {
		width: 90%;
		padding: 40px 30px;
		font-size: 20px;
		color: #666;
		line-height: 1.6;
		background: #FBF4EE;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin: auto;

		.form-item {
			display: flex;
			align-items: center;
			margin-bottom: 20px;

			.label {
				width: 100px;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 20px;
				color: #8F6726;
				text-align: right;
			}

			.form-input {
				width: 400px;
				height: 47px;
				box-sizing: border-box;
				background: #FFFFFF;
				border-radius: 6px;
				border: 1px solid #8F6726;
				padding: 15px 26px;
			}

			.text-input {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 18px;
				color: #9B9B9B;
				text-align: left;
			}

			.r-box {
				width: 400px;
				height: 47px;
			}

			.picker-box {

				// width: 540px;
				// height: 64px;
				// box-sizing: border-box;
				// background: #FFFFFF;
				// border-radius: 8px;
				// border: 2px solid #8F6726;
				// padding: 15px 26px;
				.date {
					image {
						width: 32px;
						height: 32px;
					}
				}

			}
&:last-child{
				margin-bottom: 0;
			}
		}
		.form-item2 {
			display: flex;
			align-items: center;
			margin-bottom: 20px;
			
			.label {
			width: 120px;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 20px;
				color: #8F6726;
				text-align: right;
			}
		
			.form-input {
				width: 150px;
				height: 47px;
				box-sizing: border-box;
				background: #FFFFFF;
				border-radius: 6px;
				border: 1px solid #8F6726;
				padding: 15px 26px;
			}
		
			.text-input {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 18px;
				color: #9B9B9B;
				text-align: left;
			}
		
			.r-box {
				width: 400px;
				height: 47px;
			}
		
			.picker-box {
		
				// width: 540px;
				// height: 64px;
				// box-sizing: border-box;
				// background: #FFFFFF;
				// border-radius: 8px;
				// border: 2px solid #8F6726;
				// padding: 15px 26px;
				.date {
					image {
						width: 32px;
						height: 32px;
					}
				}
		
			}
		
		}
	}

	.search-cont {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.form-input {
			flex: 1;
			height: 47px;
			margin-right: 15px;
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 8px;
			border: 1px solid #8F6726;
			padding: 11px 20px;
		}

		.text-input {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 18px;
			color: #9B9B9B;
			text-align: left;
		}

		.search-btn {
			width: 108px;
			height: 47px;
			background: #8F6726;
			border-radius: 6px 6px 6px 6px;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				width: 18px;
				height: 18px;
				margin-right: 5px;
			}

			text {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 18px;
				color: #FFFFFF;
				text-align: center;
			}
		}
	}
.isNull {
		text-align: center;
		color: #8F6726;
	}
	.userList-box {
		margin-top: 30px;
		width: 100%;
		background: #FFFFFF;
		border-radius: 12px;
		overflow: hidden;
	}

	.userList {
		width: 100%;
		height: 330px;
		overflow-y: auto;

		&::-webkit-scrollbar {
			display: block !important;
			width: 10px !important;
			/* 滚动条宽度 */
		}

		&::-webkit-scrollbar-thumb {
			background: #8F6726 !important;
			/* 滚动条滑块颜色 */
			border-radius: 5px !important;
			/* 滑块圆角 */
		}

		.item {
			width: 100%;
			padding: 17px 22px;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.title {
				flex: 1;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 18px;
				color: #8F6726;
				text-align: left;
			}

			.right-box {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.rest {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 59px;
					height: 33px;
					border-radius: 6px 6px 6px 6px;
					border: 1px solid #8F6726;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 16px;
					color: #8F6726;
					margin-right: 16px;
				}

				.select {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 59px;
					height: 33px;
					border-radius: 6px 6px 6px 6px;
					border: 1px solid #8F6726;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 16px;
					color: #8F6726;

					&.active {
						background: #8F6726;
						color: #fff;
					}
				}
			}
		}
	}

	.userDetail {
		// margin-top: 30px;
		width: 100%;
		background: #FFFFFF;
		border-radius: 12px;
		padding: 0 30px;
		height: 50vh;
		overflow-y: auto;

		&::-webkit-scrollbar {
			display: block !important;
			width: 10px !important;
			/* 滚动条宽度 */
		}

		&::-webkit-scrollbar-thumb {
			background: #8F6726 !important;
			/* 滚动条滑块颜色 */
			border-radius: 5px !important;
			/* 滑块圆角 */
		}
		.item {
			width: 100%;
			padding: 15px 0px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 20px;
			color: #8F6726;
			border-bottom: 1px dashed #8F6726;
            text{
            	flex:1
            }
			&:last-child {
				border: 0;
			}
		}
	}

	/* 弹窗底部样式 */
	.popup-footer {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-bottom: 30px;
		// background: #FBF4EE;
		// border-top: 1px solid #eee;
	}

	.btn2 {
		// flex: 1;
		padding: 26px 0;
		text-align: center;
		font-size: 20px;
		transition: all 0.2s ease;
	}

	.confirm-btn {
		width: 185px;
		height: 53px;
		background: #8F6726;
		border-radius: 12px 12px 12px 12px;
		display: flex;
		align-items: center;
		justify-content: center;

		text {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 20px;
			color: #FFFFFF;
			text-align: center;
		}

		image {
			width: 24px;
			height: 24px;
			margin-right: 10px;
		}
	}

	.confirm-btn2 {
		width: 113px;
		height: 53px;
		background: #8F6726;
		border-radius: 12px;
		display: flex;
		align-items: center;
		justify-content: center;

		text {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 20px;
			color: #FFFFFF;
			text-align: center;
		}
	}

	/* 动画效果 */
	@keyframes fadeIn {
		from {
			opacity: 0;
		}
		to {
			opacity: 1;
		}
	}
	@keyframes scaleIn {
		from {
			transform: scale(0.9);
			opacity: 0;
		}

		to {
			transform: scale(1);
			opacity: 1;
		}
	}
</style>